refactor
Improve existing code through inspection, simplification, and testing.
Skill by drlove2002
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/drlove2002-refactor
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/refactor
What's inside
- Skill name
refactor- Description
- Improve existing code through inspection, simplification, and testing. Use when the user wants to clean up, simplify, reduce duplication, restructure architecture, find deep modules, or plan a safe refactor. Detects intent: "clean this up" triggers direct simplify-test loop; "plan a refactor" triggers interview + issue; "improve architecture" triggers structural deep-module analysis.
- License
- MIT
- Instructions
- 54 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Refactor Three modes depending on what the user asks for. Detect intent, don't ask the user to choose. ## Mode A: Simplify In-Place Trigger: "clean this up", "simplify", "reduce duplication", "make this readable". 1. **Inspect** the relevant code — scout subagent if >2 files. 2. **Propose** the highest-value cleanup in 1-2 sentences. Wait for approval. 3. **Simplify** — fewer concepts, fewer branches, smaller functions. Remove duplication only when the replacement is simpler than the original. No speculative abstractions. 4. **Test** — run the nearest tests. If behavior changed, use `tdd` (write failing test → make it pass). 5. **Repeat** — propose next cleanup. Stop when remaining changes are cosmetic or low leverage. 6. If a simplification needs broader changes than the task justifies, stop and say so. ## Mode B: Plan a Refactor Trigger: "plan a refactor", "break this refactor into commits", "how should I restructure". 1. **Interview** the user about what they want to change and what stays the same. 2. **Scout** the affected area — blast radius, callers, test coverage. 3. **Break into tiny commits** — each commit leaves the codebase working. TDD red-green-refactor per commit where applicable. 4. **Write a local issue** in `issues/` with frontmatter: ```yaml --- id: NNNN title: Refactor: ... kind: refactor status: needs-triage blocked_by: [] created: YYYY-MM-DD --- ``` 5. Sections: Problem, Solution, Commits (numbered step-by-step), Decision Document, Testing Decisions, Out of Scope. 6. Hand off: "Want me to start executing?" ## Mode C: Structural Deepening Trigger: "improve architecture", "find deep modules", "reduce coupling", "consolidate". 1. **Read existing docs** — CONTEXT.md and docs/adr/ for domain language and prior decisions. 2. **Explore** the codebase for friction: shallow modules (interface as complex as implementation), tight coupling, pass-throughs, untestable seams. Apply the deletion test: would deleting this module concentrate complexity or just move it? 3. **Present candidates** — numbered list. For each: files involved, problem, solution in plain English, benefits in terms of locality and leverage. Use domain terms from CONTEXT.md. 4. **Grill** the user on their chosen candidate — constraints, dependencies, what sits behind the seam, what tests survive. 5. **Record decisions** — if a new term emerges, add it to CONTEXT.md. If a decision should prevent future re-litigation, offer an ADR. 6. If the user wants to explore interface alternatives, switch to the `design` skill. ## Stop Conditions - Remaining cleanup is cosmetic or low leverage. - A simplification needs broader changes than the task justifies. - The user says "good enough."
From drlove2002/ai-config, MIT.
More from drlove2002/ai-config
- 0.479score
simplify-code
drlove2002
Review uncommitted changes, unpushed commits, or a provided git diff range with a reuse-first simplification lens.
SkillCFreshness: CClaude Code +9 - 0.479score
web-test
drlove2002
Browser automation via agent-browser CLI for testing pages, debugging, performance audits, visual review, accessibility checks, and interaction testing.
SkillCFreshness: CClaude Code +9 - 0.474score
docs
drlove2002
Look up documentation for any library, framework, or product concept.
SkillCFreshness: CClaude Code +9 - 0.474score
plan
drlove2002
Turn conversation context into a Product Requirements Document (PRD) and break it down into independently-grabbable tracking issues.
SkillCFreshness: CClaude Code +9 - 0.474score
add-model
drlove2002
Test availability, benchmark speed, and add a new model to any OpenAI-compatible provider in models.json.
SkillCFreshness: CClaude Code +9 - 0.474score
recover
drlove2002
Surgical recovery from production regressions caused by agent-introduced bugs.
SkillCFreshness: CClaude Code +9 - 0.474score
readability
drlove2002
Examine and improve code holistically — structure, naming, readability, API design, performance, and file organization.
SkillCFreshness: CClaude Code +9 - 0.474score
design
drlove2002
Design interfaces and domain models.
SkillCFreshness: CClaude Code +9 - 0.474score
simplify-writing
drlove2002
Normalize written knowledge by eliminating redundancy, centralizing canonical descriptions, and surfacing contradictions.
SkillCFreshness: CClaude Code +9 - 0.474score
triage
drlove2002
Diagnose bugs, capture feature requests, and manage issues through a label-based workflow.
SkillCFreshness: CClaude Code +9 - 0.471score
commit
drlove2002
Automate the workflow of grouping unstaged changes or squashing unpushed commits into logical, high-quality conventional commits.
SkillCFreshness: CClaude Code +9 - 0.450score
skill
drlove2002
Create new agent skills with proper structure, progressive disclosure, and bundled resources.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jun 11, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/drlove2002/ai-config
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from drlove2002
- 0.479score
web-test
drlove2002
Browser automation via agent-browser CLI for testing pages, debugging, performance audits, visual review, accessibility checks, and interaction testing.
SkillCFreshness: CClaude Code +9 - 0.479score
simplify-code
drlove2002
Review uncommitted changes, unpushed commits, or a provided git diff range with a reuse-first simplification lens.
SkillCFreshness: CClaude Code +9 - 0.474score
design
drlove2002
Design interfaces and domain models.
SkillCFreshness: CClaude Code +9 - 0.474score
add-model
drlove2002
Test availability, benchmark speed, and add a new model to any OpenAI-compatible provider in models.json.
SkillCFreshness: CClaude Code +9 - 0.474score
plan
drlove2002
Turn conversation context into a Product Requirements Document (PRD) and break it down into independently-grabbable tracking issues.
SkillCFreshness: CClaude Code +9 - 0.474score
docs
drlove2002
Look up documentation for any library, framework, or product concept.
SkillCFreshness: CClaude Code +9
Cite this page
refactor skill. Agent Mart. https://agentmart.dev/skills/drlove2002-refactor (last updated 2026-10-24)