$npx -y skills add wrtnlabs/autobe --skill validate-testValidate test coverage against providers (read-only)
| 1 | # Validate Test Infrastructure |
| 2 | |
| 3 | Validate that test infrastructure properly covers providers and interfaces. This skill only checks for discrepancies - it does NOT modify any files. |
| 4 | |
| 5 | ## Purpose |
| 6 | |
| 7 | Compare interface/provider implementations with test coverage and report: |
| 8 | - ✅ Matching items |
| 9 | - ❌ Mismatching items (needs fix) |
| 10 | - ⚠️ Items requiring review |
| 11 | |
| 12 | ## Workflow |
| 13 | |
| 14 | ``` |
| 15 | ┌─────────────────────────────────────┐ |
| 16 | │ Step 1: Read Interfaces │ |
| 17 | │ /src/api/structures/ (ICreate) │ |
| 18 | └───────────────┬─────────────────────┘ |
| 19 | │ |
| 20 | ▼ |
| 21 | ┌─────────────────────────────────────┐ |
| 22 | │ Step 2: Read Test Files │ |
| 23 | │ /test/prepare/ │ |
| 24 | │ /test/generate/ │ |
| 25 | │ /test/features/api/ │ |
| 26 | └───────────────┬─────────────────────┘ |
| 27 | │ |
| 28 | ▼ |
| 29 | ┌─────────────────────────────────────┐ |
| 30 | │ Step 3: Compare & Report │ |
| 31 | │ - Missing prepare functions │ |
| 32 | │ - Missing generate functions │ |
| 33 | │ - Missing test scenarios │ |
| 34 | │ - Empty implementations │ |
| 35 | └─────────────────────────────────────┘ |
| 36 | ``` |
| 37 | |
| 38 | --- |
| 39 | |
| 40 | ## Step 1: Extract ICreate Interfaces |
| 41 | |
| 42 | ```bash |
| 43 | grep -r "export type ICreate\|\.ICreate" src/api/structures/ --include="*.ts" |
| 44 | ``` |
| 45 | |
| 46 | List all interfaces that need test data generators. |
| 47 | |
| 48 | --- |
| 49 | |
| 50 | ## Step 2: Read Test Files |
| 51 | |
| 52 | ```bash |
| 53 | # Prepare functions |
| 54 | find test/prepare -name "prepare_random_*.ts" -type f |
| 55 | |
| 56 | # Generate functions |
| 57 | find test/generate -name "generate_random_*.ts" -type f |
| 58 | |
| 59 | # Feature tests |
| 60 | find test/features/api -name "*.ts" -type f |
| 61 | ``` |
| 62 | |
| 63 | --- |
| 64 | |
| 65 | ## Step 3: Validation Checks |
| 66 | |
| 67 | ### 3.1 prepare_random Coverage |
| 68 | For each ICreate interface: |
| 69 | - ✅ prepare_random_* function exists |
| 70 | - ❌ Function missing |
| 71 | - ❌ Function returns empty `{}` |
| 72 | |
| 73 | ### 3.2 generate_random Coverage |
| 74 | For each prepare_random function: |
| 75 | - ✅ generate_random_* function exists (1:1 mapping) |
| 76 | - ❌ Function missing |
| 77 | - ❌ Orphan generate without prepare |
| 78 | |
| 79 | ### 3.3 Test Scenario Coverage |
| 80 | For each entity: |
| 81 | - ✅ Create test exists |
| 82 | - ✅ Read test exists |
| 83 | - ✅ Update test exists |
| 84 | - ✅ Delete test exists |
| 85 | - ❌ Missing CRUD tests |
| 86 | - ⚠️ Missing edge case tests |
| 87 | |
| 88 | ### 3.4 Test Quality |
| 89 | - ✅ Uses prepare_random (not hardcoded data) |
| 90 | - ✅ Uses generate_random (not direct API calls) |
| 91 | - ❌ Uses typia.random with empty type |
| 92 | - ❌ Hardcoded UUIDs |
| 93 | - ⚠️ Missing assertions |
| 94 | |
| 95 | --- |
| 96 | |
| 97 | ## Output Format |
| 98 | |
| 99 | ```markdown |
| 100 | # Validation Report: Test Infrastructure |
| 101 | |
| 102 | ## Summary |
| 103 | - ICreate interfaces: X |
| 104 | - prepare_random functions: Y |
| 105 | - generate_random functions: Z |
| 106 | - Test files: W |
| 107 | |
| 108 | ## ✅ Valid Items |
| 109 | - [Prepare] `prepare_random_entity` - All fields generated |
| 110 | - [Generate] `generate_random_entity` - Properly calls API |
| 111 | - [Test] `test_entity_create` - Complete assertions |
| 112 | |
| 113 | ## ❌ Issues Found |
| 114 | - [Missing Prepare] `another_entity` - No prepare function for ICreate |
| 115 | - [Missing Generate] `another_entity` - No generate function |
| 116 | - [Empty Prepare] `prepare_random_thing.ts` - Returns `{}` |
| 117 | - [Orphan Generate] `generate_random_old.ts` - No matching prepare function |
| 118 | |
| 119 | ## ⚠️ Warnings |
| 120 | - [Missing Test] `entity` - No delete test scenario |
| 121 | - [Edge Case] `entity` - No validation error test |
| 122 | - [Edge Case] `entity` - No unauthorized access test |
| 123 | |
| 124 | ## Recommendation |
| 125 | Run `/fix-test` to fix the issues above. |
| 126 | ``` |
| 127 | |
| 128 | --- |
| 129 | |
| 130 | ## Important |
| 131 | |
| 132 | **This skill is READ-ONLY.** |
| 133 | |
| 134 | - Does NOT modify any files |
| 135 | - Does NOT run any build commands |
| 136 | - Only reports discrepancies |
| 137 | |
| 138 | To fix issues, use `/fix-test` skill. |