agentleFS
fatih-developerfatih-developer/fth-skills/skills/ecosystem-database/SKILL.md

ecosystem-database

Skill7 starsChanged 42 days agoMITView on GitHub

Route database work — schema design, access policies, query performance, migrations, compliance, connection pooling — through the right fth-skills database skills in order. Use when the user wants to design tables, fix a slow query, change or migrate a schema, mask or trace data, scale connections, or asks which database skills to use.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow this protocol whenever this ecosystem is invoked.

    line 36
  2. Very specific:

    Execute: Run steps in order. Steps that share a parallel group are independent and may run concurrently (@parallel-planner).

    line 42
  3. Very specific:

    Gates: Before any destructive, irreversible, or production-impacting action, stop at @checkpoint-guardian, or ask for explicit confirmation …

    line 43
  4. Very specific:

    Failures: When a step misses its *Done when*, hand off to @error-recovery.

    line 44
  5. Very specific:

    State: Keep a run log (workflow id, step, status, artifact).

    line 45
  6. Distinctive:

    Skip this protocol: when the user names one specific skill (invoke it directly) or asks a quick factual question that needs no workflow.

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

🗄️ Database Ecosystem

This skill is the entry point of its ecosystem. It chooses a workflow, checks which member skills are installed, runs them in order with explicit handoffs, and degrades gracefully when a member is missing. The workflow map lives in references/workflows.json; the handoff format lives in references/handoff-contract.md.

Catalog

<!-- BEGIN GENERATED: ecosystem-catalog (generated from the ecosystem workflow map by build_ecosystems.py — do not edit by hand) -->

Domain: Database Domain — Model, secure, optimize, migrate, and operate SQL databases (PostgreSQL, MySQL, SQLite) with data integrity first.

Philosophy: Data integrity and safe change beat feature speed. Every destructive or locking operation on a shared database needs a reviewed plan and an explicit confirmation.

SkillRoleHandoff artifact
@schema-architectDerives normalized schemas and DDL from business requirements.docs/database-report/schema-architect-output.json
@access-policy-designerDesigns RLS, column-level security, and RBAC/ABAC policies.docs/database-report/access-policy-output.json
@seed-data-generatorGenerates referentially intact seed and test data.docs/database-report/seed-data-output.json
@query-explainerExplains EXPLAIN/EXPLAIN ANALYZE plans in plain language.docs/database-report/query-explainer-output.json
@index-advisorRecommends missing, composite, covering, or removable indexes.docs/database-report/index-advisor-output.json
@query-budget-enforcerSets query cost budgets and N+1 detection rules.docs/database-report/query-budget-output.json
@schema-diff-analyzerDetects schema drift between environments and plans safe syncs.docs/database-report/schema-diff-output.json
@migration-strategistPlans zero-downtime expand/contract migrations and backfills.docs/database-report/migration-strategist-output.json
@data-maskerDetects PII and masks production data for non-production use.docs/database-report/data-masking-output.json
@data-lineage-tracerTraces upstream and downstream lineage of tables and columns.docs/database-report/data-lineage-output.json
@pgbouncer-architectSizes and configures PgBouncer connection pooling for PostgreSQL.inline handoff block
@sqliteExpert guidance for SQLite, libSQL/Turso, D1, WAL, FTS5, and sqlite-vec.inline handoff block
<!-- END GENERATED: ecosystem-catalog -->

Router Protocol

<!-- BEGIN GENERATED: ecosystem-router (generated from the ecosystem workflow map by build_ecosystems.py — do not edit by hand) -->

Follow this protocol whenever this ecosystem is invoked.

  1. Match. Compare the request with each workflow's When phrases. Pick one workflow, or route straight to a single member skill when the request is narrow. If two workflows fit equally, ask one question to choose. If the request belongs to another domain, use the ecosystem index in @ecosystem-orchestration.
  2. Preflight. Find out which step skills are installed: check the skills your host lists, or run python <skill-dir>/scripts/install_all.py --status --workflow <id> (<skill-dir> is the folder containing this SKILL.md). Show a short plan: step, skill, installed or missing, condition, expected artifact.
  3. Missing skills never block. Offer once: (a) install them — install_all.py --workflow <id> prints the commands and only runs them with --execute after the user agrees; or (b) continue in fallback mode — perform the step yourself using its Does and Done when columns and label that output fallback.
  4. Conditions. Skip optional steps whose condition does not hold, and say which steps you skipped and why.
  5. Execute. Run steps in order. Steps that share a parallel group are independent and may run concurrently (@parallel-planner). Pass artifacts as described in references/handoff-contract.md. Check each step's Done when before moving on.
  6. Gates. Before any destructive, irreversible, or production-impacting action, stop at @checkpoint-guardian, or ask for explicit confirmation when it is not installed.
  7. Failures. When a step misses its Done when, hand off to @error-recovery. Without it, retry once with a changed approach, then report the blocker with evidence instead of guessing.
  8. State. Keep a run log (workflow id, step, status, artifact). Record it with @memory-ledger when installed, and write a @session-transfer handoff if the run will continue in another session.
  9. Finish. Summarize artifacts, skipped steps, open risks, and the most relevant next workflow.

Skip this protocol when the user names one specific skill (invoke it directly) or asks a quick factual question that needs no workflow.

<!-- END GENERATED: ecosystem-router -->

Workflows

<!-- BEGIN GENERATED: ecosystem-workflows (generated from the ecosystem workflow map by build_ecosystems.py — do not edit by hand) -->

1. New Schema Design Flow (db-new-schema)

When: “design a database”; “create tables”; “model the data”

#SkillDoesDone whenConditionParallel group
1@sqlite (optional)Apply SQLite-specific type, PRAGMA, and migration rules.SQLite constraints are reflected in the design.Target engine is SQLite, libSQL, Turso, or D1—
2@schema-architectNormalize the model and produce dialect-specific DDL.Every table has a primary key, constraints, and justified normalization level.——
3@access-policy-designerAdd RLS, column security, and role policies to the new tables.Each table with tenant or user data has an explicit policy.——
4@seed-data-generatorGenerate seed data in dependency order.Seed script loads without foreign-key errors.——

2. Performance Optimization Flow (db-performance)

When: “fix a slow query”; “optimize the database”; “why is the database slow”

#SkillDoesDone whenConditionParallel group
1@query-explainerRead the execution plan and name the bottleneck node.Bottleneck identified with row estimates vs actuals.——
2@index-advisorRecommend indexes that remove the bottleneck; flag unused indexes.Each recommendation cites the query it fixes and its write cost.——
3@query-budget-enforcer (optional)Set budgets and N+1 detection so the regression cannot return.Budgets and alert thresholds are defined.——

3. Database Evolution Flow (db-evolution)

When: “change a table”; “migrate the schema”; “sync environments”

#SkillDoesDone whenConditionParallel group
1@schema-diff-analyzerDiff source and target schemas and rate each change's risk.Every change is rated safe, warning, or dangerous.——
2@migration-strategistPlan expand/contract migrations, backfills, and rollback.Plan has up, down, backfill, and verification steps.——
3@checkpoint-guardianConfirm before any migration runs against a shared or production database.User explicitly approved the HIGH RISK step.——

4. Compliance & Lineage Flow (db-compliance)

When: “GDPR or KVKK review”; “mask production data”; “where does this data go”

#SkillDoesDone whenConditionParallel group
1@data-lineage-tracerMap where sensitive columns come from and flow to.Upstream and downstream dependencies are listed.—compliance
2@data-maskerDetect PII and choose masking strategies per column.Every PII column has a masking rule.—compliance

5. Connection Scaling Flow (db-scaling)

When: “too many connections”; “set up PgBouncer”; “size the connection pool”

#SkillDoesDone whenConditionParallel group
1@pgbouncer-architectAnalyze workload, pick pool mode, size pools, and generate config.Pool sizes are derived from server capacity and ORM constraints.——
2@query-budget-enforcer (optional)Cap long-running queries that would starve the pool.Statement timeouts and budgets are set.——

Direct handoffs

  • @index-advisor → @migration-strategist: Index creation needs a non-locking rollout on a large table.
  • @data-masker → @seed-data-generator: Masked data should be replaced by synthetic fixtures.
  • @migration-strategist → @breaking-change-detector: The schema change alters a public API contract.
<!-- END GENERATED: ecosystem-workflows -->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.