gsd-task-manager: Command for Claude Code

.claude/commands/tdd.md

tdd is a command for Claude Code from vscarpenter/gsd-task-manager. It costs 24 tokens per session (604 once invoked), scanned A, original, MIT.

A command for test-driven development, or TDD, where a failing test is written first, the code is made to pass, and then the code is cleaned up.

In plain words
What is it for?
Use it to add behavior-based tests for data, UI, or MCP-server changes, run the relevant test, and review the failing test before implementation continues.
Why use it?
It makes the intended behavior explicit before implementation and checks that the change works for the right reason.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions CLAUDE.md; mentions subagents.

This is vscarpenter/gsd-task-manager's own configuration. It tells Claude Code how to work on gsd-task-manager itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything gsd-task-manager configures →

Reuse

Borrowing it

Nothing to install: this file belongs to vscarpenter/gsd-task-manager. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/vscarpenter/gsd-task-manager/main/.claude/commands/tdd.md
Clone the repo
git clone --depth 1 https://github.com/vscarpenter/gsd-task-manager

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 tdd

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/vscarpenter/gsd-task-manager/tdd"><img src="https://agentmods.dev/badge/commands/vscarpenter/gsd-task-manager/tdd.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 604 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.00024 $0.00604
Opus 5.5 $0.00010 $0.00242
Sonnet 5.5 $0.00005 $0.00121
Haiku 4.5 $0.00002 $0.00060

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

Security

Grade A, and why

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 1mo 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.

.claude/commands/tdd.md · 43 lines

What it actually says

Start a red/green/refactor cycle for the behavior described in the arguments. Follow the TDD rules in coding-standards.md Part 2 ("Testing") and the gsd-taskmanager testing conventions in CLAUDE.md.

Behavior: $ARGUMENTS

Execute the cycle strictly in order:

  1. Red. Write a failing test in the appropriate location:

    • Data/logic tests → tests/data/
    • UI/component tests → tests/ui/
    • MCP server tests → packages/mcp-server/src/__tests__/

    Use a behavior-based name (e.g., should_skip_echo_events_from_own_device). Follow Arrange-Act-Assert. Use the project conventions:

    • Vitest with @testing-library/react + @testing-library/jest-dom
    • Mock IndexedDB is auto-imported via vitest.setup.ts
    • Use localStorage.removeItem(key) for cleanup, not localStorage.clear()
    • For sync tests, use the vi.mock('pocketbase') pattern from existing sync tests

    Run bun run test -- <test-file> (NOT bun test) and confirm it fails for the right reason — not a syntax error, missing import, or typo. Report the failure output.

  2. Pause. Stop and wait for approval of the test before writing any implementation. Do not proceed to green without confirmation.

  3. Green. Write the minimum implementation needed to make the test pass. Respect:

    • File-size limit ~400 lines (split if needed; lib/analytics/, lib/notifications/, lib/sync/, components/settings-page/, components/dashboard/ are reference modular layouts)
    • Function-size limit ≤40 lines
    • No extra features, no speculative abstractions, no unrelated edits

    Run the test and confirm it passes. Then run bun run test to confirm no regressions.

  4. Refactor. Propose a refactor pass: extract duplication, improve naming, simplify logic. Do not change behavior. Wait for confirmation before applying.

  5. Repeat. If the behavior requires multiple cycles, state the next failing test and return to step 1.

Rules:

  • Do not write implementation code before the test exists and has been confirmed to fail.
  • Do not bundle multiple behaviors into one cycle.
  • If touching lib/sync/**, also invoke the pb-sync-reviewer subagent before the refactor step.
  • If touching components in components/, also invoke the a11y-reviewer subagent before the refactor step.
  • If you cannot write a failing test first, stop and say the requirement is unclear — invoke /qspec instead.
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. 1mo ago Changed 1a698ed75e37
  2. 2mo ago First seen · 43 lines · 24 tokens per session scan A d478d464b86d

Subscribe to this mod's changes

tdd is a command published in the GitHub repository vscarpenter/gsd-task-manager (40 stars, last pushed yesterday), licensed MIT. It adds 24 tokens to every session and 604 once invoked, about $0.0001 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-30.