You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Rename TDD intent terminology to declaration across codebase
Rename internal state names (red_intent → writing_tests, green_intent →
making_tests_pass) and update all user-facing messages, documentation,
and tests to use "declaration" instead of "intent".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CLAUDE.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,12 +198,12 @@ Remember: A test that fails for the wrong reason teaches you nothing about the c
198
198
3. Can existing e2e tests be enhanced to cover this work instead of writing new ones?
199
199
4. Can planned e2e tests be unit/integration/component tests instead?
200
200
201
-
**Red Intent Honesty:**
201
+
**Honest Test Declarations:**
202
202
203
-
-**Red intent must describe expected failure.** If you're adding tests that will pass immediately, use `--skip-red` on the Green intent instead. Don't log a Red intent for tests you expect to pass.
203
+
-**The writing-tests declaration must describe expected failure.** If you're adding tests that will pass immediately, use `--skip-red` on the making-tests-pass declaration instead. Don't start writing tests for tests you expect to pass.
204
204
-**Guard tests (assert unchanged behavior):** When writing tests that expect existing/default behavior to continue (e.g., "blocked stays blocked", "no-op when absent"), these can't fail during a natural Red phase. Use `--skip-red --reason=adding-coverage` for these, even when they're part of a larger feature. Don't bundle them into a Red cycle where they'll pass immediately.
205
205
- Do NOT use `--skip-red` to avoid TDD, even if you already have e2e coverage.
206
-
- The TDD guard enforces that `tdd_log green` requires a preceding Red cycle (Red intent -> failing test -> Green intent). The `--skip-red` flag is the escape hatch for changes that genuinely don't need a failing test first.
206
+
- The TDD guard enforces that `tdd_log green` requires a preceding Red cycle (writing tests -> failing test -> making tests pass). The `--skip-red` flag is the escape hatch for changes that genuinely don't need a failing test first.
207
207
208
208
**Using --skip-red (requires --reason):**
209
209
@@ -238,7 +238,7 @@ The TDD log file name and full usage examples are provided automatically at sess
238
238
239
239
**Overriding TDD State:**
240
240
241
-
You can force the TDD state into any other state by logging a Red or Green intent by running tdd_log with your desired arguments as normal. Your override will be logged for later review. Useful if you get stuck in the wrong TDD state (e.g., you logged the wrong expectation or made a mistake).
241
+
You can force the TDD state into any other state by logging a Red or Green declaration via tdd_log with your desired arguments as normal. Your override will be logged for later review. Useful if you get stuck in the wrong TDD state (e.g., you logged the wrong expectation or made a mistake).
@@ -88,12 +88,12 @@ uv run python -m scripts.tdd_log --log "tdd-abc123.log" green --skip-red \
88
88
89
89
The `green` subcommand enforces prerequisites:
90
90
91
-
- Without `--skip-red`: requires state to be `red` (test must have failed) or `green_intent` (re-logging)
91
+
- Without `--skip-red`: requires state to be `red` (test must have failed) or `making_tests_pass` (re-logging)
92
92
- With `--skip-red`: requires a `--reason` from `{refactoring, lint-only, adding-coverage}`
93
93
94
94
### Overrides
95
95
96
-
Logging a Red or Green intent at any time overrides the current state. This is useful when the agent gets stuck in the wrong state. Overrides are recorded in the log for later review.
96
+
Logging a Red or Green declaration at any time overrides the current state. This is useful when the agent gets stuck in the wrong state. Overrides are recorded in the log for later review.
|`making_tests_pass`| Blocked\*| Allowed (if in allowlist) |
133
133
134
-
\* Test files are allowed during `green_intent` only if the Green was logged with `--skip-red`.
134
+
\* Test files are allowed during `making_tests_pass` only if the Green was logged with `--skip-red`.
135
135
136
136
### Green Allowlist
137
137
@@ -149,7 +149,7 @@ The [`scripts/tdd_post_bash.py`](https://github.com/cadamsdotcom/CodeLeash/blob/
149
149
|`npm test*` or `npm run test*`|`test`| Drives state transitions |
150
150
| Everything else |`bash`| Logged, no state change |
151
151
152
-
Test commands tagged as `test` with `SUCCEEDED` status reset the state to `initial`. Test commands that `FAILED` during a Red phase confirm the state as `red`.
152
+
Test commands tagged as `test` with `SUCCEEDED` status reset the state to `initial`. Test commands that `FAILED` during a writing-tests phase confirm the state as `red`.
0 commit comments