一键导入
tidy
TDD Production Code Refactoring Process. Triggers on 'tidy up', 'tidy this', 'clean up code'. Use for refactoring production code with test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
TDD Production Code Refactoring Process. Triggers on 'tidy up', 'tidy this', 'clean up code'. Use for refactoring production code with test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
XP-style plan review that identifies gaps, hidden assumptions, and critical misses. Triggers on 'review the plan', 'check the plan', 'audit the plan'. Reviews plans for YAGNI violations, missing feedback loops, and over-engineering.
Comprehensive code review for quality, security, performance. Triggers on 'review code', 'code review', 'check this PR', 'audit code'.
Systematically explore an unfamiliar codebase and build a reusable architecture summary. Use for repo onboarding, understanding legacy or inherited code, mapping architecture before a migration or refactor, tracing a bug or feature path, or answering "what does this project do?". Documentation-first, then data flow — ends in a concise technical architecture summary with file:line evidence, not a raw file dump.
Compile deep repository evidence into artifact-bound correctness doctrine — authority/law/proof maps, owned invariants, failure archaeology, and the strongest durable destination for each piece of knowledge, plus an optional minimal repository-specific skill portfolio. Use when the user wants both deep codebase understanding AND durable doctrine, knowledge routing, or repo-specific skill recommendations. Research discoverable facts before asking. Read-only. Not for quick onboarding, one isolated invariant, ordinary implementation, generic review, or direct skill creation.
Run a targeted fresh-eyes blunder pass over code, specs, plans, reviews, closure gates, or skill edits. Use when asked to reread with fresh eyes, find obvious bugs, catch mistakes/oversights/omissions, check for embarrassing misses, or do a second independent pass before closure. Use it as the final falsification/check pass for another workflow, not as a substitute for implementation or verification.
Mine a codebase for breakthrough, evidence-backed opportunities — features, additions, refactors, simplifications, DX, UX, reliability, performance, or architecture cleanup. Researches project reality first, then forces two escalation gates (reject the merely-adequate idea; expand ambition 10x then collapse to the smallest proof-bearing artifact). Outputs ranked opportunities, an escalation ledger, and one plan seed. Does not implement or create tickets.
| name | tidy |
| allowed-tools | ["Read","Edit","Write","Glob","Grep","Bash","Workflow"] |
| description | TDD Production Code Refactoring Process. Triggers on 'tidy up', 'tidy this', 'clean up code'. Use for refactoring production code with test coverage. |
| metadata | {"author":"Fishbowl Team","version":"0.2.0"} |
STARTER_CHARACTER = 🟣
NEVER make changes to Test code in this process.
This process is for refactoring production code with test coverage.
Locate Test File Proactively
filename.test.ext, filename.spec.ext__tests__/filename.exttests/filename.ext/test/ instead of /src/Verify Tests Pass
Scan for Refactoring Opportunities
The approval is interactive and stays here (Initial Setup step 3): you present the numbered findings, ask which to proceed with, and wait for user confirmation. Only the deterministic apply → green-gate → commit/revert loop is encoded as a Workflow, so the strike cap, green gate, and exact commit-message format run reliably instead of by prose.
Once the user has confirmed the subset, invoke the Workflow tool with the bundled script,
passing the human-approved refactor list (in priority order):
Workflow({
scriptPath: "${CLAUDE_PLUGIN_ROOT}/skills/tidy/workflow.js",
args: {
refactors: ["<approved refactor 1>", "<approved refactor 2>", ...], // priority order
testCommand: "<how to run the suite>", // optional; agent infers if omitted
productionFile: "<path>", // optional; the file being tidied
testFile: "<path>" // optional; NEVER modified
}
})
For each approved refactor the workflow runs:
{ passed, output }.passed === true: commit with message format "- r <refactoring>" (quotes must
include the - r). The loop does not commit until the gate reports passed === true.It returns { total, attempted, committed, halted, outcomes }, where each outcome carries
{ index, refactor, committed, commitMessage, attempts, halted }. Give a brief status
update after each refactor from the returned outcomes.
Stop conditions:
halted: true)When the workflow returns halted: true, pause and check with the user before doing
anything else — report which refactor failed and its attempt output; do not continue to the
next refactor on your own.