test-loop

test-loop is a skill for Claude Code from ao92265/claude-code-playbook. It costs 152 tokens per session (1,261 once invoked), scanned A, original, MIT.

A test-first workflow for fixing bugs and reorganizing code. TDD means writing a test before the code change; a refactor changes structure without intending to change behavior.

In plain words
What is it for?
Use bugfix mode for broken behavior and refactor mode for structure-only changes, then run the full checks: TypeScript compilation, tests, and linting.
Why use it?
It catches regressions by recording the expected behavior first and requiring tests, type checks, and linting to stay passing throughout the work.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the playbook plugin — 82 skills, 4 commands, 9 agents, 4 hooks shipped together

Good fit Use bugfix mode for broken behavior and refactor mode for structure-only changes, then run the full checks: TypeScript compilation, tests, and linting.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ao92265/claude-code-playbook/test-loop
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ao92265/claude-code-playbook --skill test-loop
Clone the repo
git clone --depth 1 https://github.com/ao92265/claude-code-playbook

Made for: Claude Code.

Or install playbook, the plugin that ships this one along with the rest of its 82 skills, 4 commands, 9 agents, 4 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/ao92265/claude-code-playbook/test-loop/github.svg)](https://agentmods.dev/skills/ao92265/claude-code-playbook/test-loop)
Your own site
<a href="https://agentmods.dev/skills/ao92265/claude-code-playbook/test-loop"><img src="https://agentmods.dev/badge/skills/ao92265/claude-code-playbook/test-loop/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/ao92265/claude-code-playbook/test-loop"><img src="https://agentmods.dev/badge/skills/ao92265/claude-code-playbook/test-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,261 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00152 $0.01261
Opus 5.5 $0.00061 $0.00504
Sonnet 5.5 $0.00030 $0.00252
Haiku 4.5 $0.00015 $0.00126

Measured 3mo ago against content hash 37b7ddb0156b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/test-loop/SKILL.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Loop

One shared skeleton, two modes. Eliminates wrong-approach / buggy-first-pass friction and regression-on-refactor risk by forcing tests-before-code and CI parity before shipping.

Shared skeleton

  1. Write tests (mode-specific — see below)
  2. Commit the tests as a baseline, separate from any behavior change
  3. Change code in small increments
  4. Keep tests green after every increment
  5. Full CI parity gate before PR: tsc -b && npm test && npm run lint

Mode selection

  • Bug report, issue number, "fix X is broken" → bugfix mode
  • Rename/restructure/extract/split/upgrade with no intended behavior change → refactor mode
  • Ambiguous → ask the user which one before writing anything

Mode: bugfix (failing-test-first)

Phase 1 — RED

  1. Read issue, reproduce bug locally.
  2. Write a test that captures expected behavior. Test MUST fail.
  3. Run tsc -b && npm test — confirm the test fails for the RIGHT reason (not a compile error, not a wrong assertion).
  4. Commit failing test alone: test: failing case for #N.

Phase 2 — GREEN

  1. Implement MINIMAL fix. No refactor, no adjacent cleanup.
  2. After every edit run full CI parity: tsc -b && npm test && npm run lint
  3. Loop until all three pass. NEVER skip a step.
  4. 3 failed attempts → STOP, explain blocker, ask user.

Phase 3 — SHIP

  1. Commit fix separate from test: fix: <one line> (#N).
  2. git branch --show-current before push.
  3. gh pr create referencing issue.

Mode: refactor (characterization-first)

For refactors with no intended behavior change: renaming/restructuring, splitting a god component, extracting a hook/util, deduping logic, migrating styles/theme without altering rendered output, or a contained library/version upgrade.

Not for: bug fixes (use bugfix mode above), feature adds, or a mechanical rename across files already covered by existing tests.

Step 1 — Identify target + capture surface

Ask the user (if not stated) for:

  • Target file/dir
  • Public surface to preserve: rendered output, network calls, exposed API, side effects

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 118 lines · 152 tokens per session scan A 37b7ddb0156b

Subscribe to this mod's changes

test-loop is a skill published in the GitHub repository ao92265/claude-code-playbook (13 stars, last pushed 17d ago), licensed MIT. It adds 152 tokens to every session and 1,261 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

test-loop compared with skills from other repositories

test-loop next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test-loopao92265/claude-code-playbookSkill1317d agoMITA152Claude Code
autonomous-tdd-debuggerroedyrustam/vibes-plugSkill132todayMITA43Cursor
shipnaimkatiman/continuous-improvementSkill11yesterdayMITA158Claude Code
superpowersnaimkatiman/continuous-improvementSkill11yesterdayMITB134Claude Code
lfe-tddStChiotis/Library-First-EngineeringSkill444mo agoMITA32Claude Code, Codex
test-driven-developmentnaimkatiman/continuous-improvementSkill11yesterdayMITA50Claude Code
tdd-workflownaimkatiman/continuous-improvementSkill11yesterdayMITA117Claude Code