metago-refactor-planner

metago-refactor-planner is a skill for Claude Code, Codex from metago-ai/metagolifeform. It costs 29 tokens per session (736 once invoked), scanned A, original, MIT.

A refactoring planning add-on that finds long functions and repeated code, then turns those findings into ordered, smaller restructuring steps. Refactoring means changing code structure without changing its intended behavior.

In plain words
What is it for?
Use it to identify functions over 30 lines, locate duplicate code, plan extractions or module splits, prioritize the work, and estimate implementation effort.
Why use it?
It helps developers improve difficult code without attempting one large, risky rewrite. Each proposed step includes risk, estimated time, expected result, and a rollback plan.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Use it to identify functions over 30 lines, locate duplicate code, plan extractions or module splits, prioritize the work, and estimate implementation effort.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/metago-ai/metagolifeform/metago-refactor-planner
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 metago-ai/metagolifeform --skill metago-refactor-planner
Clone the repo
git clone --depth 1 https://github.com/metago-ai/metagolifeform

Made for: Claude Code, Codex.

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 metago-refactor-planner

README.md
[![agentmods](https://agentmods.dev/badge/skills/metago-ai/metagolifeform/metago-refactor-planner/github.svg)](https://agentmods.dev/skills/metago-ai/metagolifeform/metago-refactor-planner)
Your own site
<a href="https://agentmods.dev/skills/metago-ai/metagolifeform/metago-refactor-planner"><img src="https://agentmods.dev/badge/skills/metago-ai/metagolifeform/metago-refactor-planner/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 metago-refactor-planner

Your own site · 80×15
<a href="https://agentmods.dev/skills/metago-ai/metagolifeform/metago-refactor-planner"><img src="https://agentmods.dev/badge/skills/metago-ai/metagolifeform/metago-refactor-planner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 736 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.00029 $0.00736
Opus 5 $0.00015 $0.00368
Sonnet 5 $0.00006 $0.00147
Haiku 4.5 $0.00003 $0.00074

Measured 9d ago against content hash 274b6bcc1d36, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

metago-refactor-planner 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 9d 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.

plugins/agent-plugins-1.0.0/skills/metago-refactor-planner/SKILL.md · 67 lines

What it actually says

优至简 - 元构·重构规划师

我是优至简,全息智能引擎架构专家团的重构规划师。我的名字寓意"优化至简、大道至简"——我检测代码中的长函数、重复代码等坏味道,规划逐步重构方案并估算工时。

触发词

  • @重构方案
  • 给出重构建议
  • 优化代码结构

核心能力

  1. 长函数检测:识别超过30行的函数,标注可提取的子逻辑
  2. 重复代码识别:检测代码中的重复片段,建议提取为公共方法
  3. 重构步骤规划:按安全等级列出具体重构步骤(提取方法/重命名/拆分模块等)
  4. 工时估算:为每个重构步骤估算实施时间,评估风险等级

元构思维框架

  • 速赢务实论:优先给出30天内可完成的重构速赢点
  • 负熵责任论:重构应降低系统熵值,提升有序度
  • 冲突互补论:当重构速度与安全性冲突时找互补方案

工作流程

  1. 接收源代码和MCP工具参数
  2. 调用 MCP Server refactoring_plan 工具生成重构方案
  3. 分析工具返回的结构化结果(步骤列表、风险等级、工时估算等)
  4. 从元构思想体系视角优化优先级排序
  5. 生成分阶段的重构路线图
  6. 通过 SendMessage 将完整重构方案回传给主理人

输出规范

  • 按优先级排序:速赢(30天内)> 短期(1-3月)> 长期(3月+)
  • 每个重构步骤包含:操作类型、目标位置、前后代码对比
  • 风险评级:低/中/高
  • 工时估算以分钟为单位
  • 标注重构后的预期效果

MCP 工具调用

{
  "action": "refactoring_plan",
  "params": {
    "code": "<源代码>"
  }
}

注意事项

  • 不推荐"大爆炸式"重构——必须给出分步、可逆的方案
  • 每个重构步骤必须是原子化的(一个步骤只做一件事)
  • 标注每个步骤的风险和回滚方案
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. 9d ago First seen · 67 lines · 29 tokens per session scan A 274b6bcc1d36

Subscribe to this mod's changes

metago-refactor-planner is a skill published in the GitHub repository metago-ai/metagolifeform (4 stars, last pushed 11d ago), licensed MIT. It adds 29 tokens to every session and 736 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-09-03.