Agent Skills#
edg ships with a set of Agent Skills; slash commands that help you generate, validate, debug, and migrate workload configs without leaving your terminal.
Install#
Install all edg skills into your project with one command:
npx skills add codingconcepts/edg --agent claude-code --skill '*' --yesOr install a specific skill:
npx skills add codingconcepts/edg --agent claude-code --skill edg-config --yesIf you’ve cloned edg and are running Claude Code from the repo root, the skills are available automatically.
Windows users: Git symlinks require Developer Mode enabled or
git config core.symlinks trueset before cloning. Without this, the symlinks in.claude/skills/will be checked out as plain text files. Rungit clone -c core.symlinks=trueto avoid this.
Available Skills#
/edg-config - Generate a workload config#
Generates a complete edg YAML config from a natural language description of your schema and workload. Includes database-specific patterns for all supported drivers.
Example prompts:
/edg-config
I have a users table and an orders table on CockroachDB.
Users have an email, name, and created_at timestamp.
Orders reference a user and have a total, status, and created_at.
I want a 70/30 read/write mix benchmarking order lookups and new order inserts.
Seed with 10k users and 50k orders./edg-config
MySQL e-commerce schema: products (name, category, price, stock),
customers (email, name), and a cart_items join table.
Write-heavy workload simulating add-to-cart with Zipfian product selection
(some products are much more popular). Use batch inserts for seeding./edg-config
Generate a sync config pair for CockroachDB (pgx) and MySQL.
Tables: users (id, email, name) and orders (id, user_id, amount, status).
1000 users and 5000 orders, batched 100 at a time.
I'll use edg sync run with --rng-seed for deterministic dual-write testing./edg-config
MongoDB workload: customers collection with email and name fields,
and an accounts collection referencing customers with a balance field.
Seed 500 customers and 500 accounts, then run random balance lookups./edg-config
Cassandra IoT schema: create a keyspace with a devices table (id UUID, name TEXT)
and a readings table (device_id UUID, ts TIMESTAMP, value DOUBLE).
Seed 100 devices and 10k readings, then run time-range queries./edg-config
CockroachDB bank workload with staged execution: ramp up with 1 worker
doing mostly reads (90%), then steady state with 10 workers doing heavy
transfers (45%), then cool down with 2 workers falling back to default weights.
Use per-stage run_weights to shift the workload mix at each phase.What it produces:
- A full YAML config with
globals,stages,up,seed,init,run,run_weights,workers,deseed, anddownsections - Appropriate expressions for data generation (
gen(),uuid_v7(), distributions) - Reference data setup via
initqueries for use inrunwithref_rand(),ref_same(), etc. - Driver-specific SQL patterns (batch expansion, DDL safety, upsert syntax)
- Sync config pairs for cross-database consistency testing - matched schemas with explicit IDs, identical seed args, and driver-specific batch SQL for use with
edg sync run - Uses shorthand features where appropriate: inline args (
${expr}),__columns__/__values__expansion, query type inference, and named templates to reduce boilerplate
For a quick starting point without an agent,
edg scaffoldgenerates a config interactively from the command line. See Scaffold.
/edg-validate - Validate and fix a config#
Runs edg validate on a config file, interprets errors, and suggests fixes.
Example prompts:
/edg-validate
Check my config at workloads/bench.yaml for the pgx driver./edg-validate
Validate _examples/ecommerce/mysql.yaml and fix any issues you find.What it does:
- Detects the driver from the config content (or uses one you specify)
- Runs
edg validate --driver <driver> --config <path> --explain(errors now include YAML line numbers and enhanced explanations) - Explains each error in plain language
- Suggests (or applies) fixes for common issues:
- Unknown functions or typos in expressions
- Missing
initdatasets referenced byref_*calls - Wrong query type (
execvsquery) - note thattype:is now optional and auto-inferred from the query text - Missing
count/sizeon batch operations
/edg-expression - Compose and debug expressions#
Helps you find the right edg expression for a use case, explains how functions work, and debugs syntax errors.
Example prompts:
/edg-expression
I need to generate a price between $1 and $500 with a log-normal distribution
skewed toward cheaper items, rounded to 2 decimal places./edg-expression
How do I make two columns mutually exclusive (either an email OR a phone
number, but never both?)/edg-expression
What's the difference between ref_rand, ref_same, and ref_perm?
When would I use each one?What it covers:
- All 100+ built-in functions with signatures and descriptions (also available via
edg functions [search]) - Distribution selection guidance (uniform vs normal vs zipf vs exponential)
- Reference data patterns (
ref_randvsref_samevsref_permvsref_diff) - Dependent column patterns with
arg(),cond(), andbool() - Inline args (
${expr}) and__columns__/__values__shorthand - The full expr-lang feature set (array functions, string ops, math, conditionals)
- Tips for debugging with
edg repl(with tab completion for function names)
/edg-migrate - Convert a config between drivers#
Converts an edg config written for one database driver to another, handling all SQL dialect differences.
Example prompts:
/edg-migrate
Convert _examples/ecommerce/crdb.yaml from pgx to mysql./edg-migrate
I have a workload config for PostgreSQL and need it to work on SQL Server (mssql).
The config is at workloads/bench.yaml./edg-migrate
Convert my PostgreSQL workload at workloads/users.yaml to MongoDB.What it translates:
| Concern | What changes |
|---|---|
| Batch expansion | __values__ works across all SQL drivers (recommended). Driver-specific alternatives: unnest(string_to_array(...)) (pgx), JSON_TABLE (MySQL), OPENJSON (MSSQL), XMLTABLE (Oracle), UNNEST(SPLIT(...)) (Spanner). Oracle uses __values__(table(cols)) for INSERT ALL syntax. |
| Cleanup | TRUNCATE CASCADE -> DELETE FROM / CASCADE CONSTRAINTS PURGE / DELETE FROM ... WHERE TRUE (Spanner) / TRUNCATE (Cassandra) / {"delete": ...} (MongoDB) |
| Column types | UUID -> CHAR(36) / STRING(36) / TEXT (Cassandra), STRING -> VARCHAR(n), etc. |
| DDL safety | IF NOT EXISTS -> IF OBJECT_ID(...) / PL/SQL exception blocks / CREATE TABLE IF NOT EXISTS (Spanner) |
| Default values | gen_random_uuid() -> UUID() / NEWID() / GENERATE_UUID() / args-based |
| Pagination | LIMIT/OFFSET -> FETCH NEXT ... ROWS ONLY |
| Placeholders | $1 -> ? (MySQL, Cassandra) / :1 (Oracle) / @p1 (MSSQL, Spanner) / inlined JSON (MongoDB) |
| Primary key | inline PRIMARY KEY -> table-level PRIMARY KEY (col) (Spanner) |
| Query format | SQL -> BSON/JSON commands (MongoDB) / CQL (Cassandra) |
| Random ordering | random() -> RAND() / NEWID() / DBMS_RANDOM.VALUE / TABLESAMPLE RESERVOIR (Spanner) |
| Row generation | generate_series -> recursive CTE / CONNECT BY / GENERATE_ARRAY + UNNEST (Spanner) |
| Schema creation | CREATE TABLE -> {"create": "collection"} (MongoDB) / CREATE KEYSPACE + CREATE TABLE (Cassandra) |
| Upsert | ON CONFLICT -> ON DUPLICATE KEY / MERGE INTO / INSERT OR UPDATE (Spanner) |
Expression args (gen(), ref_rand(), zipf(), etc.) are driver-agnostic and remain unchanged.
Tips#
- Combine skills: Generate a config with
/edg-config, then validate it with/edg-validate, then port it to another driver with/edg-migrate. - Start with scaffold: Run
edg scaffoldfor a quick interactive starting point, then refine with/edg-configfor more complex needs. - Use the REPL: All expression skills recommend
edg replfor interactive testing with tab completion; no database connection needed. - Discover functions: Run
edg functions [search]to find available functions by name (e.g.edg functions ref,edg functions seq). - Validate after migration: Always run
edg validate --driver <driver> --config <path> --explainafter generating or migrating a config to catch issues before hitting the database.