بنقرة واحدة
refactor
Refactor code with safety nets — tests green before and after, no behavior change
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Refactor code with safety nets — tests green before and after, no behavior change
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Write personal blog posts with the rhythm, structure, and voice of top-tier essayists (Paul Graham, Dan Luu, Henrik Karlsson, Ben Kuhn, etc.)
Add a new feature with design, TDD, and PR workflow
Audit a codebase for security vulnerabilities, code quality issues, and architecture concerns
Use 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.
Fix a bug with systematic debugging, TDD, and PR workflow
Create a git release — tag, push, and create GitHub release
| name | refactor |
| description | Refactor code with safety nets — tests green before and after, no behavior change |
| user_invocable | true |
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] |