spectre-tdd

spectre-tdd is a skill for Claude Code from joenandez/spectre. It costs 75 tokens per session (940 once invoked), scanned A, original, MIT.

A strict test-first workflow called test-driven development, or TDD. It writes a test that fails, adds the smallest code needed to pass it, and then cleans up the result.

In plain words
What is it for?
Use it to implement a defined behavior with both successful and failure cases, verify the failing-test and passing-test stages, run focused checks, and report the resulting changes.
Why use it?
It checks the expected behavior before implementation and helps keep the shipped code limited to what the tests require.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to implement a defined behavior with both successful and failure cases, verify the failing-test and passing-test stages, run focused checks, and report the resulting changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/joenandez/spectre/spectre-tdd
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 joenandez/spectre --skill spectre-tdd
Clone the repo
git clone --depth 1 https://github.com/joenandez/spectre

Made for: Claude Code.

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 spectre-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/joenandez/spectre/spectre-tdd/github.svg)](https://agentmods.dev/skills/joenandez/spectre/spectre-tdd)
Your own site
<a href="https://agentmods.dev/skills/joenandez/spectre/spectre-tdd"><img src="https://agentmods.dev/badge/skills/joenandez/spectre/spectre-tdd/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 spectre-tdd

Your own site · 80×15
<a href="https://agentmods.dev/skills/joenandez/spectre/spectre-tdd"><img src="https://agentmods.dev/badge/skills/joenandez/spectre/spectre-tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 940 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00075 $0.00940
Opus 5 $0.00037 $0.00470
Sonnet 5 $0.00015 $0.00188
Haiku 4.5 $0.00007 $0.00094

Measured 2d ago against content hash da1c20096c21, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

spectre-tdd 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 2d 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.

plugins/spectre-codex/skills/spectre-tdd/SKILL.md · 59 lines

How it starts

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

tdd

Implement assigned behavior through strict RED → GREEN → REFACTOR. Outcome: tasks done with happy + failure tests passing and only test-forced production code shipped.

Inputs

  • $ARGUMENTS or thread context — the assigned implementation task(s). If no clear task, stop and ask.
  • The task's acceptance criteria / artifact, if one exists.

Working Set (late-bound — read at run-time, never inline)

  • Target behavior, acceptance criteria, and the smallest affected code/test files.
  • Narrow test/lint commands for those files only (--testPathPattern, --findRelatedTests, per-file lint, or equivalent).
  • Existing test helpers, fixtures, stubs, fake timers, seeded-RNG patterns.

Outputs + DONE

  • A todo list with one cycle per Test Opportunity: RED behavioral casesGREEN minimal implREFACTORCOMMIT.
  • The implementation diff, focused tests, and (optional) conventional commit feat({task}): description.
  • A completion report: Summary (tasks done, ✅ happy / ✅ failure test status, files modified); Artifacts (helpers/mocks/fixtures); API Surface (new/modified exports + signatures); Patterns; Deferred coverage gaps.

DONE when: every Test Opportunity has a representative happy-path and primary-failure baseline unless the behavior genuinely supports only one; distinct requirement/boundary/regression/material-risk cases are also covered; every new test was observed failing for the expected reason before satisfying implementation; minimal production code makes focused tests pass; refactors stay green; every new observable behavior or nontrivial exported contract is tested; and focused tests + relevant lint pass.

Method / guardrails

  • Iron Law — YOU MUST confirm RED before GREEN. No production code before a failing test. If code was written first, delete it and restart from the tests — do not keep it as reference, do not adapt it.
  • A Test Opportunity is the smallest externally meaningful behavior or contract: a route, bug fix, acceptance criterion, public boundary, or independently risky logic. Private helpers are normally covered through observable behavior unless they contain independently risky logic.
  • Start each opportunity with one representative happy-path and one primary-failure test. Add another behavioral case only for a distinct requirement, public/contract boundary, credible regression, or materially different risk. Reject duplicated assertions, implementation-detail tests, and unjustified combinatorial matrices.
  • Run the narrowest command and confirm every new test fails (not errors) for the missing behavior before production code satisfies it. A test that passes immediately covers existing behavior—fix it or choose uncovered behavior.
  • GREEN = the least code to pass the focused tests: no extra branches, params, dependencies, or abstractions unless a test forces them or ≥2 call sites exist (YAGNI).
  • Refactor only while green, and only for duplication ≥3 or a material readability gain; if a refactor breaks tests, revert it.
  • Resolve lint pressure in order: guard clauses / split compounds → tiny same-file helpers → file constants → orchestrator + helpers → same-directory helper module only if still failing.
  • Keep execution scoped — never run repo-wide tests when a focused command exists.
  • Prefer the repo's existing anti-flake patterns: fake timers, stubs, seeded RNG, deterministic fixtures.

Read the full file on GitHub · 59 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. 2d ago Changed · +8 lines da1c20096c21
  2. 12d ago First seen · 51 lines · 75 tokens per session scan A bdf8c5b01d1c

Subscribe to this mod's changes

spectre-tdd is a skill published in the GitHub repository joenandez/spectre (161 stars, last pushed 3d ago), licensed MIT. It adds 75 tokens to every session and 940 once invoked, about $0.0004 per session on Opus 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-30.