refactor

refactor is a skill for Claude Code from geniro-io/geniro-claude-harness. It costs 63 tokens per session (6,185 once invoked), scanned C, a copy of geniro-refactor, Apache-2.0.

A guided skill for restructuring existing code without changing what it does. It uses a plan, an applied refactor, and test-based verification, and treats the resulting code change as the deliverable.

In plain words
What is it for?
Use it to split large modules, improve structure, remove duplication, or make code easier to maintain when no feature or behavior change is intended.
Why use it?
It provides a controlled way to improve organization and reduce technical debt while checking that behavior stays the same.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; mentions subagents; names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the geniro plugin — 37 skills, 8 agents, 1 hook shipped together

Good fit Use it to split large modules, improve structure, remove duplication, or make code easier to maintain when no feature or behavior change is intended.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add geniro-io/geniro-claude-harness
Claude Code
/plugin install geniro

Made for: Claude Code.

Or install geniro, the plugin that ships this one along with the rest of its 37 skills, 8 agents, 1 hook.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/geniro-io/geniro-claude-harness/refactor"><img src="https://agentmods.dev/badge/skills/geniro-io/geniro-claude-harness/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,185 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin 91% copy Near-identical to another mod 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.00063 $0.06185
Opus 5 $0.00032 $0.03093
Sonnet 5 $0.00013 $0.01237
Haiku 4.5 $0.00006 $0.00619

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

Security

Grade C, and why

refactor scanned grade C with 1 finding 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 4d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

`done`, `verify-summary-only`, `reverted`, `aborted`, `routed`. Every transition into any of the five first writes the terminal `phase:` via `atomic_state_set_field`, and only then runs `${CLAUDE_PLUGIN_ROOT}/skills/refa
Origin

This is a copy

91% identical to geniro-refactor — 21 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/refactor/SKILL.md · 251 lines

How it starts

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

Refactor with test verification

Contents

  • Your role — restructure, don't ship
  • Phases overview
  • State machine
  • Terminal states
  • Loop invariants
  • Anti-rationalization
  • Budgets — quality-first
  • Subagent model tiering · Agent failure handling
  • Evidence Standard
  • Universal rule: all choice questions use AskUserQuestion
  • ACI per-phase tool surface
  • Git constraint
  • Memory I/O schedule
  • Definition of done
  • Phase 1 (plan) · Phase 2 (apply) · Phase 3 (verify)
  • State file schema

Runtime portability. ${CLAUDE_PLUGIN_ROOT} is a path placeholder Claude Code substitutes into file references, never a shell export — it reads empty in a Bash call under every host, Claude Code included, so an empty probe is no evidence of another runtime (CLAUDECODE in the environment marks Claude Code). Resolve the root by working these in order: the ancestor directory of this file containing .claude-plugin/plugin.json; a copy of the referenced file sitting beside this one (the Cursor build ships each skill's own phase and reference files there); a plugin checkout inside the workspace. Substitute the resolved root for every ${CLAUDE_PLUGIN_ROOT} occurrence and export it as CLAUDE_PLUGIN_ROOT in every Bash call. Work the rungs with a command, not a judgment: the run's first Bash call lists the directory this file was read from and each candidate root, and its output is echoed verbatim before anything else. Read the rungs against that output — a path it does not show did not resolve, and a file it does not show cannot be read, however confidently a later step would report otherwise. A ladder that resolves is bookkeeping, not a finding: keep the echo to the probe output and the resolved root, and reserve a degraded-run notice for a rung that actually failed. Read ${CLAUDE_PLUGIN_ROOT}/skills/_shared/runtime-portability.md before deciding a step cannot run here: it substitutes mechanisms, not steps, and routes a host with no one to ask to ${CLAUDE_PLUGIN_ROOT}/skills/_shared/non-interactive-host.md. When no rung resolves, the files are missing but the contract is not — open your first message by naming what is unavailable, run every phase and gate this skill declares, never let the project's own rules stand in for its decision gates, and take no outward-facing action (ready-for-review PR, merge, force-push, protected-branch push, posted comment, tracker transition) without an explicit answer.

Read the full file on GitHub · 251 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago Changed 244c30c26ec2
  2. 9d ago First seen · 251 lines · 63 tokens per session scan C 27f9dc9de900

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository geniro-io/geniro-claude-harness (8 stars, last pushed yesterday), licensed Apache-2.0. It adds 63 tokens to every session and 6,185 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). It is 91% identical to geniro-refactor, differing in 21 lines, and is treated as a copy.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens