tdd-claude-acpx
TDD-Claude-Acpx
Core Protocols
- Tests come first. Verify RED before any implementation.
- Claude owns production edits. External audits and reviews run through
acpx. - Use English inside
acpxprompts. Reply to the user in their language. - Sanitize secrets before including file contents in any prompt file.
Workflow
Phase 0: Read the Task
- Read the plan file if the argument is a path.
- Otherwise, treat the argument as the task description.
- Ask for clarification if key context is missing.
Phase 1: Gather Context and Establish a Baseline
- Read the relevant production files and existing tests.
- Identify the project test conventions and coverage tooling.
- Record
START_SHAwithgit rev-parse HEAD. - If the worktree is dirty, stop and ask the user to commit or stash before continuing.
- Run the smallest useful baseline test scope and note existing failures.
Phase 2: Write Tests First (RED)
- Read
tdd-specialist-role.mdfrom this skill directory. - Use a Task subagent or direct editing to create failing tests only.
- Run only the new tests.
- Confirm the tests fail for the intended missing behavior.
- If they pass unexpectedly or fail for the wrong reason, fix the tests and re-check RED before moving on.
Phase 3: Audit the Tests Through acpx (max 2 fix cycles)
- Read
acpx-auditor-role.mdfrom this skill directory. - If
acpxis unavailable, note that the test audit was skipped and continue. - Otherwise, ensure a named session:
acpx --approve-reads codex sessions ensure --name test-audit - Build a prompt file that starts with
acpx-auditor-role.md, then tells the external reviewer to inspect the new tests only and return the structured verdict. - Run:
acpx --approve-reads --format json --json-strict codex -s test-audit -f <prompt-file> - If
CRITICALorHIGHfindings are accepted, fix the tests, re-verify RED, then re-audit in the sametest-auditsession. - If a finding seems wrong, challenge it inside the same session. Discussion rounds do not count toward the 2 fix cycles.
- Close
test-auditwhen done.
Phase 4: Implement (GREEN)
- Implement locally.
- Keep the change minimal.
- Do not modify the tests unless they are provably wrong.
- Run the new tests until they pass, then run the baseline scope to confirm no new regressions.
Phase 5: Refactor (IMPROVE)
- Refactor while keeping the tests green.
- Re-run the task tests after each meaningful cleanup.
- If coverage tooling exists, check coverage and add tests if the new behavior is under-covered.
Phase 6: Review Through acpx (max 3 fix cycles)
- If
acpxis unavailable here, stop and tell the user that the final review requires acpx-backed review. - Ensure a named session:
acpx --approve-reads codex sessions ensure --name impl-review - Build a prompt file instructing the external reviewer to inspect
git diff $START_SHAand return the structured verdict only. - Run:
acpx --approve-reads --format json --json-strict codex -s impl-review -f <prompt-file> - If accepted
CRITICAL/HIGHissues exist, fix them in one batch, re-run verification, then re-review in the sameimpl-reviewsession. - If a finding seems wrong, challenge it in the same session. Discussion rounds do not count toward the 3 fix cycles.
- Ask the user whether to fix any remaining
MEDIUM/LOWissues before delivery. - Close
impl-reviewwhen done.
Delivery
Report:
- RED confirmation
- GREEN confirmation
- coverage status
- final review verdict
- any deferred
MEDIUM/LOWissues
More from knowlet/claude-acpx
acpx
Use acpx as the transport for Codex or other ACP agents: persistent sessions, named sessions, queue-aware prompts, permission control, and compact CLI output. Trigger when the task mentions acpx, ACP, Codex via acpx, replacing Codex MCP, persistent agent sessions, or headless agent execution from Bash.
1execute-acpx
Smart size-based routing: Claude handles small changes locally, while large changes run through acpx and code-reviewer reviews the result. By default the examples use `acpx codex`, but the workflow is branded around acpx. Triggers on: /execute-acpx, execute plan, implement with routing, run the plan, or route large implementation through acpx.
1plan-acpx
Create a structured implementation plan, then audit it through acpx until approved. By default the external audit examples use `acpx codex`, but the workflow is acpx-first. Triggers on: /plan-acpx, plan a feature, create an implementation plan, design a system, architect this, or audit a plan with acpx.
1claude-acpx
Claude implements code changes locally, then an external review loop checks the diff through acpx. By default the examples use `acpx codex`, but the branding and workflow are acpx-first. Triggers on: /claude-acpx, implement and review, build with external review, or review the diff through acpx.
1tdd-execute-acpx
Full TDD with smart routing: Claude writes tests first, acpx audits them, then Claude handles small implementations locally while large implementations run through acpx and code-reviewer reviews the result. By default the examples use `acpx codex`, but the workflow is branded around acpx. Triggers on: /tdd-execute-acpx, TDD with routing, test-driven execute, or large TDD implementation through acpx.
1