From humaninloop
Transforms requirements into vertical slice TDD cycles: test-first tasks (failing test, implement, refactor, demo) for testable feature increments.
How this skill is triggered — by the user, by Claude, or both
Slash command
/humaninloop:patterns-vertical-tddThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Violating the letter of the rules is violating the spirit of the rules.**
Violating the letter of the rules is violating the spirit of the rules.
Transform requirements into implementation tasks organized as vertical slices with strict TDD discipline. Each slice (called a "cycle") delivers observable, testable value and follows test-first principles.
This is a discipline-enforcing skill. The test-first structure exists because tests written after code verify implementation, not requirements. Skipping or reordering undermines the entire purpose.
Wrong (horizontal slicing):
Phase 1: All models
Phase 2: All services
Phase 3: All endpoints
Phase 4: All tests
Right (vertical slicing):
Cycle 1: User creation (model + service + endpoint + test)
Cycle 2: User authentication (model + service + endpoint + test)
Cycle 3: User profile management (model + service + endpoint + test)
Every cycle structures tasks so tests come before implementation:
Cycle N: [Feature]
├── Task N.1: Write failing test
├── Task N.2: Implement to pass
├── Task N.3: Refactor and verify
└── Task N.4: Demo and validate
Foundation Cycles (sequential)
├── C0: Platform infrastructure (compute, CI/CD, monitoring)
├── C1: Core data model + basic CRUD
├── C2: Authentication framework
└── C3: API infrastructure
Feature Cycles (parallel-eligible)
├── C4: [P] Search functionality
├── C5: [P] Filtering
├── C6: [P] Export feature
└── C7: Notifications (depends on C4)
Each cycle must be testable at multiple levels:
See SLICE-IDENTIFICATION.md for detailed heuristics on identifying good vertical slices from requirements.
A good vertical slice:
| Boundary Signal | Action |
|---|---|
| Distinct user action | New cycle |
| Different acceptance scenario | May be new cycle or same cycle |
| Shared infrastructure need | Foundation cycle |
| Optional enhancement | Feature cycle (can parallelize) |
See CYCLE-STRUCTURE.md for detailed cycle formatting and examples.
### Cycle N: [Vertical slice description]
> Stories: US-X, US-Y
> Dependencies: C1, C2 (or "None")
> Type: Foundation | Feature [P]
- [ ] **TN.1**: Write failing E2E test for [behavior] in tests/e2e/test_[name].py
- [ ] **TN.2**: Implement [component] to pass test in src/[path]/[file].py
- [ ] **TN.3**: Refactor and verify tests pass
- [ ] **TN.4**: Demo [behavior], verify acceptance criteria
**Checkpoint**: [What should be observable/testable after this cycle]
| Marker | Meaning |
|---|---|
[P] | Parallel-eligible (no dependencies blocking) |
[US#] | Maps to user story number |
[EXTEND] | Extends existing file (brownfield) |
[MODIFY] | Modifies existing code (brownfield) |
Purpose: Establish infrastructure that ALL features depend on.
Characteristics:
Identification: Ask "Could ANY user story work in production without this?" If no, it's foundation.
Purpose: Deliver user value incrementally.
Characteristics:
Identification: Ask "Does this deliver value a user could observe?" If yes, it's a feature.
Each cycle follows the red-green-refactor pattern:
- [ ] **TN.1**: Write failing E2E test for [user action produces result] in tests/e2e/test_[feature].py
The test should:
- [ ] **TN.2**: Implement [component] to pass test in src/[path]/[file].py
Implementation should:
- [ ] **TN.3**: Refactor and verify tests pass
Refactoring should:
- [ ] **TN.4**: Demo [behavior], verify acceptance criteria
Validation should:
When a user story is well-scoped, it becomes one cycle:
US-1: As a user, I can create a task with a title
→ Cycle 1: Task creation
When a story is too large, split into multiple cycles:
US-2: As a user, I can manage my tasks (create, edit, delete, complete)
→ Cycle 2: Task creation (foundation)
→ Cycle 3: Task editing
→ Cycle 4: Task deletion
→ Cycle 5: Task completion
When stories are too small, merge into one cycle:
US-3: As a user, I can see task count
US-4: As a user, I can see completed count
→ Cycle 6: Task statistics (covers US-3 and US-4)
| Excuse | Reality |
|---|---|
| "I'll write tests after the code works" | Tests written after verify implementation, not requirements. Test-first verifies behavior. No exceptions. |
| "This is too simple to need tests first" | Simple code becomes complex. Tests document intent. Write them first anyway. |
| "Tests slow down development" | Debugging untested code is slower. Tests catch bugs immediately. Faster overall. |
| "I'm just prototyping" | Prototypes become production code. Start with tests or mark SPIKE explicitly. |
| "Horizontal slicing is more efficient" | Horizontal slicing defers integration. Bugs surface late. Vertical finds issues early. |
| "Foundation doesn't need tests" | Foundation is tested by feature cycles. But foundation cycles still follow TDD internally. |
| "Manual verification is sufficient" | Manual testing doesn't scale. Automated tests enable confident refactoring. |
| "The client wants it fast, skip tests" | Skipped tests create technical debt. Bugs cost more than tests. Push back. |
If any of these thoughts arise, STOP immediately:
All of these mean: Rationalization is occurring. Return to test-first discipline.
No exceptions:
❌ Task order: Implement → Test → Refactor ✅ Task order: Test (failing) → Implement (pass) → Refactor → Demo
❌ Cycle 1: All models, Cycle 2: All services, Cycle 3: All tests ✅ Cycle 1: User creation (model + service + endpoint + test for one feature)
❌ Cycle structure: Implement → Demo ✅ Cycle structure: Test → Implement → Refactor → Demo
❌ "Foundation is just setup, skip the test task" ✅ Foundation cycles follow the same test-first pattern
❌ One cycle covering "user management" (create, edit, delete, list) ✅ Separate cycles: Create user, Edit user, Delete user, List users
❌ "Implement user service" ✅ "Implement user service in src/services/user_service.py"
Before finalizing task mapping or task list:
npx claudepluginhub joshuarweaver/cascade-ai-ml-agents-agent-framework --plugin deepeshbodh-human-in-loopExecutes strict TDD for tasks: RED (happy/failure failing tests), GREEN (minimal impl), REFACTOR (tidy code). Enforces no prod code without tests first.
Guides test-driven development with red-green-refactor cycles, vertical slicing, and integration tests via public interfaces. Use for feature building or bug fixes in TDD style.
Guides test-driven development with a red-green-refactor loop, vertical slicing (one test at a time), and integration-style tests that verify behavior through public interfaces.