agentleFS
ForeverScForeverSc/ai-handrail/skills/legacy-doc-bootstrap/SKILL.md

legacy-doc-bootstrap

Skill1 starsChanged 9 months agoMITView on GitHub

Use when a legacy project needs documentation created from scratch or existing implicit knowledge turned into structured docs. Triggers when user says "document this project", "create docs for this codebase", "write up the architecture", or after legacy-discovery has completed analysis.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After legacy-discovery has produced initial analysis

    line 16
  2. Distinctive:

    When starting to document an undocumented legacy project

    line 17
  3. Distinctive:

    When existing docs are stale, incomplete, or scattered

    line 18
  4. Distinctive:

    When onboarding info only exists in people's heads

    line 19
  5. Very specific:

    Create the top-level index files in docs/legacy-modernization/:

    line 31
  6. Distinctive:

    Many small files: No single doc over 300 lines.

    line 88
  7. Very specific:

    Stub-first is fine: Create the file structure with [TODO] placeholders.

    line 89
  8. Very specific:

    Facts only: Don't speculate. Mark uncertain info as [UNVERIFIED] or [NEEDS-HUMAN-REVIEW].

    line 91
  9. Distinctive:

    Include versions: When referencing libraries/frameworks, always include the actual version from lockfile.

    line 92
  10. Distinctive:

    Link, don't duplicate: If info exists in another doc, link to it.

    line 93

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

Legacy Doc Bootstrap

Turn implicit project knowledge into structured, AI-consumable documentation — many small focused files, never one giant doc.

Goal

Produce a documentation set that enables any AI session (including future ones with no conversation history) to safely understand and work within this project.

When to Use

  • After legacy-discovery has produced initial analysis
  • When starting to document an undocumented legacy project
  • When existing docs are stale, incomplete, or scattered
  • When onboarding info only exists in people's heads

Mandatory Workflow

Step 1: Assess Current Documentation State

  1. Find existing docs: READMEs, wiki links, inline comments, ADRs, Confluence pages
  2. Evaluate: what's accurate? what's stale? what's missing entirely?
  3. Map gaps against discovery outputs — what knowledge exists only in the discovery analysis?

Step 2: Create Map Layer (if not exists)

Create the top-level index files in docs/legacy-modernization/:

00-overview.md              — project purpose, tech stack, high-level architecture
01-domain-index.md          — list of business domains with brief descriptions
02-critical-path-index.md   — P0 user journeys with entry points and key files
03-dependency-audit.md      — framework/library versions, known constraints
04-glossary.md              — project-specific terms, abbreviations, acronyms

These are index/summary files. Keep each under 200 lines. They point to detail docs.

Step 3: Create Domain Detail Docs

For each domain analyzed by discovery, create:

docs/legacy-modernization/domains/<domain-name>/
  overview.md         — what this domain does, who owns it, current state
  module-map.md       — files/modules in this domain, their responsibilities
  data-flow.md        — how data moves through this domain
  risks.md            — known risks, tech debt, fragile areas
  test-baseline.md    — current test coverage, gaps, testing strategy
  decisions.md        — past architectural decisions, trade-offs made

Step 4: Create Shared Docs

docs/legacy-modernization/shared/
  compatibility-rules.md   — version constraints, API compatibility notes
  risk-registry.md         — consolidated risk list across all domains

Step 5: Validate with Human

Present the generated documentation structure to the user. Ask:

  1. Are the business descriptions accurate?
  2. Are any critical areas missing from the domain index?
  3. Are the risk assessments correct?
  4. What implicit knowledge should be added?

Required Outputs

OutputTemplateLocation
Project overviewtemplates/project-overview.mddocs/legacy-modernization/00-overview.md
Domain overview (per domain)templates/domain-overview.mddocs/legacy-modernization/domains/<name>/overview.md
Module map (per domain)templates/module-map.mddocs/legacy-modernization/domains/<name>/module-map.md
Data flow (per domain)templates/data-flow.mddocs/legacy-modernization/domains/<name>/data-flow.md
Risk registrytemplates/risk-registry.mddocs/legacy-modernization/shared/risk-registry.md
Dependency audittemplates/dependency-audit.mddocs/legacy-modernization/03-dependency-audit.md
Human decisions logtemplates/human-decisions.mddocs/legacy-modernization/domains/<name>/decisions.md

Hard Rules

  1. Many small files. No single doc over 300 lines. Split by topic.
  2. Stub-first is fine. Create the file structure with [TODO] placeholders. Fill progressively.
  3. Single responsibility. Each doc answers one question (what does this module do? how does data flow? what are the risks?).
  4. Facts only. Don't speculate. Mark uncertain info as [UNVERIFIED] or [NEEDS-HUMAN-REVIEW].
  5. Include versions. When referencing libraries/frameworks, always include the actual version from lockfile.
  6. Link, don't duplicate. If info exists in another doc, link to it.
  7. Keep maps navigable. Index files must have working links to detail docs.
  8. Document non-standard behavior explicitly. Hidden traps, counter-intuitive flows, and accidental side effects need a dedicated note, not a vague warning.
  9. Use flowcharts for complex logic. data-flow.md should include a flowchart whenever prose would hide branching or state transitions.
  10. Record dependency verification evidence. High-impact old dependencies need a note of whether source inspection was performed.

Anti-Patterns

Don'tDo instead
Write a 2000-line architecture docSplit into focused files per template
Document everything in round oneStart with P0 domains, expand progressively
Copy-paste discovery outputs as-isTransform analysis into structured templates
Document things you haven't verifiedMark as [UNVERIFIED] with source reference
Skip the glossaryDomain jargon trips up both AI and new humans
Write docs that only make sense with chat contextDocs must be self-contained and context-free

Progressive Documentation Strategy

Round 1: Map layer + one domain detail set (the most critical domain) Round 2: Second domain + refine round-1 docs based on new understanding Round 3+: Expand coverage domain by domain

Each round should also revisit and correct earlier docs as understanding improves.

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.