$npx -y skills add wrtnlabs/autobe --skill validate-interfaceValidate Controllers and DTOs against requirements (read-only)
| 1 | # Validate Interface (Controllers, DTOs) |
| 2 | |
| 3 | Validate that Controllers and DTO interfaces match the requirements specification. This skill only checks for discrepancies - it does NOT modify any files. |
| 4 | |
| 5 | ## Purpose |
| 6 | |
| 7 | Compare requirements documents with interface definitions and report: |
| 8 | - ✅ Matching items |
| 9 | - ❌ Mismatching items (needs fix) |
| 10 | - ⚠️ Items requiring review |
| 11 | |
| 12 | ## Workflow |
| 13 | |
| 14 | ``` |
| 15 | ┌─────────────────────────────────────┐ |
| 16 | │ Step 1: Read Requirements │ |
| 17 | │ /docs/analysis/*.md │ |
| 18 | └───────────────┬─────────────────────┘ |
| 19 | │ |
| 20 | ▼ |
| 21 | ┌─────────────────────────────────────┐ |
| 22 | │ Step 2: Read Prisma Schema │ |
| 23 | │ /prisma/schema/*.prisma │ |
| 24 | └───────────────┬─────────────────────┘ |
| 25 | │ |
| 26 | ▼ |
| 27 | ┌─────────────────────────────────────┐ |
| 28 | │ Step 3: Read Interfaces & Controllers│ |
| 29 | │ /src/api/structures/ │ |
| 30 | │ /src/controllers/ │ |
| 31 | └───────────────┬─────────────────────┘ |
| 32 | │ |
| 33 | ▼ |
| 34 | ┌─────────────────────────────────────┐ |
| 35 | │ Step 4: Compare & Report │ |
| 36 | │ - Missing APIs │ |
| 37 | │ - Empty interfaces │ |
| 38 | │ - Type mismatches │ |
| 39 | │ - Missing DTOs │ |
| 40 | └─────────────────────────────────────┘ |
| 41 | ``` |
| 42 | |
| 43 | --- |
| 44 | |
| 45 | ## Step 1: Read Requirements |
| 46 | |
| 47 | ```bash |
| 48 | find docs/analysis -name "*.md" -type f |
| 49 | ``` |
| 50 | |
| 51 | Extract required APIs: |
| 52 | - HTTP methods (GET, POST, PATCH, PUT, DELETE) |
| 53 | - URL paths |
| 54 | - Request/response structures |
| 55 | - Authentication requirements |
| 56 | |
| 57 | --- |
| 58 | |
| 59 | ## Step 2: Read Prisma Schema |
| 60 | |
| 61 | ```bash |
| 62 | find prisma/schema -name "*.prisma" -type f |
| 63 | ``` |
| 64 | |
| 65 | Understand data model for DTO validation. |
| 66 | |
| 67 | --- |
| 68 | |
| 69 | ## Step 3: Read Current Implementation |
| 70 | |
| 71 | ```bash |
| 72 | # Controllers |
| 73 | find src/controllers -name "*Controller.ts" -type f |
| 74 | |
| 75 | # Interfaces |
| 76 | find src/api/structures -name "I*.ts" -type f |
| 77 | ``` |
| 78 | |
| 79 | --- |
| 80 | |
| 81 | ## Step 4: Validation Checks |
| 82 | |
| 83 | ### 4.1 API Coverage |
| 84 | For each required API: |
| 85 | - ✅ Controller method exists |
| 86 | - ❌ API missing |
| 87 | |
| 88 | ### 4.2 Interface Completeness |
| 89 | For each interface file: |
| 90 | - ✅ All properties defined |
| 91 | - ❌ Empty interface `{}` |
| 92 | - ❌ Missing ICreate/IUpdate/ISummary |
| 93 | |
| 94 | ### 4.3 Type Alignment with Prisma |
| 95 | For each DTO property: |
| 96 | - ✅ Type matches Prisma field |
| 97 | - ❌ Type mismatch |
| 98 | - ❌ Missing nullable annotation |
| 99 | - ⚠️ Missing typia tags |
| 100 | |
| 101 | ### 4.4 Controller Structure |
| 102 | - ✅ Proper decorators (@TypedRoute, @TypedBody) |
| 103 | - ❌ Missing authentication decorator |
| 104 | - ⚠️ Inconsistent naming |
| 105 | |
| 106 | ### 4.5 Path Naming |
| 107 | Check for redundant path segments where the same word repeats: |
| 108 | - ❌ `/{word}/{word}s` - e.g., `/admin/admins`, `/user/users` |
| 109 | - ❌ `/{word}/{word}-*` - e.g., `/item/item-details` |
| 110 | - ❌ `/{prefix}/{prefix}-*` - prefix repeated in resource path |
| 111 | |
| 112 | Fix by removing redundant segment: |
| 113 | - ✅ `/{word}s` - e.g., `/admins`, `/users` |
| 114 | - ✅ `/{prefix}/{resources}` - no repetition |
| 115 | |
| 116 | --- |
| 117 | |
| 118 | ## Output Format |
| 119 | |
| 120 | ```markdown |
| 121 | # Validation Report: Interfaces |
| 122 | |
| 123 | ## Summary |
| 124 | - Required APIs: X |
| 125 | - Implemented APIs: Y |
| 126 | - Missing APIs: Z |
| 127 | - Empty interfaces: W |
| 128 | |
| 129 | ## ✅ Valid Items |
| 130 | - [Controller] `AdminEntitiesController` - All methods present |
| 131 | - [Interface] `IEntity` - Properly defined |
| 132 | |
| 133 | ## ❌ Issues Found |
| 134 | - [Missing API] `DELETE /admin/entities/:id` - Not implemented |
| 135 | - [Empty Interface] `IEntity.ICreate` - No properties defined |
| 136 | - [Type Mismatch] `IEntity.status` - Expected union type, found string |
| 137 | |
| 138 | ## ⚠️ Warnings |
| 139 | - [Missing Tag] `IEntity.id` - Should have `tags.Format<"uuid">` |
| 140 | - [Nullable] `IEntity.deleted_at` - Should be `(string & tags.Format<"date-time">) | null` |
| 141 | - [Path Naming] `/{word}/{word}s` pattern detected - Redundant path segment, remove duplication |
| 142 | |
| 143 | ## Recommendation |
| 144 | Run `/fix-interface` to fix the issues above. |
| 145 | ``` |
| 146 | |
| 147 | --- |
| 148 | |
| 149 | ## Important |
| 150 | |
| 151 | **This skill is READ-ONLY.** |
| 152 | |
| 153 | - Does NOT modify any files |
| 154 | - Does NOT run any build commands |
| 155 | - Only reports discrepancies |
| 156 | |
| 157 | To fix issues, use `/fix-interface` skill. |