oma-refactor

oma-refactor is a skill for Claude Code, Codex from first-fluke/oh-my-agent. It costs 71 tokens per session (2,758 once invoked), scanned A, original, MIT.

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

In plain words
What is it for?
Use it to clean up technical debt, simplify long or duplicated code, modernize legacy code, or choose safe refactoring targets.
Why use it?
It reduces the risk of breaking existing behavior by using small changes, tests, type checks, and other verification steps.

Skill for Claude CodeCodex

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

Part of the oma plugin — 33 skills shipped together , and of oma

Good fit Use it to clean up technical debt, simplify long or duplicated code, modernize legacy code, or choose safe refactoring targets.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/first-fluke/oh-my-agent/oma-refactor
About the project

oh-my-agent is a harness for checking whether coding agents actually completed their work by verifying tests, required artifacts, independent reviews, and recorded decisions. It is used across multiple agent runtimes to make workflow results auditable instead of relying on an agent's own report. The catalogue add-ons provide parts of its skills, agents, hooks, MCP integrations, instructions, and plugins.

first-fluke/oh-my-agent · 1,275 stars · on GitHub · firstfluke.com

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 first-fluke/oh-my-agent --skill oma-refactor
Clone the repo
git clone --depth 1 https://github.com/first-fluke/oh-my-agent

Made for: Claude Code, Codex.

Or install oma, the plugin that ships this one along with the rest of its 33 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/first-fluke/oh-my-agent/oma-refactor.svg)](https://agentmods.dev/skills/first-fluke/oh-my-agent/oma-refactor)
Your own site
<a href="https://agentmods.dev/skills/first-fluke/oh-my-agent/oma-refactor"><img src="https://agentmods.dev/badge/skills/first-fluke/oh-my-agent/oma-refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,758 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 102
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium MCP Rug Pull · line 122
    uvx/uv tool run commands without ==version create a rug-pull risk.
    Fix: Pin the version: uvx package-name==1.2.3
  • medium MCP Rug Pull · line 122
    uvx/uv tool run commands without ==version create a rug-pull risk.
    Fix: Pin the version: uvx package-name==1.2.3
How audits are shown
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.00071 $0.02758
Opus 5 $0.00036 $0.01379
Sonnet 5 $0.00014 $0.00552
Haiku 4.5 $0.00007 $0.00276

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

Security

Grade A, and why

oma-refactor 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 8d 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.agents/skills/oma-refactor/SKILL.md · 170 lines

How it starts

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

Refactor Agent - Behavior-Preserving Restructuring Specialist

Scheduling

Goal

Improve internal code structure - readability first - without changing observable behavior, through small verified transformations, each gated by a safety net (tests / tooling / types) and committed separately from any behavior change.

Intent signature

  • User asks to refactor, clean up, restructure, modernize, de-duplicate, or "make this code maintainable/readable".
  • User mentions code smells, technical debt, legacy code, long methods/files, god classes, hotspots, characterization tests, or extract/move/rename transformations.
  • User asks "where should we refactor first?" or wants a refactoring plan/priority for a codebase.

When to use

  • Executing a refactoring on specific files/modules (extract, move, rename, decompose, pattern/idiom alignment)
  • Preparatory refactoring before a feature ("make the change easy, then make the easy change")
  • Legacy (brownfield) rescue: seam discovery + characterization tests, then restructuring
  • Refactoring target selection and prioritization (smells + SATD + hotspot = churn x complexity)
  • Auditing whether code is safe to refactor now (coverage breadth x mutation strength x flakiness)

When NOT to use

  • Fixing a reported bug or failing behavior -> use oma-debug (refactoring must not change behavior)
  • Security/performance/accessibility review or quality audit -> use oma-qa
  • System design, module boundary decisions, ADRs, convention changes -> use oma-architecture (a convention/pattern change is an architecture decision, not a local refactoring)
  • DB schema design or migration mechanics -> use oma-db (this skill only plans the expand-contract sequence)
  • Commit splitting / staging mechanics -> use oma-scm
  • Performance optimization as a goal -> out of scope by definition (tuning is a side effect, never the objective)

Expected inputs

  • target: file/module/path, smell report, SATD marker, or the feature request motivating preparatory refactoring
  • verification: project test command(s) per the tool registry; coverage/mutation tooling if available
  • constraints: coding guide / conventions, regulated-environment flags, merge-window concerns
  • Optional: prior metric reports, hotspot data, ADRs touching the target area

Read the full file on GitHub · 170 lines

Files

What ships with it

3 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. 8d ago First seen · 170 lines · 71 tokens per session scan A cb6b7cee28ca

Subscribe to this mod's changes

oma-refactor is a skill published in the GitHub repository first-fluke/oh-my-agent (1,275 stars, last pushed today), licensed MIT. It adds 71 tokens to every session and 2,758 once invoked, about $0.0004 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

improve-codebase-architecture

Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.

ne11nn/cantos-plugin · 68 tokens

rework-rate

Measure and interpret PR rework rate — the emerging 5th DORA metric.

bradygaster/squad · 20 tokens

issue

Use when starting a chain from a GitHub issue — turning an issue URL or number into a triaged, planned, dispatched, and reviewed pull request. Classifies the thread (bug → root-cause discipline, feature → plan chain, question → drafted reply), synthesizes a spec from the issue's own acceptance criteria, then runs the…

jeremylongshore/tons-of-skills-marketplace · 115 tokens

link-check

Verify @file references in AIWG skills and agents against the linking contract — per-file or corpus-wide, with optional auto-fix.

jmagly/aiwg · 29 tokens

pr-comment

Post friendly review comments to a GitHub PR — prepare locally, preview, then submit as atomic review. Use when: posting code review comments, giving PR feedback, sending inline suggestions. Not for: reading existing reviews (use load-pr-review), creating PRs (use create-pr), PR status (use pr-summary).

sd0xdev/sd0x-harness · 67 tokens

risk-assess

Uncommitted code risk assessment with breaking change detection, blast radius analysis, and scope metrics. Use when: evaluating PR risk, pre-commit risk check, large refactoring review. Not for: security vulnerabilities (use /codex-security), code correctness (use /codex-review-fast). Output: 3-dimension weighted…

sd0xdev/sd0x-harness · 77 tokens