Your escape-room builder now reports unreachable puzzles, and you’ve taken three capstone features through the same steps. Each feature started from a brief and ended in a commit you’d reviewed. That pattern is the working loop.
This page turns the loop into a checklist to keep beside your terminal for every feature, in any project. It also says which parts will outlast today’s tools, and where to go deeper.
Keep the Loop as a Checklist
Step 1 happens once per feature, and steps 2 to 7 repeat for every task. When a feature changes a decision the project already made, revise docs/brief.md and docs/map.md before you slice it:
- Slice the feature: Split it into small vertical tasks in
docs/tasks.md, each with a check you can name and a diff you can read in one sitting. Put the skeleton first and the uncertain part early. A task that needs “and” or touches unrelated parts is probably too big. - Write the task: Give the goal and why, where to look, the constraints, what not to touch and a done-when. Replace adjectives with examples, such as a room and the line it should print. When much is open, ask your agent to list what’s unclear first.
- Give it checks: Name the test commands in the instruction file, and let your agent run them without asking, inside its sandbox. End every done-when with a command that passes after the last change.
- Write the tests first: Read each test against the criteria and see it fail for the right reason. Then commit the tests and note the hash. Ask for code that passes them without changing the test files, and protect the test folder with a deny rule where your agent has one.
- Check the green run: Read your agent’s done report as a claim: which commands ran, after which edit, and what they printed. Compare
test/,rooms/andpackage.jsonwith the tests’ commit, even if your agent committed, and look for code that names the test data. With no new tests, use the commit before the task. - Review the working tree: Start from the task as written, not the agent’s summary. Read the diff since your last commit (the tests’ commit, when you wrote tests first), and open each untracked file
git statuslists. Then check the session’s commands and the places they changed, which no diff shows. Look for files outside the task, new dependencies, edited tests and configuration changes. Run the checks yourself. - Decide, commit and map it: Keep, trim, or discard and re-task. Commit what you keep, tick the task’s box in
docs/tasks.md, and updatedocs/map.mdwhen the parts fit together differently.