sql-expert

sql-expert is an agent for Claude Code from FacturaScripts/fs-claude-plugin. It costs 44 tokens per session (3,694 once invoked), scanned A, original, MIT.

A specialist assistant for designing and managing databases in FacturaScripts, an open-source business management system. It works with MySQL and PostgreSQL and follows FacturaScripts' own data-access patterns.

In plain words
What is it for?
Use it to design tables, relationships, indexes, and constraints; write SQL migrations; build or improve queries; and investigate slow database operations.
Why use it?
It helps avoid database designs and queries that do not fit the framework. It also brings database structure, migrations, transactions, and query performance work into one focused workflow.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter; mentions Claude Code; mentions Codex.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the fs-dev plugin — 31 skills, 13 agents, 3 hooks shipped together

Good fit Use it to design tables, relationships, indexes, and constraints; write SQL migrations; build or improve queries; and investigate slow database operations.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add FacturaScripts/fs-claude-plugin
Claude Code
/plugin install fs-dev

Made for: Claude Code.

Or install fs-dev, the plugin that ships this one along with the rest of its 31 skills, 13 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sql-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/facturascripts/fs-claude-plugin/sql-expert/github.svg)](https://agentmods.dev/agents/facturascripts/fs-claude-plugin/sql-expert)
Your own site
<a href="https://agentmods.dev/agents/facturascripts/fs-claude-plugin/sql-expert"><img src="https://agentmods.dev/badge/agents/facturascripts/fs-claude-plugin/sql-expert/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sql-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/facturascripts/fs-claude-plugin/sql-expert"><img src="https://agentmods.dev/badge/agents/facturascripts/fs-claude-plugin/sql-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,694 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.03694
Opus 5.5 $0.00018 $0.01478
Sonnet 5.5 $0.00009 $0.00739
Haiku 4.5 $0.00004 $0.00369

Measured 1mo ago against content hash 25022278a841, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sql-expert 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 1mo ago.

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.

fs-dev/agents/sql-expert.md · 345 lines

How it starts

The opening of the file, as written. The whole thing — 345 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Eres un experto senior en bases de datos especializado en FacturaScripts. Dominas MySQL y PostgreSQL en el contexto del ERP, con enfoque en el sistema propio de acceso a datos del framework: DbQuery, Where, DataBase, definición XML de tablas, migraciones de datos y optimización de consultas.

Fuente de verdad

La documentación oficial está en la carpeta references/docs/ del plugin fs-dev: en Claude Code, ${CLAUDE_PLUGIN_ROOT}/references/docs/; si lees este perfil desde una skill (Codex), ../references/docs/, relativa a este archivo. Busca con la herramienta disponible (Grep/Glob en Claude Code, rg en Codex) y lee completos los documentos relevantes. Los ejemplos de la documentación contienen entidades HTML (&lt;, &gt;, &#39;, &quot;): decodifícalas y verifica el código contra el core antes de reutilizarlo.

Documentos clave: acceso-a-la-base-de-datos-818.md, dbquery.md, where.md, la-definicion-de-la-estructura-de-la-tabla-514.md, relaciones-de-tablas.md, migraciones-de-tablas.md, diagramas-de-tablas.md, modelos-especiales-568.md, modelos-de-solo-visionado-o-multiples-tablas-777.md y extensiones-de-tablas.md.

Errores conocidos de la documentación que no debes copiar: whereMulti([...]) en where.md (usa where([...]), porque whereMulti se interpreta como filtro dinámico de la columna multi) y getEngine() === 'mysql' en migraciones-de-tablas.md (usa type(), ver más abajo).

Conocimiento del framework

Acceso a base de datos

FacturaScripts mantiene una única conexión de DataBase durante toda la ejecución. La conexión y desconexión son automáticas.

// Desde un modelo
self::$dataBase->select($sql);

// Desde un controlador
$this->dataBase->select($sql);

// Desde cualquier clase
use FacturaScripts\Core\Base\DataBase;
$db = new DataBase();

// SELECT — devuelve un array de filas
$filas = $db->select('SELECT * FROM clientes WHERE debaja = ' . $db->var2str(false));

// SELECT con paginación: límite y desplazamiento
$filas = $db->selectLimit('SELECT * FROM productos', 50, 0);

// INSERT, UPDATE, DELETE — devuelve true/false, no lanza excepciones
$ok = $db->exec('UPDATE clientes SET debaja = true WHERE codcliente = ' . $db->var2str($code));

// Motor actual: 'mysql' o 'postgresql'
$motor = $db->type();

Read the full file on GitHub · 345 lines

Changes

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.

  1. 1mo ago Changed · -55 lines · -58 tokens per session 25022278a841
  2. 2mo ago Changed · +2 lines c25e8ffd0d41
  3. 3mo ago First seen · 398 lines · 102 tokens per session scan A afa39f659d82

Subscribe to this mod's changes

sql-expert is an agent published in the GitHub repository FacturaScripts/fs-claude-plugin (11 stars, last pushed 8d ago), licensed MIT. It adds 44 tokens to every session and 3,694 once invoked, about $0.0002 per session on Opus 5.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-31.

Related

sql-expert compared with agents from other repositories

sql-expert next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sql-expertFacturaScripts/fs-claude-pluginAgent118d agoMITA44Claude Code
MS-SQL Database Administratorgithub/awesome-copilotAgent42ktodayMITA18Claude Code
lensjeremylongshore/tons-of-skills-marketplaceAgent3.0ktodayMITA53Claude Code
ecto-schema-designeroliver-kriska/claude-elixir-phoenixAgent579yesterdayMITA30Claude Code
core-data-auditorCharlesWiltgen/AxiomAgent1.3k22d agoMITA28Claude Code
django-migrations-specialistAratKruglik/claude-sdlcAgent5713d agoMITA85Claude Code
database-architectaayushostwal/nexusAgent1911d agoMITA96Claude Code