com um clique
auditing-parity
// Compares a modernized Next.js application against its legacy Express counterpart using runtime side-by-side verification. Use when ensuring functional and business logic parity between two systems.
// Compares a modernized Next.js application against its legacy Express counterpart using runtime side-by-side verification. Use when ensuring functional and business logic parity between two systems.
| name | auditing-parity |
| description | Compares a modernized Next.js application against its legacy Express counterpart using runtime side-by-side verification. Use when ensuring functional and business logic parity between two systems. |
Verify the modernization by performing a side-by-side architectural and interaction audit between the legacy and modern applications.
Ensure 1:1 functional parity by systematically comparing the live behavior and internal logic of both applications. The goal is to prove the new code is a perfect functional replacement.
http://localhost:3000.http://localhost:3001.Before performing the audit, you MUST ensure a stable MongoDB environment:
docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" and look for any container binding to 0.0.0.0:27017.27017 but is not the intended database for this audit session, stop it immediately (docker stop <ID>).docker compose down in both modern-app/ and legacy-app/ before starting the "Unified" database instance (docker compose up -d mongodb in modern-app/).docker ps.localhost:27017 (or the unified instance) without error.Copy this checklist and track your progress:
Task Progress:
- [ ] Step 0: Validate Database & Container State
- [ ] Step 1: Execute Side-by-Side Interactions
- [ ] Step 2: Compare Network Payloads
- [ ] Step 3: Verify Complex Authorization
- [ ] Step 4: Validate Edge Cases & Error Responses
- [ ] Step 5: Final Parity Report
- [ ] Step 6: Rinse and Repeat
You MUST invoke the browser_subagent tool to interactively test both applications. Formulate a specific subagent task to perform the following actions in tandem:
You MUST use the run_command tool with curl to directly query and intercept API requests, avoiding browser caching or rendering delays:
curl | jq .).Use curl (via run_command) to construct authenticated and unauthenticated network requests to test "Owner-Only" and "Role-Only" logic:
/login for a specific route, does the modern app do the same or return a 401?DELETE request for another user's resource. Confirm the same failure/guard occurs in the modern app.Use curl (via run_command) to inject malformed data via POST/PUT payloads (empty JSON {}, invalid IDs, excessively long strings) and strictly compare the errors array structures returned. While the UI can be modern, the API logic must remain functionally equivalent to prevent breaking downstream consumers.
Compile findings into a docs/verification/Functional_Parity_Report.md. Categorize every finding as Confirmed Parity, Functional Gap (missing logic), or Intentional Drift (modernized logic with a documented reason).
If there are any gaps or errors during testing, go back to the modern app and fix them. Then, repeat these steps from the beginning until the modern app is a perfect functional replacement for the legacy app.
Manages the end-to-end modernization of legacy Express monoliths into Next.js architectures. Orchestrates subagents for auditing, scaffolding, and verification. Use when starting or managing a greenfield rewrite project.
Systematically probe a modernized Next.js application for logic flaws, security vulnerabilities, or missing features. Use this to find bugs or cases where the migration failed to match legacy behavior.
Analyzes Express route definitions and controller logic to document API endpoints, payloads, and response structures. Use when reverse-engineering an existing Express application's API surface.
Analyzes authentication flows, authorization rules, middleware logic, and side-effects. Use when extracting business rules, Passport configurations, or mailer logic from an Express application.
Analyzes legacy ORM models (Mongoose, Sequelize) to extract schemas, validations, and relationships. Use when reverse-engineering a legacy data layer for a modern rewrite.
Analyzes legacy UI templates (Pug, EJS, HTML) to extract a comprehensive inventory of components, layouts, and conditional logic. Use when reverse-engineering a legacy frontend for a modern rewrite.