用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mary-ext/claude-skills --skill tidy命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
An independent advisor you shell out to for a second opinion. Use when planning complex changes, debugging across multiple files, making architecture decisions, reviewing your own work, or when a different perspective would help.
Use when writing skills, CLAUDE.md files, agent prompts, or any code/directive that involves shell commands, environment variables, API credentials, file creation, or git operations - prevents secrets leakage into LLM context, unsafe shell patterns, and credential exposure.
Use when writing or revising any instruction Claude will read - skills, CLAUDE.md files, agent prompts, system prompts, hook output. Covers token efficiency, compliance techniques, discovery, and per-format templates.
基于 SOC 职业分类
正在显示 SKILL.md
| name | tidy |
| description | Review changed code for reuse, quality, efficiency, and altitude, then fix any issues found. |
| argument-hint | [<target>] |
Improve the quality of the changed code. Fix any issues found.
Run git diff @{upstream}...HEAD to get the diff under review, falling back to
git diff main...HEAD or git diff HEAD~1 when there is no upstream. Also run git diff HEAD and
include the working-tree changes when that range diff is empty or uncommitted changes exist — this
review usually runs before the commit, so a range-only diff often reviews nothing.
When the user names a target — a PR number, branch name, or file path — review that instead. Treat the resulting diff as the review scope.
Use the Agent tool to launch all four agents concurrently in a single message. Pass each agent the full diff so it has the complete context, plus one of the four angles below.
Each agent reports findings as file, line, a one-line summary, and the concrete cost — what is
duplicated, wasted, or made harder to maintain. Naming the cost keeps findings actionable and makes
false positives easy to spot in Phase 3.
For each change:
Review the same changes for hacky patterns:
a ? x : b ? y : ...), nested if/else, or nested switch
3+ levels deep — flatten with early returns, guard clauses, a lookup table, or an if/else-if
cascadeReview the same changes for efficiency:
Review the same changes for altitude — whether each change is implemented at the right depth, or as a bandaid downstream of the real cause:
if (specificCase) branch inside a general function that
only one caller needs — hoist it to that caller, or generalize the underlying mechanism so the
special case disappears. Also the reverse: a caller working around a shared function's limitation
that the function should ownReport a finding when the correct location already exists, and name it. When the fix would require new structure — a new module, layer, or abstraction — mark the finding out of scope and describe in one line what it would take; a restructure that size is the user's call to make.
Don't modify any files while the agents are running. Not the files in the diff, not files adjacent to them, and not files related to the changes. The agents explore freely: they read the changed files, follow imports, inspect siblings in the same directory, and trace call chains. Any file they might touch is off-limits until they finish. Editing mid-run corrupts their view of the codebase and makes their findings unreliable. If you have nothing unrelated to work on, stop and wait.
Wait for all four agents to complete. Deduplicate findings that point at the same line or mechanism, keeping whichever states the cost most concretely. Fix each remaining finding directly.
Skip a finding, noting the skip rather than arguing with it, when its fix would:
Altitude findings marked out of scope are the exception: leave the code as it is and list them in the final summary as observations for the user to decide on.
When done, briefly summarize what was fixed and what was skipped (or confirm the code was already clean).