Reverse Spec Flow: AWS AI Legacy Modernization Guide

Reverse Spec Flow: How AWS Uses AI for Legacy Modernization

Contents hide
1 Reverse Spec Flow: How AWS Uses AI for Legacy Modernization

Can AI reconstruct an undocumented legacy application without losing critical business rules? AWS’s Reverse Spec Flow offers a structured approach to recovering specifications from source code, but its published test results reveal why verification remains essential.

On November 21, 2026, Amazon Web Services (AWS) Japan introduced Reverse Spec Flow (RSF), an open-source workflow that uses AI coding agents to generate structured, evidence-backed specifications from existing applications.

The approach addresses a familiar challenge in enterprise IT: legacy software continues to support important business operations, but its documentation may be outdated, incomplete, or missing entirely.

Without reliable specifications, even a relatively straightforward software change can involve extensive investigation. Engineers must understand the existing code, identify dependencies, reconstruct business rules, and determine which behaviors must survive a migration.

Reverse Spec Flow aims to make this investigation more systematic.

Unlike a conventional AI-generated code summary, RSF requires source-code references for specification statements, uses an independent AI verifier, and checks whether the identified code structure has been covered.

AWS tested the approach on Apache Roller, a Java application containing approximately 150,000 code steps. The specification workflow completed in approximately 38 hours, including human review waits.

However, a manual audit of 200 generated statements found partial inaccuracies in approximately 5% of the sample.

The central lesson is that AI-generated specifications can accelerate code understanding, but their value depends on how reliably the findings can be verified.

This article explains Reverse Spec Flow, its five-phase workflow, AWS’s published evaluation results, its limitations, and how businesses should assess it before investing in AI-assisted application modernization.

What Is AWS Reverse Spec Flow?

Reverse Spec Flow is an open-source AI workflow that generates structured specifications from existing source code. It is designed for applications with missing, outdated, or unreliable documentation and can support both legacy system maintenance and application reconstruction.

The workflow is published through the official AWS Samples GitHub repository.

Its primary output is structured Markdown documentation that AI agents can retrieve through requirement identifiers and indexes.

This matters because the intended audience is not exclusively human developers.

Reverse Spec Flow also prepares specifications for downstream AI agents that may help investigate, modify, or rebuild an application.

Why is traditional reverse engineering difficult?

Consider a manufacturing company operating a customized ERP application developed more than a decade ago.

Over time, multiple vendors have modified the system.

Business rules may be distributed across application code, database procedures, scheduled jobs, and external integrations.

The organization may possess some documentation, but it no longer reflects the current implementation.

Before modernization can begin, engineers must answer questions such as:

  • What happens when a customer order is approved?
  • Which modules update inventory and financial records?
  • What validations prevent duplicate transactions?
  • Which external systems depend on the current interfaces?
  • What happens when a scheduled process fails?

These questions require more than a list of classes or functions.

They require an understanding of how technical components implement business behavior.

Generative AI can help interpret code, but an ordinary summary may omit important functionality or present assumptions as facts.

Reverse Spec Flow attempts to address those weaknesses through a controlled specification-generation process.

How Does Reverse Spec Flow Work? The Five-Phase Process

Reverse Spec Flow uses five phases: source-code ingestion, code-graph creation, evidence-based analysis, structured specification generation, and independent auditing. Each phase has defined outputs and checks, including human review where necessary.

Phase Purpose Primary outcome
0. Ingestion Fix the source revision and analysis scope Reproducible baseline
1. Code graph Identify modules, entry points, and integrations Structural inventory
2. Analysis Examine architecture, requirements, data, APIs, and behavior Evidence-backed findings
3. Specification Organize findings into structured requirements AI-readable specifications
4. Audit Independently verify citations, coverage, and uncertainty Checked documentation

Source: AWS Japan’s Reverse Spec Flow announcement.

Phase 0: Establish a reliable code baseline

The workflow begins by selecting the codebase, fixing the relevant commit, and defining the investigation’s scope.

This prevents specifications from being generated against an application that changes unpredictably during analysis.

For enterprises, establishing the correct version is particularly important when development, testing, and production environments differ.

Phase 1: Map the application’s structure

The AI agent builds a code graph identifying modules, application entry points, external connections, and relationships.

The graph becomes the basis for measuring analysis coverage.

Rather than relying on the AI agent to decide when it has examined enough code, the workflow defines which elements must be covered.

However, completing the code graph is not the same as proving that all business behavior has been recovered.

Phase 2: Analyze code with traceable evidence

The AI examines the codebase to identify architectural information, requirements, data structures, interfaces, and application behavior.

Each relevant statement must be supported by a source reference such as path:line.

For example, a specification describing an order-validation rule should point to the code implementing that rule.

The verifier must check more than whether a reference exists. It should determine whether the cited code actually supports the description.

When information cannot be established from the source, it is marked as UNKNOWN.

This distinction helps prevent assumptions from being silently incorporated into future development.

Phase 3: Generate structured specifications

The workflow creates specifications using a structure informed by ISO/IEC/IEEE 29148.

For reconstruction, RSF distinguishes between two kinds of information:

Implementation-specific facts: How the current application works, including its frameworks, code structures, and technical dependencies.

Technology-independent requirements: Business rules, state transitions, logical data models, validation conditions, interfaces, and other behavior that may need to be preserved.

This separation is especially relevant when moving from an older technology stack to a modern architecture.

For example, a legacy Java application’s order-approval logic may need to be preserved even if the replacement system is built using TypeScript.

The original framework itself may not need to be retained.

Phase 4: Audit the generated specifications

A separate AI verifier checks statements against their supporting source code.

The workflow also uses automated completion checks, including gates.sh, to evaluate whether defined requirements have been satisfied.

Human intervention may still be required to resolve uncertainty around scope, compatibility, or additional validation.

Importantly, an automated pass establishes compliance with the workflow’s defined checks. It does not certify that the entire application has been understood perfectly.

What Did AWS’s Apache Roller Test Actually Prove?

AWS demonstrated that Reverse Spec Flow could generate structured specifications from Apache Roller 6.1.5 and use them as inputs to an AI-assisted reconstruction. The results also showed that some specification inaccuracies remained after automated validation.

Published evaluation results

Metric AWS-reported result
Application Apache Roller 6.1.5
Codebase Approximately 150,000 code steps
Java code Approximately 98,000 code steps
Identified components Approximately 280
Business functions 17
Specification workflow Approximately 38 hours
Manually audited statements 200
Partially inaccurate statements Approximately 5%
Completely incorrect statements in sample 0

The 38-hour duration included waiting periods for human review and reflects this specific evaluation, not a guaranteed enterprise delivery time.

AWS also reported that the workflow passed its automated completion gates.

Why does the 5% finding matter?

After the specification workflow passed its checks, AWS sampled 200 statements and compared them with the source code.

Approximately 5% contained partial errors, including missing conditions, incomplete lists, overly broad conclusions, or inaccurate source references.

No completely incorrect statements were found in the sample.

This is encouraging evidence for the methodology, but it also establishes a limitation.

Even independent AI verification and structured coverage controls did not eliminate all errors.

For an enterprise, a partially incorrect rule can still have significant consequences.

Imagine that a specification correctly describes an order-approval workflow but omits an exceptional case involving high-value transactions.

If a replacement application is built from that incomplete specification, the missing condition could become a defect in the new system.

The critical question is not whether a specification passed automated checks, but whether its remaining uncertainties are acceptable for the business process involved.

The approximately 5% result is specific to AWS’s audit sample. It should not be treated as a universal error rate for RSF or for AI-generated documentation in general.

Can the generated specifications support reconstruction?

AWS used the Apache Roller specifications with an AI-driven development workflow to rebuild the application using TypeScript and Next.js.

It reports completing core functionality and tests in the reconstruction effort.

This demonstrates a potential connection between AI-assisted reverse engineering and AI-assisted forward engineering.

However, the announcement does not establish full production equivalence across every original feature, environment, integration, and operational scenario.

Organizations must still verify application behavior through appropriate testing.

What about larger applications?

AWS also reports applying Reverse Spec Flow to Apache Fineract, an open-source financial services platform containing approximately 840,000 code steps.

This provides an example of applying the workflow to a substantially larger codebase.

However, equivalent detailed accuracy and timing measurements were not presented for Apache Fineract.

The Apache Roller results should therefore not be generalized to every large financial or enterprise system.

Can Reverse Spec Flow Replace Traditional Software Reverse Engineering?

No. Reverse Spec Flow can assist with static source-code analysis and specification generation, but it does not replace runtime investigation, business-user interviews, integration testing, or validation of undocumented operational procedures.

This limitation is particularly important for complex enterprise applications.

What static analysis cannot reveal

Reverse Spec Flow does not, as part of its described specification workflow, automatically run the application, operate its user interface, or query a live database to observe behavior.

It relies on evidence available in the analyzed source code.

Some operational rules may therefore remain undiscovered.

For example, a financial system may include a formally implemented approval process alongside manual exceptions handled through spreadsheets or email.

The code can explain the implemented workflow.

It cannot establish every process followed outside the application.

Similarly, some behavior depends on runtime configuration, deployment environments, external services, or production data.

A generated specification should identify these uncertainties rather than treating them as resolved.

Why human verification remains necessary

Successful modernization requires alignment between three sources of truth:

  1. Implemented behavior: What the existing code actually does.
  2. Operational behavior: How employees and external systems use the application.
  3. Required future behavior: What the replacement system must support.

These are related but not always identical.

A legacy application may contain obsolete functionality that should be removed.

It may also omit controls that the business now requires.

Simply reconstructing the old application does not necessarily produce the correct future system.

Reverse Spec Flow can help document implementation facts, but business stakeholders must determine which behaviors should be retained, changed, or retired.

How Much Does Reverse Spec Flow Cost?

Reverse Spec Flow’s repository is open source under the MIT-0 license, but executing the workflow can incur AI model charges and human review costs. Expenses depend on codebase size, selected models, analysis settings, and verification depth.

AWS describes three configurations intended for different objectives.

Configuration Intended use Evaluation consideration
Maintenance Understand and maintain the existing system Lower-cost starting point
Evaluation Assess reconstruction feasibility and effort Suitable for initial modernization decisions
Rebuild Produce detailed inputs for AI-assisted reconstruction Higher verification and model-usage demands

AWS indicates that the rebuild configuration may cost approximately five to seven times more than maintenance, depending on the setup.

Its Apache Roller example also illustrates how extensive AI processing can become: AWS reported approximately 15 million output tokens and 3.5 billion cached-read tokens under its detailed rebuild configuration.

These are not universal requirements or prices.

They demonstrate why costs should be measured rather than inferred solely from the size of the source-code repository.

What should enterprises include in a cost estimate?

A realistic evaluation should consider AI-model usage, engineering setup, source-code review, business-rule validation, security controls, and any additional documentation or testing required.

It should also consider the future benefit of maintaining usable specifications.

A tool that generates documentation quickly may offer limited value if substantial work is needed to correct it.

Conversely, a slower specification process may be justified if it reduces uncertainty during a much larger modernization program.

AWS recommends beginning with a small codebase, below approximately 10,000 code steps, to understand consumption before expanding the analysis.

Which Legacy Technologies Can Reverse Spec Flow Analyze?

Reverse Spec Flow includes optional playbooks for several older and modern technology stacks, including Java, ASP.NET Web Forms, C# and VB.NET Windows Forms, Visual Basic 6, procedural PHP, COBOL, and Oracle PL/SQL.

These playbooks help the workflow identify technology-specific components that should be included in the analysis.

For example, a COBOL application may require examination of batch jobs and related data structures, while an ASP.NET Web Forms application may require different coverage considerations.

The availability of a playbook does not mean every application using that technology will work without adjustment.

Companies should verify suitability against their own application structure and integrations.

The official repository currently identifies Claude Code and Kiro as supported AI coding environments for executing the specification workflow.

Source: AWS Samples — Reverse Spec Flow.

How Should Businesses Evaluate Reverse Spec Flow for Legacy Modernization?

Enterprises should begin with a controlled assessment of one important application component. The pilot should measure specification accuracy, unresolved business rules, human-review effort, AI consumption, and the usefulness of the results for future modernization work.

A practical approach is to evaluate five areas.

1. Select a business-relevant scope

Choose a component that represents real modernization challenges without exposing the entire enterprise system to unnecessary risk.

For example, a manufacturing business might select order validation, inventory allocation, or shipment authorization.

The selected component should have sufficiently clear business ownership so that generated specifications can be reviewed.

2. Establish a verified source baseline

Identify the source-code revision, dependencies, configuration files, and available documentation.

Confirm what can and cannot be included in the analysis.

This reduces uncertainty about the system being documented.

3. Generate and independently verify specifications

Run an appropriate specification workflow.

Check source-code references and sample important requirements for accuracy.

Document unsupported statements and unresolved questions.

For high-risk functionality, review all critical rules rather than relying exclusively on random sampling.

4. Validate specifications with business users

Compare the generated documents with actual operational procedures.

Pay attention to exceptions, manual approvals, reporting requirements, and integrations.

This step can reveal missing knowledge that static source analysis cannot detect.

5. Evaluate modernization readiness and costs

Determine whether the resulting specifications are suitable for maintenance, migration planning, partial reconstruction, or broader modernization.

Record AI usage, engineering hours, review effort, unresolved issues, and testing requirements.

Only then should the organization decide whether expanding the approach is commercially justified.

What should a pilot deliver?

A useful pilot should produce more than an AI-generated document.

Its deliverables should include a traceable specification, an unresolved-issues register, an assessment of important business-rule coverage, a cost record, and recommendations for the next modernization step.

This provides decision-makers with evidence they can evaluate rather than a demonstration that simply generates impressive-looking documentation.

How Should Enterprises Choose an AI Modernization Partner?

An AI modernization partner should demonstrate both technical capabilities and a reliable approach to verification. Buyers should evaluate its knowledge of legacy systems, treatment of confidential code, business-process understanding, modernization strategy, and ability to validate rebuilt software.

A provider should be able to answer questions such as:

  • How will generated requirements be checked against actual code?
  • How will undocumented operational rules be discovered?
  • What happens when the AI cannot establish a requirement?
  • How will the current application be compared with its replacement?
  • How will intellectual property and sensitive source code be protected?
  • How will AI charges and human-review costs be reported?
  • Which modernization activities can be automated, and which require engineering decisions?

These questions are relevant regardless of whether the provider uses Reverse Spec Flow or another approach.

Application modernization at Renesis Tech Japan

Renesis Tech Japan supports companies evaluating existing applications, architecture improvements, system integrations, and phased modernization.

Our application modernization services are relevant to organizations seeking to reduce technical debt and make legacy applications easier to maintain and evolve.

AI-assisted specification generation may become one component of a modernization assessment, depending on the application and available evidence.

However, this article does not imply that Renesis Tech Japan has independently reproduced AWS’s published evaluation results or deployed Reverse Spec Flow in a customer environment.

Any proposed approach should first be validated against the organization’s actual technical and operational requirements.

Frequently Asked Questions About Reverse Spec Flow

Is Reverse Spec Flow an AWS managed service?

No. Reverse Spec Flow is published as an open-source sample workflow in the AWS Samples GitHub organization. It is not presented as a standalone managed SaaS product.

Can Reverse Spec Flow rebuild a legacy application automatically?

Not by itself. It generates specifications that may support subsequent AI-assisted development. Reconstruction, integration, migration, and verification remain separate activities.

Does Reverse Spec Flow guarantee accurate specifications?

No. It uses evidence references, independent AI verification, and completion checks to reduce errors, but AWS’s own Apache Roller audit identified partially inaccurate statements.

Does 100% code-graph coverage mean every business rule was recovered?

No. Coverage of identified code structures is different from comprehensive knowledge of runtime behavior, manual processes, and undocumented business requirements.

Can Reverse Spec Flow help with COBOL modernization?

Potentially. The repository includes a COBOL playbook covering CICS, JCL batch processing, and related technologies. Its suitability must still be validated against the specific application.

What is the difference between Reverse Spec Flow and AI Modernization Flow?

AWS describes AI Modernization Flow as supporting Refactor, or modernization of the existing technology stack while preserving business logic. Reverse Spec Flow supports the specification-recovery stage of Reimagine, where the application may be rebuilt using a different architecture.

Is Reverse Spec Flow free?

The workflow code is open source, but AI model usage and engineering work can incur costs.

What should a company do before adopting Reverse Spec Flow?

Start with a limited codebase, define measurable acceptance criteria, protect confidential source code, review generated specifications, and compare findings against actual business operations.

Conclusion: AI-Generated Specifications Are Only as Valuable as Their Verification

Reverse Spec Flow introduces a structured approach to a difficult enterprise problem: understanding and documenting software whose original specifications may no longer be reliable.

Its traceable code references, independent AI verifier, explicit uncertainty markers, and coverage checks offer useful mechanisms for improving AI-generated documentation.

AWS’s Apache Roller demonstration shows that these specifications can also support subsequent AI-assisted reconstruction.

But the same evaluation highlights an important constraint.

Even after automated checks passed, some generated statements still contained inaccuracies.

For business-critical systems, incomplete conditions and missing exceptions may be as consequential as outright incorrect requirements.

Organizations should therefore view AI-assisted specification recovery as part of a broader modernization process, not as a substitute for engineering judgment and business validation.

Before rebuilding a legacy application with AI, establish which behaviors must be preserved and how their accuracy will be verified.

That is where a modernization initiative moves from an interesting AI demonstration to a defensible enterprise decision.

Renesis Tech Japan helps organizations evaluate application modernization opportunities, improve system integrations, and plan the evolution of existing digital infrastructure.

Companies exploring broader AI adoption and business-process improvements can also use our AI Business Assessment to identify potential areas for investigation.

The AI Business Assessment is not a replacement for technical source-code auditing or a dedicated legacy-modernization assessment.


Sources and further reading

AWS Japan, November 21, 2026: Introducing Reverse Spec Flow. Primary source for the workflow, Apache Roller results, limitations, and reported costs.

AWS Samples: Reverse Spec Flow GitHub repository. Technical source for the workflow implementation, supported environments, playbooks, and precautions.

AWS Japan: Introducing AI Modernization Flow. Background on the broader AI-driven modernization approach.


Renesis

Top Case Studies

View All

Services

Social