From fairmind-integration
Use when implementing features with Fairmind acceptance criteria - TDD workflow aligned with Fairmind test plans, implementation plans, and journal-based traceability
How this skill is triggered — by the user, by Claude, or both
Slash command
/fairmind-integration:fairmind-tddThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Test-Driven Development workflow aligned with Fairmind test plans and acceptance criteria. This skill ensures tests are **aligned with Fairmind acceptance criteria** (not invented) and implementation follows **plans from get_task** (not free-form).
Test-Driven Development workflow aligned with Fairmind test plans and acceptance criteria. This skill ensures tests are aligned with Fairmind acceptance criteria (not invented) and implementation follows plans from get_task (not free-form).
Announce at start: "I'm using the fairmind-tdd skill to implement this feature with test-driven development."
Dependencies: Requires fairmind-context skill as foundation
Use this skill when:
Step 1: Gather context
fairmind-context skill to gather full contextStudio_get_task)Studio_list_tests_by_userstory)Step 2: Understand what to build
Step 3: Write the failing test
Write a test that:
list_tests_by_userstoryExample:
def test_user_can_login_with_valid_credentials():
# Acceptance criterion: "Users can log in with email and password"
result = login("[email protected]", "password123")
assert result.success == True
assert result.user_id is not None
Step 4: Run test to verify it fails
Run the test and verify:
Document in terminal:
FAILED: test_user_can_login_with_valid_credentials
Expected failure: login function not yet implemented
Step 5: Implement minimal code
Write the minimal code to make the test pass:
Example:
def login(email, password):
# Minimal implementation to pass test
if email and password:
return LoginResult(success=True, user_id=1)
return LoginResult(success=False, user_id=None)
Step 6: Run test to verify it passes
Run the test and verify:
Document in terminal:
PASSED: test_user_can_login_with_valid_credentials
All tests passing: 1/1
Step 7: Clean up code
Improve code quality while maintaining test passage:
Step 8: Run tests again
Verify all tests still pass after refactoring.
Step 9: Update journal
Update fairmind/journals/{role}/{task_id}_*_journal.md with:
### {Timestamp} - Implemented {Feature Name}
**Implementation Plan Item**: {Which item from plan was completed}
**Test Added**:
- File: `{test_file_path}`
- Test name: `{test_name}`
- Aligned with acceptance criterion: "{criterion text}"
**Code Added**:
- File: `{implementation_file_path}`
- Function/class: `{name}`
- Lines: {start_line}-{end_line}
**Test Coverage**:
- ✓ Acceptance criterion X covered
- Test result: PASSED
**Next Steps**: {What's next from the plan}
Step 10: Validate against Fairmind expectations
Cross-check:
get_task?list_tests_by_userstory?Step 11: Continue with next unit
Return to RED PHASE (Step 3) for the next small unit of functionality from the implementation plan.
| Generic TDD | Fairmind TDD |
|---|---|
| Invent test scenarios | Align with Fairmind acceptance criteria |
| Free-form implementation | Follow plan from get_task |
| No traceability requirement | Journal provides plan→test→code traceability |
| Test coverage subjective | Test coverage from list_tests_by_userstory |
Before marking work complete, verify:
If acceptance criteria unclear:
fairmind-context to gather more detailsIf implementation plan missing:
If test expectations unavailable:
npx claudepluginhub fairmind-gen-ai-studio/fairmind-integration --plugin fairmind-integrationProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.