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 skills/event4u-app/agent-config/databasenpx skills add event4u-app/agent-config --skill databasegit clone --depth 1 https://github.com/event4u-app/agent-configWrote 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.
[](https://agentmods.dev/skills/event4u-app/agent-config/database)<a href="https://agentmods.dev/skills/event4u-app/agent-config/database"><img src="https://agentmods.dev/badge/skills/event4u-app/agent-config/database.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00039 | $0.01380 |
| Opus 5 | $0.00019 | $0.00690 |
| Sonnet 5 | $0.00008 | $0.00276 |
| Haiku 4.5 | $0.00004 | $0.00138 |
Grade A, and why
database 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 — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.
database
Grounded corpus (Tier-1 consultation): symptom → index/strategy decisions come grounded —
./scripts-run <skills-root>/corpus-grounding/scripts/ground search --manifest <skills-root>/database/data/manifest.json "<symptom>"returns root cause, strategy, good-code sketch, anti-pattern, and the verification probe (EXPLAIN expectation). Corpus:data/query-tuning.csv(PostgreSQL 16 / MySQL 8-derived).
When to use
Use when designing schemas, optimizing queries, adding indexes, or troubleshooting database performance.
Do NOT use when:
- Writing framework-specific ORM models (use the matching skill — e.g.
eloquentfor Laravel,symfony-workflowfor Doctrine, framework-native skill for Prisma / TypeORM / SQLAlchemy / GORM / Diesel) - Creating migrations only — use the framework-specific migration skill (
laravel-migrationfor Laravel, framework-native for others)
Procedure: Optimize a query
Step 0: Inspect
- Read project docs in
agents/reference/docs/for database architecture. - Check
config/database.phpfor connection definitions. - Detect engine: check
.envdriver anddocker-compose.yml.
Step 1: Diagnose
Run EXPLAIN / EXPLAIN ANALYZE:
EXPLAIN ANALYZE SELECT * FROM projects WHERE customer_id = 42 AND status = 'active';
Check for: full table scans (type=ALL), missing indexes (key=NULL), filesort, temporary tables.
Step 2: Fix
- Add missing indexes (most selective column first in composites)
- Rewrite anti-patterns (subquery → JOIN,
OFFSET→ cursor,SELECT *→ specific columns) - Add eager loading for N+1 queries
- Always paginate list endpoints
Step 3: Verify
Re-run EXPLAIN and confirm improved plan.
Schema awareness (anti-hallucination)
Never guess table or column names. Verify before writing queries/migrations:
- Read migrations — source of truth
- Read models —
$table,$connection,$fillable,$casts, relationships - Run schema queries — use the project's REPL or a raw introspection query:
- Laravel:
php artisan tinker --execute="Schema::getColumnListing('table')" - Symfony / Doctrine:
bin/console doctrine:mapping:info - Rails:
bin/rails runner "p ActiveRecord::Base.connection.columns('table').map(&:name)" - Prisma:
npx prisma db pull --print | grep -A20 "model Table" - Generic SQL:
psql -d mydb -c "\d table"/mysql -e "DESCRIBE table"
- Laravel:
- Check project docs —
agents/reference/docs/for conventions
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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 · 143 lines · 39 tokens per session scan A 14e93995da29
database is a skill published in the GitHub repository event4u-app/agent-config (10 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 1,380 once invoked, about $0.0002 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-09-03.
Other skills, from other repositories
architect/data-api-design
Skill "architect/data-api-design" from echoVic/boss-skill, covering 数据模型与api设计方法论, 适用场景, 数据模型设计, 1. 实体识别 and 2. 关系识别.
mongodb-schema-design
MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or troubleshooting performance issues caused by schema problems. Triggers on "design schema", "embed vs reference", "MongoDB data model", "schema review", "unbounded arrays", "one-to-many", "tree…
mongodb-search-and-ai
Guides MongoDB users through implementing and optimizing Atlas Search (full-text), Vector Search (semantic), and Hybrid Search solutions. Use this skill when users need to build search functionality for text-based queries (autocomplete, fuzzy matching, faceted search), semantic similarity (embeddings, RAG…
solr-semantic-search
To build Solr phrase-tagging semantic search: concept tagging, taxonomy, graph paths.
generate-validation-notebook
Generate SQL validation notebooks for dbt changes. Pass a GitHub PR URL or local dbt repo path.
qdrant-multitenancy
Guides tenant isolation architecture in Qdrant for multi-tenant or multi-user applications. Use when someone asks 'how to isolate customer data', 'how to build multi-tenant search/RAG', 'how many collections should I create', 'how to partition tenants by payload', 'a customer's data legally has to stay in a certain…