refactor-planner

refactor-planner is a skill for Claude Code, Codex from kivo360/OmoiOS. It costs 14 tokens per session (1,428 once invoked), scanned A, original, Apache-2.0.

A refactoring guide for changing code structure safely while preserving its behavior. Refactoring means improving internal code without intentionally changing what the program does.

In plain words
What is it for?
Use it to analyze dependencies, plan incremental changes, add missing tests, apply refactoring patterns, and verify that behavior and performance remain correct.
Why use it?
It reduces the risk of breaking dependent code by emphasizing dependency checks, tests, small changes, and rollback plans.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to analyze dependencies, plan incremental changes, add missing tests, apply…

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/kivo360/omoios/refactor-planner.svg)](https://agentmods.dev/skills/kivo360/omoios/refactor-planner)
Your own site
<a href="https://agentmods.dev/skills/kivo360/omoios/refactor-planner"><img src="https://agentmods.dev/badge/skills/kivo360/omoios/refactor-planner.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,428 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.00014 $0.01428
Opus 5 $0.00007 $0.00714
Sonnet 5 $0.00003 $0.00286
Haiku 4.5 $0.00001 $0.00143

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

Security

Grade A, and why

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 7d 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.

backend/omoi_os/sandbox_skills/refactor-planner/SKILL.md · 276 lines

How it starts

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

Refactor Planner

Plan safe, incremental refactoring with proper impact analysis.

Refactoring Workflow

1. Analyze → 2. Plan → 3. Test → 4. Execute → 5. Verify

1. Analyze Current State

  • Understand existing code structure
  • Map dependencies (what uses this code)
  • Identify coupling and cohesion issues
  • Document current behavior with tests

2. Plan the Refactoring

  • Define target state clearly
  • Break into small, reversible steps
  • Identify risk points
  • Plan rollback strategy

3. Test Coverage First

  • Ensure existing tests pass
  • Add tests for uncovered behavior
  • Create integration tests for dependencies
  • Never refactor without tests

4. Execute Incrementally

  • One logical change per commit
  • Run tests after each step
  • Keep the system working throughout
  • Commit frequently

5. Verify Results

  • All tests still pass
  • No new warnings/errors
  • Performance unchanged (or improved)
  • Dependencies still work

Refactoring Patterns

Extract Function

When: Code block is reused or too complex

# Before
def process_order(order):
    # Calculate total
    total = 0
    for item in order.items:
        price = item.price * item.quantity
        if item.discount:
            price *= (1 - item.discount)
        total += price
    # ... more code

# After
def calculate_item_price(item) -> float:
    """Calculate price for single item with discount."""
    price = item.price * item.quantity
    if item.discount:
        price *= (1 - item.discount)
    return price

def calculate_order_total(order) -> float:
    """Calculate total order price."""
    return sum(calculate_item_price(item) for item in order.items)

def process_order(order):
    total = calculate_order_total(order)
    # ... more code

Extract Class

When: A class has too many responsibilities

# Before: User class doing too much
class User:
    def authenticate(self, password): ...
    def send_email(self, subject, body): ...
    def generate_report(self): ...

# After: Split by responsibility
class User:
    def __init__(self):
        self.auth = UserAuthenticator(self)
        self.notifier = UserNotifier(self)
        self.reporter = UserReporter(self)

class UserAuthenticator:
    def authenticate(self, password): ...

class UserNotifier:
    def send_email(self, subject, body): ...

class UserReporter:
    def generate_report(self): ...

Read the full file on GitHub · 276 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. 7d ago First seen · 276 lines · 14 tokens per session scan A f41ded2725ef

Subscribe to this mod's changes

refactor-planner is a skill published in the GitHub repository kivo360/OmoiOS (76 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 14 tokens to every session and 1,428 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

self-awareness

Use when the user asks about Archie itself — what Archie is, how it works, what it can or cannot do, what agents or domains exist, how plugins work, how requests get handled, why something behaves a certain way, what integrations are available, or whether Archie can change itself. Triggers on phrases like "what can…

sweatco/archie-hq · 148 tokens

writing-plugins

Read this before authoring or substantially changing a plugin, agent, or skill for Archie. It's the conceptual playbook for building plugins that fit Archie's multi-agent, single-orchestrator model — what a plugin must respect, why every plugin usually needs an orchestrator-facing skill, and how to think about agents…

sweatco/archie-hq · 137 tokens

triggers

Set up, list, or manage triggers — persistent "do Y when X happens" rules. Use when someone asks Archie to do something on a schedule ("every weekday at 9am…", "every morning post…", "remind the channel weekly…"), to react to new messages in a channel ("whenever someone posts X in.

sweatco/archie-hq · 71 tokens

thread-conduct

Use before posting anywhere outside this task's own thread, or when deciding how much to post inside it. Covers keeping one task in one thread, what to do with a finding that belongs to another team, when a cross-channel post is allowed and how small it must be, how much traffic a thread should carry, and how to…

sweatco/archie-hq · 103 tokens

trigger-task

Use when this task was started by a trigger and you have been given a trigger directory — the one place that survives from one fire of that trigger to the next. Covers reading what an earlier fire left before you start work, what is worth leaving behind so a later fire continues instead of repeating, keeping the…

sweatco/archie-hq · 144 tokens

engineering

Engineering task workflow. Use when the task involves code investigation, code changes, bug fixes, feature implementation, or any software engineering work. Provides the engineering task lifecycle, edit mode workflow, and decision framework for coordinating engineering agents.

sweatco/archie-hq · 47 tokens