Coding Workflows Workflow Intermediate

AI Architecture Recovery Workflow

Recover a legacy system's architecture before you change it — package the codebase context, explain the current structure, surface the risks and seams, then document the recovered architecture.

The problem

Greenfield architecture design and architecture recovery are opposite jobs, and using the first for the second is how modernization goes wrong. A legacy system already has an architecture — it's just undocumented, scattered across the code, and half-understood. Designing a 'new' architecture for it skips the expensive part: figuring out what's actually there, what depends on what, and where change is safe versus where it cascades. Recovery is the deliberate version — understand the current structure, separate what the code shows from what you're assuming, and find the seams — so modernization decisions rest on the real system instead of a guess about it.

Recommended workflow

Each step uses an existing NewPrompt tool, pre-filled by a matching resource. Open the resource to read it, or jump straight into the tool with the inputs ready.

  1. Package the codebase context

    Set up what the AI needs to know about the existing codebase — its stack, structure, and conventions — so it reasons from the real system instead of guessing at it.

    Outcome A project context profile the AI reads before reasoning about the code.
  2. Explain the current architecture

    Have the AI explain the system's actual shape — modules, boundaries, dependencies, and data flows — keeping what the code shows separate from what it infers.

    Outcome A clear explanation of the current architecture, observed facts marked apart from inference.
  3. Find the legacy risks and seams

    Identify the risky coupling and fragile dependencies, and the seams where modernization can start safely — the places change is cheap versus where it cascades.

    Outcome The legacy risks and the safe modernization seams, named.
  4. Document the recovered architecture

    Write up the recovered architecture as a document the modernization works from — structure, dependencies, risks, and the open questions still to resolve.

    Outcome A recovered-architecture document the modernization team builds on.

Expected outcome

The existing system's architecture recovered and documented — its current structure explained, the risks and modernization seams identified, and a recovered-architecture document the team works from — so modernization decisions rest on the real system instead of a guess about it.

Best for

  • Understanding a legacy or inherited codebase before modernizing it
  • Documenting the current architecture of an existing system
  • Finding the risks and safe seams before refactoring

Not for

  • Designing a brand-new architecture from scratch — use the AI Project Architecture Workflow
  • Refactoring or modernizing the code itself — use the AI Refactoring or Legacy Modernization Workflow
  • Reviewing code for bugs and quality — use the AI Code Review Workflow

FAQ

Architecture recovery vs greenfield architecture design — which do I need?

That workflow designs a new architecture from trade-offs — greenfield, deciding structure that doesn't exist yet. This one recovers the architecture already living in a legacy system: what modules exist, how they connect, and where change is risky. One invents structure; this uncovers and documents it.

Does it change any code?

No. It produces understanding and a recovered-architecture document — observed facts separated from inference, with the open questions named. The actual refactoring and modernization are separate workflows that build on what this recovers.

What does the AI architecture recovery workflow produce?

A recovered-architecture document written in step 4 — the current structure explained, dependencies mapped, legacy risks and safe modernization seams named, and the open questions still to resolve. It's the artifact your modernization or refactoring team works from, not a change to the code itself.

What do I need before running the architecture recovery workflow?

The existing codebase and enough context for the AI to reason from the real system: its stack, structure, and conventions, packaged in step 1 with the project-context-builder. Without that project context profile the AI guesses at the architecture instead of reading it, and the recovery is unreliable.

How do I run the AI architecture recovery workflow?

Work the four steps in order in your own AI tool: package the codebase context, have the AI explain the current architecture, find the legacy risks and modernization seams, then document the recovered architecture. NewPrompt supplies each step's prompt and links; you run them and confirm each claim against the real system.

The AI architecture explanation looks wrong — how do I verify it?

Check the explanation against the code yourself — this workflow keeps observed facts marked apart from inference in step 2, so scrutinize the inferred claims first. Where a module boundary or dependency looks wrong, re-run the explanation prompt with that file included, and log unresolved gaps as open questions in the step-4 document.

Part of these projects

Complete build journeys that include this workflow as a stage.

Recommended next workflow

Tip: Each step's resource opens its tool pre-filled — start at step one and carry the output forward.