Skip to content

Coding agents

SelectJoin suits coding agents for the same reasons it suits code review: a project is plain Python, every command runs offline, and the result of a change can be checked without a database.

  • Nothing to connect. SelectJoin generates SQL and never runs it. An agent needs no warehouse credentials, and no command can change data.
  • A check it can run itself. selectjoin check validates every source and model in the project. An agent can edit, check, and repeat until the project compiles.
  • Structured answers. The commands an agent uses to find its way around print JSON.
  • Located errors. A failed check names the file, the line when it is known, and a suggested fix when there is one.
Terminal window
selectjoin agents --write

This saves an AGENTS.md in the project root with the working loop, the commands that print JSON, and the project rules. Coding agents that read AGENTS.md pick it up on their own. Without --write the guide prints to the terminal, so you can paste it into another instructions file. --force replaces an existing AGENTS.md.

Skills are short, step-by-step instructions for one task each. An agent that supports them loads a skill only when the task matches its description.

Terminal window
selectjoin skills --write

This saves four skills into .claude/skills/ in the project:

Skill What the agent does
selectjoin-add-model Scaffolds a model in the right layer, looks for components to reuse before writing logic, and checks the result.
selectjoin-change-model Finds what depends on a model, makes the change, and reports every breaking change even when the check passes.
selectjoin-reuse-logic Moves repeated logic into one component, then compares the project before and after to prove no model changed shape.
selectjoin-trace-column Explains where a value comes from, step by step, back to the raw table.

selectjoin skills lists them without writing anything, and --json prints the list as JSON. --dir chooses another folder inside the project, and --force replaces skill files that already exist.

Each skill is a SKILL.md file with a name and a description of when to use it, so you can read, edit, or delete any of them.

  1. selectjoin list --json lists every source and model with its layer, grain, and direct dependencies.
  2. selectjoin inspect NAME --json returns one unit’s columns and types, grain, upstream and downstream units, and its SQL.
  3. The agent edits Python, or scaffolds a model with selectjoin new.
  4. selectjoin check --json validates the project.
  5. selectjoin compile NAME prints the final SQL for review.

A passing check exits with code 0:

{
"ok": true,
"dialect": "duckdb",
"units": 11,
"checks": 2
}

A failing check exits with code 1 and still prints JSON to standard output:

{
"ok": false,
"error": {
"message": "models/marts/mart_completed_orders.py:13 (mart_completed_orders): Unknown column: statuss Did you mean 'status'?",
"file": "models/marts/mart_completed_orders.py",
"line": 13,
"suggestion": "status"
},
"errors": [
{
"message": "models/marts/mart_completed_orders.py:13 (mart_completed_orders): Unknown column: statuss Did you mean 'status'?",
"file": "models/marts/mart_completed_orders.py",
"line": 13,
"suggestion": "status"
}
]
}

errors lists every problem found in the run, and error is the first of them. One run reports all independent problems: two broken models in different branches of the graph both appear.

A model downstream of a broken one cannot be analyzed until the upstream model is fixed, so its own mistakes show up on the next run.

line and suggestion are null when they are not known. The line is known when the mistake is a column reference written through the query API; a column named in a string, such as .where("is_completedd"), is reported with its file only.

Command Returns
list [--layer LAYER] --json Units with kind, layer, grain, and dependencies
layers --json Layers with folder, prefix, and model count
inspect NAME --json Columns, types, grain, neighbors, and SQL
deps NAME [--upstream] [--downstream] [--direct] --json Dependency names
lineage [NAME] [--column COLUMN] Model and column lineage (always JSON)
checks [--layer LAYER] --json Data checks defined in checks.py
check --json The validation result or a located error
diff --against REF --json Changes to model shapes since a git ref, with breaking ones flagged

Without --json, errors go to standard error as a single Error: ... line. Output is styled only in an interactive terminal, so an agent that captures output always gets plain text. Exit codes are 0 for success, 1 for a project or usage error, and 130 when interrupted.

This site publishes its documentation as plain text for language models:

  • /llms.txt is an index of every page with a one-line summary.
  • /llms-full.txt is the full documentation in one file.

selectjoin check validates definitions: names, columns, grains, and types. It does not test data, and nothing in SelectJoin can tell an agent how a query behaves in the warehouse. Review compiled SQL before running it, as you would for any change.