mags-legacy

mags-legacy is a skill for Claude Code from doancan/mags. It costs 18 tokens per session (631 once invoked), scanned A, original, MIT.

A setup guide for MAGS in an existing codebase that has little or no documentation. It scans the code to identify the technology stack and modules, then creates starting documents for the current system and its migration work.

In plain words
What is it for?
Use it to inspect a legacy project, record its current architecture, plan a migration or modernization, and begin tracking technical debt.
Why use it?
It gives developers a documented starting point for older or undocumented software without requiring them to map everything manually first.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Part of the mags plugin — 17 skills, 2 agents shipped together

Good fit Use it to inspect a legacy project, record its current architecture, plan a migration or modernization, and begin tracking technical debt.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/doancan/mags/mags-legacy
View source ↗ doancan/mags
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add doancan/mags --skill mags-legacy
Clone the repo
git clone --depth 1 https://github.com/doancan/mags

Made for: Claude Code.

Or install mags, the plugin that ships this one along with the rest of its 17 skills, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mags-legacy

README.md
[![agentmods](https://agentmods.dev/badge/skills/doancan/mags/mags-legacy/github.svg)](https://agentmods.dev/skills/doancan/mags/mags-legacy)
Your own site
<a href="https://agentmods.dev/skills/doancan/mags/mags-legacy"><img src="https://agentmods.dev/badge/skills/doancan/mags/mags-legacy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mags-legacy

Your own site · 80×15
<a href="https://agentmods.dev/skills/doancan/mags/mags-legacy"><img src="https://agentmods.dev/badge/skills/doancan/mags/mags-legacy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 631 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00631
Opus 5 $0.00009 $0.00316
Sonnet 5 $0.00004 $0.00126
Haiku 4.5 $0.00002 $0.00063

Measured 10d ago against content hash 0cc3101b3460, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

mags-legacy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mags-legacy/SKILL.md · 90 lines

What it actually says

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:

Command Description
/mags-init Initialize MAGS for a new project
/mags-status View project progress dashboard
/mags-setup Get Claude Code configuration recommendations
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 90 lines · 18 tokens per session scan A 0cc3101b3460

Subscribe to this mod's changes

mags-legacy is a skill published in the GitHub repository doancan/mags (3 stars, last pushed 7mo ago), licensed MIT. It adds 18 tokens to every session and 631 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

prior-art-search

Systematic 7-step methodology for comprehensive patent prior art searches and patentability assessments using BigQuery and CPC classification.

RobThePCGuy/Claude-Patent-Creator · 26 tokens

sanity-best-practices

Sanity development best practices for schema design, GROQ queries, TypeGen, Visual Editing, images, Portable Text, Studio structure, localization, migrations, Sanity Functions, webhooks, Blueprints, and framework integrations such as Next.js, Nuxt, Astro, Remix, SvelteKit, Angular, Hydrogen, and the App SDK. Use this…

sanity-io/agent-toolkit · 164 tokens

portable-text-serialization

Render and serialize Portable Text to React, Svelte, Vue, Astro, HTML, Markdown, and plain text. Use when implementing Portable Text rendering in any frontend framework, building custom serializers for non-standard block types, converting Portable Text to HTML strings server-side, converting Portable Text to Markdown…

sanity-io/agent-toolkit · 85 tokens

development-assistant

Guides through adding new features, MCP tools, analyzers, and extending the patent creator system.

RobThePCGuy/Claude-Patent-Creator · 24 tokens

mpep-search

Expert system for searching USPTO MPEP, 35 USC statutes, 37 CFR regulations, and post-Jan 2024 updates.

RobThePCGuy/Claude-Patent-Creator · 32 tokens

video-perception

Use when the user mentions a video file (.mp4, .mov, .avi, .mkv, .webm), a YouTube URL, asks to watch/analyze/review a video, or references video content in conversation.

jordanrendric/claude-video-vision · 51 tokens