Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/fsistemas/sql2json/agents-mdgit clone --depth 1 https://github.com/fsistemas/sql2jsonWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.03721 | $0.03721 |
| Opus 5 | $0.01861 | $0.01861 |
| Sonnet 5 | $0.00744 | $0.00744 |
| Haiku 4.5 | $0.00372 | $0.00372 |
Grade A, and why
sql2json AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 349 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Using sql2json with AI Agents and LLMs
Working on this repository? Coding agents and maintainers should read
WORKFLOW.mdandWORKFLOW.local.mdfirst. They define the public-safe branch/PR lifecycle, francisco-boards usage, validation gates, and release discipline for this repo (S2J, base branchmaster). The rest of this file explains how agents should usesql2jsonas a CLI/library.
sql2json runs SQL queries via SQLAlchemy and outputs JSON or CSV to stdout. It is invoked as a CLI tool or imported as a Python package — no framework coupling, no MCP server required.
Invocation: examples below use the
sql2jsoncommand, available since v0.2.1. On0.2.0and earlier — or when the package's scripts directory is not onPATH— substitute the equivalentpython -m sql2json ...form (on Windows,py -m sql2json ...).
Install & upgrade (for agents)
Install sql2json as an isolated tool, with the database drivers bundled so
queries against PostgreSQL/MySQL work without a follow-up step:
uv tool install "sql2json[postgres,mysql]"
# or
pipx install "sql2json[postgres,mysql]"
Why these methods matter in a sandbox:
- They work on externally-managed environments (Manjaro/Arch, Debian 12+,
Ubuntu 23.04+, Homebrew Python), where a plain
pip installis refused witherror: externally-managed-environment(PEP 668). - They expose
sql2jsononPATH(in~/.local/bin; runpipx ensurepathif it is missing) without mutating any project environment.
Quote the extras. In bash/zsh the brackets are glob characters, so the spec
must be quoted — "sql2json[postgres,mysql]" — or the shell expands it and the
install fails before the installer runs. In PowerShell use single quotes:
'sql2json[postgres,mysql]'.
Selecting drivers: [postgres] (psycopg2) or [mysql] (pymysql) for a
single database; bare sql2json is SQLite only — connecting to
Postgres/MySQL without the extras raises ModuleNotFoundError: psycopg2 /
pymysql. For other databases (e.g. MS SQL Server's pyodbc), install the
driver alongside: uv tool install "sql2json" --with pyodbc.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 349 lines · 3,721 tokens per session scan A 760d3eacd059
sql2json AGENTS.md is an instructions file published in the GitHub repository fsistemas/sql2json (55 stars, last pushed 2mo ago), licensed MIT. It adds 3,721 tokens to every session, about $0.0186 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
sqlglot AGENTS.md
Instructions for tobymao/sqlglot, covering contributing to sqlglot, about sqlglot, development commands, installation and basic installation.
chdb AGENTS.md
Instructions for chdb-io/chdb, covering agents.md — chdb, 1. fully lazy execution architecture, 2. natural execution triggering (explicit calls prohibited), 3. unified architecture, simplicity first and 4. testing principles.
headson CLAUDE.md
Instructions for kantord/headson, covering headson — agents guide, mission, primary surfaces to mind, core pipeline (keep behaviors intact) and heuristics & semantics to preserve.
database-operations-mcp AGENTS.md
Instructions for sandraschi/database-operations-mcp, covering database-operations-mcp — agent guide, entry points, standards, key files and quick ref.
database-operations-mcp CLAUDE.md
Instructions for sandraschi/database-operations-mcp, covering database-operations-mcp — claude code guide, entry points, standards and key files.
sqlglot CLAUDE.md
Instructions for tobymao/sqlglot, a project described as: Python SQL Parser and Transpiler.