# Tdd+

> Invoke AFTER plan+ is approved. Wraps superpowers:test-driven-development with full-loop assertions, real-dependency enforcement for stack/integration-layer tests, zero-defect, stale test detection, and scoped test runs. Implements plan tasks with RED-GREEN-REFACTOR discipline.

- **Type:** Skill
- **Install:** `agentstack add skill-franklywatson-claude-rig-tdd-plus`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [franklywatson](https://agentstack.voostack.com/s/franklywatson)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [franklywatson](https://github.com/franklywatson)
- **Source:** https://github.com/franklywatson/claude-rig/tree/master/templates/skills/tdd-plus

## Install

```sh
agentstack add skill-franklywatson-claude-rig-tdd-plus
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# tdd+ — Disciplined Implementation

Wraps `superpowers:test-driven-development`. Requires superpowers to be installed.

**This skill activates tdd+ phase in the enforcement layer.** During this phase:

- Full test suite runs are redirected (use scoped tests only)
- Stale test warnings fire when source edits lack test updates
- Active enforcement rules from session context are enforced (see session-start output; real dependencies in stack/E2E (integration-layer) tests by default)

## Procedure

### Phase A: Setup

1. Announce phase entry:

   ```
   Now using tdd+ skill. Enforcement layer active:
   - Test scope: scoped runs only (full suite reserved for verify+)
   - Stale tests: warnings when source edited without test updates
   - Zero-defect: every failure must be fixed before proceeding
   ```

2. Load the plan from `docs/plans/`.

3. Identify the task(s) to implement.

4. If branch discipline is active (see session-start output) and you are on a
   protected branch, create an isolated workspace before implementing — a
   worktree (`superpowers:using-git-worktrees`) when the plan is multi-task or
   the working tree is dirty, a plain feature branch otherwise.

### Phase B: Implement Each Task (delegate to superpowers:test-driven-development)

1. For each task in the plan, follow RED-GREEN-REFACTOR:

   **RED — Write the failing test first:**
   - Write a test that captures the task's requirement
   - Use full-loop assertions where applicable:
     - Primary: does the function return the expected value?
     - Second-order: did the side effect occur? (state change, log entry, event)
     - Third-order: is the system still consistent? (no orphan records, no leaked connections)
   - If the plan defines a signal stack, each task's completion gate is its
     named gating signal — run that signal and show its output before marking
     the task done
   - Run the test: it MUST fail (if it passes immediately, the test is wrong)
   - Show the failure output

   **GREEN — Write minimal code to make the test pass:**
   - Write the smallest possible implementation
   - Do not add features not in the plan
   - Run the scoped test: `npx vitest run tests/path/to/specific.test.ts`
   - Show the passing output

   **REFACTOR — Clean up while tests pass:**
   - Improve code structure without changing behavior
   - Run scoped tests after each refactoring step
   - Commit after each completed task

2. After each source file edit, check:
   - Was the corresponding test file also updated?
   - If not, the enforcement layer will emit a stale test warning
   - Address it before proceeding to the next task

### Phase C: Task Completion

1. After each task, verify:
   - [ ] Test was written first and shown to fail
   - [ ] Implementation makes the test pass
   - [ ] Scoped test run passes (not full suite)
   - [ ] Active enforcement rules followed (see session-start output)
   - [ ] Commit made with descriptive message

2. Proceed to next task or exit tdd+ phase when all plan tasks complete.

## Test Scope Rules

During tdd+ phase, the enforcement layer redirects:

- `npx vitest run` (full suite) → advise to run scoped tests only
- `pytest` (full suite) → advise to run specific test file

Use scoped commands:

```
npx vitest run tests/router/resolver.test.ts
pytest tests/test_config.py::test_load_config
```

Full suite runs happen during `verify+` phase, not here.

## Skill Chain

After completing all plan tasks with tdd+:

- Invoke `/verify+` to run full suite and verify against plan acceptance criteria

## Completion

Report one of these states when the skill finishes:

- **DONE** — All plan tasks implemented with passing scoped tests. No constitutional violations.
- **DONE_WITH_CONCERNS** — All tasks implemented but some tests need attention or minor deviations exist.
- **BLOCKED** — Tests failing, cannot proceed without fixing. Return to RED phase.
- **NEEDS_CONTEXT** — Need user input to resolve an implementation ambiguity or design question.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [franklywatson](https://github.com/franklywatson)
- **Source:** [franklywatson/claude-rig](https://github.com/franklywatson/claude-rig)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-franklywatson-claude-rig-tdd-plus
- Seller: https://agentstack.voostack.com/s/franklywatson
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
