Skip to content

About

Agent Skill for SQL Coder CLI: turns a data question into reviewable, auditable SQL — semantic file, plan approval, clarification, read-only CTE-level debugging.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

SQL Coder CLI — Agent Skill

An Agent Skill that teaches an LLM agent to drive the SQL Coder CLI end to end: from installing the tool and preparing a runtime configuration, through semantic-file generation and plan approval, to read-only SQL validation and reporting the result back to the user.

The skill is a single SKILL.md file: frontmatter declares when the skill applies, the body states the commands, the return contracts, the exit codes and the failure handling an agent needs in order to act without guessing.

What the skill covers

Section Content
Installation and detection Verify coder --version; clone and install sql-coder-cli with the [mysql] extra; diagnose four common installation failures
Quick path Six steps from loading environment variables to reporting a result
Preparation Environment variables, semantic-file generation, model service, workspace naming
Querying Schema reconnaissance, chat and run/resume, the run return contract, plan review, clarification answers, partial and failed runs
Debugging Segment listing, CTE and UNION-branch targeting, read-only limits, evidence
Command reference Every subcommand and the options an agent actually needs
Prohibitions Actions that must not be taken (direct SDK calls, database writes, hand-written SQL as deliverable)

Requirements

  • SQL Coder CLI — installed from https://github.com/AskSqlAI/asksql_coding_assistant; Python 3.11 or newer, installed with pip install -e ".[mysql]"
  • A read-only MySQL account on the target database
  • A model API key for any Chat Completions-compatible endpoint

The skill installs the CLI itself when it is absent; see section 0 of SKILL.md.

Installing the skill

Copy the directory into the skills folder your agent reads.

WorkBuddy, user level (available in every project):

mkdir -p ~/.workbuddy/skills/sql-coder-cli
cp SKILL.md ~/.workbuddy/skills/sql-coder-cli/SKILL.md

WorkBuddy, project level (shared with the repository):

mkdir -p .workbuddy/skills/sql-coder-cli
cp SKILL.md .workbuddy/skills/sql-coder-cli/SKILL.md

Claude Code:

mkdir -p .claude/skills/sql-coder-cli
cp SKILL.md .claude/skills/sql-coder-cli/SKILL.md

Codex, user level (every repository):

mkdir -p ~/.codex/skills/sql-coder-cli
cp SKILL.md ~/.codex/skills/sql-coder-cli/SKILL.md

Codex, repository level (committed with the project, shared with the team):

mkdir -p .agents/skills/sql-coder-cli
cp SKILL.md .agents/skills/sql-coder-cli/SKILL.md

Codex reads skills from $CODEX_HOME/skills (default ~/.codex/skills) and, inside a repository, from every .agents/skills directory between the working directory and the repository root. When both a user-level and a repository-level skill share a name, Codex lists both rather than merging them.

A new session picks the skill up on start; a running session keeps the description it loaded at launch. Codex detects edits automatically — restart it if a change does not appear.

Validating the file

The frontmatter must contain name and description, and the name must match the directory:

python - <<'PY'
import yaml, pathlib
text = pathlib.Path("SKILL.md").read_text(encoding="utf-8")
meta = yaml.safe_load(text.split("---", 2)[1])
assert meta["name"] == "sql-coder-cli", meta
assert len(meta["description"]) > 40
print(meta["name"], "ok")
PY

Related

License

MIT — see LICENSE.

About

Agent Skill for SQL Coder CLI: turns a data question into reviewable, auditable SQL — semantic file, plan approval, clarification, read-only CTE-level debugging.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors