refactor-all

star 1

Full-scope parallel refactor for active repository changes. Use when the user explicitly says "$refactor-all" or requests broad cleanup across all current staged+unstaged tracked edits, not just files Codex touched.

w00ing By w00ing schedule Updated 3/3/2026

name: refactor-all description: Full-scope parallel refactor for active repository changes. Use when the user explicitly says "$refactor-all" or requests broad cleanup across all current staged+unstaged tracked edits, not just files Codex touched.

Refactor All

Refactor all current tracked changes in the working tree.

Defaults

  • Scope: staged + unstaged tracked modified files.
  • Parallelism: up to 4 workers (cap by file count).
  • Strategy: single mode; choose depth by risk.

Workflow

  1. Read constraints first.
  • Read nearest AGENTS.md in repo.
  • If in submodule, read submodule AGENTS.md too.
  • Apply stricter rule on conflicts.
  1. Build full scope.
git diff --name-only --diff-filter=d
git diff --cached --name-only --diff-filter=d
  • Merge + dedupe paths.
  • Keep tracked files only.
  • If empty, report and stop.
  1. Partition for parallel workers.
  • Sort files by path.
  • Pick workers = min(4, file_count).
  • Split into non-overlapping chunks.
  1. Spawn workers in parallel.
  • Use spawn_agent with agent_type: worker per chunk.
  • Worker prompt must include:
    • owned file list
    • "You are not alone in the codebase; ignore edits from others unless in owned files."
    • goals: readability, maintainability, low-risk efficiency, AGENTS compliance
    • constraints: no destructive git commands, no out-of-scope edits, escalate risky semantic changes
  1. Collect and reconcile.
  • Wait for all workers.
  • Resolve overlap/conflict conservatively.
  • Keep behavior stable unless explicitly requested otherwise.
  1. Verify and report.
  • Run smallest relevant checks.
  • Prefer: typecheck, test, lint when available.
  • Report scope, touched files, improvements, compliance notes, risks.

Guardrails

  • No destructive git commands.
  • No edits outside assigned worker ownership.
  • Do not revert unrelated user changes.
  • Stop and escalate when semantic risk is non-trivial.
Install via CLI
npx skills add https://github.com/w00ing/skills --skill refactor-all
Repository Details
star Stars 1
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator