tdd-cycle

tdd-cycle is a command for Claude Code from thapaliyabikendra/ai-artifacts. It costs 0 tokens per session (985 once invoked), scanned A, original, Apache-2.0.

A command for Test-Driven Development, a practice of writing a failing test before the code, then making it pass and improving the result. It applies this red-green-refactor cycle to ABP/.NET work.

In plain words
What is it for?
Use it to write failing xUnit tests, implement code that passes existing tests, refactor completed code, or proceed one test at a time.
Why use it?
It gives development a repeatable order and keeps each change tied to a test. You can run the full cycle or work on only one phase.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to write failing xUnit tests, implement code that passes existing tests, refactor completed code, or proceed one test at a time.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/thapaliyabikendra/ai-artifacts/tdd-cycle
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.

Clone the repo
git clone --depth 1 https://github.com/thapaliyabikendra/ai-artifacts

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/tdd-cycle"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/tdd-cycle.svg" alt="Reviewed on agentmods" width="80" 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 985 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.00000 $0.00985
Opus 5 $0.00000 $0.00492
Sonnet 5 $0.00000 $0.00197
Haiku 4.5 $0.00000 $0.00098

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

Security

Grade A, and why

tdd-cycle 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 9d 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/tdd-cycle.md · 160 lines

How it starts

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

TDD Cycle Command

Execute Test-Driven Development workflow with optional phase selection.

Arguments: $ARGUMENTS

Workflow

┌─────────┐   ┌─────────┐   ┌──────────┐
│ 1. RED  │ → │ 2.GREEN │ → │3.REFACTOR│
│ (qa-    │   │ (abp-   │   │ (code-   │
│ engineer│   │developer│   │ reviewer)│
└─────────┘   └─────────┘   └──────────┘
     ↑                            │
     └────────────────────────────┘

Mode Selection

Option Phases Use When
(default) Red → Green → Refactor Full TDD cycle
--phase red Red only Write failing tests first
--phase green Green only Implement to pass existing tests
--phase refactor Refactor only Improve code quality
--incremental One test at a time Fine-grained TDD

Phase 1: RED - Write Failing Tests

Use Task tool with subagent_type="qa-engineer":

Write FAILING xUnit tests for: {feature-or-component}

Context: Read existing tests in test/ folder
Skills: Apply xunit-testing-patterns

Requirements:
- Tests MUST fail initially (missing implementation)
- Use Arrange-Act-Assert pattern
- Should_ExpectedBehavior_When_Condition naming
- Include: happy path, validation, authorization, edge cases
- Use Shouldly for assertions
- Mock dependencies with NSubstitute

Coverage Categories:
1. Happy Path - Normal successful operations
2. Validation - Invalid inputs, missing required fields
3. Authorization - Permission checks, role-based access
4. Edge Cases - Empty collections, boundary values, nulls

Output: Test files in appropriate test project

Checkpoint: All tests fail with meaningful error messages.


Phase 2: GREEN - Minimal Implementation

Use Task tool with subagent_type="abp-developer":

Implement MINIMAL code to make tests pass for: {feature-or-component}

Context: Read docs/architecture/README.md, failing tests
Skills: Apply abp-framework-patterns

Requirements:
- Focus ONLY on making tests green
- No extra features or optimizations
- Follow ABP naming conventions
- Keep methods small and focused

Output: Source code files per test requirements

Read the full file on GitHub · 160 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. 9d ago First seen · 160 lines · 0 tokens per session scan A 07cbf95d97a8

Subscribe to this mod's changes

tdd-cycle is a command published in the GitHub repository thapaliyabikendra/ai-artifacts (24 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 985 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.