Prompts tagged "重構" in the PromptCraft library.
Distills 14 classic software engineering books (Clean Code, Refactoring, Domain-Driven Design, The Pragmatic Programmer, Working Effectively with Legacy Code, and more) into imperative rule sets you can paste directly into AGENTS.md / CLAUDE.md / Cursor rules, offered in full / mini / nano sizes so you can pick based on your context budget.
Has Claude Code break a large task into several independent, parallel subagents (each with its own context, restricted tools, and an assignable model), planning how to fan the work out, defining each subagent's responsibility boundaries and reporting format, and producing reusable .claude/agents subagent definition files when needed.
Forces Claude Code through a strict red→green→refactor cycle: for every behavior, first write a test that fails (red) and actually run it to prove the failure, then write the minimal implementation that just makes it pass (green), and finally refactor under the safety of the passing tests. Cures the AI's old habit of jumping straight to the happy path, skipping edge cases, and faking test coverage.
Has Codex write characterization tests for untested legacy code: it first reads and documents what the code 'actually does right now' (bugs included), systematically covers the happy path plus edge cases and error paths, and is strictly forbidden from modifying the code under test.
A large-refactor playbook for agents: first do a read-only survey of the 'blast radius' — which files, call sites, and tests are affected — then split the change into small batches, each preserving behavior, each run through its own tests, each its own atomic commit. Puts an end to 'change 40 files at once, then the build breaks and no one knows where to start fixing it.'