Agent skill
validate-tests
Validate and improve the test approach in an implementation plan
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/validate-tests
SKILL.md
Validate Test Approach
Review and improve the test plan in an implementation plan against TESTING_GUIDELINES.md.
Instructions
-
Find the Plan
- Detect current workflow folder from git branch
- Read
workflows/<folder>/plan.md - If no plan exists, suggest running
/create-planfirst
-
Read Testing Guidelines
- Load TESTING_GUIDELINES.md
- Load GIT_TEST_SCENARIOS.md (required for setting up Git test scenarios)
-
Validate Against Guidelines
Check each test in the plan against these requirements:
Naming Convention
- Descriptive names:
TestStartFeatureBranch,TestFinishWithMergeConflict - Names indicate what is being tested
One Test Case Per Function (CRITICAL)
- NO table-driven tests for integration scenarios
- Each test function tests exactly ONE scenario
- Exception only for pure validation functions
Required Test Comments
- First line: Brief description
-
Steps:section with numbered list - Expected outcomes in steps
Test Setup Pattern
- Uses
testutil.SetupTestRepo(t) - Uses
defer testutil.CleanupTestRepo(t, dir) - Uses
testutil.RunGitFlow()not direct exec - Uses
git flow init --defaultsfor setup
Working Directory (CRITICAL)
- Uses testutil functions that set
cmd.Dir - NO reliance on
os.Chdir()unless unavoidable - If
os.Chdir()needed, proper save/restore pattern
Coverage Requirements
- Success path tested
- Error conditions tested
- Edge cases identified and tested
- Descriptive names:
-
Identify Missing Tests
- Check if all code paths have tests
- Identify error conditions that need testing
- Look for edge cases not covered
-
Update the Plan
- Add missing tests to the Test Plan section
- Improve test descriptions
- Add specific test comments following the pattern
- Note any testing challenges
-
Generate Test Skeletons (Optional) If requested, provide test function templates:
go// TestFeatureName tests <description>. // Steps: // 1. Sets up a test repository and initializes git-flow // 2. <Step 2> // 3. <Step 3> // 4. Verifies <expected outcome> func TestFeatureName(t *testing.T) { dir := testutil.SetupTestRepo(t) defer testutil.CleanupTestRepo(t, dir) // Initialize git-flow with defaults output, err := testutil.RunGitFlow(t, dir, "init", "--defaults") if err != nil { t.Fatalf("Failed to initialize git-flow: %v\nOutput: %s", err, output) } // TODO: Implement test } -
Report Findings Summarize:
- Tests that pass validation
- Issues found and fixes made
- Tests added to the plan
- Any concerns or recommendations
Checklist Output
After validation, add this checklist to the plan:
## Test Validation Checklist
- [x] All tests follow naming conventions
- [x] One test case per function rule followed
- [x] Test comments include Steps section
- [x] Using testutil helpers correctly
- [x] Success and error paths covered
- [ ] <Any remaining issues>
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?