$npx -y skills add wrtnlabs/autobe --skill validate-providerValidate Providers against interfaces (read-only)
| 1 | # Validate Providers |
| 2 | |
| 3 | Validate that Providers, Collectors, and Transformers properly implement the interfaces. This skill only checks for discrepancies - it does NOT modify any files. |
| 4 | |
| 5 | ## Purpose |
| 6 | |
| 7 | Compare interface definitions with provider implementations 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/ │ |
| 18 | └───────────────┬─────────────────────┘ |
| 19 | │ |
| 20 | ▼ |
| 21 | ┌─────────────────────────────────────┐ |
| 22 | │ Step 2: Read Providers │ |
| 23 | │ /src/providers/ │ |
| 24 | │ /src/collectors/ │ |
| 25 | │ /src/transformers/ │ |
| 26 | └───────────────┬─────────────────────┘ |
| 27 | │ |
| 28 | ▼ |
| 29 | ┌─────────────────────────────────────┐ |
| 30 | │ Step 3: Compare & Report │ |
| 31 | │ - Missing providers │ |
| 32 | │ - Missing collectors │ |
| 33 | │ - Missing transformers │ |
| 34 | │ - Type safety issues │ |
| 35 | └─────────────────────────────────────┘ |
| 36 | ``` |
| 37 | |
| 38 | --- |
| 39 | |
| 40 | ## Step 1: Read Interfaces |
| 41 | |
| 42 | ```bash |
| 43 | find src/api/structures -name "I*.ts" -type f |
| 44 | ``` |
| 45 | |
| 46 | For each interface, identify: |
| 47 | - Main entity type |
| 48 | - ICreate subtype |
| 49 | - IUpdate subtype |
| 50 | - ISummary subtype |
| 51 | |
| 52 | --- |
| 53 | |
| 54 | ## Step 2: Read Implementation Files |
| 55 | |
| 56 | ```bash |
| 57 | # Providers |
| 58 | find src/providers -name "*.ts" -type f |
| 59 | |
| 60 | # Collectors |
| 61 | find src/collectors -name "*Collector.ts" -type f |
| 62 | |
| 63 | # Transformers |
| 64 | find src/transformers -name "*Transformer.ts" -type f |
| 65 | ``` |
| 66 | |
| 67 | --- |
| 68 | |
| 69 | ## Step 3: Validation Checks |
| 70 | |
| 71 | ### 3.1 Provider Coverage |
| 72 | For each interface: |
| 73 | - ✅ POST provider exists (uses ICreate) |
| 74 | - ✅ GET provider exists (returns Interface) |
| 75 | - ✅ PATCH/PUT provider exists (uses IUpdate) |
| 76 | - ✅ DELETE provider exists |
| 77 | - ❌ Provider missing |
| 78 | |
| 79 | ### 3.2 Collector Coverage |
| 80 | For each interface with ICreate: |
| 81 | - ✅ Collector exists |
| 82 | - ✅ Collector returns Prisma.CreateInput |
| 83 | - ❌ Collector missing |
| 84 | - ❌ Wrong return type |
| 85 | |
| 86 | ### 3.3 Transformer Coverage |
| 87 | For each interface: |
| 88 | - ✅ Transformer exists |
| 89 | - ✅ transform() method defined |
| 90 | - ✅ toSummary() method defined |
| 91 | - ❌ Transformer missing |
| 92 | - ❌ Methods missing |
| 93 | |
| 94 | ### 3.4 Type Safety |
| 95 | Search for anti-patterns: |
| 96 | - ❌ `as any` usage |
| 97 | - ❌ `any` type annotations |
| 98 | - ❌ Type assertions (`as Type`) |
| 99 | - ⚠️ Inline transformations (should use Transformer) |
| 100 | |
| 101 | --- |
| 102 | |
| 103 | ## Output Format |
| 104 | |
| 105 | ```markdown |
| 106 | # Validation Report: Providers |
| 107 | |
| 108 | ## Summary |
| 109 | - Interfaces: X |
| 110 | - Providers found: Y |
| 111 | - Collectors found: Z |
| 112 | - Transformers found: W |
| 113 | |
| 114 | ## ✅ Valid Items |
| 115 | - [Provider] `postEntity` - Uses Collector, returns via Transformer |
| 116 | - [Collector] `EntityCollector` - Properly typed |
| 117 | - [Transformer] `EntityTransformer` - All methods present |
| 118 | |
| 119 | ## ❌ Issues Found |
| 120 | - [Missing Collector] `AnotherEntity` - No collector for ICreate |
| 121 | - [Missing Transformer] `AnotherEntity` - No transformer defined |
| 122 | - [Type Safety] `postEntity.ts:27` - Uses `as any` |
| 123 | - [Type Safety] `getEntity.ts:15` - Inline transformation instead of Transformer |
| 124 | |
| 125 | ## ⚠️ Warnings |
| 126 | - [Unused Import] `postEntity.ts` - Imports unused module |
| 127 | - [Missing Null Check] `getEntity.ts:20` - Should check for null before transform |
| 128 | |
| 129 | ## Recommendation |
| 130 | Run `/fix-provider` to fix the issues above. |
| 131 | ``` |
| 132 | |
| 133 | --- |
| 134 | |
| 135 | ## Important |
| 136 | |
| 137 | **This skill is READ-ONLY.** |
| 138 | |
| 139 | - Does NOT modify any files |
| 140 | - Does NOT run any build commands |
| 141 | - Only reports discrepancies |
| 142 | |
| 143 | To fix issues, use `/fix-provider` skill. |