Install
openclaw skills install workflow-patternsSystematic task implementation using TDD, phase checkpoints, and structured commits. Ensures quality through red-green-refactor cycles, 80% coverage gates, and verification protocols before proceeding.
openclaw skills install workflow-patternsImplement tasks systematically using TDD (Test-Driven Development) with phase checkpoints and verification protocols. Ensures quality at every step.
npx clawhub@latest install workflow-patterns
Provides a structured approach to implementing tasks:
Use for:
Skip for:
Keywords: TDD, implementation, testing, coverage, checkpoints, verification, red-green-refactor
11 steps for each task:
Read the plan and identify the next pending [ ] task. Select tasks in order within the current phase. Do not skip ahead.
Update the plan to mark the task as [~]:
- [~] **Task 2.1**: Implement user validation
Write tests that define expected behavior before implementation:
def test_validate_email_valid():
user = User(email="test@example.com")
assert user.validate_email() is True
def test_validate_email_invalid():
user = User(email="invalid")
assert user.validate_email() is False
Write the minimum code to make tests pass:
With green tests, improve the code:
Check test coverage meets the 80% target:
pytest --cov=module --cov-report=term-missing
If coverage is below 80%:
If implementation deviated from plan or added dependencies:
Create focused commit:
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"
Mark task complete with commit SHA:
- [x] **Task 2.1**: Implement user validation `abc1234`
git commit -m "docs: update plan - task 2.1 complete"
Continue to next task until phase is complete.
When all tasks in a phase are complete:
git diff --name-only <last-checkpoint-sha>..HEAD
For each modified file:
pytest -v --tb=short
All tests must pass.
## Phase 1 Verification
- [ ] User can register with valid email
- [ ] Invalid email shows appropriate error
- [ ] Database stores user correctly
Present checklist:
Phase 1 complete. Please verify:
1. [x] Test suite passes (automated)
2. [x] Coverage meets target (automated)
3. [ ] Manual verification items (requires human)
Respond with 'approved' to continue.
Do NOT proceed without explicit approval.
git commit -m "checkpoint: phase 1 complete
Verified:
- All tests passing
- Coverage: 87%
- Manual verification approved"
Update plan checkpoints table:
## Checkpoints
| Phase | SHA | Date | Status |
|---------|---------|------------|----------|
| Phase 1 | def5678 | 2025-01-15 | verified |
| Phase 2 | | | pending |
Before marking any task complete:
| Gate | Requirement |
|---|---|
| Tests | All existing tests pass, new tests pass |
| Coverage | New code has 80%+ coverage |
| Linting | No linter errors |
| Types | Type checker passes (if applicable) |
| Security | No secrets in code, input validation present |
<type>(<scope>): <subject>
<body>
Task: <task-id>
Types:
feat — New featurefix — Bug fixrefactor — Code change without feature/fixtest — Adding testsdocs — Documentationchore — MaintenanceDiscovered requirement not in spec:
Feature deemed unnecessary:
[-] (skipped) with reasonDifferent approach than planned:
- [x] **Task 2.1**: Implement validation `abc1234`
- DEVIATION: Used library instead of custom code
- Reason: Better edge case handling
- Impact: Added email-validator to dependencies
[!] with blocker description| Symbol | Meaning |
|---|---|
[ ] | Pending |
[~] | In progress |
[x] | Complete |
[-] | Skipped |
[!] | Blocked |