Systematic Code Refactoring
luongnv89/claude-howto
Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.
Restructure existing code while preserving observable behavior.
$ npx skills add first-fluke/oh-my-agent --skill oma-refactor -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install first-fluke/oh-my-agent oma-refactor --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/first-fluke/oh-my-agent.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/oma-refactor .claude/skills/oma-refactor && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "oma-refactor" agent skill from https://github.com/first-fluke/oh-my-agent/tree/main/skills/oma-refactor into .claude/skills/oma-refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oma-refactor", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/first-fluke/oh-my-agent/tree/main/skills/oma-refactorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add first-fluke/oh-my-agent --skill oma-refactor -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install first-fluke/oh-my-agent oma-refactor --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/first-fluke/oh-my-agent.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/oma-refactor .agents/skills/oma-refactor && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "oma-refactor" agent skill from https://github.com/first-fluke/oh-my-agent/tree/main/skills/oma-refactor into .agents/skills/oma-refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oma-refactor", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add first-fluke/oh-my-agent --skill oma-refactor -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install first-fluke/oh-my-agent oma-refactor --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/first-fluke/oh-my-agent.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/oma-refactor .cursor/skills/oma-refactor && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "oma-refactor" agent skill from https://github.com/first-fluke/oh-my-agent/tree/main/skills/oma-refactor into .cursor/skills/oma-refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oma-refactor", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/first-fluke/oh-my-agent.git --path skills/oma-refactor--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add first-fluke/oh-my-agent --skill oma-refactor -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install first-fluke/oh-my-agent oma-refactor --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/first-fluke/oh-my-agent.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/oma-refactor .gemini/skills/oma-refactor && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "oma-refactor" agent skill from https://github.com/first-fluke/oh-my-agent/tree/main/skills/oma-refactor into .gemini/skills/oma-refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oma-refactor", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install first-fluke/oh-my-agent oma-refactorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add first-fluke/oh-my-agent --skill oma-refactor -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/first-fluke/oh-my-agent.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/oma-refactor .github/skills/oma-refactor && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "oma-refactor" agent skill from https://github.com/first-fluke/oh-my-agent/tree/main/skills/oma-refactor into .github/skills/oma-refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oma-refactor", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add first-fluke/oh-my-agent --skill oma-refactor -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install first-fluke/oh-my-agent oma-refactor --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/first-fluke/oh-my-agent.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/oma-refactor .opencode/skills/oma-refactor && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "oma-refactor" agent skill from https://github.com/first-fluke/oh-my-agent/tree/main/skills/oma-refactor into .opencode/skills/oma-refactor/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "oma-refactor", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
oma-refactorRestructure existing code while preserving observable behavior.
Oma Refactor is an agent skill from first-fluke/oh-my-agent. Restructure existing code while preserving observable behavior. Use for targeted technical debt or hotspot work with characterization tests.
Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files (for example `resources/definition.md`, `resources/governance.md` and `resources/hotspots.py`).
It sits in Development, covering Refactoring and Technical debt. The repository describes itself as: Mechanical verification for AI coding agents — skills pack or full harness (stop-hook gates, artifact checks, independent judges). The licence is MIT.
3 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit f65bbc0. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships script files (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Oma Refactor loads about 3.2k tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 1,499 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from first-fluke/oh-my-agent at commit f65bbc0, republished under its MIT licence (© first-fluke). 1,499 words, ~3,219 tokens.
.claude/skills/oma-refactor/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.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.
oma-debug (refactoring must not change behavior)oma-qaoma-architecture (a convention/pattern change is an architecture decision, not a local refactoring)oma-db (this skill only plans the expand-contract sequence)oma-scmtarget: file/module/path, smell report, SATD marker, or the feature request motivating preparatory refactoringverification: existing project test command(s); coverage/mutation tooling if already availableconstraints: coding guide / conventions, regulated-environment flags, merge-window concernsoutputs:
- name: report
description: refactoring plan or before/after report
artifact: ".agents/results/refactor/*.md"
required: falseStandalone runs write plan / before-after reports under .agents/results/refactor/; orchestrated runs (via the refactor-engineer agent) write .agents/results/result-refactor[-{sessionId}].md per the agent execution protocol.
resources/definition.md (invariant definition: 5 properties, boundaries, destination principle, naming roles, inline evidence)resources/measurement.md (4-layer measurement + git forensics commands)resources/governance.md (optional organization conventions and existing verification tools)oma-architecture when the change requires a convention/boundary decisionoma-architecture for an ADR + ratchet plan.oma-debug; do not fix it in the refactor commit..git-blame-ignore-revs.| Failure | Recovery |
|---|---|
| Tests fail after a transformation | Mikado: record prerequisite, undo only this transformation's edits, preserve unrelated work, attack prerequisite first |
| No tests and code is untestable | Find a seam; apply only minimal mechanical changes to inject test access, then characterize |
| Tests are flaky | Fix or quarantine flaky tests before refactoring - an unreliable net is no net |
| Metric improves but readability worsens | Reject the transformation; readability is the success criterion, metrics are proxies |
| Scope keeps growing | Stop; report the boundary issue and split into a Mikado graph or route to architecture |
| Refactoring engine/codemod produces wrong output | Engines are not infallible - tests re-run is mandatory; fall back to manual atomic edits |
| Action | SSL primitive | Evidence |
|---|---|---|
| Diagnose safety net | VALIDATE | Coverage/flakiness/mutation state of target scope |
| Collect signals | READ | Metrics, git churn/ownership, smells, SATD |
| Rank targets | COMPARE | Hotspot = complexity x churn |
| Plan atomic sequence | INFER | Named transformations, Mikado graph |
| Write characterization tests | WRITE | Golden-master/snapshot tests (separate commit) |
| Apply transformation | WRITE / CALL_TOOL | One atomic refactor, engine-first |
| Verify preservation | VALIDATE | Existing tests re-run unchanged |
| Commit separately | UPDATE_STATE | refactor:-typed commits only |
| Report delta | NOTIFY | Metric + readability before/after |
resources/governance.md)resources/measurement.md)refactor: only.
On repeated failure: record prerequisite, undo only this transformation's edits,
preserve pre-existing and concurrent work, recurse (Mikado).| Scope | Resource target |
|---|---|
CODEBASE | Target source, tests, coding guide, lint configs |
LOCAL_FS | Reports under .agents/results/refactor/, .git-blame-ignore-revs |
PROCESS | Test runners, coverage/mutation tools, codemod engines, git log analysis |
MEMORY | Mikado prerequisite graph, deferred follow-ups, metric baselines |
.agents/results/refactor/ and entries to .git-blame-ignore-revs.Local code tools: ../_shared/core/code-intelligence.md (code search/navigation)
Invariant definition (5 properties, boundaries, destination, naming roles, contexts, D&C, inline evidence): resources/definition.md
Measurement: 4 layers + git forensics commands: resources/measurement.md
Optional organization conventions and existing verification tools: resources/governance.md
Context loading: ../_shared/core/context-loading.md
Quality principles: ../_shared/core/quality-principles.md
Adjacent skills: oma-debug (bugs), oma-qa (audits), oma-architecture (boundaries/ADR), oma-db (schema), oma-scm (commits)
© first-fluke, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 4 other files in skills/oma-refactor of first-fluke/oh-my-agent.
Open the folder on GitHubat commit f65bbc0
We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders. This page covers the copy in first-fluke/oh-my-agent, which our catalogue first saw on October 7, 2026.
Oma Refactor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Oma Refactor this skillfirst-fluke/oh-my-agent | 1.3k | — | ~3.2k | Automated safety check: Pass | MIT | |
| Systematic Code Refactoringluongnv89/claude-howto | 42k | — | ~3k | Automated safety check: Pass | MIT | |
| Code Simplification for ego-litecitrolabs/ego-lite | 17k | — | ~1.2k | Automated safety check: Pass | MIT | |
| Code Refactoring Workflowluongnv89/claude-howto | 42k | — | ~3.1k | Automated safety check: Pass | MIT | |
| Tech Debt Analyzerailabs-393/ai-labs-claude-skills | 454 | 2 repos | ~3.9k | Automated safety check: Pass | MIT | |
| FIXME Resolvertailcallhq/forgecode | 7.6k | — | ~1.1k | Automated safety check: Pass | Apache-2.0 |
luongnv89/claude-howto
Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.
citrolabs/ego-lite
Finds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes.
luongnv89/claude-howto
Guides systematic, test-backed refactoring in the style of Martin Fowler, moving through research, planning and small incremental changes with your approval at each phase.
ailabs-393/ai-labs-claude-skills
This skill should be used when analyzing technical debt in a codebase, documenting code quality issues, creating technical debt registers, or assessing code maintainability.
tailcallhq/forgecode
Finds every FIXME comment in a codebase, groups related ones across files into one task, implements the work they describe and removes the comments once it is done.
Git-on-my-level/codex-autorunner
Codebase health scanner and technical debt tracker. An agent skill from Git-on-my-level/codex-autorunner.
first-fluke/oh-my-agent
Decomposes a complex feature into tasks, dispatches parallel specialist agents with durable state, and supervises verification, QA review and retries.
first-fluke/oh-my-agent
Create short, explainer, or recorded-demo videos through the OMA video CLI.
first-fluke/oh-my-agent
Splits a complex feature into prioritized tasks, spawns specialist CLI subagents in parallel, tracks them through shared memory and verifies each result.
first-fluke/oh-my-agent
Evaluates system boundaries and tradeoffs and writes architecture recommendations, option comparisons or ADRs, with a Mermaid diagram when structure changes.
first-fluke/oh-my-agent
Backend specialist for APIs, database work, authentication and migrations that follows clean architecture with router, service and repository layers.
first-fluke/oh-my-agent
Installs or checks the oma CLI and its runtimes (bun, uv, serena) in a fresh workspace so that oma-* skills can run their commands.
Categories
Restructure existing code while preserving observable behavior. Oma Refactor is an agent skill from first-fluke/oh-my-agent. Restructure existing code while preserving observable behavior.
Oma Refactor fits situations like: targeted technical debt; hotspot work with characterization tests.
Run `npx skills add first-fluke/oh-my-agent --skill oma-refactor -a claude-code`. Or copy the skill folder (skills/oma-refactor in first-fluke/oh-my-agent) into .claude/skills/oma-refactor in your project. Claude Code loads it when a task matches its description.
Run `npx skills add first-fluke/oh-my-agent --skill oma-refactor -a codex`. Or copy the skill folder (skills/oma-refactor in first-fluke/oh-my-agent) into .agents/skills/oma-refactor in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add first-fluke/oh-my-agent --skill oma-refactor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/oma-refactor, .gemini/skills/oma-refactor, .github/skills/oma-refactor and .opencode/skills/oma-refactor in your project.
Going by SKILL.md and its folder, Oma Refactor needs Python for the scripts in its folder. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Oma Refactor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Oma Refactor: Systematic Code Refactoring (luongnv89/claude-howto, 42k stars), Code Simplification for ego-lite (citrolabs/ego-lite, 17k stars), Code Refactoring Workflow (luongnv89/claude-howto, 42k stars) and Tech Debt Analyzer (ailabs-393/ai-labs-claude-skills, 454 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
first-fluke (a GitHub organization) maintains it in first-fluke/oh-my-agent, which has 1,338 GitHub stars. The repository holds 57 skills in this directory. The repository was last updated on October 8, 2026.
Source: first-fluke/oh-my-agent on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.