sql-expert

A database specialist for FacturaScripts, an open-source business and invoicing system. It works with that system’s tables, queries, filters, indexes, constraints, migrations, and transactions.

In plain words
What is it for?
Use it to design table definitions, write or optimize database queries, add indexes and rules, create migrations, and analyze database performance in FacturaScripts.
Why use it?
FacturaScripts handles database work differently from many common web frameworks. This helps avoid using database patterns that do not fit its codebase.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/facturascripts/fs-claude-plugin/sql-expert
Any agent
npx skills add FacturaScripts/fs-claude-plugin --skill sql-expert
Clone the repo
git clone --depth 1 https://github.com/FacturaScripts/fs-claude-plugin

Made for: Claude Code, Codex.

Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 686 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00102 $0.00686
Opus 5 $0.00051 $0.00343
Sonnet 5 $0.00020 $0.00137
Haiku 4.5 $0.00010 $0.00069

Measured 2d ago against content hash a33c6cba89ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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/skills/sql-expert/SKILL.md · 61 lines

How it starts

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

Skill: sql-expert — Especialista en base de datos de FacturaScripts

Esta skill conecta las tareas de base de datos del usuario con el agente sql-expert, que domina el sistema de acceso a datos de FacturaScripts: DbQuery, Where, DataBaseWhere, definición XML de tablas, migraciones y optimización de consultas para MySQL y PostgreSQL.

Por qué usar el agente

El agente sql-expert conoce las particularidades del acceso a datos en FacturaScripts: el constructor DbQuery (que difiere de Eloquent o Doctrine), la clase Where con sus métodos estáticos, DataBaseWhere para filtrar en modelos, la definición de tablas en XML (no en migraciones PHP como Laravel), las transacciones no anidadas, y los patrones de optimización específicos del ERP. Responder sin el agente introduce riesgo de aplicar patrones de otros frameworks que no son compatibles.

Cómo invocar el agente

Usa el agente sql-expert pasándole la tarea del usuario:

Agente: sql-expert
Tarea: [descripción exacta de lo que necesita el usuario]

El agente:

  1. Consulta la documentación en ./agents/docs/ (acceso-a-la-base-de-datos, dbquery, definición de tablas, relaciones, migraciones)
  2. Analiza el esquema de tablas existente si es necesario
  3. Implementa la solución siguiendo las convenciones de FacturaScripts
  4. Crea los archivos necesarios (Table XML, migraciones, índices, queries)

Qué tareas activan esta skill

  • "Diseña la tabla XML para almacenar proyectos con relación a clientes"
  • "Optimiza esta consulta que tarda mucho en ejecutarse"
  • "¿Cómo hago un JOIN con DbQuery?"
  • "Crea un índice para mejorar la búsqueda por fecha y cliente"
  • "Necesito una migración para cambiar el tipo de una columna"
  • "¿Cómo uso transacciones en FacturaScripts?"
  • "¿Cuál es la diferencia entre DbQuery y DataBaseWhere?"
  • "Diseña las relaciones entre mis tablas de proyectos y tareas"
  • "¿Cómo hago una consulta agregada con SUM y GROUP BY?"
  • Cualquier tarea que involucre diseño de tablas, consultas SQL o rendimiento de base de datos

Read the full file on GitHub · 61 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. 2d ago First seen · 61 lines · 102 tokens per session scan A a33c6cba89ce

Subscribe to this mod's changes

sql-expert is a skill published in the GitHub repository FacturaScripts/fs-claude-plugin (8 stars, last pushed 2mo ago), licensed MIT. It adds 102 tokens to every session and 686 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

agent-host-chat-contributions

Build and review cross-cutting agent-host chat behavior through lifecycle contributions. Use when adding turn lifecycle side effects, prompt or context injection, restored-history transformation, protocol-action observation, or when reviewing changes that add code to AgentSideEffects or AgentService.

microsoft/vscode · 56 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens