Agentic SQL — Data skill for Claude Code
Claude Code skill for library-first SQL investigations.
How to install Agentic SQL
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open 23blocks-OS/agentic-sql and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Agentic SQL does
Claude Code skill for library-first SQL investigations. Three-layer safety gate (read-only Postgres role + SQLGlot AST + LIMIT injection) + forced post-investigation curation. Based on Vanna AI, AutoLink, LangChain SQL Toolkit, and Cemri et al. multi-agent failure modes.
Alternatives in Data
- Biopython — Bioinformatics tools with BioPython library 6.4k ★
- LLM Redteam — LLM red-team corpus runner — fires categorized prompt-injection / jailbreak / system-prompt-leak / data-exfil 4.5k ★
- Vibesec — Helps write secure code by preventing common vulnerabilities including IDOR, XSS, SQL injection, SSRF, and wea 687 ★
README
agentic-sql
Claude Code skill for **library-first SQL investigations**. Curated read-only query library + SQL gate (read-only role, single-statement SQLGlot allow-list, LIMIT injection) + a forced post-investigation curation step that keeps the library from rotting.
Works with any Postgres, any framework, any backend that you investigate via psql.
Based on:
- Vanna AI's saved-query RAG pattern
- AutoLink (arxiv 2511.17190) and LinkAlign (arxiv 2503.18596) — schema-as-retrieval
- LangChain SQL Toolkit's two-tier safety layer (LLM checker + AST gate)
- SQLGlot AST primer
- Cemri et al. (arxiv 2503.13657) — multi-agent failure modes (specifically "diffusion of responsibility" → why curation must be a workflow step, not "everyone's job")
Why this exists
Every team with a Postgres production database has the same problem: AI agents (and humans) keep re-deriving the same queries. A support ticket lands, someone reaches for psql, writes a query, runs it, reports back, and the query dies in a terminal history file. The next ticket reaches for the same query and re-derives it from scratch — sometimes with a different join key, sometimes missing a known gotcha, sometimes touching a column that was renamed three months ago.
Curated SQL libraries solve this — they're standard practice in mature data orgs — but they only work if the agent CONSULTS the library before writing new SQL and CURATES new findings after the investigation succeeds. Without enforcement, both steps get skipped under time pressure. The library freezes; ad-hoc scripts pile up in `scripts/audit_*.py`; the next incident the team can't find the query they wrote three months ago.
This skill makes both steps a non-negotiable part of the workflow: `find` before writing, `curate` before reporting back. Plus an SQL gate that prevents the most common production accidents (running a query as the app role, executing a hallucinated DELETE, returning millions of rows by mistake).
First-Time Se
Related Skills
Snowflake Safe Query Skill
Write and run read-only Snowflake queries against the Gaiia reporting database under a four-layer safety guard
Jobs Add
Add a source to the pipeline in one of three modes — company (auto-detect ATS, default), board (enable a built
Payment Integrity Analyst
Natural-language payment-integrity analyst agent on Claude: text-to-SQL over a healthcare claims and investiga
I Am Truth
I Am Truth — agentic methodological auditor for biomedical papers. Gemini 3.7 Flash on Vertex AI, six-layer pi
Agentix Kdd
Autonomous development pipeline for Cursor & Claude Code. Type aa: and a persistent SQLite knowledge graph aut
AI Stock Analyst
Turn a plain-English request ("compare Apple and Microsoft YTD") into a validated stock chart — a CrewAI multi
Related Agents
PM Security Review
Read-only security reviewer for Product Masters LMS diffs. Finds the input/actor that breaks auth, access, RLS
Wd Researcher
Use this agent for time-boxed investigations that feed specs - provider TOS and rate-limit realities, Claude C
DB Postgres Expert
Expert PostgreSQL DBA for pure PostgreSQL environments. Use for database design, query optimization, indexing