Get the FREE Ultimate OpenClaw Setup Guide →

mags-legacy

Scanned
npx machina-cli add skill doancan/mags/mags-legacy --openclaw
Files (1)
SKILL.md
2.4 KB

MAGS Legacy Init

Initialize MAGS for an existing (brownfield/legacy) project that already has code but lacks documentation.

Steps

1. Scan existing codebase

Use mags_detect_stack to detect the project's tech stack automatically. Use mags_discover_modules to find existing modules in the code.

Report findings:

Detected Stack:
  Languages:    <detected>
  Frameworks:   <detected>
  Databases:    <detected>
  API Style:    <detected>

Discovered Modules:
  - <module> (confidence: <score>%)
  - ...

2. Gather legacy context from user

Ask the user these questions (all at once):

  1. What is the migration goal? (modernize, rewrite, extend, maintain)
  2. What are the main pain points in the current codebase?
  3. Are there parts of the system that must be preserved as-is?
  4. What is the target architecture? (keep current, monolith, microservices, serverless)

3. Create legacy documentation

Using mags_create_doc, create these documents from the legacy templates:

  • current-architecture — Document the current architecture based on scan results
  • migration-plan — Create a migration plan based on user goals
  • tech-debt — Start a tech debt registry
  • target-architecture — Document the target architecture

Also create standard docs:

  • tech-stack — Based on detected stack
  • project-structure — Based on discovered modules

4. Show summary

MAGS Legacy Init Complete

  Stack:         <detected stack summary>
  Modules:       <N> modules discovered

  Documents Created:
    - current-architecture.md
    - migration-plan.md
    - tech-debt.md
    - target-architecture.md
    - tech-stack.md
    - project-structure.md

Run /mags-status to see your project dashboard.

Related commands:

CommandDescription
/mags-initInitialize MAGS for a new project
/mags-statusView project progress dashboard
/mags-setupGet Claude Code configuration recommendations

Source

git clone https://github.com/doancan/mags/blob/main/skills/mags-legacy/SKILL.mdView on GitHub

Overview

MAGS Legacy Init bootstraps documentation for brownfield projects that already have code but lack docs. It detects the stack and modules, collects legacy goals, and generates a standard set of documentation templates to accelerate knowledge capture.

How This Skill Works

The tool runs mags_detect_stack to infer the project's tech stack and mags_discover_modules to enumerate existing modules. It then prompts for legacy context and uses mags_create_doc to generate key documents (current-architecture, migration-plan, tech-debt, target-architecture) plus standard docs like tech-stack and project-structure.

When to Use It

  • You have a codebase with no docs and need visibility into stack and modules
  • You want a migration or modernization plan for a brownfield project
  • You need to register tech-debt and document the current architecture
  • You plan to document both current and target architectures for alignment
  • You are preparing documentation templates before a formal rewrite or microservice breakdown

Quick Start

  1. Step 1: Run mags_detect_stack to detect the stack and mags_discover_modules to enumerate modules
  2. Step 2: Answer the legacy context questions (migration goal, pain points, preserved parts, target architecture)
  3. Step 3: Run mags_create_doc to generate current-architecture, migration-plan, tech-debt, target-architecture, plus tech-stack and project-structure docs

Best Practices

  • Scan the codebase first to accurately detect stack and modules using mags_detect_stack and mags_discover_modules
  • Capture all legacy questions at once to avoid back-and-forth, per the workflow
  • Use mags_create_doc to produce current-architecture, migration-plan, tech-debt, and target-architecture documents from templates
  • Create tech-stack and project-structure docs based on actual findings for a holistic view
  • Review generated docs with stakeholders and keep them up to date as the project evolves

Example Use Cases

  • Brownfield e-commerce app with a monolith needing documentation before a rewrite
  • Legacy internal toolset with unclear module boundaries and outdated tech stack
  • CMS migrating to a microservices or serverless architecture with documented targets
  • On-premise backend with a rich tech stack requiring a current-architecture baseline
  • Data-heavy legacy app where tech-debt landmarks help prioritize modernization

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers