agentleFS
Google CloudKnown publisherGoogleCloudPlatform/devrel-demos/other/modernizing-expressjs/.agents/skills/auditing-data-models/SKILL.md

auditing-data-models

Skill378 starsChanged 4 months agoApache-2.0View on GitHub

Analyzes legacy ORM models (Mongoose, Sequelize) to extract schemas, validations, and relationships. Use when reverse-engineering a legacy data layer for a modern rewrite.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Search the legacy codebase for database model definitions (e.g., app/models/, db/models/).

    line 25
  2. Distinctive:

    Validations: Document required fields, unique constraints, regex patterns, or enums.

    line 30
  3. Very specific:

    Hooks: Search for lifecycle events (e.g., pre('save'), post('remove')) that perform side-effects like cascading deletes or password hashing.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

Auditing Data Models

Analyze the legacy data layer to extract schemas, validation rules, and entity relationships. Produce a blueprint for a modern, type-safe data access layer (e.g., Zod + Native MongoDB).

Objective

Reverse-engineer the legacy application's database models to ensure data integrity and structural parity in the modernized system.

Instructions for the Audit Subagent

Copy this checklist and track your progress:

Task Progress:
- [ ] Step 1: Locate the Models
- [ ] Step 2: Analyze Entity Schemas
- [ ] Step 3: Map Relationships & Hooks
- [ ] Step 4: Generate Data_Models.md

Step 1. Locate the Models

Search the legacy codebase for database model definitions (e.g., app/models/, db/models/). Identify the Primary Entities and their corresponding source files.

Step 2. Analyze Entity Schemas

For each database model, extract:

  • Fields & Types: Map every field to its legacy data type (e.g., String, ObjectId, Date).
  • Validations: Document required fields, unique constraints, regex patterns, or enums.
  • Default Values: Identify any automatically assigned values (e.g., Date.now).
  • Legacy Methods/Virtuals: Note custom methods (e.g., user.authenticate(password)) or computed properties that will need to be ported to the utility layer.

Step 3. Map Relationships & Hooks

  • Relationships: Identify how entities are connected (One-to-Many, Many-to-Many, Embedded Documents). Use Mermaid ER diagrams to visualize these connections in the final report.
  • Hooks: Search for lifecycle events (e.g., pre('save'), post('remove')) that perform side-effects like cascading deletes or password hashing.

Step 4. Generate Data_Models.md & Identify Probes

Compile findings into docs/legacy-audit/Data_Models.md. Additionally, identify specific data-integrity stress-tests (e.g., "Attempt to load a legacy record missing the email field to check if the new Zod schema handles it gracefully"). Append these probes to docs/verification/Verification_Plan.md.

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.