No slash command · from deniz-process
Use when implementing any feature or bugfix, before writing implementation code — the red-green loop, the seam to test at, and one slice at a time
Ships in deniz-process. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write the test first. Watch it fail. Write minimal code to pass.
Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.
Two things decide whether the loop produces tests worth keeping, and neither is the loop itself: where you test — the seam — and how much you take per cycle — one slice.
Violating the letter of the rules is violating the spirit of the rules.
Always:
Exceptions (state the one that applies in one line; do not ask):
Thinking "skip TDD just this once"? Stop. That's rationalization.
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over.
No exceptions:
Implement fresh from tests. Period.
A seam is the public boundary you observe behavior at without reaching inside: the interface a caller actually uses. Tests live at seams, never against internals. Code can change entirely; a test written at a seam shouldn't. It reads like a specification — "user can checkout with valid cart" names a capability — and survives refactors because it doesn't care about internal structure.
Name the seam before writing the test. Every cycle, say which boundary this test observes. If you cannot name one, you are about to test an internal, and the test will break on the next refactor while sleeping through real bugs.
Put the seam to your human partner when the choice is consequential — several boundaries would work, the obvious one is expensive or slow, or testing there would drive a design change. You can't test everything; agreeing the seams is how effort lands on critical paths and complex logic instead of on every edge case. Ask: "What's the public interface, and which seams should we test?" Give each proposed seam a one-line note on what it catches and what it misses.
A too-shallow seam gives false confidence: it exercises a stand-in rather than the pattern as it occurs at the call site. If no correct seam exists, that itself is a finding — the architecture is preventing the behavior from being locked down. Say so rather than testing an internal instead.
One seam, one test, one minimal implementation per cycle. Each test is a tracer bullet: it responds to what the last cycle taught you.
Never write all the tests first, then all the implementation. Bulk tests verify imagined behavior — you test the shape of things rather than what a caller experiences, the tests go insensitive to real changes, and you commit to a test structure before understanding the implementation you are about to write.
digraph tdd_cycle {
rankdir=LR;
seam [label="SEAM\nName the boundary", shape=box, style=filled, fillcolor="#ffe0b2"];
red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
verify_red [label="Verify fails\ncorrectly", shape=diamond];
green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
verify_green [label="Verify passes\nAll green", shape=diamond];
refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
next [label="Next slice", shape=ellipse];
seam -> red;
red -> verify_red;
verify_red -> green [label="yes"];
verify_red -> red [label="wrong\nfailure"];
green -> verify_green;
verify_green -> refactor [label="yes"];
verify_green -> green [label="no"];
refactor -> verify_green [label="stay\ngreen"];
verify_green -> next;
next -> seam;
}
Write one minimal test showing what should happen, at the seam you just named.
```typescript test('retries failed operations 3 times', async () => { let attempts = 0; const operation = () => { attempts++; if (attempts < 3) throw new Error('fail'); return 'success'; };const result = await retryOperation(operation);
expect(result).toBe('success'); expect(attempts).toBe(3); });
Clear name, tests real behavior, one thing
</Good>
<Bad>
```typescript
test('retry works', async () => {
const mock = jest.fn()
.mockRejectedValueOnce(new Error())
.mockRejectedValueOnce(new Error())
.mockResolvedValueOnce('success');
await retryOperation(mock);
expect(mock).toHaveBeenCalledTimes(3);
});
Vague name, tests mock not code
Requirements:
MANDATORY. Never skip.
npm test path/to/test.test.ts
Confirm:
Test passes? You're testing existing behavior. Fix test.
Test errors? Fix error, re-run until it fails correctly.
Write simplest code to pass the test.
```typescript async function retryOperation(fn: () => Promise): Promise { for (let i = 0; i < 3; i++) { try { return await fn(); } catch (e) { if (i === 2) throw e; } } throw new Error('unreachable'); } ``` Just enough to pass ```typescript async function retryOperation( fn: () => Promise, options?: { maxRetries?: number; backoff?: 'linear' | 'exponential'; onRetry?: (attempt: number) => void; } ): Promise { // YAGNI } ``` Over-engineeredDon't add features, refactor other code, or "improve" beyond the test.
MANDATORY.
npm test path/to/test.test.ts
Confirm:
Test fails? Fix code, not test.
Other tests fail? Fix now.
"Other tests" means the project's suite, not just your file. A
green run of the test you wrote is not a green suite. Before you call
the change done, run the project's test command (bare pytest,
npm test, cargo test — whatever the repo uses) even when your task
named only one test file. A scope statement in your task bounds the
deliverable, not your verification. Any failure that run shows —
including one you didn't cause — goes in your report by name; a red
test you watched scroll past and didn't mention is a report falsified
by omission.
After green only, and only what this slice touched:
Keep tests green. Don't add behavior.
Structural work is not part of this step. Reshaping a module, moving a boundary, splitting a class that grew wrong — that is review's judgement, not the loop's, and doing it here quietly turns one slice into an unreviewable change. Note it and take it to the deniz-process:requesting-code-review skill.
Next seam, next failing test, next slice.
| Quality | Good | Bad |
|---|---|---|
| Minimal | One thing. "and" in name? Split it. | test('validates email and domain and whitespace') |
| Clear | Name describes behavior | test('test1') |
| Shows intent | Demonstrates desired API | Obscures what code should do |
| At a seam | Public interface, survives refactors | Private methods, internal collaborators, call counts |
When writing or changing any test, read writing-good-tests.md for the rules that keep tests honest:
| Excuse | Reality |
|---|---|
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
| "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. |
| "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. |
| "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. |
| "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. |
| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
| "Need to explore first" | Fine. Throw away exploration, start with TDD. |
| "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
| "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. |
| "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
| "Existing code has no tests" | You're improving it. Add tests for existing code. |
| "I'll write all the tests, then implement" | Bulk tests verify imagined behavior. One slice at a time. |
| "No clean seam, I'll test the internal instead" | The missing seam is the finding. Say so; don't bury it in a brittle test. |
All of these mean: Delete code. Start over with TDD.
Bug: Empty email accepted
SEAM — the form submission interface callers use, not the validator inside it.
RED
test('rejects empty email', async () => {
const result = await submitForm({ email: '' });
expect(result.error).toBe('Email required');
});
Verify RED
$ npm test
FAIL: expected 'Email required', got undefined
GREEN
function submitForm(data: FormData) {
if (!data.email?.trim()) {
return { error: 'Email required' };
}
// ...
}
Verify GREEN
$ npm test
PASS
REFACTOR Extract validation for multiple fields if needed — inside this slice only.
Before marking work complete:
Can't check all boxes? You skipped TDD. Start over.
| Problem | Solution |
|---|---|
| Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
| Can't find a seam | Say so — it is a finding about the design, not a reason to test an internal. |
| Test too complicated | Design too complicated. Simplify interface. |
| Must mock everything | Code too coupled. Use dependency injection. |
| Test setup huge | Extract helpers. Still complex? Simplify design. |
Bug found? Don't start here — start with the deniz-process:systematic-debugging skill, which builds the red signal first and finds the root cause. It comes back to this skill for the regression test, at a seam that exercises the real bug pattern. Never fix bugs without a test.
Production code → test exists and failed first
Otherwise → not TDD
No other exceptions without your human partner's word.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub blind-striker/agent-skills-and-plugins --plugin deniz-process45 skills in this plugin
/asd-ste100Use when English text must be parsed without a human to resolve ambiguity — tool descriptions, error messages, inter-agent instructions, system prompts, status reports — and misreading has a real cost, or when text reads as dense, hedged, or easy to misparse. Triggers: disambiguate, STE100 rewrite, apply Simplified Technical English, plain-language rewrite, controlled-language rewrite, rewrite so an agent cannot misread this. Not for creative or marketing copy./ask-denizUse when unsure which skill or ceremony fits, or when asked which to use, across installed deniz Modules: process workflows, .NET, Aspire, and Akka. Manual ceremonies stay user-started./brainstormingOther plugins' skills for the same job