Practical development workflows
Ready-to-adapt prompts for exploring a codebase, fixing bugs, building features, refactoring, writing tests, reviewing changes, and working through GitHub issues.
Every workflow follows the same loop: pick the project and environment, choose an agent and permission mode, give a bounded goal, review the changes, and check the result yourself. The first task walks through that loop with a real failing test.
Understand an unfamiliar codebase
Start read-only. Plan (Autohand) or + > Plan mode keeps the agent from editing.
Trace how an incoming request reaches the order total calculation. Read
only; do not edit or install dependencies. Identify the entry points,
relevant files, and existing tests. Cite file paths for each claim.
Open the cited files in Explorer to check them. Use the answer to scope the next task rather than assuming the agent read the whole repository.
Fix a bug or debug a failure
Give the expected behavior, how to reproduce it, and the smallest useful error:
An order with price 5 and quantity 3 totals 5 instead of 15. Reproduce it
with the existing test runner. Find the cause, make the smallest fix, add
a regression test, and rerun the focused tests. Do not commit or push.
If tests still fail, paste the actual output into the same thread. Tell apart a failing assertion from a missing dependency, database, or service. + > Debug mode switches the thread to evidence-first debugging.
Build a feature across files
Use a New worktree and state both the behavior and the limits:
Add optional quantity validation to the order API. Reject negative or
non-integer quantities with the existing error format. Update the handler,
validation tests, and API documentation. Preserve existing callers. Run
the relevant tests and build. Do not change unrelated endpoints.
Review every layer of the change, including tests and docs. For a UI feature, check it in the browser after the build.
Refactor without changing behavior
Extract the duplicated order-total calculation into one shared function.
Preserve existing behavior and public interfaces. Identify callers first,
then update them and run their tests. Explain any behavior difference
instead of silently treating it as cleanup.
Check call sites, edge cases, and the working-tree diff. A shorter function is not proof that behavior stayed the same.
Write meaningful tests
Find the untested quantity edge cases in this module. Add tests using the
existing test framework. Include zero quantity and empty input. Confirm
the tests would fail for the relevant broken behavior, then run them.
Do not add a second framework.
Make sure the tests assert behavior instead of mirroring the implementation.
Review a change
Review this branch against main. Do not edit files. Report concrete
correctness risks with file paths, how to reproduce them, and severity.
Check the tests relevant to those risks. Do not list style preferences as
bugs.
Check the base branch and the diff you are reading. Uncommitted files are not part of a branch diff. For pull requests already on GitHub, start from Code review in the navigation rail.
Work through a GitHub issue
- Add or clone the repository.
- Start a thread in a New worktree.
- Give the agent the issue text or URL. If it cannot open the URL, paste the description without secrets.
- Ask it to list the acceptance criteria and reproduce the issue before editing.
- Review, test, and then explicitly ask for the commit, push, and pull request.
Implement the attached issue in this worktree. First summarize the
acceptance criteria and identify any ambiguity. Reproduce the existing
problem, add a regression test, then implement and verify the fix. Prepare
a PR description with actual test results; do not submit it yet.
Get a second opinion
Change the model for a bounded alternative, or use Hand off to move the task to another agent. Give it the goal, the changes so far, and any failing checks. Switching models does not remove the need to reproduce and verify.
Keep long tasks in one thread with notes in files; give independent tasks their own threads and worktrees. See sessions and context.