Use when implementing high-assurance code with evidence-first development — executable spec + gauntlet of constraints (tests, types, coverage, mutation) so line-by-line review becomes optional. Triggers on "prove it works", "I won't read the code", or high-stakes domains (money, auth, data loss, concurrency, public API).
This skill implements high-assurance code with evidence-first development: an executable spec plus a gauntlet of constraints — tests, types, coverage, mutation — so line-by-line review becomes optional. Use it when the stakes are high: money, auth, data loss, concurrency, public API. It triggers on "prove it works" and similar demands for rigor.
Old Coder: Evidence-First Development
An old coder's strategy for the agent era: don't read the code — make it run the gauntlet. This skill makes coding agents prove their work through executable specifications and evidence reports rather than relying on human code review.
When to Use
User explicitly asks for high-assurance or evidence-first work ("reliable", "TDD", "prove it works", "I won't read the code")
Changes touching high-stakes domains: money, auth, data loss, concurrency, public API
When you need to produce an executable spec (SPEC) and evidence report (EVIDENCE) instead of relying on code review
For routine changes where the user just wants normal tests, write good tests directly instead of invoking this loop
Verification
Implement a small module with the evidence-first loop and confirm every constraint (tests, types, coverage, mutation) is green at the documented thresholds.
Introduce a bug and confirm at least one gate (test, type, coverage, mutation) catches it.
Verify the executable spec drives the implementation: acceptance criteria map 1:1 to tests.
Confirm the final review step requires the gates' output, not self-reported completion.
Anti-Rationalization Table
Excuse
Reality
Rule
"The tests pass, isn't that enough?"
Passing tests can be vacuous, mocked, or testing the wrong thing
Mutation testing is mandatory — tests must catch planted bugs
"I'll add tests after the implementation"
Post-hoc tests rarely exercise the actual logic paths
RED phase is non-negotiable — watch every test fail first
"Coverage is 100%, we're good"
Global coverage % is vanity; changed-line coverage is the constraint
Gate on changed-line coverage with --cov-fail-under
"This is a trivial change, skip the gauntlet"
Trivial changes in high-stakes domains cause the worst bugs
Scale to blast radius (Tier 1/2/3), never skip silently
"The mutation tool is slow/unavailable"
No tool? Manual mutation with a persisted runner script is required
Document every skipped layer and why in EVIDENCE
"The spec is good enough, let's code"
An unapproved spec breaks the author-correlation breaker
Human must explicitly approve SPEC before any implementation
"I fixed it, the gauntlet passes now"
If you weakened a test or check to make it pass, you destroyed trust
Never weaken tests, never report unrun layers, failing gauntlet blocks done
Process
The Evidence-First Loop.
SPEC → (human approves spec, not code) → RED → GREEN → REFACTOR → GAUNTLET → EVIDENCE
↑_____________________|
repeat per behavior
Phase 1: SPEC — The Only Thing the Human Reads Before Code
Goal: Turn the request into executable acceptance criteria before touching implementation.
Steps:
Write behaviors as Gherkin-style scenarios or a named test list — concrete inputs, concrete expected outputs, edge cases, and error cases.
Include what the change must NOT do (invariants: existing tests, public API signatures, performance budgets).
Include the setup plan: tools to install, git usage, files the gauntlet will add, and every new dependency with a one-line justification.
Write the spec to a file at an absolute path (so it's clickable in terminal).
Show the spec to the human in plain language and get explicit approval before writing implementation.
In autonomous mode: state the spec and proceed, but EVIDENCE must record spec approval: not obtained (autonomous run) with lower confidence.
Anti-gaming: An answer to a question is not an approval. Questions and approval are two exchanges — fold answers in, show revised spec, ask again.
Phase 2: RED — Prove Each Test Can Fail
Goal: Write the test for one behavior, run it, and watch it fail before writing implementation.
Steps:
If module doesn't exist, create a stub that raises (e.g., NotImplementedError) so test fails on behavior, not import.
Run the new test individually and observe failure.
If a new test passes immediately: it's either vacuous or behavior already exists. Prove it — break implementation with a throwaway mutant, watch test fail, restore.
Record pre-existing behavior kept as regression armor.
Phase 3: GREEN — Minimal Implementation
Goal: Write the least code that makes the failing test pass.
Steps:
Implement minimal code for the current behavior.
Run the full suite, not just the new test.
All tests must pass.
Phase 4: REFACTOR — Clean Up Under Green
Goal: Improve names, extract duplication, simplify structure while suite is green.
Rules:
Implementation refactors touch no test files.
Test-structure refactors (helpers, fixtures) allowed as separate step: assertions unchanged, suite green before and after, then rerun mutation to confirm tests still kill.
Anything requiring editing an assertion is a behavior change — goes back to SPEC.
Run suite after each refactor.
Phase 5: GAUNTLET — The Constraint Stack
Goal: Run every applicable layer after all spec behaviors are green. Scale to task (Tier 1/2/3), never skip silently.
Tier 1 (trivial): Full suite + lint. No new tests required, state why.
Tier 2 (normal): Full loop. Bug fixes MUST start with RED test reproducing the bug.
Tier 3 (high stakes — money, auth, data loss, concurrency, public API): Full loop + property-based tests + mutation testing (tool-based) + adversarial pass — explicitly try to break your own implementation with hostile inputs before declaring done. Write a short failure model listing ways this change can hurt, and for each mode add a layer that catches it.
Phase 6: EVIDENCE — The Only Thing the Human Reads After Code
Goal: End with a report the human can trust without opening a single source file.
Required Sections:
Spec approval status: Obtained from user / not obtained (autonomous) with confidence downgrade
Source state: Commit SHA or sha256 tree hash (persist computation as script)
#!/usr/bin/env python3
"""
Manual mutation runner for ecosystems without a mature mutation tool.
Persisted in repo so EVIDENCE is reproducible.
Proves it executed each mutant via mtime pinning + cache check.
"""
import subprocess
import sys
import os
import hashlib
from pathlib import Path
MUTANTS = [
# (file, original_snippet, mutated_snippet, description)
("src/rate_limiter.py", "if current >= limit:", "if current > limit:", "off-by-one: >= -> >"),
("src/rate_limiter.py", "return tokens >= cost", "return tokens > cost", "off-by-one: >= -> >"),
("src/rate_limiter.py", "self.tokens = min(self.tokens + rate, capacity)", "self.tokens = min(self.tokens + rate, capacity - 1)", "capacity off-by-one"),
("src/rate_limiter.py", "async def acquire", "async def acquire_not_called", "delete method"),
("src/rate_limiter.py", "return True", "return False", "flip boolean return"),
]
def file_hash(path: Path) -> str:
return hashlib.md5(path.read_bytes()).hexdigest()
def run_tests() -> bool:
result = subprocess.run([sys.executable, "-m", "pytest", "-q"], capture_output=True)
return result.returncode == 0
def main():
src_files = [Path(m[0]) for m in MUTANTS]
original_hashes = {f: file_hash(f) for f in src_files}
killed = 0
total = len(MUTANTS)
for file_path, original, mutated, desc in MUTANTS:
path = Path(file_path)
content = path.read_text()
if original not in content:
print(f"FAIL: mutant pattern not found: {desc}")
sys.exit(1)
# Apply mutant
mutated_content = content.replace(original, mutated, 1)
path.write_text(mutated_content)
# Prove execution: mtime must change, no bytecode cache reuse
new_hash = file_hash(path)
if new_hash == original_hashes[path]:
print(f"FAIL: mutant did not change file hash: {desc}")
sys.exit(1)
print(f"Testing mutant: {desc}")
if not run_tests():
print(f" KILLED")
killed += 1
else:
print(f" SURVIVED - missing test!")
# Restore and fail
path.write_text(content)
print(f"Manual mutation: {killed}/{total} killed")
sys.exit(1)
# Restore
path.write_text(content)
restored_hash = file_hash(path)
if restored_hash != original_hashes[path]:
print(f"FAIL: restore mismatch for {desc}")
sys.exit(1)
print(f"Manual mutation: {killed}/{total} killed")
# Final verification
if not run_tests():
print("FAIL: suite not green after restore")
sys.exit(1)
if __name__ == "__main__":
main()
Verification Checklist
Run this checklist before claiming the task is complete:
SPEC written to absolute path and contains: behaviors (Gherkin/named tests), negative constraints, setup plan with justified dependencies, failure model (Tier 3)
Human explicitly approved SPEC before any implementation (or autonomous mode noted in EVIDENCE)
RED phase: Every new test observed failing individually before implementation
GREEN phase: Minimal implementation, full suite passes
REFACTOR phase: Only under green, assertions frozen, mutation rerun after test-structure changes
GAUNTLET: Every applicable layer run, all exit non-zero on failure, no silent skips
Changed-line coverage: Gates at 100% with --cov-fail-under (not just reports %)
Mutation testing: Tool-based preferred; manual with persisted runner that proves execution
EVIDENCE report: Single final fresh run, reproducible entry point, spec→test mapping, all layers with commands+results, skipped layers with reasons, honest notes
Anti-gaming: No weakened tests, no simultaneous test+impl edits, no mocking unit under test, no coverage chasing, no unrun layers reported
1---2name: old-coder3description: Use when implementing high-assurance code with evidence-first development4 — executable spec + gauntlet of constraints (tests, types, coverage, mutation) so5 line-by-line review becomes optional. Triggers on "prove it works", "I won't read6 the code", or high-stakes domains (money, auth, data loss, concurrency, public API).7category: development8domain: development9version: 1.0.010tags:11- tdd12- evidence-first13- mutation-testing14- quality-assurance15- high-assurance16- test-driven-development17author: oyi7718license: Apache-2.019subdomain: software-development20metadata:21 source: https://skillmd.com/skills/oyi77/old-coder22---2324## Overview2526This skill implements high-assurance code with evidence-first development: an executable spec plus a gauntlet of constraints — tests, types, coverage, mutation — so line-by-line review becomes optional. Use it when the stakes are high: money, auth, data loss, concurrency, public API. It triggers on "prove it works" and similar demands for rigor.27282930# Old Coder: Evidence-First Development3132An old coder's strategy for the agent era: don't read the code — make it run the gauntlet. This skill makes coding agents prove their work through executable specifications and evidence reports rather than relying on human code review.3334## When to Use3536- User explicitly asks for high-assurance or evidence-first work ("reliable", "TDD", "prove it works", "I won't read the code")37- Changes touching high-stakes domains: money, auth, data loss, concurrency, public API38- When you need to produce an executable spec (SPEC) and evidence report (EVIDENCE) instead of relying on code review39- For routine changes where the user just wants normal tests, write good tests directly instead of invoking this loop4041---4243## Verification4445- Implement a small module with the evidence-first loop and confirm every constraint (tests, types, coverage, mutation) is green at the documented thresholds.46- Introduce a bug and confirm at least one gate (test, type, coverage, mutation) catches it.47- Verify the executable spec drives the implementation: acceptance criteria map 1:1 to tests.48- Confirm the final review step requires the gates' output, not self-reported completion.4950## Anti-Rationalization Table5152| Excuse | Reality | Rule |53|--------|---------|------|54| "The tests pass, isn't that enough?" | Passing tests can be vacuous, mocked, or testing the wrong thing | Mutation testing is mandatory — tests must catch planted bugs |55| "I'll add tests after the implementation" | Post-hoc tests rarely exercise the actual logic paths | RED phase is non-negotiable — watch every test fail first |56| "Coverage is 100%, we're good" | Global coverage % is vanity; changed-line coverage is the constraint | Gate on changed-line coverage with `--cov-fail-under` |57| "This is a trivial change, skip the gauntlet" | Trivial changes in high-stakes domains cause the worst bugs | Scale to blast radius (Tier 1/2/3), never skip silently |58| "The mutation tool is slow/unavailable" | No tool? Manual mutation with a persisted runner script is required | Document every skipped layer and why in EVIDENCE |59| "The spec is good enough, let's code" | An unapproved spec breaks the author-correlation breaker | Human must explicitly approve SPEC before any implementation |60| "I fixed it, the gauntlet passes now" | If you weakened a test or check to make it pass, you destroyed trust | Never weaken tests, never report unrun layers, failing gauntlet blocks done |6162---6364## Process6566**The Evidence-First Loop.**6768```69SPEC → (human approves spec, not code) → RED → GREEN → REFACTOR → GAUNTLET → EVIDENCE70 ↑_____________________|71 repeat per behavior72```7374### Phase 1: SPEC — The Only Thing the Human Reads Before Code7576**Goal**: Turn the request into executable acceptance criteria before touching implementation.7778**Steps**:791. Write behaviors as Gherkin-style scenarios or a named test list — concrete inputs, concrete expected outputs, edge cases, and error cases.802. Include what the change must NOT do (invariants: existing tests, public API signatures, performance budgets).813. Include the **setup plan**: tools to install, git usage, files the gauntlet will add, and **every new dependency with a one-line justification**.824. Write the spec to a file at an **absolute path** (so it's clickable in terminal).835. Show the spec to the human in plain language and get explicit approval **before writing implementation**.846. In autonomous mode: state the spec and proceed, but EVIDENCE must record `spec approval: not obtained (autonomous run)` with lower confidence.8586**Anti-gaming**: An answer to a question is not an approval. Questions and approval are two exchanges — fold answers in, show revised spec, ask again.8788### Phase 2: RED — Prove Each Test Can Fail8990**Goal**: Write the test for one behavior, run it, and **watch it fail** before writing implementation.9192**Steps**:931. If module doesn't exist, create a stub that raises (e.g., `NotImplementedError`) so test fails on behavior, not import.942. Run the new test individually and observe failure.953. If a new test passes immediately: it's either vacuous or behavior already exists. Prove it — break implementation with a throwaway mutant, watch test fail, restore.964. Record pre-existing behavior kept as regression armor.9798### Phase 3: GREEN — Minimal Implementation99100**Goal**: Write the least code that makes the failing test pass.101102**Steps**:1031. Implement minimal code for the current behavior.1042. Run the **full suite**, not just the new test.1053. All tests must pass.106107### Phase 4: REFACTOR — Clean Up Under Green108109**Goal**: Improve names, extract duplication, simplify structure while suite is green.110111**Rules**:112- Implementation refactors touch no test files.113- Test-structure refactors (helpers, fixtures) allowed as separate step: assertions unchanged, suite green before and after, then rerun mutation to confirm tests still kill.114- Anything requiring editing an assertion is a behavior change — goes back to SPEC.115- Run suite after each refactor.116117### Phase 5: GAUNTLET — The Constraint Stack118119**Goal**: Run every applicable layer after all spec behaviors are green. Scale to task (Tier 1/2/3), never skip silently.120121| Layer | What It Catches | Tool (Python) | Must Exit Non-Zero |122|-------|----------------|---------------|-------------------|123| Full test suite | Regressions | `pytest -q` | Yes |124| Static types | Whole classes of bugs | `mypy <pkg>` / `pyright` | Yes |125| Lint + format | Latent bugs, drift | `ruff check . && ruff format --check .` | Yes |126| Changed-line coverage | Untested code paths | `pytest --cov=<pkg> --cov-branch --cov-fail-under=100` | **Yes** (critical) |127| Mutation testing | Tests that assert nothing | `mutmut run` (configure in pyproject.toml) | Yes |128| Property-based tests | Edge cases you didn't imagine | `hypothesis` strategies | Yes |129| Complexity budget | Unmaintainable output | Manual review / tools | No (subjective) |130| Real execution | "Passes tests, doesn't run" | Run app/CLI/endpoint on realistic input | Yes |131| Supply chain & secrets | Vulnerable deps, leaked creds | `pip-audit`, `gitleaks` | Yes |132| Suite health | Flaky/order-dependent tests | `pytest-randomly`, repeat suspected flakes | Yes |133134**Calibration**:135- **Tier 1 (trivial)**: Full suite + lint. No new tests required, state why.136- **Tier 2 (normal)**: Full loop. Bug fixes MUST start with RED test reproducing the bug.137- **Tier 3 (high stakes — money, auth, data loss, concurrency, public API)**: Full loop + property-based tests + mutation testing (tool-based) + **adversarial pass** — explicitly try to break your own implementation with hostile inputs before declaring done. Write a short **failure model** listing ways this change can hurt, and for each mode add a layer that catches it.138139### Phase 6: EVIDENCE — The Only Thing the Human Reads After Code140141**Goal**: End with a report the human can trust without opening a single source file.142143**Required Sections**:1441. **Spec approval status**: Obtained from user / not obtained (autonomous) with confidence downgrade1452. **Source state**: Commit SHA or sha256 tree hash (persist computation as script)1463. **Toolchain**: Pinned versions file (e.g., `requirements-dev.txt`)1474. **Entry point**: Single command that reruns every layer (e.g., `tools/gauntlet.sh`)1485. **Independent verification**: not performed / passed / failed / blocked (Tier 3 protocol in `verifier.md`)149150**Spec → Test Mapping Table**:151| Scenario | Test | Status |152|---|---|---|153| Scenario name | `test_file::test_name` | pass / fail / unverified / n-a |154155**Gauntlet Results Table** (all from ONE final fresh run):156| Layer | Command | Result |157|---|---|---|158| Tests | `<cmd>` | N passed, 0 failed |159| Types | `<cmd>` | 0 errors |160| Lint | `<cmd>` | 0 warnings |161| Changed-line coverage | `<cmd>` | covered/total changed lines |162| Mutation | `<tool or manual>` | killed/total killed |163| Property-based | `<cmd>` | N properties, examples each |164| Real execution | `<cmd>` | Observed output |165| Supply chain | `<cmd>` | 0 known vulns; new deps listed with SPEC justification |166| Suite health | `<cmd>` | Randomized order (seed N), all passed |167168**Skipped layers**: List each with reason (or "none").169170**Honest notes**: Failures hit during task and how resolved, spec revisions, anything reducing confidence.171172---173174## Code Examples175176### Python Project Setup (pyproject.toml)177178```toml179[project]180name = "my-project"181version = "0.1.0"182dependencies = []183184[project.optional-dependencies]185dev = [186 "pytest>=8.0",187 "pytest-cov>=5.0",188 "pytest-randomly>=3.15",189 "hypothesis>=6.100",190 "mutmut>=3.0",191 "mypy>=1.10",192 "ruff>=0.6",193 "pip-audit>=2.7",194 "gitleaks>=8.0",195]196197[tool.pytest.ini_options]198addopts = "-q --randomly-seed=last"199testpaths = ["tests"]200python_files = ["test_*.py"]201python_functions = ["test_*"]202203[tool.mutmut]204source_paths = ["src/"]205tests_dir = "tests/"206runner = "python -m pytest"207208[tool.coverage.run]209source = ["src"]210branch = true211212[tool.coverage.report]213fail_under = 100214show_missing = true215216[tool.mypy]217python_version = "3.11"218warn_return_any = true219warn_unused_configs = true220disallow_untyped_defs = true221222[tool.ruff]223target-version = "py311"224line-length = 100225select = ["E", "F", "I", "UP", "B", "C4", "PTH", "T20", "ARG", "SIM", "RUF", "PERF"]226ignore = []227```228229### Gauntlet Entry Point Script (tools/gauntlet.sh)230231```bash232#!/usr/bin/env bash233set -euo pipefail234235# Freshness by mechanism: delete stale artifacts from previous runs236rm -rf .coverage coverage.xml .mutmut-cache htmlcov .pytest_cache237238echo "=== GAUNTLET START ==="239echo "Source state: $(git rev-parse HEAD 2>/dev/null || sha256sum $(find . -type f -name '*.py' | sort) | sha256sum | cut -d' ' -f1)"240241# 1. Full test suite242echo "--- Tests ---"243python -m pytest -q244245# 2. Static types246echo "--- Types ---"247python -m mypy src/248249# 3. Lint + format250echo "--- Lint ---"251python -m ruff check .252python -m ruff format --check .253254# 4. Changed-line coverage (requires baseline)255echo "--- Changed-line Coverage ---"256python -m pytest --cov=src --cov-branch --cov-report=term-missing --cov-fail-under=100257258# 5. Mutation testing259echo "--- Mutation ---"260python -m mutmut run --paths-to-mutate=src/261262# 6. Property-based tests (included in pytest run above)263echo "--- Properties ---"264python -m pytest -q -k "property"265266# 7. Real execution267echo "--- Real Execution ---"268python -m src.cli --help # or run actual CLI/app on realistic input269270# 8. Supply chain & secrets271echo "--- Supply Chain ---"272python -m pip_audit273gitleaks detect --source . --verbose --redact274275# 9. Suite health276echo "--- Suite Health ---"277python -m pytest -q --randomly-seed=last --randomly-dont-reorganize278279echo "=== GAUNTLET COMPLETE ==="280```281282### SPEC Template (spec.md)283284```markdown285# SPEC: <Task Name>286287**Tier**: 1 | 2 | 3288**Approval**: [ ] Obtained from user / [ ] Not obtained (autonomous)289290## Behaviors (Gherkin-style)291292### Feature: <Capability in user language>293294#### Scenario: <One concrete behavior>295**Given** <concrete starting state>296**When** <concrete action with concrete input>297**Then** <concrete observable outcome, exact values>298299#### Scenario: <Error case>300**Given** <starting state>301**When** <invalid/hostile input>302**Then** <exact error type/message/status, and what state must NOT change>303304## Negative Constraints (Must NOT)305306| Invariant | Verification Method |307|-----------|---------------------|308| Existing tests still pass | Full suite baseline |309| Public API signatures unchanged | API compatibility check (griffe) |310| No new network/filesystem/env usage | Capability diff |311312## Setup Plan313314- Tools to install: (from `requirements-dev.txt`)315- Git: init / checkpoint commit cadence316- Files gauntlet will add: `tests/`, `tools/gauntlet.sh`, `tools/mutants.py`317- New dependencies: (each with one-line justification)318319## Failure Model (Tier 3 only)320321| Failure Mode | Layer That Catches It |322|--------------|----------------------|323| Race condition | `go test -race` / threading stress + rerun |324| Parser edge case | Property-based tests (hypothesis) |325| Silent production failure | Observability assertions in tests |326| Rollback failure | Migration rehearsal test |327```328329### EVIDENCE Template (evidence.md)330331```markdown332## Evidence Report — <Task Name> (Tier <1|2|3>)333334- Spec approval: <obtained | not obtained (autonomous)>335- Source state: <commit SHA | tree hash>336- Toolchain: <requirements-dev.txt>337- Entry point: `./tools/gauntlet.sh`338- Independent verification: <not performed | passed | failed | blocked>339340### Spec → Test Mapping341342| Scenario | Test | Status |343|---|---|---|344| Happy path: divide(10, 2) = 5 | `test_math.py::test_divide_happy` | pass |345| Error: divide(1, 0) raises ZeroDivisionError | `test_math.py::test_divide_by_zero` | pass |346| Must NOT: change existing API | `griffe` diff | pass |347348### Gauntlet (Final Fresh Run)349350| Layer | Command | Result |351|---|---|---|352| Tests | `pytest -q` | 47 passed, 0 failed |353| Types | `mypy src` | 0 errors |354| Lint | `ruff check . && ruff format --check .` | 0 warnings |355| Changed-line coverage | `pytest --cov=src --cov-fail-under=100` | 31/31 lines, 20/20 branches |356| Mutation | `mutmut run` | 22/22 killed |357| Property-based | `pytest -k property` | 5 properties, 200 examples each |358| Real execution | `python -m src.cli 10 2` | `5.0` |359| Supply chain | `pip-audit && gitleaks detect` | 0 vulns; 0 new deps |360| Suite health | `pytest --randomly-seed=last` | seed 42, all passed |361362### Skipped Layers363- none364365### Honest Notes366- Mutation runner initially had cache bug (fixed in tools/mutants.py with mtime pinning)367- Spec revised once: added negative constraint for env var access368```369370### Manual Mutation Runner (tools/mutants.py)371372```python373#!/usr/bin/env python3374"""375Manual mutation runner for ecosystems without a mature mutation tool.376Persisted in repo so EVIDENCE is reproducible.377Proves it executed each mutant via mtime pinning + cache check.378"""379import subprocess380import sys381import os382import hashlib383from pathlib import Path384385MUTANTS = [386 # (file, original_snippet, mutated_snippet, description)387 ("src/rate_limiter.py", "if current >= limit:", "if current > limit:", "off-by-one: >= -> >"),388 ("src/rate_limiter.py", "return tokens >= cost", "return tokens > cost", "off-by-one: >= -> >"),389 ("src/rate_limiter.py", "self.tokens = min(self.tokens + rate, capacity)", "self.tokens = min(self.tokens + rate, capacity - 1)", "capacity off-by-one"),390 ("src/rate_limiter.py", "async def acquire", "async def acquire_not_called", "delete method"),391 ("src/rate_limiter.py", "return True", "return False", "flip boolean return"),392]393394def file_hash(path: Path) -> str:395 return hashlib.md5(path.read_bytes()).hexdigest()396397def run_tests() -> bool:398 result = subprocess.run([sys.executable, "-m", "pytest", "-q"], capture_output=True)399 return result.returncode == 0400401def main():402 src_files = [Path(m[0]) for m in MUTANTS]403 original_hashes = {f: file_hash(f) for f in src_files}404405 killed = 0406 total = len(MUTANTS)407408 for file_path, original, mutated, desc in MUTANTS:409 path = Path(file_path)410 content = path.read_text()411412 if original not in content:413 print(f"FAIL: mutant pattern not found: {desc}")414 sys.exit(1)415416 # Apply mutant417 mutated_content = content.replace(original, mutated, 1)418 path.write_text(mutated_content)419420 # Prove execution: mtime must change, no bytecode cache reuse421 new_hash = file_hash(path)422 if new_hash == original_hashes[path]:423 print(f"FAIL: mutant did not change file hash: {desc}")424 sys.exit(1)425426 print(f"Testing mutant: {desc}")427 if not run_tests():428 print(f" KILLED")429 killed += 1430 else:431 print(f" SURVIVED - missing test!")432 # Restore and fail433 path.write_text(content)434 print(f"Manual mutation: {killed}/{total} killed")435 sys.exit(1)436437 # Restore438 path.write_text(content)439 restored_hash = file_hash(path)440 if restored_hash != original_hashes[path]:441 print(f"FAIL: restore mismatch for {desc}")442 sys.exit(1)443444 print(f"Manual mutation: {killed}/{total} killed")445 # Final verification446 if not run_tests():447 print("FAIL: suite not green after restore")448 sys.exit(1)449450if __name__ == "__main__":451 main()452```453454---455456## Verification Checklist457458Run this checklist before claiming the task is complete:459460- [ ] **SPEC written to absolute path** and contains: behaviors (Gherkin/named tests), negative constraints, setup plan with justified dependencies, failure model (Tier 3)461- [ ] **Human explicitly approved SPEC** before any implementation (or autonomous mode noted in EVIDENCE)462- [ ] **RED phase**: Every new test observed failing individually before implementation463- [ ] **GREEN phase**: Minimal implementation, full suite passes464- [ ] **REFACTOR phase**: Only under green, assertions frozen, mutation rerun after test-structure changes465- [ ] **GAUNTLET**: Every applicable layer run, all exit non-zero on failure, no silent skips466- [ ] **Changed-line coverage**: Gates at 100% with `--cov-fail-under` (not just reports %)467- [ ] **Mutation testing**: Tool-based preferred; manual with persisted runner that proves execution468- [ ] **EVIDENCE report**: Single final fresh run, reproducible entry point, spec→test mapping, all layers with commands+results, skipped layers with reasons, honest notes469- [ ] **Anti-gaming**: No weakened tests, no simultaneous test+impl edits, no mocking unit under test, no coverage chasing, no unrun layers reported470- [ ] **Tier 3**: Failure model written, adversarial pass performed, independent verification protocol acknowledged471- [ ] **Independent verification** (Tier 3): `verifier.md` protocol executed or explicitly marked not performed with confidence downgrade472473---474475## References476477- Original repo: https://github.com/AmazingAng/old-coder478- Gauntlet tooling by ecosystem: `references/gauntlet.md`479- Verifier protocol (Tier 3): `references/verifier.md`480- Verifier case study: `references/verifier-case-study.md`481- Demo project: `demo-rate-limiter/` (shows 41 tests, 100% coverage, 22/22 mutants killed)
Run npx get-skill add oyi77/old-coder in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use when implementing high-assurance code with evidence-first development — executable spec + gauntlet of constraints (tests, types, coverage, mutation) so line-by-line review becomes optional. Triggers on "prove it works", "I won't read the code", or high-stakes domains (money, auth, data loss, concurrency, public API). It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under Apache-2.
oyi77 (@oyi77) published this skill. Their other Agent Skills are listed on their SkillMD profile.