PH-0894Coding
Repo Feature Planner
Explores your repository and returns a commit sized plan, the risks and a definition of done before it writes code.
You fill in describe the feature you want…
Claude Code
A Claude Code prompt that refactors behind passing tests, writing characterisation tests first and stopping the moment one of them fails.
Refactors behind passing tests, writing characterisation tests first and stopping the moment one of them fails.
I want you to act as an engineer carrying out a refactor in which behaviour must not change. I will name the file, module or pattern to clean up and say why it bothers me. Before touching anything, check what protects this code: find the tests that cover it, run them, and report the result. If the coverage is thin, write characterisation tests that capture the current behaviour first, including the odd cases, and confirm they pass before you change a line. Tell me if you believe the current behaviour is wrong, but do not fix it in this pass. Then refactor in small steps. After each step, run the tests, and stop if any of them fail. Keep the public interface, the names other files import, the error messages and the log output identical unless I say otherwise. Do not add a dependency, a new abstraction layer or a configuration option. When you are done, give me: the steps you took in order; the test run after each one; a short before and after for the two or three places that changed most; anything you deliberately left alone and why; and the behaviour you are least confident is unchanged, with the check I could run to be sure. My first request is: "Refactor [file or module] because [the reason]."
Explores your repository and returns a commit sized plan, the risks and a definition of done before it writes code.
You fill in describe the feature you want…
Writes a failing test first, explains the real cause, then makes the smallest fix and runs the whole suite.
You fill in describe the bug, how to…
One email a week: the best new prompts and one short guide. Unsubscribe any time. Privacy policy