refactor-plan

refactor-plan is a skill for Claude Code, Codex from Smart-AI-Memory/attune-ai. It costs 41 tokens per session (604 once invoked), scanned A, original, Apache-2.0.

A code-refactoring analysis skill that examines a file or directory for duplication, complexity, and technical debt, then outlines improvements.

In plain words
What is it for?
Use it for full refactoring plans or for simplifying particularly complex code.
Why use it?
It helps turn a vague cleanup request into a scoped analysis or roadmap based on the selected target and concern.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

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.

agentmods
npx agentmods add skills/smart-ai-memory/attune-ai/refactor-plan
Any agent
npx skills add Smart-AI-Memory/attune-ai --skill refactor-plan
Clone the repo
git clone --depth 1 https://github.com/Smart-AI-Memory/attune-ai

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 refactor-plan

README.md
[![agentmods](https://agentmods.dev/badge/skills/smart-ai-memory/attune-ai/refactor-plan.svg)](https://agentmods.dev/skills/smart-ai-memory/attune-ai/refactor-plan)
Your own site
<a href="https://agentmods.dev/skills/smart-ai-memory/attune-ai/refactor-plan"><img src="https://agentmods.dev/badge/skills/smart-ai-memory/attune-ai/refactor-plan.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 604 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00041 $0.00604
Opus 5 $0.00020 $0.00302
Sonnet 5 $0.00008 $0.00121
Haiku 4.5 $0.00004 $0.00060

Measured 6d ago against content hash 793a28a0663e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

refactor-plan 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 6d 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.

.agents/skills/refactor-plan/SKILL.md · 91 lines

How it starts

The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactor Planning

IMPORTANT: Start your response with a context preamble.

Call help_lookup(topic="refactor-plan", mode="preamble") and display the returned preamble text as a blockquote. Then tell the user they can say "tell me more" for a step-by-step guide, or answer the scoping questions below to proceed.

If the MCP call fails, fall back to:

Refactor Plan — Analyzes code structure and produces a prioritized refactoring roadmap.

Scoping

Before running, ask:

  1. Target: "Which file or directory needs refactoring analysis?"
  2. Focus: "Full analysis or specific concern?"
    • Full: refactor_plan (all areas)
    • Simplify: simplify_code (reduce complexity only)
  3. Depth: "Quick scan or detailed roadmap?"

Execution

Based on scope:

  • Full analysis: refactor_plan(path="<target>")
  • Simplify only: simplify_code(path="<target>")

Or via CLI:

attune workflow run refactor-plan --path <target>

MCP Tools

Tool What It Does
refactor_plan Tech debt analysis and refactoring roadmap
simplify_code Reduce complexity in specific files

refactor_plan

Full refactoring analysis for a path.

refactor_plan(path="<target>")

simplify_code

Targeted complexity reduction for a single file or module. Flattens nested conditionals, inlines trivial helpers, removes dead code.

simplify_code(path="<target file>")

Analysis Areas

  • Code Smells: Long methods, god classes, feature envy
  • Duplication: Copy-paste detection, DRY violations
  • Complexity: High cyclomatic complexity, deep nesting
  • Coupling: Tight dependencies, circular imports
  • Naming: Unclear or inconsistent naming

Output

Prefer the rich panel. If the tool response includes panel_html, pass it to mcp__visualize__show_widget — the universal report panel (title, score, findings/category sections; from attune.workflows.report_panel). It shows an explicit "did not complete" state on failure, never a false "clean". Fall back to the markdown below when the widget surface is unavailable.

Read the full file on GitHub · 91 lines

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. 6d ago First seen · 91 lines · 41 tokens per session scan A 793a28a0663e

Subscribe to this mod's changes

refactor-plan is a skill published in the GitHub repository Smart-AI-Memory/attune-ai (10 stars, last pushed yesterday), licensed Apache-2.0. It adds 41 tokens to every session and 604 once invoked, about $0.0002 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

tmux

Manage long-running shell sessions with tmux — start a detached session, run a long task, reattach later, capture output. Use when a task takes longer than a single tool call (build, test, log tail).

Team-Commonly/commonly · 48 tokens

lynkr

Universal LLM gateway with intelligent routing, Graphify code intelligence, Distill compression, routing telemetry, Code Mode, and 12+ provider support. 60-80% cost reduction for Claude Code, Cursor, and Codex.

Fast-Editor/Lynkr · 50 tokens

web-research

Use this skill for requests related to web research; it provides a structured approach to conducting comprehensive web research.

shibing624/agentica · 24 tokens

story-setup

网文写作工具集基础设施部署。将 hooks/rules/agents/CLAUDE.md/AGENTS.md 等基础设施部署到用户项目目录,支持 Claude Code / OpenCode / Codex / OpenClaw。触发方式:/story-setup、$story-setup、「准备写书」「帮我搭一下环境」「配置写作项目」。.

Xiaoyangy/novel-studio · 81 tokens

novel-writing-assets

查看、启用、停用、组合、绑定、试写和重新编译 novel-studio 的长期写法资产。触发:「列出写法特征」「启用/停用某个写法」「组合写法」「绑定写法」「试写写法」「重编译写法规则」「维护写法资产」。.

Xiaoyangy/novel-studio · 77 tokens

officecli

Create, analyze, proofread, and modify Office documents (.docx, .xlsx, .pptx) using the officecli CLI tool. Use when the user wants to create, inspect, check formatting, find issues, add charts, or modify Office documents.

Team-Commonly/commonly · 56 tokens