persistence-schema-reverse-engineering
Skill0 starsChanged 2 months agoMITView on GitHub
Reconstruct persistence architecture and database/data schema from current source, ORM mappings, SQL, migrations, DDL, schema bootstrap, upgrade scripts, and runtime repository wiring; distinguish code-known schema from external-only details.
In this repository33 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- adversarial-baseline-auditSkill
- architecture-drift-detectionSkill
- architecture-reconstruction-and-diagramsSkill
- artifact-detailed-designSkill
- baseline-source-of-truth-maintenanceSkill
- claim-verification-and-promotionSkill
- configuration-source-traceSkill
- contract-impact-test-designSkill
- current-state-tdd-synthesisSkill
- design-artifact-decompositionSkill
- design-artifact-decomposition-verificationSkill
- detailed-design-verificationSkill
- full-reverse-engineeringSkill
- implementation-readiness-certificationSkill
- incident-root-cause-analysisSkill
- integration-selection-analysisSkill
- observability-traceability-analysisSkill
- patch-impact-reviewSkill
- post-readiness-adversarial-auditSkill
- regression-test-designSkill
- requirement-compliance-reviewSkill
- resolve-high-impact-unknownsSkill
- resume-reverse-engineeringSkill
- reverse-engineering-bootstrapSkill
- reverse-engineering-coverage-auditSkill
- run-engineering-workflowSkill
- runtime-binding-verificationSkill
- runtime-flow-analysisSkill
- technical-design-proposalSkill
- technical-design-verificationSkill
- wbs-generationSkill
- wbs-verificationSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
If no persistence is materially present, record NOT_APPLICABLE with evidence and stop.
- Distinctive: line 40
Verify runtime binding of repository implementations when abstractions exist.
- Distinctive: line 44
Use evidence in priority order:
- Distinctive: line 65
Do not invent missing columns or relationships.
- Distinctive: line 86
If the repository contains queries/mappings but not authoritative DDL:
- Distinctive: line 90
do not call all database schema details UNKNOWN
- Distinctive: line 100
Update evidence ledger/open questions as appropriate.
≈ “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.
Files
Persistence and Schema Reverse Engineering
Mission
Determine whether persistence exists, how code reaches it, and what schema/data model is actually supported by repository evidence.
Applicability Check
First search for:
- JDBC/data sources/connections
- ORM entities/mappings
- repository/DAO classes
- SQL/query builders
- migration frameworks/scripts
- DDL/schema files
- embedded/test DB setup
- upgrade/install scripts
- table/column constants
If no persistence is materially present, record NOT_APPLICABLE with evidence and stop.
Runtime Trace
Trace representative reads and writes:
business/service
→ repository/DAO
→ ORM/query/SQL
→ connection/data source
→ table/entity/schemaVerify runtime binding of repository implementations when abstractions exist.
Schema Reconstruction
Use evidence in priority order:
- active migrations/DDL/schema bootstrap
- active ORM/entity mappings
- production SQL/query definitions
- install/upgrade scripts
- tests/test schema as supporting evidence only
- docs/comments as secondary evidence
Reconstruct where supported:
- table/entity names
- important columns/fields
- data types
- PK/unique keys
- FKs/relationships
- indexes when behaviorally relevant
- read/write ownership
- transaction boundaries
- migration/version history
Do not invent missing columns or relationships.
Required Tables
Persistence Path
| Operation | Service/Caller | Repository/DAO | Concrete Binding | Query/ORM | Data Source | Evidence |
Schema Inventory
| Table/Entity | Key | Important Fields | Relationships | Read By | Written By | Definition Evidence | Confidence |
Schema Gaps
| Question | Search Performed | Code-Known Facts | Missing External Fact | Closure State |
External Schema
If the repository contains queries/mappings but not authoritative DDL:
- promote only the schema facts directly required/proven by active code
- mark unavailable authoritative DDL/version as external if repository search is exhausted
- do not call all database schema details UNKNOWN
Output
Create/update:
docs/reverse-engineering/persistence/<scope>.mdUpdate evidence ledger/open questions as appropriate.
Consumer Architecture Model
Update:
docs/reverse-engineering/models/persistence_state_model.md
docs/reverse-engineering/diagrams/05_state_persistence_lifecycle.mdThe model must explain ownership and behavior, not merely dump entity fields.
Capture, where applicable:
owner
→ read/write path
→ transaction/connection boundary
→ persisted entity/table/state
→ lifecycle/state transition
→ concurrency/async interaction
→ failure/recovery behavior05_state_persistence_lifecycle.md must contain at least one evidence-linked Mermaid diagram. If persistence is not applicable, model the most material runtime state/resource/job lifecycle instead and document why persistence is NOT_APPLICABLE.
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
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.

