convert-to-test-driven-prompt

convert-to-test-driven-prompt is a command for Claude Code from centminmod/my-claude-code-setup. It costs 0 tokens per session (947 once invoked), scanned A, original, MIT.

A command that rewrites a feature request as a Test-Driven Development (TDD) prompt. TDD means defining tests and expected results before writing the implementation.

In plain words
What is it for?
Use it for features, refactors, validation, authentication, database changes, or other work where explicit test cases and acceptance criteria are useful.
Why use it?
It turns a broad request into specific behaviors that can be checked, making the success conditions clearer before coding starts.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

About the project

my-claude-code-setup is a starter configuration and memory-bank template for Claude Code, providing project guidance and reusable setup for Claude Code sessions. Developers use it to organize Claude Code behavior, memory, commands, skills, subagents, hooks, and settings. The catalogue entries are components of this Claude Code workflow.

centminmod/my-claude-code-setup · 2,620 stars · on GitHub · threads.com

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.

agentmods
npx agentmods add commands/centminmod/my-claude-code-setup/convert-to-test-driven-prompt
Clone the repo
git clone --depth 1 https://github.com/centminmod/my-claude-code-setup

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 convert-to-test-driven-prompt

README.md
[![agentmods](https://agentmods.dev/badge/commands/centminmod/my-claude-code-setup/convert-to-test-driven-prompt.svg)](https://agentmods.dev/commands/centminmod/my-claude-code-setup/convert-to-test-driven-prompt)
Your own site
<a href="https://agentmods.dev/commands/centminmod/my-claude-code-setup/convert-to-test-driven-prompt"><img src="https://agentmods.dev/badge/commands/centminmod/my-claude-code-setup/convert-to-test-driven-prompt.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 947 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00000 $0.00947
Opus 5 $0.00000 $0.00474
Sonnet 5 $0.00000 $0.00189
Haiku 4.5 $0.00000 $0.00095

Measured 6d ago against content hash 3ae9383ac651, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

convert-to-test-driven-prompt 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 6d 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/promptengineering/convert-to-test-driven-prompt.md · 156 lines

How it starts

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

Convert to Test-Driven Prompt

Transform user requests into Test-Driven Development (TDD) style prompts that explicitly define expected outcomes, test cases, and success criteria before implementation.

Usage Examples

Basic Usage

"Convert this to TDD: Add a user authentication feature" "Make this test-driven: Create a shopping cart component" "TDD version: Implement data validation for the form"

With File Input

/convert-to-test-driven-prompt @path/to/prompt-file.md /convert-to-test-driven-prompt @../other-project/feature-request.txt

Complex Scenarios

"Convert to TDD: Refactor the payment processing module" "Test-driven approach for: API rate limiting feature" "TDD prompt for: Database migration script"

Instructions for Claude

When converting to TDD prompts:

Input Handling

  • If $ARGUMENTS is provided, read the file at that path to get the prompt to convert
  • If no $ARGUMENTS, use the user's direct input as the prompt to convert
  • Support relative and absolute file paths
  1. Extract Requirements: Identify core functionality from the original request
  2. Define Test Cases: Create specific, measurable test scenarios
  3. Specify Expected Outcomes: Clear success and failure criteria
  4. Structure for Implementation: Organize prompt for red-green-refactor cycle
  5. Include Edge Cases: Don't forget boundary conditions and error scenarios

TDD Prompt Structure

1. Objective Statement

Clear, concise description of what needs to be built

2. Test Specifications
GIVEN: [Initial state/context]
WHEN: [Action performed]
THEN: [Expected outcome]
3. Success Criteria
  • Specific, measurable outcomes
  • Performance requirements
  • Error handling expectations
  • Edge case behaviors
4. Test Cases Format
Test Case 1: [Descriptive name]
- Input: [Specific input data]
- Expected Output: [Exact expected result]
- Validation: [How to verify success]

Test Case 2: [Edge case name]
- Input: [Boundary/error condition]
- Expected Output: [Error handling result]
- Validation: [Error verification method]

Read the full file on GitHub · 156 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. 6d ago First seen · 156 lines · 0 tokens per session scan A 3ae9383ac651

Subscribe to this mod's changes

convert-to-test-driven-prompt is a command published in the GitHub repository centminmod/my-claude-code-setup (2,620 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 947 tokens. 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.