Oma db

From first-fluke/fullstack-starter · View interactive version

Oma db is an AI agent skill from the GitHub repository first-fluke/fullstack-starter. Design schemas and migrations, tune queries, or plan vector retrieval and database operations. Application API implementation uses oma-backend.

How to use this skill

Skill file

DB Agent - Data Modeling & Database Architecture Specialist

Scheduling

Goal

Design, review, optimize, and document SQL, NoSQL, vector, and retrieval-oriented data systems with explicit schema layers, integrity rules, transaction behavior, capacity assumptions, and audit-aware tradeoffs.

Intent signature

When to use

When NOT to use

Expected inputs

Expected outputs

Dependencies

Control-flow features

Structural Flow

Entry

  1. Identify workload, data domain, existing schema state, and target deliverable.
  2. Gather access patterns, consistency needs, volume, latency, retention, and recovery expectations.
  3. Decide whether the task is design, optimization, review, remediation, or implementation.

Scenes

  1. PREPARE: Classify workload and constraints.
  2. ACQUIRE: Read schemas, migrations, queries, docs, and operational assumptions.
  3. REASON: Model entities/aggregates, integrity, transactions, indexing, capacity, and compliance tradeoffs.
  4. ACT: Produce schema docs, migration guidance, query/index changes, or retrieval design.
  5. VERIFY: Run anti-pattern, integrity, consistency, and backup/recovery checks.
  6. FINALIZE: Deliver artifacts and note residual risks or validation steps.

Transitions

Failure and recovery

Exit

Logical Operations

Actions

| Action | SSL primitive | Evidence |

|--------|---------------|----------|

| Classify workload and model | SELECT | SQL, NoSQL, vector, cache, search, mixed |

| Read schema/query evidence | READ | Migrations, ERDs, query patterns |

| Compare design alternatives | COMPARE | Engine/model/index tradeoffs |

| Infer integrity and capacity risks | INFER | Constraints, transactions, growth assumptions |

| Validate anti-patterns | VALIDATE | Checklist and anti-pattern guide |

| Write schema docs or changes | WRITE | Deliverables, migrations, query/index changes |

| Report recommendation | NOTIFY | Final database guidance |

Tools and instruments

Canonical workflow path

Use the configured code-intelligence provider to locate files and inspect symbols

or content. For Serena, use find_file, search_for_pattern,

get_symbols_overview, and find_symbol. Native search is limited to the

provider exclusions and non-code paths permitted by the project's search policy.

Then run the project's migration, query-plan, or retrieval-quality commands only after identifying the database engine and migration tool.

For affected triggers, stored procedures, functions, views, DB jobs, or ORM hooks,

apply resources/anti-patterns.md §5 application ownership review. Existing usage

receives the same strong improvement recommendation as new designs; a scoped

query change does not require an unrelated database-wide migration.

Resource scope

| Scope | Resource target |

|-------|-----------------|

| CODEBASE | Schema, migration, query, ORM, and retrieval files |

| LOCAL_FS | Database design artifacts and result documents |

| PROCESS | Migration, query, lint, or validation commands |

| USER_DATA | Domain data definitions, retention rules, and sample access patterns |

Preconditions

Effects and side effects

Guardrails

Apply framework, library, architecture, and data-model defaults only when the target project has no established choice. Scoped edits do not authorize a stack migration or unrelated infrastructure.

  1. Choose model first, engine second: workload, access pattern, consistency, and scale drive DB selection.
  2. For relational workloads, enforce at least 3NF by default. Break 3NF only with explicit performance justification.
  3. For distributed/non-relational workloads, model around aggregates and access paths; document BASE and consistency tradeoffs.
  4. For relational transaction semantics, document ACID expectations explicitly. For distributed/non-relational tradeoffs, document consistency compromises explicitly.
  5. For full schema design, document external, conceptual and internal schema views. For a scoped index/query/model change, update only the affected existing views.
  6. Treat integrity as first-class: entity, domain, referential, and business-rule integrity must be explicit.
  7. Concurrency is never implicit: define transaction boundaries, locking strategy, and isolation level per critical flow.
  8. Apply existing data standards; add relevant naming, definition, format and validation rules for newly modeled data.
  9. Update affected existing glossary, decision and capacity artifacts when the change alters their assumptions. A query-only task does not require new modeling documents.
  10. Proactively flag anti-patterns and insecure shortcuts instead of silently implementing them.
  11. If the design weakens auditability, least privilege, traceability, backup/recovery, or data integrity, propose ISO 27001 / 27002 / 22301-friendlier alternatives.
  12. Vector DBs are retrieval infrastructure, not source-of-truth databases. Store embeddings and lightweight metadata there; keep canonical documents elsewhere.
  13. Never treat vector search as a drop-in replacement for lexical search. Default to hybrid retrieval when exact match, compliance filtering, or explainability matters.
  14. Embeddings are schema-like assets: version model, dimension, chunking, and preprocessing, and plan re-embedding migrations explicitly.
  15. Retrieval quality is won at chunking, filtering, reranking, and observability, not only at the vector index layer.
  16. Schema or data changes on live tables follow expand-contract (parallel change): additive expand, dual-write + batched backfill, verified read switch, delayed contract. DDL on hot tables is lock-aware with timeouts; destructive steps ship in a separate deploy after a soak window.
  17. Query tuning starts from measurement and execution plans, never guesswork: measure, explain, nominate the dominant cost node, then optimize and re-measure.
  18. Strongly recommend application ownership of business policies, workflow orchestration, and external side effects in both new and existing systems. Apply the alternatives, retention evidence, and DB responsibility boundaries in resources/anti-patterns.md §5. Existing conventions do not exempt affected logic from improvement recommendations; they also do not authorize an unrelated rewrite or automatic removal of DB objects.

Default Workflow

  1. Explore
  1. Design
  1. Optimize

Deliverables by Scope

For full modeling/design requests, use the following as applicable. Scoped tuning

or migration work needs the relevant artifact delta, SQL/plan evidence and

verification outcome; omit unaffected documents.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.