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

auditing-parity

Skill378 starsChanged 4 months agoApache-2.0View on GitHub

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.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify the modernization by performing a side-by-side architectural and interaction audit between the legacy and modern applications.

    line 8
  2. Distinctive:

    Ensure 1:1 functional parity by systematically comparing the live behavior and internal logic of both applications.

    line 11
  3. Distinctive:

    Before performing the audit, you MUST ensure a stable MongoDB environment:

    line 19
  4. Very specific:

    Detect Port Conflicts: Run docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" and look for any container binding to 0.0.0.0:27017.

    line 21
  5. Very specific:

    Stop Conflicting Instances: If a container is binding to 27017 but is not the intended database for this audit session, stop it immediately …

    line 22
  6. Very specific:

    Verify Unified Port: Ensure only one MongoDB container is reporting a bound host port in docker ps.

    line 24
  7. Very specific:

    Connectivity Check: Verify both applications connect to localhost:27017 (or the unified instance) without error.

    line 25
  8. Distinctive:

    Request Bodies: Ensure the new frontend API routes accept the exact same field names and types expected by the legacy API contract.

    line 49
  9. Very specific:

    Response Envelopes: Verify that the JSON response structure is identical (Check for wrapped vs.

    line 50
  10. Very specific:

    Use curl (via run_command) to construct authenticated and unauthenticated network requests to test "Owner-Only" and "Role-Only" logic:

    line 54
  11. Very specific:

    Unauthorized Access: If the legacy app redirects to /login for a specific route, does the modern app do the same or return a 401?

    line 55
  12. Distinctive:

    If there are any gaps or errors during testing, go back to the modern app and fix them.

    line 65

≈ “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

Side-by-Side Parity Audit

Verify the modernization by performing a side-by-side architectural and interaction audit between the legacy and modern applications.

Objective

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.

Prerequisites

  1. Legacy App: Running on http://localhost:3000.
  2. Modern App: Running on http://localhost:3001.
  3. Unified State (MongoDB): Both applications must target the same database instance to ensure data consistency during side-by-side testing.

Pre-Audit Environment Setup

Before performing the audit, you MUST ensure a stable MongoDB environment:

  1. Detect Port Conflicts: Run docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" and look for any container binding to 0.0.0.0:27017.
  2. Stop Conflicting Instances: If a container is binding to 27017 but is not the intended database for this audit session, stop it immediately (docker stop <ID>).
  3. Fresh Lifecycle: To ensure a clean state, run docker compose down in both modern-app/ and legacy-app/ before starting the "Unified" database instance (docker compose up -d mongodb in modern-app/).
  4. Verify Unified Port: Ensure only one MongoDB container is reporting a bound host port in docker ps.
  5. Connectivity Check: Verify both applications connect to localhost:27017 (or the unified instance) without error.

Instructions for the Audit Subagent

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

Step 1. Execute Side-by-Side Interactions

You MUST invoke the browser_subagent tool to interactively test both applications. Formulate a specific subagent task to perform the following actions in tandem:

  • Navigation: Click through all primary and sub-resource routes. Do the URL structures match or have a clear mapping?
  • Data Entry: Submit the same data into both legacy and modern forms. Ensure both succeed or fail in the same way.
  • Empty States: Compare views when no data is present.

Step 2. Compare Network Payloads (Terminal / CLI)

You MUST use the run_command tool with curl to directly query and intercept API requests, avoiding browser caching or rendering delays:

  • Request Bodies: Ensure the new frontend API routes accept the exact same field names and types expected by the legacy API contract.
  • Response Envelopes: Verify that the JSON response structure is identical (Check for wrapped vs. unwrapped payloads using curl | jq .).
  • Status Codes: Confirm that success (200/201) and failure (400/404/422/500) HTTP codes match exactly.

Step 3. Verify Complex Authorization (Terminal / CLI)

Use curl (via run_command) to construct authenticated and unauthenticated network requests to test "Owner-Only" and "Role-Only" logic:

  • Unauthorized Access: If the legacy app redirects to /login for a specific route, does the modern app do the same or return a 401?
  • Horizontal Privilege Checks: Attempt a DELETE request for another user's resource. Confirm the same failure/guard occurs in the modern app.

Step 4. Validate Edge Cases & Error Responses (Terminal / CLI)

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.

Step 5. Final Parity Report

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).

Step 6: Rinse and Repeat

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.

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.