Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
TDD task implementation patterns - red-green-refactor cycle, phase checkpoints, git commits, and verification protocols for quality assurance.
version
1.0.0
model
sonnet
invoked_by
both
tools
["Read","Write","Edit","Bash","Glob","Grep"]
verified
false
lastVerifiedAt
"2026-02-19T05:29:09.098Z"
source
builtin
trust_score
100
provenance_sha
e0778887043c1729
Workflow Patterns
Guide for implementing tasks using TDD workflow, managing phase checkpoints, handling git commits, and executing the verification protocol that ensures quality throughout implementation.
When to Use This Skill
Implementing tasks from a track's plan.md
Following TDD red-green-refactor cycle
Completing phase checkpoints
Managing git commits and notes
Understanding quality assurance gates
Handling verification protocols
Recording progress in plan files
TDD Task Lifecycle
Follow these 11 steps for each task:
Step 1: Select Next Task
Read plan.md and identify the next pending [ ] task. Select tasks in order within the current phase. Do not skip ahead to later phases.
Step 2: Mark as In Progress
Update plan.md to mark the task as [~]:
- [~] **Task 2.1**: Implement user validation
Commit this status change separately from implementation.
Step 3: RED - Write Failing Tests
Write tests that define the expected behavior before writing implementation:
Create test file if needed
Write test cases covering happy path
Write test cases covering edge cases
Write test cases covering error conditions
Run tests - they should FAIL
Example:
deftest_validate_user_email_valid():
user = User(email="test@example.com")
assert user.validate_email() isTruedeftest_validate_user_email_invalid():
user = User(email="invalid")
assert user.validate_email() isFalse
Step 4: GREEN - Implement Minimum Code
Write the minimum code necessary to make tests pass:
Focus on making tests green, not perfection
Avoid premature optimization
Keep implementation simple
Run tests - they should PASS
Step 5: REFACTOR - Improve Clarity
With green tests, improve the code:
Extract common patterns
Improve naming
Remove duplication
Simplify logic
Run tests after each change - they should remain GREEN
Step 6: Verify Coverage
Check test coverage meets the 80% target:
pytest --cov=module --cov-report=term-missing
If coverage is below 80%:
Identify uncovered lines
Add tests for missing paths
Re-run coverage check
Step 7: Document Deviations
If implementation deviated from plan or introduced new dependencies:
Update tech-stack.md with new dependencies
Note deviations in plan.md task comments
Update spec.md if requirements changed
Step 8: Commit Implementation
Create a focused commit for the task:
git add -A
git commit -m "feat(user): implement email validation
- Add validate_email method to User class
- Handle empty and malformed emails
- Add comprehensive test coverage
Task: 2.1
Track: user-auth_20250115"
Commit message format:
Type: feat, fix, refactor, test, docs, chore
Scope: affected module or component
Summary: imperative, present tense
Body: bullet points of changes
Footer: task and track references
Step 9: Attach Git Notes
Add rich task summary as git note:
git notes add -m "Task 2.1: Implement user validation
Summary:
- Added email validation using regex pattern
- Handles edge cases: empty, no @, no domain
- Coverage: 94% on validation module
Files changed:
- src/models/user.py (modified)
- tests/test_user.py (modified)
Decisions:
- Used simple regex over email-validator library
- Reason: No external dependency for basic validation"
Step 10: Update Plan with SHA
Update plan.md to mark task complete with commit SHA:
- [x] **Task 2.1**: Implement user validation `abc1234`