plan-refactoring

A refactoring-planning skill that finds code worth restructuring and ranks it by likely value. Refactoring means improving internal code structure without changing its intended behavior.

In plain words
What is it for?
Use it to inspect code structure, hotspots, clones, technical debt, and the impact of changing a symbol, then choose and sequence refactoring targets.
Why use it?
It helps focus limited engineering time on complex, frequently changed, duplicated, or already acknowledged problem areas.

Skill for Claude CodeCodex

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/panbanda/omen/plan-refactoring
Any agent
npx skills add panbanda/omen --skill plan-refactoring
Clone the repo
git clone --depth 1 https://github.com/panbanda/omen

Made for: Claude Code, Codex.

Per session 11 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 317 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 $0.00011 $0.00317
Opus 5 $0.00005 $0.00159
Sonnet 5 $0.00002 $0.00063
Haiku 4.5 $0.00001 $0.00032

Measured 3d ago against content hash af85056b9e16, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

plan-refactoring 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 3d 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/development/skills/plan-refactoring/SKILL.md · 56 lines

What it actually says

Plan Refactoring Skill

Find refactoring targets in: {{.paths}}

Quick Start

# Get a quick structural overview before deciding what to refactor
omen -f json outline --compact --top 50

# Find hotspots (high churn + complexity)
omen -f json hotspot --top 10

# Find code clones
omen -f json clones

# Find acknowledged debt
omen -f json satd | jq '.items[] | select(.category == "design")'

# Assess blast radius before refactoring a specific symbol
omen -f json impact <symbol-name> --depth 2

Priority Matrix

Finding Effort ROI
Hotspot with clones Medium High
God component High High
Isolated clone Low Medium
Low-churn debt Low Low

Effort Guide

  • Extract function: 30min - 2hr
  • Split class: 2hr - 1 day
  • Break cycle: 1-3 days
  • Extract module: 1-2 weeks

Sequencing

  1. Quick wins: hotspot + low complexity
  2. Clone extraction
  3. God components (dedicated sprint)
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. 3d ago First seen · 56 lines · 11 tokens per session scan A af85056b9e16

Subscribe to this mod's changes

plan-refactoring is a skill published in the GitHub repository panbanda/omen (18 stars, last pushed 10d ago), licensed Apache-2.0. It adds 11 tokens to every session and 317 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-30.

Related

Other skills, from other repositories

find-docs

Retrieves up-to-date documentation, API references, and code examples for any developer technology. Use this skill whenever the user asks about a specific library, framework, SDK, CLI tool, or cloud service — even for well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot. Your training…

upstash/context7 · 172 tokens

context7-cli

Use the ctx7 CLI to fetch library documentation, manage AI coding skills, and configure Context7 MCP. Activate when the user mentions "ctx7" or "context7", needs current docs for any library, wants to install/search/generate skills, or needs to set up Context7 for their AI coding agent.

upstash/context7 · 67 tokens

context7-mcp

This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.

upstash/context7 · 58 tokens

context7-docs

Fetch up-to-date documentation and code examples for any library, framework, SDK, CLI tool, or cloud service. Use whenever the user asks about a specific library — even well-known ones like React, Next.js, Prisma, Express, Tailwind, Django, or Spring Boot — because training data may not reflect recent API changes or…

upstash/context7 · 157 tokens

tsa-edit-then-verify

The full edit-and-verify loop mandated by CLAUDE.md and docs/agent-tooling-gap-report.md:58. Pre-edit gate (edit action=safe + baseline health action=file) → LLM edits → post-edit verify (health action=file diff + edit action=impact + scoped verificationcommand). Replaces "edit then run the whole pytest suite" (5 min)…

aimasteracc/tree-sitter-analyzer · 267 tokens

tsa-pr-review

AST-grounded PR / diff review. One workflow → per-file risk ranking, blast radius per changed symbol, the exact pytest command to gate merge, any architecture-constraint violations, and a final BLOCK / REVIEW / APPROVE verdict — in 1–2k tokens and 4–6 MCP calls. Goes beyond a generic LLM diff-read because only TSA's…

aimasteracc/tree-sitter-analyzer · 354 tokens