pitroom 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.claude-plugin/marketplace.json +18 -0
  2. package/.claude-plugin/plugin.json +22 -0
  3. package/.codex-plugin/plugin.json +29 -0
  4. package/CHANGELOG.md +85 -0
  5. package/LICENSE +21 -0
  6. package/README.md +471 -0
  7. package/dist/lib.mjs +1222 -0
  8. package/dist/pitroom.mjs +3685 -0
  9. package/docs/backends.md +113 -0
  10. package/hooks/hooks.json +28 -0
  11. package/hooks/session-start.mjs +42 -0
  12. package/package.json +60 -0
  13. package/skills/pitroom-brainstorming/SKILL.md +243 -0
  14. package/skills/pitroom-brainstorming/spec-document-reviewer-prompt.md +22 -0
  15. package/skills/pitroom-crew/SKILL.md +80 -0
  16. package/skills/pitroom-debugging/SKILL.md +287 -0
  17. package/skills/pitroom-debugging/condition-based-waiting-example.ts +170 -0
  18. package/skills/pitroom-debugging/condition-based-waiting.md +115 -0
  19. package/skills/pitroom-debugging/defense-in-depth.md +122 -0
  20. package/skills/pitroom-debugging/find-polluter.sh +72 -0
  21. package/skills/pitroom-debugging/root-cause-tracing.md +169 -0
  22. package/skills/pitroom-driven-development/SKILL.md +138 -0
  23. package/skills/pitroom-driven-development/implementer-prompt.md +68 -0
  24. package/skills/pitroom-driven-development/re-review-prompt.md +41 -0
  25. package/skills/pitroom-driven-development/task-reviewer-prompt.md +59 -0
  26. package/skills/pitroom-finishing/SKILL.md +226 -0
  27. package/skills/pitroom-implement/SKILL.md +42 -0
  28. package/skills/pitroom-receiving-review/SKILL.md +209 -0
  29. package/skills/pitroom-research/SKILL.md +35 -0
  30. package/skills/pitroom-review/SKILL.md +47 -0
  31. package/skills/pitroom-review/code-reviewer.md +38 -0
  32. package/skills/pitroom-tdd/SKILL.md +322 -0
  33. package/skills/pitroom-tdd/writing-good-tests.md +198 -0
  34. package/skills/pitroom-verification/SKILL.md +124 -0
  35. package/skills/pitroom-worktrees/SKILL.md +171 -0
  36. package/skills/pitroom-writing-plans/SKILL.md +183 -0
  37. package/skills/pitroom-writing-plans/plan-document-reviewer-prompt.md +23 -0
  38. package/skills/using-pitroom/SKILL.md +66 -0
@@ -0,0 +1,322 @@
1
+ ---
2
+ name: pitroom-tdd
3
+ description: Use when you want to drive a feature or bugfix test-first - red, green, refactor, for you and for the workers you brief.
4
+ ---
5
+
6
+ # Test-Driven Development (TDD)
7
+
8
+ ## Overview
9
+
10
+ Write the test first. Watch it fail. Write minimal code to pass.
11
+
12
+ **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
13
+
14
+ **Violating the letter of the rules is violating the spirit of the rules.**
15
+
16
+ Workers follow it too: an implementer worker on a plan task is told to use TDD and to report RED and GREEN evidence. Check that evidence in its report before you trust the tests.
17
+
18
+ ## When to Use
19
+
20
+ **Always:**
21
+ - New features
22
+ - Bug fixes
23
+ - Refactoring
24
+ - Behavior changes
25
+
26
+ **Exceptions (ask your human partner):**
27
+ - Throwaway prototypes
28
+ - Generated code
29
+ - Configuration files
30
+
31
+ Thinking "skip TDD just this once"? Stop. That's rationalization.
32
+
33
+ ## The Iron Law
34
+
35
+ ```
36
+ NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
37
+ ```
38
+
39
+ Write code before the test? Delete it. Start over.
40
+
41
+ **No exceptions:**
42
+ - Don't keep it as "reference"
43
+ - Don't "adapt" it while writing tests
44
+ - Don't look at it
45
+ - Delete means delete
46
+
47
+ Implement fresh from tests. Period.
48
+
49
+ ## Red-Green-Refactor
50
+
51
+ ```dot
52
+ digraph tdd_cycle {
53
+ rankdir=LR;
54
+ red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
55
+ verify_red [label="Verify fails\ncorrectly", shape=diamond];
56
+ green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
57
+ verify_green [label="Verify passes\nAll green", shape=diamond];
58
+ refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
59
+ next [label="Next", shape=ellipse];
60
+
61
+ red -> verify_red;
62
+ verify_red -> green [label="yes"];
63
+ verify_red -> red [label="wrong\nfailure"];
64
+ green -> verify_green;
65
+ verify_green -> refactor [label="yes"];
66
+ verify_green -> green [label="no"];
67
+ refactor -> verify_green [label="stay\ngreen"];
68
+ verify_green -> next;
69
+ next -> red;
70
+ }
71
+ ```
72
+
73
+ ### RED - Write Failing Test
74
+
75
+ Write one minimal test showing what should happen.
76
+
77
+ <Good>
78
+ ```typescript
79
+ test('retries failed operations 3 times', async () => {
80
+ let attempts = 0;
81
+ const operation = () => {
82
+ attempts++;
83
+ if (attempts < 3) throw new Error('fail');
84
+ return 'success';
85
+ };
86
+
87
+ const result = await retryOperation(operation);
88
+
89
+ expect(result).toBe('success');
90
+ expect(attempts).toBe(3);
91
+ });
92
+ ```
93
+ Clear name, tests real behavior, one thing
94
+ </Good>
95
+
96
+ <Bad>
97
+ ```typescript
98
+ test('retry works', async () => {
99
+ const mock = jest.fn()
100
+ .mockRejectedValueOnce(new Error())
101
+ .mockRejectedValueOnce(new Error())
102
+ .mockResolvedValueOnce('success');
103
+ await retryOperation(mock);
104
+ expect(mock).toHaveBeenCalledTimes(3);
105
+ });
106
+ ```
107
+ Vague name, tests mock not code
108
+ </Bad>
109
+
110
+ **Requirements:**
111
+ - One behavior
112
+ - Clear name
113
+ - Real code (no mocks unless unavoidable)
114
+
115
+ ### Verify RED - Watch It Fail
116
+
117
+ **MANDATORY. Never skip.**
118
+
119
+ ```bash
120
+ npm test path/to/test.test.ts
121
+ ```
122
+
123
+ Confirm:
124
+ - Test fails (not errors)
125
+ - Failure message is expected
126
+ - Fails because feature missing (not typos)
127
+
128
+ **Test passes?** You're testing existing behavior. Fix test.
129
+
130
+ **Test errors?** Fix error, re-run until it fails correctly.
131
+
132
+ ### GREEN - Minimal Code
133
+
134
+ Write simplest code to pass the test.
135
+
136
+ <Good>
137
+ ```typescript
138
+ async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
139
+ for (let i = 0; i < 3; i++) {
140
+ try {
141
+ return await fn();
142
+ } catch (e) {
143
+ if (i === 2) throw e;
144
+ }
145
+ }
146
+ throw new Error('unreachable');
147
+ }
148
+ ```
149
+ Just enough to pass
150
+ </Good>
151
+
152
+ <Bad>
153
+ ```typescript
154
+ async function retryOperation<T>(
155
+ fn: () => Promise<T>,
156
+ options?: {
157
+ maxRetries?: number;
158
+ backoff?: 'linear' | 'exponential';
159
+ onRetry?: (attempt: number) => void;
160
+ }
161
+ ): Promise<T> {
162
+ // YAGNI
163
+ }
164
+ ```
165
+ Over-engineered
166
+ </Bad>
167
+
168
+ Don't add features, refactor other code, or "improve" beyond the test.
169
+
170
+ ### Verify GREEN - Watch It Pass
171
+
172
+ **MANDATORY.**
173
+
174
+ ```bash
175
+ npm test path/to/test.test.ts
176
+ ```
177
+
178
+ Confirm:
179
+ - Test passes
180
+ - Other tests still pass
181
+ - Output pristine (no errors, warnings)
182
+
183
+ **Test fails?** Fix code, not test.
184
+
185
+ **Other tests fail?** Fix now.
186
+
187
+ ### REFACTOR - Clean Up
188
+
189
+ After green only:
190
+ - Remove duplication
191
+ - Improve names
192
+ - Extract helpers
193
+
194
+ Keep tests green. Don't add behavior.
195
+
196
+ ### Repeat
197
+
198
+ Next failing test for next feature.
199
+
200
+ ## Good Tests
201
+
202
+ | Quality | Good | Bad |
203
+ |---------|------|-----|
204
+ | **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
205
+ | **Clear** | Name describes behavior | `test('test1')` |
206
+ | **Shows intent** | Demonstrates desired API | Obscures what code should do |
207
+
208
+ When writing or changing any test, read [writing-good-tests.md](writing-good-tests.md) for the rules that keep tests honest:
209
+ - Name the production change that would make the test fail — before writing it
210
+ - Assert on real behavior, never on mock behavior
211
+ - Keep test-only code in test utilities, out of production classes
212
+ - Understand a dependency's side effects before mocking it
213
+
214
+ ## Common Rationalizations
215
+
216
+ | Excuse | Reality |
217
+ |--------|---------|
218
+ | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
219
+ | "I'll test after" | Tests written after pass immediately — which proves nothing. They may test the wrong thing, test the implementation instead of the behavior, or miss the edge case you forgot. You never watched it fail, so you never proved it can catch the bug. Test-first forces that failure. |
220
+ | "Tests after achieve same goals (spirit not ritual)" | Tests-after answer "what does this do?"; tests-first answer "what should this do?" Tests written after are biased by the code you already wrote — you verify the cases you remembered, not the ones you'd have discovered. Coverage without proof the tests work. |
221
+ | "Already manually tested" | Manual testing is ad-hoc: no record of what you covered, no way to re-run it when the code changes, easy to forget cases under pressure. "Worked when I tried it" ≠ comprehensive. Automated tests run the same way every time. |
222
+ | "Deleting X hours is wasteful" | Sunk cost fallacy — that time is already spent either way. The real choice: rewrite with TDD (high confidence) vs. keep it and bolt tests on after (low confidence, likely bugs). Keeping code you can't trust is the waste. |
223
+ | "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
224
+ | "Need to explore first" | Fine. Throw away exploration, start with TDD. |
225
+ | "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
226
+ | "TDD will slow me down" | TDD IS the pragmatic path: catches bugs before commit, prevents regressions, lets you refactor without fear. "Pragmatic" shortcuts mean debugging in production — slower, not faster. |
227
+ | "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
228
+ | "Existing code has no tests" | You're improving it. Add tests for existing code. |
229
+
230
+ ## Red Flags - STOP and Start Over
231
+
232
+ - Code before test
233
+ - Test after implementation
234
+ - Test passes immediately
235
+ - Can't explain why test failed
236
+ - Tests added "later"
237
+ - Rationalizing "just this once"
238
+ - "I already manually tested it"
239
+ - "Tests after achieve the same purpose"
240
+ - "It's about spirit not ritual"
241
+ - "Keep as reference" or "adapt existing code"
242
+ - "Already spent X hours, deleting is wasteful"
243
+ - "TDD is dogmatic, I'm being pragmatic"
244
+ - "This is different because..."
245
+
246
+ **All of these mean: Delete code. Start over with TDD.**
247
+
248
+ ## Example: Bug Fix
249
+
250
+ **Bug:** Empty email accepted
251
+
252
+ **RED**
253
+ ```typescript
254
+ test('rejects empty email', async () => {
255
+ const result = await submitForm({ email: '' });
256
+ expect(result.error).toBe('Email required');
257
+ });
258
+ ```
259
+
260
+ **Verify RED**
261
+ ```bash
262
+ $ npm test
263
+ FAIL: expected 'Email required', got undefined
264
+ ```
265
+
266
+ **GREEN**
267
+ ```typescript
268
+ function submitForm(data: FormData) {
269
+ if (!data.email?.trim()) {
270
+ return { error: 'Email required' };
271
+ }
272
+ // ...
273
+ }
274
+ ```
275
+
276
+ **Verify GREEN**
277
+ ```bash
278
+ $ npm test
279
+ PASS
280
+ ```
281
+
282
+ **REFACTOR**
283
+ Extract validation for multiple fields if needed.
284
+
285
+ ## Verification Checklist
286
+
287
+ Before marking work complete:
288
+
289
+ - [ ] Every new function/method has a test
290
+ - [ ] Watched each test fail before implementing
291
+ - [ ] Each test failed for expected reason (feature missing, not typo)
292
+ - [ ] Wrote minimal code to pass each test
293
+ - [ ] All tests pass
294
+ - [ ] Output pristine (no errors, warnings)
295
+ - [ ] Tests use real code (mocks only if unavoidable)
296
+ - [ ] Edge cases and errors covered
297
+
298
+ Can't check all boxes? You skipped TDD. Start over.
299
+
300
+ ## When Stuck
301
+
302
+ | Problem | Solution |
303
+ |---------|----------|
304
+ | Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
305
+ | Test too complicated | Design too complicated. Simplify interface. |
306
+ | Must mock everything | Code too coupled. Use dependency injection. |
307
+ | Test setup huge | Extract helpers. Still complex? Simplify design. |
308
+
309
+ ## Debugging Integration
310
+
311
+ Bug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.
312
+
313
+ Never fix bugs without a test.
314
+
315
+ ## Final Rule
316
+
317
+ ```
318
+ Production code → test exists and failed first
319
+ Otherwise → not TDD
320
+ ```
321
+
322
+ No exceptions without your human partner's permission.
@@ -0,0 +1,198 @@
1
+ # Writing Good Tests
2
+
3
+ **Load this reference when:** writing or changing tests, adding mocks, or
4
+ adding cleanup/helper methods for tests.
5
+
6
+ ## Overview
7
+
8
+ A test exists to catch a specific break. Two principles govern everything
9
+ here:
10
+
11
+ ```
12
+ 1. Every test names the break it catches
13
+ 2. Every test exercises the real thing
14
+ ```
15
+
16
+ Strict TDD produces both naturally: a test written first and watched
17
+ failing against real code has already proven it can fail, and only earns
18
+ a mock when the real dependency proves slow or external.
19
+
20
+ ## Principle 1: Name the Break
21
+
22
+ Before writing the test body, answer: **what production change should
23
+ make this test fail — and is that change a bug or a decision?** A test
24
+ earns its place by catching a wrong branch, missing side effect, wrong
25
+ argument, boundary case, or broken contract.
26
+
27
+ **Derive expectations independently.** Use literals and hand-checked
28
+ fixtures; table-driven tests with literal `want` values are the preferred
29
+ shape. An expectation computed by the code under test — or its helpers —
30
+ passes no matter what that code does:
31
+
32
+ ```typescript
33
+ // ❌ Mirror assertion: the same builder computes both sides — always true
34
+ const expected = buildSearchQuery({ tag: 'urgent' });
35
+ expect(buildSearchQuery({ tag: 'urgent' })).toBe(expected);
36
+
37
+ // ✅ Hand-derived literal
38
+ expect(buildSearchQuery({ tag: 'urgent' })).toBe('tag:"urgent"');
39
+ ```
40
+
41
+ **No change detectors.** If only intentional decisions can fail a test —
42
+ a constant's value, exact message wording, private structure — it fires
43
+ on redesign and sleeps through bugs. Test the behavior that depends on
44
+ the decision: not `expect(MAX_RETRIES).toBe(5)` but "a failing call is
45
+ retried 5 times and the 6th attempt never happens."
46
+
47
+ **Behavior, not text.** Asserting that a script, skill, or config
48
+ contains an exact line proves only that the source is the source. Run
49
+ scripts against controlled inputs and assert outputs, side effects, or
50
+ exit codes. Documents that instruct agents are tested by the consuming
51
+ agent's behavior; prose for humans earns no
52
+ test at all.
53
+
54
+ **Your code, not the framework.** Test the contract your code makes at
55
+ its boundaries — the route you register, the query you emit, the payload
56
+ you produce. Upstream mechanics are their maintainers' tests to write
57
+ (the classic: asserting your router invokes a registered handler — that
58
+ is the framework's test, not yours). When upstream behavior genuinely
59
+ surprised you, write one narrow characterization test naming the
60
+ assumption. The same boundary applies inside your code: constructors,
61
+ getters, constants, and trivial forwarding earn tests only when they
62
+ validate, normalize, default, derive, enforce, or cause side effects —
63
+ otherwise assert the first consumer-visible result that depends on them.
64
+
65
+ ### Gate Function
66
+
67
+ ```
68
+ BEFORE writing the test body:
69
+ Name the production change that would make this test fail.
70
+
71
+ Cannot name one → redesign around an observable behavior
72
+ "The source text changed" → run the artifact and assert its effects
73
+ Only intentional decisions → change detector; test the behavior
74
+ that depends on the decision
75
+
76
+ Confirm the expected value is derived without the code under test.
77
+ IF it reuses the code's logic or helpers:
78
+ Replace it with a literal or hand-checked fixture
79
+ ```
80
+
81
+ ## Principle 2: Exercise the Real Thing
82
+
83
+ **The mock earns no assertions.** A mock assertion passes when the mock
84
+ is present and fails when it is absent — it says nothing about the
85
+ component. Assert the real component's behavior; if the mock is what you
86
+ are checking, unmock it or delete the assertion.
87
+
88
+ ```typescript
89
+ // ✅ Real behavior
90
+ expect(screen.getByRole('navigation')).toBeInTheDocument();
91
+
92
+ // ❌ Mock existence
93
+ expect(screen.getByTestId('sidebar-mock')).toBeInTheDocument();
94
+ ```
95
+
96
+ **your human partner's correction:** "Are we testing the behavior of a
97
+ mock?"
98
+
99
+ **Mock at the right level.** Learn every side effect of the real method
100
+ before replacing it; mock the slow or external operation and keep what
101
+ the test depends on real. When unsure, run the test against the real
102
+ implementation first and observe what actually needs to happen.
103
+
104
+ ```typescript
105
+ // ❌ The mock swallows the config write that duplicate detection reads
106
+ vi.mock('ToolCatalog', () => ({
107
+ discoverAndCacheTools: vi.fn().mockResolvedValue(undefined)
108
+ }));
109
+
110
+ // ✅ Mock only the slow server startup; the config write stays real
111
+ vi.mock('MCPServerManager');
112
+ ```
113
+
114
+ **Make doubles specific.** When arguments, call counts, or ordering are
115
+ part of the contract, assert them — a fake that accepts anything verifies
116
+ nothing. Give each branch (success, error, malformed) its own fixture or
117
+ spy, so the wrong branch cannot satisfy the expectation.
118
+
119
+ **Mirror real data completely.** Mock the complete structure as it exists
120
+ in reality — all documented fields — not just the ones your test reads.
121
+ Partial mocks fail silently when downstream code reads an omitted field:
122
+ the test passes while integration breaks.
123
+
124
+ **Production classes carry production methods only.** Cleanup that only
125
+ tests need lives in test utilities, never as a `destroy()` on the
126
+ production class. Ask: is this method called only from tests? Does this
127
+ class own this resource's lifecycle? Wrong answers → test utility.
128
+
129
+ **Prefer real components over complex mocks.** When mock setup outgrows
130
+ the test logic, mocks miss methods the real components have, or tests
131
+ break when the mock changes, switch to an integration test with real
132
+ components. **your human partner's question:** "Do we need to be using a
133
+ mock here?"
134
+
135
+ ### Gate Function
136
+
137
+ ```
138
+ BEFORE adding a mock or test helper:
139
+ List the real method's side effects; keep the ones the test
140
+ depends on real — mock the slow/external level below them.
141
+
142
+ Mock responses mirror the complete real structure.
143
+
144
+ A method only tests call lives in test utilities, not production.
145
+
146
+ About to assert on the mock itself?
147
+ Unmock it or delete the assertion.
148
+ ```
149
+
150
+ ## Tests Ship With the Implementation
151
+
152
+ The TDD cycle — failing test, minimal implementation, refactor — is what
153
+ "complete" means. Ship the tests the behavior needs and only those:
154
+ trivial code and human prose earn none, and a test written to satisfy
155
+ process costs maintenance forever.
156
+
157
+ ## The Mutation Check
158
+
159
+ Before finishing, mentally mutate the production code; at least one test
160
+ should fail for each realistic mutation:
161
+
162
+ - Wrong constant or argument
163
+ - Wrong branch handler
164
+ - Missing state change or side effect
165
+ - Empty or default return
166
+ - Missing validation for zero, empty, nil, unauthorized, or malformed input
167
+
168
+ A mutation nothing catches marks the behavior as unprotected — or the
169
+ test as tautological.
170
+
171
+ ## Quick Reference
172
+
173
+ | When you... | Do |
174
+ |-------------|-----|
175
+ | Write any test | Name the break it catches — a bug, not a decision |
176
+ | Build an expected value | Derive it by hand; never with the code under test |
177
+ | Test a script or document | Run it / pressure-test its consumer; never grep its text |
178
+ | Reach for a dependency test | Test your boundary contract, not their documented mechanics |
179
+ | Want to assert on a mocked element | Test the real component, or unmock it |
180
+ | Are about to mock a method | Learn its side effects; mock the slow/external level |
181
+ | Build a mock response | Mirror the real structure completely |
182
+ | Need cleanup only tests use | Put it in test utilities |
183
+ | Watch mock setup balloon | Switch to an integration test with real components |
184
+ | Finish a test file | Run the mutation check |
185
+
186
+ ## Warning Signs
187
+
188
+ - Setup and assertion share the same object, guaranteeing equality
189
+ - The test can fail only through a panic, crash, or missing selector
190
+ - The test fails on every intentional change, never on accidental breakage
191
+ - Expected values are hidden behind loops, builders, or helpers
192
+ - The test greps source text, or asserts a removed symbol stays removed
193
+ - The test would still matter if only the framework remained
194
+ - The test exists for coverage, checking no side effect or outcome
195
+ - An assertion checks a `*-mock` test ID, or fails if you remove the mock
196
+ - A method is called only from test files
197
+ - Mock setup is more than half the test, or you can't explain why the mock is needed
198
+ - Mocking "just to be safe"
@@ -0,0 +1,124 @@
1
+ ---
2
+ name: pitroom-verification
3
+ description: Use when you want evidence before claiming work is complete, fixed or passing, or before committing or opening a PR - run the checks and read their output first, including for claims a worker made.
4
+ ---
5
+
6
+ # Verification Before Completion
7
+
8
+ ## Overview
9
+
10
+ **Core principle:** Evidence before claims, always.
11
+
12
+ **Violating the letter of this rule is violating the spirit of this rule.**
13
+
14
+ ## The Iron Law
15
+
16
+ ```
17
+ NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
18
+ ```
19
+
20
+ If you haven't run the verification command in this message, you cannot claim it passes.
21
+
22
+ ## The Gate Function
23
+
24
+ ```
25
+ BEFORE claiming any status or expressing satisfaction:
26
+
27
+ 1. IDENTIFY: What command proves this claim?
28
+ 2. RUN: Execute the FULL command (fresh, complete)
29
+ 3. READ: Full output, check exit code, count failures
30
+ 4. VERIFY: Does output confirm the claim?
31
+ - If NO: State actual status with evidence
32
+ - If YES: State claim WITH evidence
33
+ 5. ONLY THEN: Make the claim
34
+
35
+ Skip any step = lying, not verifying
36
+ ```
37
+
38
+ ## Common Failures
39
+
40
+ | Claim | Requires | Not Sufficient |
41
+ |-------|----------|----------------|
42
+ | Tests pass | Test command output: 0 failures | Previous run, "should pass" |
43
+ | Linter clean | Linter output: 0 errors | Partial check, extrapolation |
44
+ | Build succeeds | Build command: exit 0 | Linter passing, logs look good |
45
+ | Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
46
+ | Regression test works | Red-green cycle verified | Test passes once |
47
+ | Agent completed | VCS diff shows changes | Agent reports "success" |
48
+ | Requirements met | Line-by-line checklist | Tests passing |
49
+
50
+ ## Red Flags - STOP
51
+
52
+ - Using "should", "probably", "seems to"
53
+ - Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
54
+ - About to commit/push/PR without verification
55
+ - Trusting agent success reports
56
+ - Relying on partial verification
57
+ - Thinking "just this once"
58
+ - Tired and wanting work over
59
+ - **ANY wording implying success without having run verification**
60
+
61
+ ## Rationalization Prevention
62
+
63
+ | Excuse | Reality |
64
+ |--------|---------|
65
+ | "Should work now" | RUN the verification |
66
+ | "I'm confident" | Confidence ≠ evidence |
67
+ | "Just this once" | No exceptions |
68
+ | "Linter passed" | Linter ≠ compiler |
69
+ | "Agent said success" | Verify independently |
70
+ | "I'm tired" | Exhaustion ≠ excuse |
71
+ | "Partial check is enough" | Partial proves nothing |
72
+ | "Different words so rule doesn't apply" | Spirit over letter |
73
+
74
+ ## Key Patterns
75
+
76
+ **Tests:**
77
+ ```
78
+ ✅ [Run test command] [See: 34/34 pass] "All tests pass"
79
+ ❌ "Should pass now" / "Looks correct"
80
+ ```
81
+
82
+ **Regression tests (TDD Red-Green):**
83
+ ```
84
+ ✅ Write → Run (pass) → Revert fix → Run (MUST FAIL) → Restore → Run (pass)
85
+ ❌ "I've written a regression test" (without red-green verification)
86
+ ```
87
+
88
+ **Build:**
89
+ ```
90
+ ✅ [Run build] [See: exit 0] "Build passes"
91
+ ❌ "Linter passed" (linter doesn't check compilation)
92
+ ```
93
+
94
+ **Requirements:**
95
+ ```
96
+ ✅ Re-read plan → Create checklist → Verify each → Report gaps or completion
97
+ ❌ "Tests pass, phase complete"
98
+ ```
99
+
100
+ **Agent delegation:**
101
+ ```
102
+ ✅ Agent reports success → Check VCS diff → Verify changes → Report actual state
103
+ ❌ Trust agent report
104
+ ```
105
+
106
+ ## Worker reports are claims
107
+
108
+ A Pitroom worker's "tests pass", `verify: ✔ passed` in an isolated copy, or a reviewer's approval is evidence about that copy at that moment, not about your tree now. After `pitroom apply`, run the verification yourself on your tree before you say anything is done, fixed or passing.
109
+
110
+ ## When To Apply
111
+
112
+ **ALWAYS before:**
113
+ - ANY variation of success/completion claims
114
+ - ANY expression of satisfaction
115
+ - ANY positive statement about work state
116
+ - Committing, PR creation, task completion
117
+ - Moving to next task
118
+ - Delegating to agents
119
+
120
+ **Rule applies to:**
121
+ - Exact phrases
122
+ - Paraphrases and synonyms
123
+ - Implications of success
124
+ - ANY communication suggesting completion/correctness