Implement features from task specifications using Test-Driven Development (TDD) with bmad-commands for file operations and testing. This skill should be used when implementing new functionality from approved task specs.
Implement features from task specifications using Test-Driven Development (TDD) with bmad-commands for file operations and testing. This skill should be used when implementing new functionality from approved task specs.
acceptance
[{"tests_passing":"All tests must pass"},{"coverage_threshold":"Test coverage >= 80%"},{"no_syntax_errors":"Code must have no syntax errors"},{"task_spec_loaded":"Task specification successfully loaded"},{"requirements_met":"All acceptance criteria from task spec addressed"}]
inputs
{"task_id":{"type":"string","required":true,"description":"Task identifier (e.g., task-auth-002-login)","validation":"Must match pattern: task-{component}-{number}-{slug}"},"subtask_id":{"type":"string","required":false,"description":"Optional subtask identifier to implement only a specific subtask (e.g., subtask-1, subtask-2)","validation":"Must match pattern: subtask-{number} if provided"}}
outputs
{"implementation_complete":{"type":"boolean","description":"Whether implementation is complete and meets all criteria"},"test_coverage_percent":{"type":"number","description":"Test coverage percentage achieved"},"files_modified":{"type":"array","description":"List of files created or modified"},"tests_passed":{"type":"boolean","description":"Whether all tests passed"}}
Implement features from task specifications or user stories using Test-Driven Development (TDD). This skill writes tests first, implements code to make tests pass, and validates the implementation meets all acceptance criteria.
Core Principles:
Test-Driven Development (Red → Green → Refactor)
Deterministic operations via bmad-commands
Automated acceptance criteria verification
Continuous validation
Prerequisites
Task specification exists at workspace/tasks/{task_id}.md
bmad-commands skill available at .claude/skills/bmad-commands/
Action: Create task spec first using create-task-spec skill
Halt implementation
If subtask_id is provided:
Parse the task specification to locate the specific subtask section
Filter acceptance criteria to only those related to the subtask
Scope implementation to only the subtask requirements
Note: All workflow steps below apply only to the selected subtask
See:references/templates.md for required task spec format
Step 1: Analyze Requirements
Action: Break down acceptance criteria into test cases.
For each acceptance criterion:
Identify what needs to be tested (behavior/outcome)
Determine test type (unit/integration/e2e)
Plan test structure and data
Identify edge cases
Example Analysis:
AC-1: User can log in with valid credentials
Test Cases:
- [Unit] Should return user object when credentials valid
- [Unit] Should return null when email not found
- [Unit] Should return null when password incorrect
- [Integration] Should create session when login successful
- [Integration] Should return 401 when login fails
Identify Files:
Files to create (new implementation + tests)
Files to modify (existing routes, config)
Files to reference (existing models, utilities)
See:references/requirement-analysis-guide.md for detailed analysis patterns
Step 2: Write Tests (TDD Red Phase)
Action: Write failing tests that cover all acceptance criteria.