claude-workspace: Command for Claude Code

.claude/commands/tdd.md

tdd is a command for Claude Code from Piyush8296/claude-workspace. It costs 13 tokens per session (500 once invoked), scanned A, original, MIT.

A test-driven development workflow, where you write a failing automated test, add the smallest code that makes it pass, then clean up the code. TDD means testing the expected behavior before implementing it.

In plain words
What is it for?
Use it to build a feature or function in small verified steps, covering normal behavior and at least one unusual case with tests.
Why use it?
Starting with a test makes the requirement concrete and exposes missing edge cases early. Running the test at each stage helps show whether the change works and stays working.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is Piyush8296/claude-workspace's own configuration. It tells Claude Code how to work on claude-workspace 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 claude-workspace configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Piyush8296/claude-workspace. 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/Piyush8296/claude-workspace/main/.claude/commands/tdd.md
Clone the repo
git clone --depth 1 https://github.com/Piyush8296/claude-workspace

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/piyush8296/claude-workspace/tdd.svg)](https://agentmods.dev/commands/piyush8296/claude-workspace/tdd)
Your own site
<a href="https://agentmods.dev/commands/piyush8296/claude-workspace/tdd"><img src="https://agentmods.dev/badge/commands/piyush8296/claude-workspace/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 500 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.00013 $0.00500
Opus 5 $0.00006 $0.00250
Sonnet 5 $0.00003 $0.00100
Haiku 4.5 $0.00001 $0.00050

Measured 7d ago against content hash 65f25b761ef2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 7d 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 · 86 lines

What it actually says

TDD Workflow

Develop with TDD: $ARGUMENTS

Instructions

1. Understand the requirement

Clarify with the user if needed:

  • What should this feature/function do?
  • What are the inputs and expected outputs?
  • What edge cases matter?

2. RED — Write a failing test

Create the test file first. The test should:

  • Describe the expected behavior in plain English
  • Use factory functions for test data: getProps(), getMockX()
  • Cover the happy path AND at least one edge case
  • Use accessible queries: getByRole > getByText > getByTestId
# Run the test — it MUST fail
npx vitest run <test-file> --reporter=verbose

If the test passes without implementation, the test is wrong. Rewrite it.

3. GREEN — Write minimal code to pass

Implement the minimum code that makes the test pass:

  • No extra features
  • No premature optimization
  • No refactoring yet
  • Just make it green
# Verify it passes
npx vitest run <test-file> --reporter=verbose

4. REFACTOR — Clean up while green

Now improve the code:

  • Extract helper functions
  • Improve naming
  • Remove duplication
  • Apply project patterns (check relevant skills)
# Tests must still pass after refactoring
npx vitest run <test-file> --reporter=verbose

5. Expand coverage

Add more test cases:

  • Error states
  • Loading states
  • Empty states
  • Boundary values
  • Invalid inputs

Repeat RED → GREEN → REFACTOR for each new case.

6. Commit

git add -A
git commit -m "feat: implement $ARGUMENTS with TDD"

7. Report

Summarize:

  • Tests written (count)
  • All passing? (yes/no)
  • Edge cases covered
  • Files created/modified
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. 7d ago First seen · 86 lines · 13 tokens per session scan A 65f25b761ef2

Subscribe to this mod's changes

tdd is a command published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 4mo ago), licensed MIT. It adds 13 tokens to every session and 500 once invoked, about $0.0001 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-31.