Run all code quality skills — effects, memo, callbacks, state, React Query, emcn design review, url-state, comments, and test-audit — analyzing in parallel, the
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-cleanup-c413641c9b4e ,按照其中的说明把「cleanup」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Arguments:
User arguments: $ARGUMENTS
Parse $ARGUMENTS into scope and fix: extract the fix=true|false token wherever it appears in the string and strip it from scope; defaults are the current changes and fix=true. fix is consumed by Step 3 only — the passes below always run fix=false.
Spawn up to nine passes concurrently as subagents in a single message (multiple Agent tool calls); pass 9 runs only when its condition holds. Each runs its skill on the parsed scope with fix=false — analysis and proposals ONLY, no edits. Instruct each agent to return its findings as a structured list: for every proposed change, the file path, line range, a one-line description of the change, and the exact before/after so the orchestrator can apply it without re-deriving.
Run these in parallel on the parsed scope:
/you-might-not-need-an-effect <scope> fix=false/you-might-not-need-a-memo <scope> fix=false/you-might-not-need-a-callback <scope> fix=false/you-might-not-need-state <scope> fix=false/react-query-best-practices <scope> fix=false/emcn-design-review <scope> fix=false/you-might-not-need-url-state <scope> fix=false/you-might-not-need-a-comment <scope> fix=false/test-audit audit <test paths> — read-only; only when the scope adds or changes test files (*.test.ts(x), *.integration.ts, **/e2e/**, apps/sim/scripts/test-*-e2e.ts). First resolve a free-form scope to the concrete list of added or changed test paths (git diff --name-only against the scope's base) and pass those paths. It applies the authoring gate to every new or changed test and proposes deleting the ones that fail it.Collect all findings into one list, keeping each proposal tagged with the pass that produced it — do NOT collapse a file's proposals into a single unlabeled patch, because Step 3 applies in pass order and needs those labels. Detect overlaps where two passes touch the same region (common: a state pass and an effect pass on the same block, or a memo and callback pass on the same component). Reconcile only genuine same-region conflicts, and drop proposals a sibling pass has made moot; a reconciled change inherits the pass label of whichever of its passes comes first in the Step 3 dependency order (effects → state → memo → callback → React Query → url-state → emcn → comments → tests), so it is applied at the earliest safe point. Non-overlapping proposals stay as-is with their own labels. The output is a per-pass list of surviving changes, not a per-file patch.
If fix=false, skip this step — just report the proposals from Step 2.
Otherwise apply the surviving changes yourself (in the main context, not delegated), iterating pass by pass in this dependency order so earlier structural changes settle before later passes build on them:
For each pass in turn, apply all of that pass's changes, then move to the next pass. A file touched by several passes is therefore edited once per pass, in this order — not once as a merged patch. This is what makes the ordering real: a single merged-per-file patch would collapse all passes into one edit and lose it.
Comments apply after every structural pass, on purpose: that pass operates on whatever the earlier passes settled the code into, so it never edits lines a sibling pass is about to delete or rewrite. Tests apply last because they only touch test files; in Step 2, drop any other pass's proposal on a test file the tests pass deletes.
Treat every Step 1 proposal as snapshot-relative, not authoritative. All passes analyzed the original files in parallel, so a proposal's line ranges and before/after text describe the code as it was before any edits — once an earlier pass has run, a later pass's snippet may no longer match. So for each change, before applying:
old_string snippet), not by its line number — line numbers from Step 1 are only a hint for where to look, since earlier edits shift them.old_string still matches verbatim, apply it — a content-anchored edit is safe even if its line moved.After all edits, run bun run lint from the repo root (it autofixes formatting across the repo; there is no per-file target).
Output a summary across all passes that ran: what each found, what was applied vs. skipped-as-redundant, and any proposals that need a human decision.
Never resolve a boundary finding by adding a // boundary-raw-fetch / // double-cast-allowed annotation — fix the call (adopt the contract + requestJson, or narrow the type). Annotations are only for the documented exceptions in .claude/rules/sim-api-contracts.md → Boundary annotations.