refactor
Improve code structure without changing behavior, then create a GH Issue + PR.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Improve code structure without changing behavior, then create a GH Issue + PR.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Pre-meeting B2B account research. Produces a structured account brief (company overview, recent news, tech stack, decision structure hypothesis, hypothesized pain points, approach strategy). Use before /discovery-prep.
Generates a Discovery meeting plan from an account brief — SPIN questions, MEDDIC checklist, hypothesized pain points with verification questions, objection prep, time-boxed agenda. Run after /account-brief, before the meeting.
Generates post-meeting follow-up assets — customer-facing email draft, internal action list, CRM update fields, account_brief updates, champion status tracking. Run after any sales meeting.
Converts sales-written meeting notes (discovery type) into a PRD draft for PoC building, and updates account_brief.md with newly learned facts. The bridge between sales discovery and engineering PoC. Run after a discovery meeting, before /kickoff.
Generates a closing proposal from demo meeting notes + the actual PoC + account brief. Business-value first; technical specs in appendix. Run after a demo meeting, before contract negotiation.
Analyzes and critiques business viability. Use after /brainstorm and before /prd.
| name | refactor |
| description | Improve code structure without changing behavior, then create a GH Issue + PR. |
| argument-hint | [file or module path to refactor] |
| disable-model-invocation | false |
| allowed-tools | Read, Glob, Grep, Write, Edit, Bash(bash scripts/checkpoint.sh *), Bash(bash scripts/wt_setup.sh *), Bash(bash scripts/wt_cleanup.sh *), Bash(bash scripts/registry_edit.sh *), Bash(bash scripts/flock_edit.sh *), Bash(bash scripts/worktree.sh *), Bash(python3 scripts/*), Bash(git *), Bash(gh *), Bash(pytest *), Bash(npm *), Bash(bash ${CLAUDE_PLUGIN_ROOT}/scripts/*), Bash(python3 ${CLAUDE_PLUGIN_ROOT}/scripts/*) |
Kit root: ${CLAUDE_PLUGIN_ROOT}
scripts/ dir): prefix every kit script command with it, e.g.
bash <kit-root>/scripts/checkpoint.sh …. Absolute paths also work from worktrees.${…} placeholder above → standalone layout: run commands as written.Run these checks silently at the start. Use results to adapt behavior:
[ -f issues.md ] — if true, this project uses the sprint system. Respect issue numbering and STATUS.md.[ -f docs/sprint_state.md ] — if true and Status shows running, a sprint is active. Be aware of parallel work in worktrees.[ -f docs/prd_digest.md ] — if true, read it for quick project context before starting.gh auth status before any GitHub operation.Every phase in this skill that has a CHECKPOINT block must be verified. Run the verification command after completing each phase. Blocking gates exit non-zero on failure: STOP immediately, report, do NOT proceed. Advisory gates always exit 0 and print an ADVISORY: line on failure: report the gap, self-correct, then continue (ISSUE-031). Never skip running either tier.
Slug convention: After creating the worktree, store the branch slug (e.g., refactor/extract-views-helpers) for use in checkpoint commands.
$ARGUMENTS is empty or blank, ask the user: "Which file or directory would you like to refactor? Please provide a path."<path>. Please provide a valid file or directory path."Steps:
gh authenticated (gh auth status).WT="$(bash scripts/wt_setup.sh refactor/<slug>)"
wt_setup.sh creates the worktree and writes the freeze marker inside
.claude-kit/freeze-dir.txt atomically. All subsequent file operations
happen inside $WT/.CHECKPOINT — ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill refactor --phase worktree --issue "$SLUG"Advisory: exits 0 even on failure, printing anADVISORY:line — report the gap, self-correct, then continue.
$WT/, running tests after each step.CHECKPOINT — MANDATORY — NEVER SKIP Run:
bash scripts/checkpoint.sh --skill refactor --phase test --issue "$SLUG"If exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.
gh issue create --title "refactor: <concise description>" --body "<body>"$WT/).CHECKPOINT — ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill refactor --phase push --issue "$SLUG"Advisory: exits 0 even on failure, printing anADVISORY:line — report the gap, self-correct, then continue.
gh pr create --title "refactor: <concise description>" --body "Closes #<issue_number>\n\n<details>"/review and /ship.If issues.md exists in the project root, register this work in the sprint ecosystem:
issues.md to find the next available ISSUE-NNN number.bash scripts/registry_edit.sh issues.md -- bash -c '<append issue entry>'
Issue fields:
<number><pr_url>If issues.md does not exist, skip this step silently.
gh auth status fails: stop and instruct the user to run gh auth login.bash scripts/wt_cleanup.sh <branch> for safe worktree removal —
the wrapper cd's to main root and removes the worktree in a single subshell.bash scripts/wt_cleanup.sh <branch>git push origin --delete <branch> (remote cleanup, if pushed)gh pr close <pr_number> then clean up worktree and branch as above.IMPORTANT: Never commit issues.md, STATUS.md, or CHANGELOG.md to the feature branch.
These are registry files managed only on main. Always use bash scripts/registry_edit.sh <file> -- bash -c '<update command>' — the wrapper resolves the main repo root internally.