agentleFS
ForeverScForeverSc/ai-handrail/skills/legacy-kickstart/SKILL.md

legacy-kickstart

Skill1 starsChanged 9 months agoMITView on GitHub

Use when the user wants a guided, end-to-end AI modernization of a legacy project. Triggers when user says "AI化改造", "AI-friendly modernization", "modernize this project", "make this project AI-ready", "对这个项目进行AI改造", "help me modernize this codebase", or wants a one-click guided experience through discovery, documentation, and safety rails.

The file

Show its rules and text

We split this skill into the rules it gives an agent

20 rules. About 0 are common, 15 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run a shallow directory listing (top 2 levels)

    line 46
  2. Very specific:

    Create the docs/legacy-modernization/ directory if it doesn't exist

    line 82
  3. Distinctive:

    Write the plan as a real file, not just chat output

    line 83
  4. Distinctive:

    Ask the user to choose one domain (or accept the recommendation)

    line 92
  5. Distinctive:

    Important: Wait for user response. Do not proceed without explicit user selection.

    line 95
  6. Very specific:

    Read and follow the full workflow in skills/legacy-discovery/SKILL.md

    line 104
  7. Distinctive:

    Use discovery outputs as input

    line 113
  8. Distinctive:

    Use discovery + documentation outputs as input

    line 121
  9. Very specific:

    If any phase encounters a HUMAN-REVIEW decision point, stop and ask the user before continuing

    line 127
  10. Distinctive:

    If a phase fails or cannot complete, report the issue and ask the user how to proceed

    line 128
  11. Distinctive:

    Do not skip phases

    line 129
  12. Distinctive:

    After completing all three phases for the selected domain:

    line 133
  13. Distinctive:

    If yes: loop back to Step 4 with the new domain

    line 148
  14. Distinctive:

    If no: end the session with a summary of overall progress

    line 149
  15. Distinctive:

    Modernization plan is a living document: After completing a domain, update the plan to reflect progress (mark domain status, adjust …

    line 157
  16. Distinctive:

    No silent failures: If a phase encounters issues (e.g., no test framework found, ambiguous domain boundaries), report to user and ask how …

    line 158
  17. Distinctive:

    Lockfile is truth: Read actual dependency versions from lockfiles.

    line 162
  18. Distinctive:

    High-impact outdated dependencies require source inspection: Verify their APIs from the pinned version's project usage and source …

    line 170
  19. Very specific:

    Source edits are blocked until tests exist: If a module is TEST-MISSING or lacks module-to-test mapping, stop and establish tests before …

    line 171
  20. Very specific:

    Use the same label system as the rest of the suite.

    line 175

≈ “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 Kickstart — Guided Modernization Orchestrator

One-click entry point for making a legacy project AI-friendly. Orchestrates a lightweight project scan, produces a modernization plan, and then drives the user through discovery → doc-bootstrap → safety-rails for a chosen domain.

Goal

Take a user from "I have an old project" to "one domain is fully analyzed, documented, and guarded" in a single guided session.

When to Use

  • User wants a full guided modernization experience
  • User says "help me modernize this project" or "对这个项目进行AI改造"
  • User is unsure where to start with a legacy codebase
  • First-time users of AI Handrail who want end-to-end guidance

When NOT to Use

  • User already knows which domain to focus on (use legacy-discovery directly)
  • User only needs one specific phase (use the individual skill)
  • Greenfield projects
  • Small scripts or utilities with obvious structure

Mandatory Workflow

Step 1: Project-Level Overview (Lightweight Scan)

This is intentionally shallow — a triage pass, not a full discovery.

  1. Detect project type — scan project metadata files to identify the tech stack:
    • package.json, go.mod, pom.xml, build.gradle, pyproject.toml, Gemfile, Cargo.toml, *.csproj, etc.
    • Match against detection signals defined in skills/legacy-discovery/profiles/ to identify project type
    • Record: Project Type: [frontend | backend-node | backend-java | backend-python | backend-go | fullstack | unclassified]
  2. Read project metadata — gather basic facts:
    • Project name, language, framework, and versions (from lockfiles)
    • CI/CD configuration (.github/workflows/, Jenkinsfile, .gitlab-ci.yml, etc.)
    • Deployment configuration (Dockerfile, docker-compose.yml, Kubernetes manifests, etc.)
    • README and any existing documentation
  3. Map directory structure — identify top-level layout:
    • Run a shallow directory listing (top 2 levels)
    • Identify naming conventions (feature-based, layer-based, domain-based)
    • Count files per top-level directory
  4. Identify all business domains / top-level modules — for each candidate domain:
    • Name and brief description (inferred from directory name, code, and any docs)
    • File count
    • Has tests? (look for test/, __tests__/, *_test.*, *.spec.* nearby)
    • Has documentation? (look for README, docs, comments)
    • Git change frequency (run git log --oneline --since="6 months ago" -- <path> | wc -l for a rough hotspot signal)
  5. Quick risk grading per domain — assign HIGH / MEDIUM / LOW based on:

    FactorHIGH signalMEDIUM signalLOW signal
    File count>50 files10-50 files<10 files
    Test coverageNo tests foundSome testsComprehensive tests
    DocumentationNo docsPartial docsWell documented
    Git churn (6mo)>100 commits20-100 commits<20 commits
    Coupling signalsImported by many modulesSome importsSelf-contained

    Overall risk = highest factor wins. Tie-break: prefer higher risk.

Step 2: Produce Modernization Plan Document

Generate docs/legacy-modernization/modernization-plan.md using the template from templates/modernization-plan.md.

The document must contain:

  • Project type and tech stack summary
  • Business domain inventory with brief descriptions
  • Risk score per domain (HIGH / MEDIUM / LOW) with justification
  • Recommended modernization order (highest risk + highest value first)
  • Estimated effort per domain (Light / Medium / Heavy)
  • Current state assessment (docs, tests, CI status)

Output rules:

  • Create the docs/legacy-modernization/ directory if it doesn't exist
  • Write the plan as a real file, not just chat output
  • Tell the user where the file was saved

Step 3: Ask User Which Domain to Start

Present the domain list with risk levels and recommended order:

  1. Show a summary table of domains, risk levels, and recommended priority
  2. Highlight the recommended first domain and explain why
  3. Ask the user to choose one domain (or accept the recommendation)
  4. Confirm the chosen domain before proceeding

Important: Wait for user response. Do not proceed without explicit user selection.

Step 4: Execute Phase 0 → 1 → 2 on Selected Domain

Automatically run three phases in sequence on the user-selected domain. Each phase follows its own skill's complete workflow.

Phase 0 — Discovery

  1. Announce: "Starting Phase 0: Discovery for [domain]"
  2. Read and follow the full workflow in skills/legacy-discovery/SKILL.md
  3. Scope is pre-set to the selected domain — skip the "establish boundaries" negotiation
  4. Complete all discovery steps, produce all discovery outputs
  5. Brief progress report: what was found, key risks, unknowns

Phase 1 — Doc Bootstrap

  1. Announce: "Starting Phase 1: Documentation for [domain]"
  2. Read and follow the full workflow in skills/legacy-doc-bootstrap/SKILL.md
  3. Use discovery outputs as input
  4. Produce all documentation artifacts
  5. Brief progress report: what docs were created

Phase 2 — Safety Rails

  1. Announce: "Starting Phase 2: Safety Rails for [domain]"
  2. Read and follow the full workflow in skills/legacy-safety-rails/SKILL.md
  3. Use discovery + documentation outputs as input
  4. Produce test recommendations and guardrail artifacts
  5. Brief progress report: what guardrails were established

Cross-phase rules:

  • Each phase must fully complete before the next begins
  • If any phase encounters a HUMAN-REVIEW decision point, stop and ask the user before continuing
  • If a phase fails or cannot complete, report the issue and ask the user how to proceed
  • Do not skip phases

Step 5: Summary and Next Steps

After completing all three phases for the selected domain:

  1. Summarize what was accomplished:
    • Domain analyzed
    • Documents created (list file paths)
    • Guardrails established
    • Key findings and risks identified
  2. Recommend next domain:
    • Refer back to the modernization plan
    • Suggest the next-priority domain
    • Explain why it should be next
  3. Ask user:
    • "Would you like to continue with [next domain]?"
    • If yes: loop back to Step 4 with the new domain
    • If no: end the session with a summary of overall progress

Kickstart-Specific Rules

  1. Project-level overview is intentionally shallow. It is a triage/screening pass, not a full discovery. Deep analysis only happens on the user-selected domain in Step 4.
  2. Deep work follows each sub-skill's own workflow. The kickstart orchestrator does not replace or simplify the sub-skills — it coordinates them.
  3. HUMAN-REVIEW stops execution. Any HUMAN-REVIEW decision point encountered during Phase 0/1/2 must pause execution and ask the user.
  4. One domain at a time. Even though the overview scans all domains, deep work is always scoped to one domain per round.
  5. Modernization plan is a living document. After completing a domain, update the plan to reflect progress (mark domain status, adjust priorities if new information emerged).
  6. No silent failures. If a phase encounters issues (e.g., no test framework found, ambiguous domain boundaries), report to user and ask how to proceed.

Hard Rules (inherited from suite)

  1. Lockfile is truth. Read actual dependency versions from lockfiles.
  2. Project code is primary reference. Existing implementations beat external documentation.
  3. 80/20 rule. Focus on P0 critical paths first.
  4. No hidden assumptions. Mark unknowns as UNKNOWN.
  5. Human checkpoints are non-negotiable. Business rules, schema changes, and deletions require explicit approval.
  6. Guardrails before depth. Tests → observability → feature flags → rollback plan → then refactor.
  7. Complex logic needs a flowchart. Discovery and documentation outputs must include a flowchart for branch-heavy or stateful legacy behavior.
  8. Hidden traps must be documented. Non-standard patterns and counter-intuitive side effects cannot stay implicit.
  9. High-impact outdated dependencies require source inspection. Verify their APIs from the pinned version's project usage and source inspection before planning changes.
  10. Source edits are blocked until tests exist. If a module is TEST-MISSING or lacks module-to-test mapping, stop and establish tests before planning refactors.

Risk Labels

Use the same label system as the rest of the suite. See the root SKILL.md for the full list.

Output Files

FileCreated in
docs/legacy-modernization/modernization-plan.mdStep 2
All outputs from legacy-discoveryStep 4 Phase 0
All outputs from legacy-doc-bootstrapStep 4 Phase 1
All outputs from legacy-safety-railsStep 4 Phase 2

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.