tdd-workflow

tdd-workflow is a skill for Claude Code from mshadmanrahman/pm-pilot. It costs 18 tokens per session (652 once invoked), scanned A, original, MIT.

A test-first workflow for writing software: first write a test that fails, then add the smallest code that makes it pass, and finally improve the code.

In plain words
What is it for?
Use it to follow the RED-GREEN-IMPROVE cycle and run the appropriate test commands for Jest, pytest, Go, or Maven projects.
Why use it?
It helps catch incorrect behavior early and keeps new code, bug fixes, and refactoring covered by tests.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the pm-dev plugin — 4 skills, 4 commands, 3 agents shipped together

Good fit Use it to follow the RED-GREEN-IMPROVE cycle and run the appropriate test commands for Jest, pytest, Go, or Maven projects.

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

Made for: Claude Code.

Or install pm-dev, the plugin that ships this one along with the rest of its 4 skills, 4 commands, 3 agents.

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-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/mshadmanrahman/pm-pilot/tdd-workflow.svg)](https://agentmods.dev/skills/mshadmanrahman/pm-pilot/tdd-workflow)
Your own site
<a href="https://agentmods.dev/skills/mshadmanrahman/pm-pilot/tdd-workflow"><img src="https://agentmods.dev/badge/skills/mshadmanrahman/pm-pilot/tdd-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 652 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.00018 $0.00652
Opus 5 $0.00009 $0.00326
Sonnet 5 $0.00004 $0.00130
Haiku 4.5 $0.00002 $0.00065

Measured 7d ago against content hash 43e85cdfa11d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tdd-workflow 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.

plugins/pm-dev/skills/tdd-workflow/SKILL.md · 85 lines

How it starts

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

TDD Workflow

Detailed test-driven development procedure with framework-specific commands.

Relationship to tdd-guide agent: The /tdd command dispatches the tdd-guide agent, which enforces the loop. This skill provides the detailed procedure and framework-specific commands that the agent references.

When to Use

  • Referenced by tdd-guide agent during enforcement
  • Directly when user needs framework-specific test commands
  • Any new feature, bug fix, or refactoring that needs test coverage

Procedure

Phase 1: RED (Write Failing Test)

  1. Identify the behavior to implement
  2. Write the test that describes expected behavior
  3. Run the test: it MUST fail
  4. If it passes, the test is wrong or the feature already exists
# Framework detection
jest --testPathPattern={test_file} 2>/dev/null || \
pytest {test_file} 2>/dev/null || \
go test -run {test_name} ./... 2>/dev/null || \
mvn test -Dtest={test_class} 2>/dev/null

Phase 2: GREEN (Minimal Implementation)

  1. Write the minimum code to make the test pass
  2. No extra features, no premature optimization
  3. Run the test: it MUST pass
  4. If it fails, fix the implementation (not the test)

Phase 3: IMPROVE (Refactor)

  1. Clean up implementation while keeping tests green
  2. Extract functions, rename variables, remove duplication
  3. Run full test suite after each change
  4. Verify no regressions

Phase 4: COVERAGE

  1. Check coverage meets 80% minimum:
    jest --coverage 2>/dev/null || \
    pytest --cov={module} 2>/dev/null || \
    go test -coverprofile=cover.out ./... 2>/dev/null
    
  2. If below 80%, identify uncovered paths and add tests
  3. Focus on branch coverage, not just line coverage

Output Format

TDD Cycle: {feature name}
RED:   Test written - {test file}:{test name} - FAILS as expected
GREEN: Implementation - {impl file} - Test PASSES
IMPROVE: Refactored {what changed}
Coverage: {percent}% ({above/below} 80% target)

Read the full file on GitHub · 85 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. 7d ago First seen · 85 lines · 18 tokens per session scan A 43e85cdfa11d

Subscribe to this mod's changes

tdd-workflow is a skill published in the GitHub repository mshadmanrahman/pm-pilot (20 stars, last pushed yesterday), licensed MIT. It adds 18 tokens to every session and 652 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-30.

Related

Other skills, from other repositories

test-first

Use when implementing any feature, bugfix, or refactor that has a testable outcome. Activate for keywords like "TDD", "test-first", "red-green", "write the test first", "implement ", "fix ". Enforces the red-green-refactor discipline -- write a failing test, make it pass with the smallest change, refactor with tests…

duthaho/claudekit · 106 tokens

dev-tdd

TDD development with Red-Green-Refactor cycle. Use to implement a feature by writing tests BEFORE the code. Trigger automatically when the user asks for TDD, wants to write tests first, mentions "test first", or asks to implement, add, create, fix, correct code, a new feature, a bugfix, or a functionality.

christopherlouet/claude-base · 75 tokens

forward-derivation

Derive BDD scenarios and TDD test skeletons from approved SDD specifications. ATDD acceptance test tables are optional output for specialized needs. Use when: spec is approved, starting BDD/TDD implementation, generating test structures. Keywords: forward derivation, spec to test, BDD generation, TDD skeleton, test…

ValorVie/custom-skills · 91 tokens

bdd-assistant

A guide to Behavior-Driven Development, or BDD, a way to describe software behavior with examples in plain language before building it. It uses Given-When-Then scenarios and Gherkin, a structured format for those examples.

ValorVie/custom-skills · 76 tokens

methodology-system

Manage and guide developers through active development methodology workflows. Use when: TDD, BDD, SDD, ATDD, or custom methodology workflows are needed. Keywords: methodology, workflow, TDD, BDD, SDD, ATDD, phase, checkpoint, development process.

ValorVie/custom-skills · 61 tokens

logging-guide

A guide for applying a development process such as TDD, BDD, or SDD. TDD means writing tests before the code; BDD describes expected behavior; SDD plans changes in specifications first.

ValorVie/custom-skills · 55 tokens