Reverse-engineer a legacy codebase into ATDD-ready, traceable specifications
69
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Low
Low-risk findings worth noting
How doc-this-data-master adapts behavior based on state.json.database_ownership and state.json.schema_versioning (set by doc-this/references/step-04-database-context.md during first run).
database_ownership?
├─ none → return immediately, no DB analysis needed
├─ owned → full schema + business-logic + migrations-timeline (DB is implementation detail)
├─ external → external-contract + business-logic with "owned by DBA team" markings + emit kind:database for external-surface.json
└─ mixed → owned-set (per app-owned tables) + external-contract (per external tables) + per-object ownership label
+ emit kind:database entries only for the external-owned objectsownedThe team controls the schema. DB is implementation detail of the app.
Files produced in <output_folder>/database/:
schema.md — DDL + ERD (always)business-logic.md — narrated procedures/functions/views/triggers/computed columns/scheduled jobs (always)data-dictionary.md — all tables + columns (always)relationships.md — relationship matrix (always)procedures.md — extracted procedure/function bodies (when present)orm-drift.md — only when drift exists between ORM models and DB schemamigrations-timeline.md — only when schema_versioning = in-repoArchitect integration: NO kind: "database" entries in external-surface.json. The DB is internal — its operations are covered transitively by @api/@browser/@cli/@message scenarios.
Detective integration: cross-references rules from business-logic.md into per-module domain rules in unit requirements.md (Detective's responsibility, but Data Master must produce the source).
Writer integration: NO @database scenarios.
Reviewer integration: flags any @database scenario as suspect (DB is implementation detail; should not appear in scenarios).
externalThe team can't change the schema. DB is a frozen external contract.
Files produced in <output_folder>/database/:
external-contract.md — every consumed table, view, procedure, function, trigger documented as a frozen interface with version metadata (where available) (always)business-logic.md — narrated logic of every consumed DB object, with explicit "🟢 external dependency, owned by [DBA team] — coordinate with the team for any change" markings (ownership is itself a citation from the snapshot/contract source per the describe-only pact)schema-snapshot.sql — when schema_versioning ∈ {external, unversioned} and a snapshot was possible (for posterity and migration baseline)data-dictionary.md — only the tables/columns the app actually consumesrelationships.md — only relationships involving consumed objectsprocedures.md — extracted procedure/function bodies (always; this is the contract)Architect integration: emit kind: "database" entries for external-surface.json covering each consumed object:
{
"kind": "database",
"name": "dbo.usp_CalculateInvoiceTotal",
"type": "stored_procedure",
"schema_object": "dbo.usp_CalculateInvoiceTotal",
"consumed_by": ["src/services/InvoiceService.cs:142"],
"contract_owner": "DBA team",
"schema_version": "<version or 'unknown 🔴'>",
"visibility": "external_dependency",
"confidence": "confirmed"
}Architect renders the external DB as a separate Container in C4 diagrams, outside the team's deployment perimeter, labeled with the contract_owner.
Detective integration: external DB rules are NOT incorporated into per-module domain rules (the rules are NOT the team's; they're the DBA's contract). Instead, Detective creates per-FR notes: "Depends on external DB contract X — see external-contract.md."
Writer integration: emits @database scenarios for app-side calls that MUST continue to interact with the external DB in a specific way. Each scenario asserts observable contract behavior (parameter shape, return, side effects on rows the app reads next, transactional semantics) — NOT internal procedure logic.
Reviewer integration: Rule H (every kind: "database" entry is referenced from at least one @database or @browser/@cli scenario's call graph). Schema-version gate: if schema_versioning = unversioned AND no schema-snapshot.sql exists, refuse coverage completion.
mixedSome schemas/tables app-owned, others externally owned.
Files produced: BOTH the owned set (for app-owned objects) AND the external set (for externally-owned objects). Each table/object carries an ownership: app-owned | external label in data-dictionary.md and relationships.md.
Architect integration: emit kind: "database" entries ONLY for externally-owned objects. App-owned objects stay implementation detail.
Detective + Writer + Reviewer: behave per-object based on the ownership label. App-owned object rules go into per-module domain rules + no @database scenarios; externally-owned object rules become external-contract notes + @database scenarios.
The boundary is rendered explicitly in C4 (the team's deployment perimeter encloses app-owned tables only).
noneSkipped. No DB analysis. Doc-Master returns "skipped — project has no relational database" to the orchestrator immediately.
schema_versioning | Behavior |
|---|---|
in-repo | Read migrations folder, build chronological evolution narrative, identify "interesting" migrations (drops, complex backfills, schema flips). Produce migrations-timeline.md. |
external | Read schema from user-provided external location (path, dump file, or live read-only connection). Save as schema-snapshot.sql with extraction date. |
unversioned | Snapshot from live DB if available. Else create 🔴 GAP recommending baseline capture before reimplementation; suggest the per-engine command. Add to gaps.md: "DB schema is not versioned — recommend capturing baseline DDL before any migration work." |
unknown | Probe for migration tooling on first run; if found, switch to in-repo and tell orchestrator to update state.json; else fall back to unversioned. |
If the team can't determine ownership cleanly during step-04, ask in this order:
migrations/, db/migrate/, or equivalent folder in this repo?"Persist answers to state.json so future Discovery runs don't ask again.
For customer projects — any project outside your own or your organization's namespace:
.tessl-plugin
hooks
skills
doc-this
references
scripts
doc-this-architect
references
doc-this-code-analyst
references
doc-this-data-master
doc-this-design-system
doc-this-detective
references
doc-this-help
doc-this-promote
doc-this-reviewer
doc-this-scout
doc-this-tracer
doc-this-viewer
doc-this-visor
doc-this-writer