From tdd-discipline
Test-driven development discipline (red-green-refactor). Triggers when authoring new functionality or fixing bugs. Enforces failing test first, minimal code to pass, then refactor. Pairs with the test-writer subagent (sonnet tier). Used by Triora's test-writer + migration-writer agents and Pillarworks tester agent.
How this skill is triggered — by the user, by Claude, or both
Slash command
/tdd-discipline:tdd-disciplineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
For new functionality: write the failing test before the code. Pass with the minimum implementation. Then refactor. For bug fixes: reproduce with a test first, fix code to make it green, leave the test as a regression guard.
For new functionality: write the failing test before the code. Pass with the minimum implementation. Then refactor. For bug fixes: reproduce with a test first, fix code to make it green, leave the test as a regression guard.
When NOT strictly TDD:
it('rejects expired tokens')it('checkTokenExpiry returns false')def test_rejects_expired_tokens():
"""Trial-eligibility endpoint must reject tokens issued > 1h ago."""
expired_token = make_token(issued_at=datetime.utcnow() - timedelta(hours=2))
with pytest.raises(AuthError):
check_eligibility(token=expired_token, patient_id="P-001")
it('rejects expired tokens', () => {
const expired = makeToken({ issuedAt: subHours(new Date(), 2) });
expect(() => checkEligibility(expired, 'P-001')).toThrow(AuthError);
});
it('rejects expired tokens at /check-eligibility', async () => {
const expired = makeToken({ issuedAt: subHours(new Date(), 2) });
await expect(callEndpoint('/check-eligibility', { token: expired, patient_id: 'P-001' }))
.rejects.toMatchObject({ error: 'TokenExpired' });
});
This is non-negotiable for production-impact bugs. Even small bugs deserve a regression test.
Per D:\orryx-standards\README.md:
But coverage alone isn't enough — coverage measures "lines hit," not "behaviours verified." Aim for: every public function has at least one happy-path test + one edge-case test. Coverage will follow.
methodology/code-review — code-reviewer subagent flags missing testsmethodology/systematic-debugging — bug-fix workflow that starts with a regression testdelivery/quality-check (Wave 4) — runs test suite + coverage reporttest-writer + migration-writer subagents — sonnet-tier; well-tested patternstester agent — sonnet-tierProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.
npx claudepluginhub alexmclaren/orryx-knowledge --plugin tdd-discipline