AL test development patterns with telemetry verification. MANDATORY when: (1) planning test implementation, (2) creating new tests, (3) modifying existing tests. Invoke proactively at ALL three stages. PLANNING: Structure plans with Red-Green-Refactor phases and use TodoWrite to track progress through each phase. CRITICAL RULE: DEBUG-* telemetry must be ZERO at both task START and END.
View on GitHubFBakkensen/bc-agentic-dev-tools
tdd
plugins/tdd/skills/tdd/SKILL.md
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/FBakkensen/bc-agentic-dev-tools/blob/main/plugins/tdd/skills/tdd/SKILL.md -a claude-code --skill tddInstallation paths:
.claude/skills/tdd/# AL Test Development Patterns ## Planning Test Work When planning any test-related task, structure your plan with Red-Green-Refactor phases: ### Plan Structure **Phase 1 - Red (Design):** - Identify test scenarios to cover - Plan DEBUG-* telemetry checkpoints for verification - Determine which code paths need proof of execution **Phase 2 - Green (Implementation):** - Write test code with DEBUG-TEST-START markers - Add DEBUG-* checkpoints in production code at decision points - Run tests and verify telemetry.jsonl shows correct paths **Phase 3 - Refactor (Cleanup):** - Remove ALL DEBUG-* telemetry from test and production code - Verify zero DEBUG-* calls remain ### TodoWrite Integration When implementing tests, create todos for each phase: ``` 1. [Red] Add DEBUG-TEST-START to <TestName> 2. [Red] Add DEBUG-BRANCH-* checkpoints to <ProductionCode> 3. [Green] Run al-build and verify test passes 4. [Green] Verify correct path in telemetry.jsonl 5. [Refactor] Remove DEBUG-* from production code 6. [Refactor] Remove DEBUG-TEST-START from test code 7. [Refactor] Verify zero DEBUG-* calls remain ``` This structure ensures every test task follows the complete verification cycle. ## DEBUG Telemetry is Always Temporary **Expected starting state:** Zero `DEBUG-*` telemetry calls in both production code (`app/src/`) and test code (`test/src/`). **Why:** DEBUG telemetry is temporary scaffolding for proving code paths during development. It is NOT production instrumentation. If you find existing DEBUG-* calls, they indicate incomplete previous work. **Lifecycle:** 1. Start clean (expect no DEBUG-* anywhere) 2. Add DEBUG-* calls during Red phase to prove execution 3. Verify in telemetry.jsonl during Green phase 4. **Remove ALL DEBUG-* calls during Refactor phase** (REQUIRED) 5. End clean (no DEBUG-* anywhere) **If you find existing DEBUG-* calls:** - Complete the previous work (remove them after verification), OR - Remove them immediately if they're orphaned from aba