Load mahou:basics first, then mahou:implement. Then read .mahou/implement-with-tdd.md if present.
Implement with TDD
Follow implement from start to end. Only how each repository's code gets written changes, in implement's Dispatch and collect. The opening, the brief, the manual validation, the agentic review, the design reconciliation and the ending stay as implement states them.
Two subagents per repository
For each repository, spawn two subagents from this session, a tester and an implementer, labelled <repository>: tester and <repository>: implementer. Both get the repository's full brief from implement and work in the same checkout, on the same branch. Neither spawns the other, and they never talk to each other directly. Every exchange passes through this session. The session relays each exchange between the tester and the implementer and records it in the repository's section of implementation-status.md. The session does not show an exchange to the user when the exchange arrives.
Neither subagent commits. That is the only change to the brief's repository rules.
The rounds
- Red. The tester writes the new tests for the repository's
★ test rows, updates any unstarred test rows whose expected outcome changed, and removes any tests listed under Deleted:. It leaves the unstarred rows whose expected outcome did not change untouched, because they are regression rows. It runs the suite and confirms that each new or updated test fails because the behaviour is missing, not because the test is broken, and that every regression row still passes. When the tests cannot load before the code exists, it says how it checked the reason for the failure. It reports the row-to-test mapping, the files it changed and why each test fails.
- Green. Relay the failing tests and the changed files to the implementer. It writes the code until the tests pass, then reports the linter and test output tail.
- Validate. Relay the implementer's report to the tester. The tester runs the suite, confirms the regression rows still pass, and checks the code against the design's rules and contracts, not only against the tests. It answers with an approval or with concrete feedback. Relay the feedback to the implementer and repeat 2 and 3 until the tester approves.
Rules for the rounds:
- The implementer does not edit test files. When it believes a test is wrong, it says so, and this session relays the claim to the tester.
- The tester does not edit the implementation.
- When either subagent finds a design ambiguity that changes the outcome, this session asks the user. Neither subagent decides it.
Committing
Once the tester approves, this session commits the repository's changes with mahou:commit-changes, then continues with implement's manual validation for that repository.
1---2name: implement-with-tdd3description: Implements a change whose design and test design are settled the way mahou:implement does, but writes each repository's code test first. Per repository, a tester subagent writes the failing tests and validates each round, an implementer subagent writes the code, and this session relays every exchange between them. Use after test-design, before human-review, when the code should be written test first.4argument-hint: <the tasks, the design notes, the test matrices, the repositories and the branch name>5metadata:6 source: https://skillmd.com/skills/asermax/implement-with-tdd7---89Load mahou:basics first, then mahou:implement. Then read `.mahou/implement-with-tdd.md` if present.1011# Implement with TDD1213Follow `implement` from start to end. Only how each repository's code gets written changes, in `implement`'s Dispatch and collect. The opening, the brief, the manual validation, the agentic review, the design reconciliation and the ending stay as `implement` states them.1415## Two subagents per repository1617For each repository, spawn two subagents from this session, a tester and an implementer, labelled `<repository>: tester` and `<repository>: implementer`. Both get the repository's full brief from `implement` and work in the same checkout, on the same branch. Neither spawns the other, and they never talk to each other directly. Every exchange passes through this session. The session relays each exchange between the tester and the implementer and records it in the repository's section of `implementation-status.md`. The session does not show an exchange to the user when the exchange arrives.1819Neither subagent commits. That is the only change to the brief's repository rules.2021## The rounds22231. **Red.** The tester writes the new tests for the repository's `★` `test` rows, updates any unstarred `test` rows whose expected outcome changed, and removes any tests listed under `Deleted:`. It leaves the unstarred rows whose expected outcome did not change untouched, because they are regression rows. It runs the suite and confirms that each new or updated test fails because the behaviour is missing, not because the test is broken, and that every regression row still passes. When the tests cannot load before the code exists, it says how it checked the reason for the failure. It reports the row-to-test mapping, the files it changed and why each test fails.242. **Green.** Relay the failing tests and the changed files to the implementer. It writes the code until the tests pass, then reports the linter and test output tail.253. **Validate.** Relay the implementer's report to the tester. The tester runs the suite, confirms the regression rows still pass, and checks the code against the design's rules and contracts, not only against the tests. It answers with an approval or with concrete feedback. Relay the feedback to the implementer and repeat 2 and 3 until the tester approves.2627Rules for the rounds:2829- The implementer does not edit test files. When it believes a test is wrong, it says so, and this session relays the claim to the tester.30- The tester does not edit the implementation.31- When either subagent finds a design ambiguity that changes the outcome, this session asks the user. Neither subagent decides it.3233## Committing3435Once the tester approves, this session commits the repository's changes with mahou:commit-changes, then continues with `implement`'s manual validation for that repository.