---
name: legacy-codebase-documentation-generator
description: "Analyzes legacy mainframe source files, batch jobs, and developer notes to produce architecture maps, data flow summaries, and business rule documentation. Use when modernization teams need maintainable system documentation."
license: CC-BY-4.0
compatibility: "Needs access to: GitHub, Docs, Notes."
metadata:
  author: "BotBento Editorial"
  version: "2026-10-16"
  source: "https://botbento.com/usecases/legacy-codebase-documentation-generator/"
  kind: workflow
  hermes:
    tags: ["legacy-code", "cobol", "architecture", "documentation", "modernization"]
    category: coding
    requires_toolsets: ["file"]
---
# Legacy codebase documentation generator

Map complex legacy program flows and business logic into maintainable system documentation

## When to use

Analyze legacy mainframe source files, batch jobs, and developer walkthroughs to produce clear technical architecture maps, data flow summaries, and business rule documentation for modernization initiatives.

## Inputs

- `legacy_source_files`: Legacy mainframe source files and batch job scripts to analyze.
- `interview_notes` (optional): Operational interview notes or developer walkthroughs explaining critical edge cases.

## Steps

1. When something happens: Legacy repository scan triggered (A legacy repository scan is triggered.)
2. Map logic rules and dependencies
3. Publish architecture document

## Instructions

Inspect provided repository files containing legacy source code and batch job scripts. Trace procedural logic, data structures, and conditional business rules into structured technical summaries. Correlate code definitions with operational interview notes to explain critical edge cases. Draft system architecture overviews, dependency graphs, and cataloged routines. Always request user approval before committing generated files to the repository or publishing documents.

## Approvals

- Committing generated files to the repository must wait for user approval.
- Publishing generated documents must wait for user approval.

## Output

Architecture document with data flow summaries, dependency graphs, and cataloged routines. (format: document)

## Source

Summarized in our own words from [Launch HN: Hypercubic (YC F25) – AI for COBOL and Mainframes](https://news.ycombinator.com/item?id=45877517) (Hacker News, checked 2026-10-16). Any results described there are the authors’ own.

From the BotBento use-case directory: https://botbento.com/usecases/legacy-codebase-documentation-generator/. Licence: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
