/zforge:refactorfrom zforge
Refactor code with safety nets — tests green before and after, no behavior change
Ships in zforge. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Restructure code without changing behavior. Tests are your safety net.
git checkout main && git pull
/fix-bug, not a refactor)git worktree add .claude/worktrees/refactor-<name> -b refactor/<description>
cd .claude/worktrees/refactor-<name>
All work happens in the worktree — main stays clean.
git diff main...HEADgh pr creategh pr merge <number> --mergecd <project-root> && git worktree remove .claude/worktrees/refactor-<name>git checkout main && git pull && git branch -d refactor/<description>Before every PR, answer each item and present as a markdown table:
| # | Check | Answer |
|---|---|---|
| 1 | What changed — what was refactored and why | [brief] |
| 2 | Behavior preserved — does the code behave identically? | [yes/no + evidence] |
| 3 | Single source of truth — no duplicate data paths or redundant caches introduced? | [yes/no + evidence] |
| 4 | Test regression — do all existing tests pass? Same count as baseline? | [pass count / fail count] |
| 5 | Reuse — did you reuse existing patterns/functions, or reinvent something? | [yes/no + evidence] |
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
16 skills in this plugin
/add-featAdd a new feature with design, TDD, and PR workflow/auditAudit a codebase for security vulnerabilities, code quality issues, and architecture concerns/autopilotUse when the user says "autopilot", "auto mode", "替我回答", or "自动回答". Enables autonomous decision-making by answering Claude's own questions based on the user's personality profile./blogWrite personal blog posts with the rhythm, structure, and voice of top-tier essayists (Paul Graham, Dan Luu, Henrik Karlsson, Ben Kuhn, etc.)npx claudepluginhub zhengxuyu/zforge --plugin zforge