db_current_state_analysis

Analyze current brownfield database structure and persistence rules from SQL exports and source evidence.

4|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/synthaicode/XRefKit --skill db-current-state-analysis-synthaicode
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: db_current_state_analysis
Source: https://github.com/synthaicode/XRefKit/tree/main/skills/db_current_state_analysis
Command: npx skills add https://github.com/synthaicode/XRefKit --skill db-current-state-analysis-synthaicode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Before designing or migrating a database in a brownfield system, teams often lack a trustworthy picture of what actually exists: tables, stored procedures, naming conventions, transaction behavior, and read/write paths are scattered across DDL exports, ORM mappings, and application code. This Skill produces an evidence-backed current-state analysis so DB design decisions are grounded in facts instead of guesses. ## Core Features & Use Cases - Persistence and model inventory: Builds a persistence inventory plus current logical and physical models from DB-unit SQL export files, cross-checked against ORM mappings, migrations, repositories, and raw SQL. - Local rule extraction: Extracts naming rules, table-definition rules (types, lengths, nullability, defaults, concurrency), stored procedure conventions, transaction and isolation behavior, and DDL/query construction rules with explicit confidence levels. - Mismatch and risk detection: Records DDL/ORM/code mismatches, external dependencies, operational risks, and unresolved live-DB verification status instead of silently picking a winner. - Use Case: Before designing a new schema for a legacy C# application, run this Skill against the repository and its SQL script exports to get a reusable current-state report that hands off concrete local rules to the db_design Skill. ## Quick Start Ask the AI to run the db_current_state_analysis Skill on your target repository with the DB-unit SQL export files and source scope to produce a current database state analysis report.

Frequently Asked Questions about db_current_state_analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze an existing database structure before redesigning it?▼

Run this Skill against the target repository with its DB-unit SQL export files. It builds a persistence inventory, logical and physical models, naming rules, and read/write path maps, producing a current-state report ready for DB design handoff.

What inputs does brownfield database current-state analysis need?▼

It needs the target repository scope, DB-unit SQL export files per database (DDL dumps, migration-generated SQL, or checked-in scripts), and source-structure finding XIDs. ORM mappings, raw SQL, jobs, and tests serve as secondary cross-check evidence; live DB access is optional.

Can this analysis work without live database access?▼

Yes, it proceeds source-first using SQL exports and code artifacts as evidence. Live DB status is recorded as not_verified, and any source-versus-live differences are marked unknown rather than inferred.

Does this Skill design the new schema or write migrations?▼

No, it strictly analyzes the current state and explicitly forbids designing schemas or implementing migrations. Extracted local rules and mismatches are handed off to the db_design Skill for actual design decisions.

What happens when DDL, ORM mappings, and code disagree?▼

The Skill records the mismatch explicitly instead of choosing a winner. Each conflict is documented with evidence and handed to db_design or a constraint-derivation Skill so design work does not proceed on hidden assumptions.