afc-test
Test strategy and writing โ unit, integration, e2e tests, coverage improvement
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Test strategy and writing โ unit, integration, e2e tests, coverage improvement
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Code and component analysis โ analyze code, trace flows, audit consistency, inspect components
Architecture analysis and design review
Full auto pipeline โ run spec-to-clean cycle automatically for new features
Save session state for later resumption
Resolve spec ambiguities with clarifying questions
Pipeline artifact cleanup and codebase hygiene
| name | afc:test |
| description | Test strategy and writing โ unit, integration, e2e tests, coverage improvement |
| argument-hint | [target: file path, feature name, or coverage] |
| allowed-tools | ["Read","Write","Edit","Bash","Glob","Grep"] |
| model | sonnet |
Establishes a test strategy for implemented code and writes tests. Standalone command โ not part of the auto pipeline. Use after implement or before review.
$ARGUMENTS โ (required) Test target. One of:
src/features/auth/)login flow)coverage โ full coverage analysis and gap remediation!cat .claude/afc.config.md 2>/dev/null || echo "[CONFIG NOT FOUND] .claude/afc.config.md not found. Create it with /afc:init."
Values used: {config.gate} (CI), {config.architecture} (layers), test framework from Project Context.
Parse $ARGUMENTS:
Existing coverage check: Before writing new tests, evaluate what already exists:
Determine characteristics of target code:
### Test Strategy
- Target: {file/feature}
- Framework: {test framework from Project Context}
- Test types:
- [ ] Unit tests: {list of target functions/methods}
- [ ] Integration tests: {component interactions}
- [ ] E2E tests: {user scenarios} (only if applicable)
- Mocking strategy: {mocking approach per dependency}
Confirm strategy with user before proceeding.
Principles:
it('should {expected behavior} when {condition}') formatPriority:
Test file location: follows project convention
{filename}.test.{ext} (same directory)__tests__/{filename}.test.{ext} or tests/ directoryAlways read
${CLAUDE_SKILL_DIR}/../../docs/critic-loop-rules.mdfirst and follow it.
Run the critic loop until convergence. Safety cap: 5 passes.
| Criterion | Validation |
|---|---|
| COVERAGE | Are all core logic and branch points covered? |
| QUALITY | Do tests validate behavior, not implementation details? Are there any brittle tests? |
Follow verdict handling and output format per docs/critic-loop-rules.md.
{config.gate}
On failure:
Maximum 3 retries.
Tests complete
โโ Target: {file/feature}
โโ Written: {N} tests ({unit X, integration Y, E2E Z})
โโ Coverage: {summary of key branch point coverage}
โโ Critic: converged ({N} passes, {M} fixes, {E} escalations)
โโ Verified: all tests passing
โโ Found: {bug details if found, otherwise "no issues"}