agentleFS
Google CloudKnown publisherGoogleCloudPlatform/devrel-demos/other/modernizing-expressjs/.agents/skills/orchestrating-greenfield-migration/SKILL.md

orchestrating-greenfield-migration

Skill416 starsChanged 31 days agoApache-2.0View on GitHub

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.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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
  1. Very specific:

    Checkpointing: Wait for each phase's artifacts (in docs/) to be completed before starting the implementation phase.

    line 55

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

Greenfield Migration Orchestrator

This skill manages the transition from legacy Node.js monoliths (Express/Pug/Mongoose) to modern Next.js architectures using a Greenfield Rewrite strategy.

Modernization Hub Structure

The preferred workspace layout is a "Modernization Hub" monorepo:

/workspace-root/
├── .agents/        # This Skills Pack
├── docs/           # Centralized Audit & Verification Specs
├── legacy-app/     # The Source (Read-Only)
└── modern-app/     # The Target (The Greenfield Repo)

The Workflow

Phase 1: The AI Audit (Reverse Engineering)

Dispatch subagents to produce specifications while identifying project-specific test scenarios for the Verification_Plan.md.

  • Establish Database Strategy: Decide whether to use the Existing Legacy DB or a Seeded Greenfield DB. (Default: Legacy Direct).
  • Expose Legacy DB to Host: If using the legacy DB via Docker, modify legacy-app/docker-compose.yml to include ports: ["27017:27017"] and restart the service.
  • Initialize docs/verification/Verification_Plan.md: Create the baseline template using resources/verification-strategy.md.
  • Run auditing-data-models -> Append Data Integrity Stress-Tests.
  • Run auditing-api-contracts -> Append API Parity & Edge Case Probes.
  • Run auditing-business-logic -> Append Logic & Authorization Stress-Tests.
  • Run auditing-ui-archeology -> Append Interaction & Layout Verification Targets.

Phase 2: The Greenfield Foundation & TDD

  • Run scaffolding-nextjs-foundation to generate the base App.
  • Run scaffolding-test-foundation to configure Vitest.
  • Run generating-api-tests to convert API_Contracts.md into failing integration tests.

Phase 3: The Greenfield Scaffold (Make Tests Pass)

  • Run scaffolding-data-layer to translate models into Native MongoDB/Zod types.
  • Run scaffolding-api-routes to implement Route Handlers until tests pass.
  • Skip or Run generating-database-seeder based on the Strategy decision.

Phase 4: The UI & Pages Scaffold

  • Run scaffolding-ui-and-pages to translate UI_Component_Inventory.md into ShadCN components AND complete Next.js pages.
  • Strict Checkpoint: Verify that every route identified in the "Route & Page Topology" section of the inventory has an associated page.tsx implementation.

Phase 5: Verification & Adversarial Audit

  • Run auditing-parity to perform a side-by-side runtime check.
  • Run adversarial-verification to probe for security and logic flaws.
  • Finalize Parity_Adversarial_Report.md.

Instructions for Orchestration

  1. Validate Paths: Confirm the relative paths to the legacy-app and modern-app.
  2. Dispatch Subagents: Explicitly tell subagents where the source code and documentation folders are located.
  3. Checkpointing: Wait for each phase's artifacts (in docs/) to be completed before starting the implementation phase.

Resources

  • resources/verification-strategy.md: The master methodology for side-by-side verification.

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.