Implements features using test-driven development (red-green-refactor cycle). Use when the user wants to add testable functionality, mentions TDD, or asks to write tests first before implementation.
/plugin marketplace add astrosteveo/harness/plugin install harness@astrosteveo-marketplaceThis skill is limited to using the following tools:
You are helping a developer implement functionality using strict TDD methodology. Follow the red-green-refactor cycle: write a failing test first, write minimal code to pass, then refactor.
All progress is saved to .artifacts/{feature-slug}/ alongside other feature artifacts.
When $ARGUMENTS contains a new feature/function to implement, start from Phase 1.
When $ARGUMENTS references an existing feature or .artifacts/{feature-slug}/ exists:
.artifacts/{feature-slug}/tdd-progress.mdThese files are added to the existing .artifacts/{feature-slug}/ directory:
.artifacts/{feature-slug}/
├── requirements.md # (existing) Feature requirements
├── design.md # (existing) Architecture design
├── plan.md # (existing) Implementation plan
├── progress.md # (existing) Overall feature progress
├── test-plan.md # TDD: Ordered list of test cases
├── tdd-progress.md # TDD: Current cycle status
└── tdd-summary.md # TDD: Final testing summary
Before starting TDD, verify the test framework is configured:
vitest.config.ts, jest.config.js, etc.)npm install -D vitestpackage.json: "test": "vitest", "test:run": "vitest run"vitest.config.ts if neededCommits follow the TDD rhythm:
test({feature-slug}): add failing test for {behavior} # RED
feat({feature-slug}): implement {behavior} # GREEN
refactor({feature-slug}): {description} # REFACTOR
Goal: Break the feature into testable behaviors
Actions:
feature-slug from the feature name.artifacts/{feature-slug}/ directory (or use existing)Artifact: Create requirements.md:
# {Feature Name} - TDD Requirements
## Overview
{What we're building}
## Testable Behaviors
1. {Behavior 1} - {description}
2. {Behavior 2} - {description}
3. {Behavior 3} - {description}
## Dependencies
- {Any mocks or fixtures needed}
## Out of Scope
- {What we're NOT testing - UI rendering, etc.}
Git Commit: docs({feature-slug}): define testable requirements for TDD
Goal: Order tests from simplest to most complex
Actions:
Artifact: Create test-plan.md:
# {Feature Name} - Test Plan
## Test Order
Tests are ordered from simplest to most complex, each building on the last.
### Cycle 1: {Test Name}
- **Behavior**: {What we're testing}
- **Input**: {Test input}
- **Expected**: {Expected output}
- **Why first**: {Why this is the simplest starting point}
### Cycle 2: {Test Name}
- **Behavior**: {What we're testing}
- **Input**: {Test input}
- **Expected**: {Expected output}
- **Builds on**: {Previous test}
### Cycle 3: {Test Name}
...
## Shared Setup
- {Any beforeEach, fixtures, mocks}
## File Structure
- Test file: `src/{path}/__tests__/{name}.test.ts`
- Implementation: `src/{path}/{name}.ts`
Git Commit: docs({feature-slug}): create TDD test plan with {N} cycles
Goal: Implement each test case using red-green-refactor
For each cycle in the test plan:
test({feature-slug}): add failing test for {behavior}feat({feature-slug}): implement {behavior}refactor({feature-slug}): {description}tdd-progress.md with cycle completionProgress Update Format (in tdd-progress.md):
## Cycle {N}: {Test Name}
- Status: COMPLETE
- RED: Test written, verified failing
- GREEN: Implementation complete, test passing
- REFACTOR: {What was refactored, or "No refactoring needed"}
- Commit(s): {list commit hashes}
Goal: Ensure the TDD'd code integrates correctly
Actions:
npx tsc --noEmit)Git Commit: test({feature-slug}): verify full test suite passes
Goal: Document what was accomplished
Artifact: Create tdd-summary.md:
# {Feature Name} - TDD Summary
## Completed
{Date}
## Test Coverage
- {N} test cases implemented
- All tests passing
## Implementation
- Files created: {list}
- Files modified: {list}
## Key Design Decisions
- {Decision 1}: {rationale}
- {Decision 2}: {rationale}
## Cycles Summary
| Cycle | Behavior | Test | Status |
|-------|----------|------|--------|
| 1 | {behavior} | {test name} | PASS |
| 2 | {behavior} | {test name} | PASS |
## Lessons Learned
- {What went well}
- {What was challenging}
Git Commit: docs({feature-slug}): complete TDD summary
MiningLaser hit detection, TargetingSystem lock mechanicsMiningResult processing, resource calculationsPlace tests adjacent to source:
src/game/systems/
├── MiningLaser.ts
├── __tests__/
│ └── MiningLaser.test.ts
For systems that depend on entities:
// Create minimal mock objects for testing
const mockShip = { position: { x: 0, y: 0 }, rotation: 0 };
const mockAsteroid = { position: { x: 100, y: 0 }, radius: 20 };
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.