test
Skill96 starsChanged 7 months agoMITView on GitHub
TDD test writer. Use before implementing any feature or fix (write the failing test first), when the user asks to 'write tests', or when coverage is missing. Writes failing tests FIRST (red), then verifies they pass after implementation (green). Covers unit, integration, and e2e tests.
189 other projects use a version of this.
Adopted by
Most recently taken up by
- RoboFinSystems/robosystemstheir own version, first seen Nov 30, 2026
- yamanidev/claude-code-configurationtheir own version, first seen Nov 29, 2026
- DGouron/review-flowtheir own version, first seen Nov 29, 2026
- Kirill-Chistov/igcse-revision-kittheir own version, first seen Nov 29, 2026
- klntsky/icaretheir own version, first seen Nov 29, 2026
- crbnos/carbontheir own version, first seen Nov 29, 2026
Used with
Projects with it also use agent-context-isolation, agentica-infrastructure and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
parcadeiSkillagent-context-isolation
Agent Context Isolation
Also in 3 projects that use this
parcadeiSkillagentica-infrastructure
Reference guide for Agentica multi-agent infrastructure APIs
Also in 3 projects that use this
- +10 more from parcadei
Other versions189 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 189
- react/react★ 253ksame name
- facebook/react★ 253ksame name
- apache/skywalking★ 25ksame name
- livewire/livewire★ 24ksame name
- NVIDIA/TensorRT★ 13ksame name
- FalkorDB/FalkorDB★ 11ksame name
- FastLED/FastLED★ 7.5ksame name
- fleetdm/fleet★ 7.3ksame name
- parcadei/Continuous-Claude★ 3.9ksame name
- parcadei/Continuous-Claude-v2★ 3.9ksame name
179 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- llms.txtllms.txt
- adversarySkill
- asset-creatorSkill
- auditSkill
- autopsySkill
- baSkill
- brainstormSkill
- browser-pilotSkill
- completion-gateSkill
- constraint-checkSkill
- context-engineSkill
- context-packSkill
- convergeSkill
- cookSkill
- councilSkill
- dbSkill
- debugSkill
- dependency-doctorSkill
- deploySkill
- designSkill
- diagramSkill
- doc-processorSkill
- docs-seekerSkill
- docsSkill
- fixSkill
- gitSkill
- graftSkill
- hallucination-guardSkill
- improve-architectureSkill
- incidentSkill
- integrity-checkSkill
- journalSkill
- launchSkill
- logic-guardianSkill
- marketingSkill
- mcp-builderSkill
- neural-memorySkill
- onboardSkill
- perfSkill
- planSkill
- preflightSkill
- problem-solverSkill
- quarantineSkill
- rescueSkill
- researchSkill
- retroSkill
- review-intakeSkill
- reviewSkill
- safeguardSkill
- sastSkill
- scaffoldSkill
- scope-guardSkill
- scoutSkill
- sentinel-envSkill
- sentinelSkill
- sequential-thinkingSkill
- session-bridgeSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
61 rules. 0 are common, 37 are distinctive, and 24 are very specific to this project.
0
Common
Most of the 164 edited versions we read keep these.
37
Distinctive
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
If tests pass without implementation → the tests are wrong.
- Distinctive: line 23
Do NOT keep it as "reference"
- Distinctive: line 24
Do NOT "adapt" it while writing tests
- Distinctive: line 25
Do NOT look at it to "inform" test design
- Very specific: line 26
Delete means delete. git checkout -- <file> or remove the changes entirely.
- Distinctive: line 30
Do NOT "quickly fix" a broken import in source to make tests run
- Distinctive: line 31
Do NOT refactor source code to be "more testable"
- Distinctive: line 32
Do NOT add missing exports to source files
- Very specific: line 33
If source needs changes → hand off to rune:fix.
- Distinctive: line 38
After each GREEN, bulk_test_count resets to 0.
- Distinctive: line 51
Read the implementation plan or task description carefully
- Very specific: line 52
Use Glob to find existing test files: /*.test.*, /*.spec.*, /test_*
- Very specific: line 53
Use Read on 2-3 existing test files to understand:
- Distinctive: line 54
Test framework in use
- Very specific: line 56
Test directory structure (co-located vs __tests__/ vs tests/)
- Very specific: line 58
Use Glob to find the source file(s) being tested
- Very specific: line 72
Use Glob to find config files and identify the framework:
- Very specific: line 77
Async check: If pytest detected AND source files contain async def:
- Very specific: line 78
Check if pytest-asyncio is in dependencies (pyproject.toml [project.dependencies] or [project.optional-dependencies])
- Very specific: line 79
Check if asyncio_mode is set in [tool.pytest.ini_options] (values: auto, strict, or absent)
- Very specific: line 80
If async code exists but no asyncio_mode configured → WARN: "pytest-asyncio not configured.
- Very specific: line 90
Use Write to create test files following the detected conventions:
- Distinctive: line 101
Use proper assertions. Do NOT use implementation details — test behavior:
- Distinctive: line 115
Before running the new test in Phase 4, count what's about to be added to the working tree:
- Distinctive: line 139
When the violation fires, do NOT delete tests automatically — surface to the calling agent: "horizontal slicing detected (N tests before …
- Very specific: line 143
Use Bash to run ONLY the newly created test files (not full suite):
- Distinctive: line 151
Hard gate: ALL new tests MUST fail at this point.
- Distinctive: line 153
If ANY test passes before implementation exists → that test is not testing real behavior.
- Distinctive: line 154
If tests fail with import/syntax errors (not assertion errors) → fix the test code, re-run
- Very specific: line 158
After rune:fix writes implementation code, run the same test command again:
- Distinctive: line 160
ALL tests in the new test files MUST pass
- Very specific: line 161
Run the full test suite with Bash to check for regressions:
- Distinctive: line 163
If any test fails: report clearly which test, what was expected, what was received
- Very specific: line 164
If an existing test now fails (regression): escalate to rune:debug
- Very specific: line 170
After GREEN phase, call verification to check coverage threshold (80% minimum):
- Distinctive: line 172
If coverage drops below 80%: identify uncovered lines, write additional tests
- Very specific: line 177
When invoked with mode: "diff-aware" or by cook after implementation:
- Distinctive: line 179
Run git diff main --name-only to get changed files
- Very specific: line 207
If test framework not found: ask calling skill to specify, or check package.json devDependencies
- Very specific: line 208
If Write to test file fails: check if directory exists, create it first with Bash mkdir -p
- Distinctive: line 209
If tests error on import (module not found): check that source file path is correct, adjust imports
- Very specific: line 210
If Bash test runner hangs beyond 120 seconds: kill and report as TIMEOUT
- Distinctive: line 284
If you catch yourself with ANY of these, delete implementation code and restart with tests:
- Distinctive: line 297
MUST write tests BEFORE implementation code — if tests pass without implementation, they are wrong
- Distinctive: line 298
MUST cover happy path + edge cases + error cases — not just happy path
- Distinctive: line 299
MUST run tests to verify they FAIL before implementation exists (RED phase is mandatory)
- Distinctive: line 300
MUST NOT write tests that test mock behavior instead of real code behavior
- Distinctive: line 301
MUST achieve 80% coverage minimum — identify and fill gaps
- Distinctive: line 302
MUST use the project's existing test framework and conventions — don't introduce a new one
- Distinctive: line 303
MUST NOT say "tests pass" without showing actual test runner output
- Distinctive: line 304
MUST delete implementation code written before tests — Iron Law, no exceptions
- Distinctive: line 305
MUST show RED phase output (actual failure) — "I confirmed they fail" without output is REJECTED
- Very specific: line 306
MUST NOT modify source/implementation files — test writes test files ONLY, hand off source changes to rune:fix
- Distinctive: line 307
MUST NOT write a 2nd test until the 1st test reaches GREEN — vertical slicing only, bulk_test_count <= 1 enforced
- Very specific: line 308
MUST emit commit pair per cycle (test: then feat:) — git log is the audit trail for "I did TDD" claims
- Distinctive: line 416
Test framework detected from project config files
- Distinctive: line 418
All new tests FAIL (RED phase — actual failure output shown)
- Distinctive: line 419
After implementation: all tests PASS (GREEN phase — actual pass output shown)
- Distinctive: line 421
Test Report emitted with framework, test count, RED/GREEN status, and coverage
- Very specific: line 424
Test names use behavior-words (accepts/rejects/produces/...) not shape-words (returns/has property/is defined)
- Distinctive: line 430
Scope guardrail: Do not modify source or implementation files to make tests pass unless explicitly delegated by the parent agent.
“Common” is measured: kept by at least 6 in 10 of the 164 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
test
<HARD-GATE>
Tests define the EXPECTED BEHAVIOR. They MUST be written BEFORE implementation code.
If tests pass without implementation → the tests are wrong. Rewrite them.
The only exception: when retrofitting tests for existing untested code.THE IRON LAW: Write code before test? DELETE IT. Start over.
- Do NOT keep it as "reference"
- Do NOT "adapt" it while writing tests
- Do NOT look at it to "inform" test design
- Delete means delete.
git checkout -- <file>or remove the changes entirely. This is not negotiable. This is not optional. "But I already wrote it" is a sunk cost fallacy.
ROLE BOUNDARY: Test writes TEST FILES only. NEVER modify source/implementation files.
- Do NOT "quickly fix" a broken import in source to make tests run
- Do NOT refactor source code to be "more testable"
- Do NOT add missing exports to source files
- If source needs changes → hand off to
rune:fix. Test's job ends at the test file. This separation ensures test never writes code biased toward passing its own tests.
VERTICAL SLICING (Iron Law extension): one test → GREEN → one test → GREEN. Never bulk.
- bulk_test_count MUST stay <= 1 before the first GREEN in a session
- After each GREEN, bulk_test_count resets to 0; writing 2+ tests before the next GREEN = HORIZONTAL VIOLATION
- Each cycle MUST emit a commit pair:
test(scope): <behavior>+feat(scope): <behavior> - Claim "I did TDD" is verified by
completion-gateagainstgit log --oneline— no paired commits = REJECTED - Horizontal slicing produces tests-of-imagination, not tests-of-behavior. See references/vertical-tdd.md.
- Emit signal
tdd.horizontal.violationwhen triggered; preflight blocks merge until cycles are unwound. Exceptions (narrow, must be documented in test header): retrofitting characterization tests for legacy untested code; spec-driven scaffolding where the contract is external (OpenAPI, wire protocol). Characterization tests go undertests/char/and stay frozen after safeguard; holdout tests go undertests/holdout/and are not authored by the implementer. See references/test-integrity-gate.md.</HARD-GATE>
Instructions
Phase 1: Understand What to Test
- Read the implementation plan or task description carefully
- Use
Globto find existing test files:**/*.test.*,**/*.spec.*,**/test_* - Use
Readon 2-3 existing test files to understand:- Test framework in use
- File naming convention (e.g.,
foo.test.tsmirrorsfoo.ts) - Test directory structure (co-located vs
__tests__/vstests/) - Assertion style and patterns
- Use
Globto find the source file(s) being tested
TodoWrite: [
{ content: "Understand scope and find existing test patterns", status: "in_progress" },
{ content: "Detect test framework and conventions", status: "pending" },
{ content: "Write failing tests (RED phase)", status: "pending" },
{ content: "Run tests — verify they FAIL", status: "pending" },
{ content: "After implementation: verify tests PASS (GREEN phase)", status: "pending" }
]Phase 2: Detect Test Framework
Use Glob to find config files and identify the framework:
jest.config.*or"jest"key inpackage.json→ Jestvitest.config.*or"vitest"key inpackage.json→ Vitestpytest.ini,[tool.pytest.ini_options]inpyproject.toml→ pytest- Async check: If pytest detected AND source files contain
async def:- Check if
pytest-asynciois in dependencies (pyproject.toml [project.dependencies]or[project.optional-dependencies]) - Check if
asyncio_modeis set in[tool.pytest.ini_options](values:auto,strict, or absent) - If async code exists but no
asyncio_modeconfigured → WARN: "pytest-asyncio not configured. Async tests may silently pass without executing async code. Recommend addingasyncio_mode = \"auto\"to[tool.pytest.ini_options]in pyproject.toml."
- Check if
- Async check: If pytest detected AND source files contain
Cargo.tomlwith#[cfg(test)]pattern → built-incargo test*_test.gofiles present → built-ingo testcypress.config.*→ Cypress (E2E)playwright.config.*→ Playwright (E2E)
Verification gate: Framework identified before writing any test code.
Phase 3: Write Failing Tests
Use Write to create test files following the detected conventions:
- Mirror source file location: if source is
src/auth/login.ts, test issrc/auth/login.test.ts - Structure tests with clear
describe/itblocks (or language equivalent):describe('Feature name')it('should [expected behavior] when [condition]')
- Cover all three categories:
- Happy path: valid inputs, expected success output
- Edge cases: empty input, boundary values, large input
- Error cases: invalid input, missing data, network failure simulation
- Use proper assertions. Do NOT use implementation details — test behavior:
- Jest/Vitest:
expect(result).toBe(expected) - pytest:
assert result == expected - Rust:
assert_eq!(result, expected) - Go:
if result != expected { t.Errorf(...) }
- Jest/Vitest:
- For async code: use
async/awaitor pytest@pytest.mark.asyncio
Python Async Tests (pytest-asyncio)
Full detail moved to
references/python-async.md(progressive disclosure). Read that file before executing this section.
Phase 3.5: Cycle Discipline (Vertical Slicing Gate)
Before running the new test in Phase 4, count what's about to be added to the working tree:
bulk_test_count = (test files staged + test files unstaged but new) since the last GREEN commitGate: bulk_test_count MUST be exactly 1.
| State | Action |
bulk_test_count == 1 | Proceed to Phase 4 (run RED). |
bulk_test_count >= 2 AND no prior GREEN this session | HORIZONTAL VIOLATION — pause, keep one test, defer the rest. |
bulk_test_count >= 2 AND last GREEN exists in git log | HORIZONTAL VIOLATION — same. |
bulk_test_count == 0 | No test to run; this phase is a no-op. |
Cycle audit log — append to TEST.md (or create) one line per cycle:
cycle 1 — RED: test_validates_email_rejects_empty | GREEN: validateEmail handles empty | commit: 4f3a1c
cycle 2 — RED: test_validates_email_requires_at_sign | GREEN: validateEmail checks @ | commit: a92e0dThe audit log is the receipt. completion-gate reads it.
When the violation fires, do NOT delete tests automatically — surface to the calling agent: "horizontal slicing detected (N tests before first GREEN). Recommend keeping test K, deferring N-1 to subsequent cycles."
Phase 4: Run Tests — Verify They FAIL (RED)
Use Bash to run ONLY the newly created test files (not full suite):
- Jest:
npx jest path/to/test.ts --no-coverage - Vitest:
npx vitest run path/to/test.ts - pytest:
pytest path/to/test_file.py -v(if async tests and noasyncio_modein config: add--asyncio-mode=auto) - Rust:
cargo test test_module_name - Go:
go test ./path/to/package/... -run TestFunctionName
Hard gate: ALL new tests MUST fail at this point.
- If ANY test passes before implementation exists → that test is not testing real behavior. Rewrite it to be stricter.
- If tests fail with import/syntax errors (not assertion errors) → fix the test code, re-run
Phase 5: After Implementation — Verify Tests PASS (GREEN)
After rune:fix writes implementation code, run the same test command again:
- ALL tests in the new test files MUST pass
- Run the full test suite with
Bashto check for regressions:npm test,pytest,cargo test,go test ./...
- If any test fails: report clearly which test, what was expected, what was received
- If an existing test now fails (regression): escalate to
rune:debug
Verification gate: 100% of new tests pass AND 0 regressions in existing tests.
Phase 6: Coverage Check
After GREEN phase, call verification to check coverage threshold (80% minimum):
- If coverage drops below 80%: identify uncovered lines, write additional tests
- Report coverage gaps with file:line references
Phase 6.5: Diff-Aware Mode (optional)
When invoked with mode: "diff-aware" or by cook after implementation:
- Run
git diff main --name-onlyto get changed files - For each changed file, trace its blast radius: what imports it? what routes does it serve? what components render it?
- Map changed files → affected routes/endpoints/pages
- Prioritize tests: files with most downstream dependents get tested first
- Generate targeted test commands that cover ONLY affected paths — skip unchanged modules
This mode is valuable for large codebases where running the full suite is slow. It answers: "what could this diff have broken?"
Input: git diff main --name-only
Output: Prioritized test plan targeting only affected pathsTest Types — 4-Layer Methodology
Full detail moved to
references/test-types.md(progressive disclosure). Read that file before executing this section.
TEST.md — Test Plan + Results Document
Full detail moved to
references/test-plan-doc.md(progressive disclosure). Read that file before executing this section.
Skill Behavior Tests (Eval Scenarios)
Full detail moved to
references/evals.md(progressive disclosure). Read that file before executing this section.
Error Recovery
- If test framework not found: ask calling skill to specify, or check
package.jsondevDependencies - If
Writeto test file fails: check if directory exists, create it first withBash mkdir -p - If tests error on import (module not found): check that source file path is correct, adjust imports
- If
Bashtest runner hangs beyond 120 seconds: kill and report as TIMEOUT
Called By (inbound)
cook(L1): Phase 3 TEST — write tests firstfix(L2): verify fix passes testsreview(L2): untested edge case found → write test for itdeploy(L2): pre-deployment full test suitepreflight(L2): run targeted regression tests on affected codesurgeon(L2): verify refactored codelaunch(L1): pre-deployment test suitesafeguard(L2): writing characterization tests for legacy codereview-intake(L2): write tests for issues identified during review intakescaffold(L1): generate initial test suite for new projectgraft(L2): write integration tests for grafted codeskill-forge(L2): write tests for new skill functionalitymcp-builder(L2): write tests for MCP server toolsdebug(L2): write regression test capturing the bugplan(L2): reference test requirements in implementation plan
Calls (outbound)
verification(L3): Phase 6 — coverage check (80% minimum threshold)browser-pilot(L3): Phase 4 — e2e and visual testing for UI flowsdebug(L2): Phase 5 — when existing test regresses unexpectedly
Data Flow
Feeds Into →
cook(L1): test results (pass/fail/coverage) → cook's Phase 5 quality gate evidencecompletion-gate(L3): test runner stdout → evidence for "tests pass" claimsfix(L2): failing test output → fix's target (what to make green)
Fed By ←
plan(L2): phase file test tasks → test's RED phase targets (what to test)review(L2): untested edge cases found during review → new test targetsfix(L2): implemented code → test's GREEN phase verification target
Feedback Loops ↻
test↔fix: test writes failing tests (RED) → fix implements to pass → test verifies (GREEN) → if new failures emerge, loop continuestest↔debug: test discovers regression → debug diagnoses root cause → test writes regression test to prevent recurrence
Anti-Rationalization Table
| Excuse | Reality |
| "Too simple to need tests first" | Simple code breaks. Test takes 30 seconds. Write it first. |
| "I'll write tests after — same result" | Tests-after = "what does this do?" Tests-first = "what SHOULD this do?" Completely different. |
| "I already wrote the code, let me just add tests" | Iron Law: delete the code. Start over with tests. Sunk cost is not an argument. |
| "Tests after achieve the same goals" | They don't. Tests-after are biased by the implementation you just wrote. |
| "It's about spirit not ritual" | Violating the letter IS violating the spirit. Write the test first. |
| "I mentally tested it" | Mental testing is not testing. Run the command, show the output. |
| "This is different because..." | It's not. Write the test first. |
| "I'll batch the tests since they're related" | Batched tests = tests of imagination. Each cycle reacts to the prior. Write one, GREEN it, then the next. |
| "All five tests are already written, let me just review them with you" | Same fallacy as code-before-test. Keep the first one, defer the others to subsequent cycles. |
Advanced: Oracle-Injection E2E Testing
Full detail moved to
references/oracle-e2e.md(progressive disclosure). Read that file before executing this section.
Spec→Test Traceability
Full detail moved to
references/traceability.md(progressive disclosure). Read that file before executing this section.
Eval-Driven Development
Full detail moved to
references/evals.md(progressive disclosure). Read that file before executing this section.
Red Flags — STOP and Start Over
If you catch yourself with ANY of these, delete implementation code and restart with tests:
- Code exists before test file
- "I already manually tested it"
- "Tests after achieve the same purpose"
- "It's about spirit not ritual"
- "This is different because..."
- "Let me just finish this, then add tests"
All of these mean: Delete code. Start over with TDD.
Constraints
- MUST write tests BEFORE implementation code — if tests pass without implementation, they are wrong
- MUST cover happy path + edge cases + error cases — not just happy path
- MUST run tests to verify they FAIL before implementation exists (RED phase is mandatory)
- MUST NOT write tests that test mock behavior instead of real code behavior
- MUST achieve 80% coverage minimum — identify and fill gaps
- MUST use the project's existing test framework and conventions — don't introduce a new one
- MUST NOT say "tests pass" without showing actual test runner output
- MUST delete implementation code written before tests — Iron Law, no exceptions
- MUST show RED phase output (actual failure) — "I confirmed they fail" without output is REJECTED
- MUST NOT modify source/implementation files — test writes test files ONLY, hand off source changes to rune:fix
- MUST NOT write a 2nd test until the 1st test reaches GREEN — vertical slicing only, bulk_test_count <= 1 enforced
- MUST emit commit pair per cycle (
test:thenfeat:) — git log is the audit trail for "I did TDD" claims
Mesh Gates
| Gate | Requires | If Missing |
| RED Gate | All new tests FAIL before implementation | If any pass, rewrite stricter tests |
| GREEN Gate | All tests PASS after implementation | Fix code, not tests |
| Coverage Gate | 80%+ coverage verified via verification | Write additional tests for gaps |
| Integrity Gate | rune verify --integrity (also preflight / sentinel hooks) is clean, or an auditable override is present | Do not weaken, skip, or retarget tests to get green — see references/test-integrity-gate.md |
Output Format
## Test Report
- **Framework**: [detected]
- **Files Created**: [list of new test file paths]
- **Tests Written**: [count]
- **Status**: RED (failing as expected) | GREEN (all passing)
### Test Cases
| Test | Status | Description |
|------|--------|-------------|
| `test_name` | FAIL/PASS | [what it tests] |
### Coverage
- Lines: [X]% | Branches: [Y]%
- Gaps: `path/to/file.ts:42-58` — uncovered branch (error handling)
### Regressions (if any)
- [existing test that broke, with error details]Testing Anti-Patterns (Gate Functions)
Full detail moved to
references/testing-anti-patterns.md(progressive disclosure). Read that file before executing this section.
Returns
| Artifact | Format | Location |
| Test files | Source files | Co-located or __tests__/ per project convention |
| Test plan + results | Markdown | TEST.md in test directory (non-trivial features only) |
| Eval scenarios | Markdown | skills/<name>/evals.md (for skill behavior testing) |
| Coverage report | Inline stdout | Shown in Test Report |
| Test Report | Markdown (inline) | Emitted to calling skill (cook, fix, review) |
Chain Metadata
Append to Test Report when invoked standalone. Suppress when called as sub-skill inside an L1 orchestrator (cook, team, etc.) — the orchestrator emits a consolidated block. See docs/references/chain-metadata.md.
chain_metadata:
skill: "rune:test"
version: "1.2.0"
status: "[DONE]"
domain: "[area tested]"
files_changed:
- "[test files created/modified]"
exports:
test_results: { passed: [N], failed: [N], coverage: [N] }
test_files: ["[paths to test files]"]
status: "[RED | GREEN]" # RED = TDD failing (expected), GREEN = all pass
suggested_next: # status-aware — pick based on RED or GREEN
# When GREEN:
- skill: "rune:preflight"
reason: "[grounded in results — e.g., 'All 15 tests GREEN, check edge case completeness']"
consumes: ["test_results", "test_files"]
# When RED (TDD expected):
- skill: "rune:fix"
reason: "[grounded in failures — e.g., '3 tests RED as expected, implement to make them pass']"
consumes: ["test_results", "test_files"]Sharp Edges
Known failure modes for this skill. Check these before declaring done.
| Failure Mode | Severity | Mitigation |
| Tests passing before implementation exists | CRITICAL | RED Gate: rewrite stricter tests — passing without code = not testing real behavior |
| Skipping the RED phase (not confirming FAIL) | HIGH | Run tests, confirm FAIL output before calling cook/fix to implement |
| Testing mock behavior instead of real code | HIGH | Anti-Pattern 1 gate: "Am I testing real behavior or mock existence?" |
| Mocking without understanding side effects | HIGH | Anti-Pattern 3 gate: run with real impl first, observe side effects, THEN mock minimally |
| Incomplete mocks missing downstream fields | HIGH | Anti-Pattern 4 iron rule: mock COMPLETE data structure, not just fields your test checks |
| Coverage below 80% without filling gaps | MEDIUM | Coverage Gate: identify uncovered lines and write additional tests |
| Introducing a new test framework instead of using existing one | MEDIUM | Constraint 6: detect framework first, use project's existing one always |
| Modifying source files to make tests work | HIGH | Role boundary: test writes test files ONLY — source changes go to rune:fix |
| Test-only methods leaking into production code | MEDIUM | Anti-Pattern 2 gate: if method only called by tests → move to test utilities |
| Bulk test writing before first GREEN (horizontal slicing) | CRITICAL | Phase 3.5 gate — bulk_test_count <= 1, defer additional tests to subsequent cycles |
Test names describe shape (returns boolean, has property) instead of behavior | MEDIUM | Scan names for shape-words; rewrite to behavior verbs (accepts/rejects/produces). See references/test-quality.md |
| Mocking internal collaborators in same module | HIGH | System-boundary rule from references/mocking-policy.md — mock only what you don't own |
| Layering old shallow-module tests on top of new deepened-interface tests | MEDIUM | After improve-architecture deepens a module, REPLACE tests don't ADD them; one interface = one test surface |
Self-Validation
SELF-VALIDATION (run before emitting Test Report):
- [ ] Every test file has at least one assertion — no empty test bodies
- [ ] RED phase output shows actual failures (not "0 tests") — tests were real, not stubs
- [ ] No test modifies source code — test files only, source changes belong to fix
- [ ] Test names describe behavior, not implementation ("should reject expired token" not "test function X")
- [ ] No mocks of the thing being tested — only mock external dependencies
- [ ] If BA requirements exist (REQ-xxx), every requirement has at least one test — check plan's Traceability MatrixDone When
- Test framework detected from project config files
- Tests cover happy path + at least 2 edge cases + error case
- All new tests FAIL (RED phase — actual failure output shown)
- After implementation: all tests PASS (GREEN phase — actual pass output shown)
- Coverage ≥80% verified via verification
- Test Report emitted with framework, test count, RED/GREEN status, and coverage
- Self-Validation: all checks passed
- Cycle audit trail intact — every RED has a paired GREEN in
git log, no orphan tests pre-first-GREEN - Test names use behavior-words (accepts/rejects/produces/...) not shape-words (returns/has property/is defined)
Cost Profile
~$0.03-0.08 per invocation. Sonnet for writing tests, Bash for running them. Frequent invocation in TDD workflow.
Scope guardrail: Do not modify source or implementation files to make tests pass unless explicitly delegated by the parent agent.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

