Instrucciones de origen · Vista previa de solo lectura
name
ring:dev-testing
description
Gate 3 of development cycle - ensures unit test coverage meets threshold (85%+)
for all acceptance criteria using TDD methodology.
trigger
- After implementation and SRE complete (Gate 0/1/2)
- Task has acceptance criteria requiring test coverage
- Need to verify implementation meets requirements
NOT_skip_when
- "Manual testing validates all criteria" → Manual tests are not executable. Gate 3 requires unit tests.
- "Integration tests are better" → Gate 3 scope is unit tests only.
- "Coverage is close to 85%" → Close enough is not passing. Meet exact threshold.
{"required":[{"name":"unit_id","type":"string","description":"Task or subtask identifier"},{"name":"acceptance_criteria","type":"array","items":"string","description":"List of acceptance criteria to test"},{"name":"implementation_files","type":"array","items":"string","description":"Files from Gate 0 implementation"},{"name":"language","type":"string","enum":["go","typescript","python"],"description":"Programming language"}],"optional":[{"name":"coverage_threshold","type":"float","default":85,"description":"Minimum coverage percentage (cannot be below 85)"},{"name":"gate0_handoff","type":"object","description":"Full handoff from Gate 0"},{"name":"existing_tests","type":"array","items":"string","description":"Existing test files"}]}
output_schema
{"format":"markdown","required_sections":[{"name":"Testing Summary","pattern":"^## Testing Summary","required":true},{"name":"Coverage Report","pattern":"^## Coverage Report","required":true},{"name":"Traceability Matrix","pattern":"^## Traceability Matrix","required":true},{"name":"Handoff to Next Gate","pattern":"^## Handoff to Next Gate","required":true}],"metrics":[{"name":"result","type":"enum","values":["PASS","FAIL"]},{"name":"coverage_actual","type":"float"},{"name":"coverage_threshold","type":"float"},{"name":"tests_written","type":"integer"},{"name":"criteria_covered","type":"string","description":"X/Y format"},{"name":"iterations","type":"integer"}]}
verification
{"automated":[{"command":"go test ./... -covermode=atomic -coverprofile=coverage.out && go tool cover -func=coverage.out | grep total","description":"Go tests pass with coverage","success_pattern":"total:.*[8-9][0-9]|100"},{"command":"npm test -- --coverage | grep -E 'All files|Statements'","description":"TypeScript tests pass with coverage","success_pattern":"[8-9][0-9]|100"}],"manual":["Every acceptance criterion has at least one test","No skipped or pending tests"]}
examples
[{"name":"TDD for auth service","input":{"unit_id":"task-001","acceptance_criteria":["User can login with valid credentials","Invalid password returns error"],"implementation_files":["internal/service/auth.go"],"language":"go"},"expected_output":"## Testing Summary\n**Status:** PASS\n**Coverage:** 89.5%\n\n## Coverage Report\n| Package | Coverage |\n|---------|----------|\n| internal/service | 89.5% |\n\n## Traceability Matrix\n| AC | Test | Status |\n|----|------|--------|\n| AC-1 | TestAuthService_Login_ValidCredentials | ✅ |\n| AC-2 | TestAuthService_Login_InvalidPassword | ✅ |\n\n## Handoff to Next Gate\n- Ready for Gate 4: YES\n"}]
Dev Testing (Gate 3)
Overview
Ensure every acceptance criterion has at least one unit test proving it works. Follow TDD methodology: RED (failing test) -> GREEN (implementation) -> REFACTOR.
Core principle: Untested acceptance criteria are unverified claims. Each criterion MUST map to at least one executable unit test.
<block_condition>
Coverage below 85% = FAIL
Any acceptance criterion without test = FAIL
</block_condition>
Coverage threshold: 85% minimum (Ring standard). PROJECT_RULES.md can raise, not lower.
CRITICAL: Role Clarification
This skill ORCHESTRATES. QA Analyst Agent EXECUTES.
REQUIRED INPUT (from ring:dev-cycle orchestrator):
<verify_before_proceed>
- unit_id exists
- acceptance_criteria is not empty
- implementation_files is not empty
- language is valid (go|typescript|python)
</verify_before_proceed>
```text
- unit_id: [task/subtask being tested]
- acceptance_criteria: [list of ACs to test]
- implementation_files: [files from Gate 0]
- language: [go|typescript|python]
OPTIONAL INPUT:
- coverage_threshold: [default 85.0, cannot be lower]
- gate0_handoff: [full Gate 0 output]
- existing_tests: [existing test files]
if any REQUIRED input is missing:
→ STOP and report: "Missing required input: [field]"
→ Return to orchestrator with error
if coverage_threshold < 85:
→ STOP and report: "Coverage threshold cannot be below Ring minimum (85%)"
→ Use 85% as threshold