|
| 1 | +<pdd-reason>Validates architecture completeness: PRD coverage, layer completeness, dependency graph validity.</pdd-reason> |
| 2 | +<pdd-interface> |
| 3 | +{{ |
| 4 | + "type": "module", |
| 5 | + "module": {{ |
| 6 | + "functions": [ |
| 7 | + {{"name": "validate_completeness", "signature": "(architecture_json: str, prd_summary: str)", "returns": "str ('VALID' or list of completeness errors)"}} |
| 8 | + ] |
| 9 | + }} |
| 10 | +}} |
| 11 | +</pdd-interface> |
| 12 | +<pdd-dependency>agentic_arch_step9_prompts_LLM.prompt</pdd-dependency> |
| 13 | +% You are an expert software architect. Your task is to validate that the architecture is COMPLETE and covers all PRD requirements. |
| 14 | + |
| 15 | +% Context |
| 16 | + |
| 17 | +You are working on step 10 of the agentic architecture workflow. Step 9 generated prompt files. Now validate that the architecture covers ALL requirements for a COMPLETE, COMPILABLE, RUNNABLE project - NOT just a skeleton. |
| 18 | + |
| 19 | +% Inputs |
| 20 | + |
| 21 | +- GitHub Issue URL: {issue_url} |
| 22 | +- Repository: {repo_owner}/{repo_name} |
| 23 | +- Issue Number: {issue_number} |
| 24 | + |
| 25 | +% Architecture to Validate |
| 26 | +<architecture_json> |
| 27 | +{step7_output} |
| 28 | +</architecture_json> |
| 29 | + |
| 30 | +% PRD Summary (from Step 1) |
| 31 | +<prd_summary> |
| 32 | +{step1_output} |
| 33 | +</prd_summary> |
| 34 | + |
| 35 | +% Validation Checks |
| 36 | + |
| 37 | +**1. PRD Coverage Check** |
| 38 | + |
| 39 | +Extract ALL features/requirements from the PRD summary and verify each has a corresponding module: |
| 40 | + |
| 41 | +```bash |
| 42 | +# List all modules |
| 43 | +cat architecture.json | jq -r '.[] | "\(.filename): \(.reason)"' |
| 44 | +``` |
| 45 | + |
| 46 | +For EACH PRD requirement, find the module(s) that implement it: |
| 47 | +- User authentication → auth_middleware, login_page, etc. |
| 48 | +- Course management → api_courses_route, courses_page, etc. |
| 49 | +- Data persistence → database models, API routes, etc. |
| 50 | + |
| 51 | +**Flag as ERROR if:** |
| 52 | +- A PRD feature has NO corresponding module |
| 53 | +- A core user flow is incomplete (e.g., create without read/update/delete) |
| 54 | + |
| 55 | +**2. Layer Completeness Check** |
| 56 | + |
| 57 | +Based on the project type, verify all essential layers exist: |
| 58 | + |
| 59 | +**For Web Applications (React, Next.js, Vue, etc.):** |
| 60 | +- [ ] Entry point (page.tsx, index.tsx, App.tsx, +page.svelte) |
| 61 | +- [ ] Root layout (layout.tsx, App.tsx with Router) |
| 62 | +- [ ] All routes mentioned in PRD have pages |
| 63 | +- [ ] API routes for all data operations |
| 64 | +- [ ] Types/interfaces for data shapes |
| 65 | +- [ ] State management (if needed) |
| 66 | + |
| 67 | +**For Backend Services (FastAPI, Express, etc.):** |
| 68 | +- [ ] Main entry point (main.py, server.ts, app.ts) |
| 69 | +- [ ] All API endpoints from PRD |
| 70 | +- [ ] Database models/schemas for entities |
| 71 | +- [ ] Authentication/authorization (if mentioned) |
| 72 | +- [ ] Configuration management |
| 73 | + |
| 74 | +**For Full-Stack:** |
| 75 | +- [ ] All frontend requirements |
| 76 | +- [ ] All backend requirements |
| 77 | +- [ ] Shared types between frontend/backend |
| 78 | + |
| 79 | +Run layer check: |
| 80 | +```bash |
| 81 | +# Check for entry points |
| 82 | +cat architecture.json | jq -r '.[].filepath' | grep -E "(page\.|index\.|main\.|app\.|server\.)" |
| 83 | + |
| 84 | +# Check for API routes |
| 85 | +cat architecture.json | jq -r '.[].filepath' | grep -E "(route\.|api/|endpoint)" |
| 86 | + |
| 87 | +# Check for types/models |
| 88 | +cat architecture.json | jq -r '.[].filepath' | grep -E "(types|models|schemas|interfaces)" |
| 89 | +``` |
| 90 | + |
| 91 | +**3. Dependency Graph Analysis** |
| 92 | + |
| 93 | +Verify the dependency graph is valid and complete: |
| 94 | + |
| 95 | +```bash |
| 96 | +# List all dependencies |
| 97 | +cat architecture.json | jq -r '.[] | "\(.filename) depends on: \(.dependencies | join(", "))"' |
| 98 | + |
| 99 | +# Find modules with no dependencies (should be base/config modules) |
| 100 | +cat architecture.json | jq -r '.[] | select(.dependencies | length == 0) | .filename' |
| 101 | + |
| 102 | +# Find modules that nothing depends on (should be entry points/pages) |
| 103 | +``` |
| 104 | + |
| 105 | +**Check for:** |
| 106 | +- Circular dependencies (A→B→C→A) |
| 107 | +- Orphan modules (not connected to the graph, except config/types) |
| 108 | +- Missing dependency references (referencing non-existent modules) |
| 109 | + |
| 110 | +**4. Compilability Check** |
| 111 | + |
| 112 | +Verify the architecture would compile without import errors: |
| 113 | + |
| 114 | +- For TypeScript: All imported types should have corresponding type modules |
| 115 | +- For Python: All imported modules should exist |
| 116 | +- Shared utilities referenced by multiple modules should exist |
| 117 | + |
| 118 | +% Output |
| 119 | + |
| 120 | +**1. Run all validation checks** |
| 121 | + |
| 122 | +Execute the actual commands and analyze results. |
| 123 | + |
| 124 | +**2. Output validation result marker** |
| 125 | + |
| 126 | +If ALL checks pass, output exactly on its own line: |
| 127 | +``` |
| 128 | +VALIDATION_RESULT: VALID |
| 129 | +``` |
| 130 | + |
| 131 | +If any checks fail, output: |
| 132 | +``` |
| 133 | +VALIDATION_RESULT: INVALID |
| 134 | +``` |
| 135 | + |
| 136 | +Followed by error details: |
| 137 | +```markdown |
| 138 | +## Completeness Validation Errors |
| 139 | + |
| 140 | +### PRD Coverage Gaps |
| 141 | +- [ ] Feature X: No module implements this |
| 142 | +- [ ] Feature Y: Incomplete implementation (missing update/delete) |
| 143 | + |
| 144 | +### Missing Layers |
| 145 | +- [ ] No root layout found |
| 146 | +- [ ] No type definitions for shared data |
| 147 | + |
| 148 | +### Dependency Graph Issues |
| 149 | +- [ ] Circular dependency: A → B → A |
| 150 | +- [ ] Orphan module: X is not connected |
| 151 | + |
| 152 | +### Compilability Issues |
| 153 | +- [ ] Module X imports Y which doesn't exist |
| 154 | +``` |
| 155 | + |
| 156 | +**3. Post results to GitHub** |
| 157 | + |
| 158 | +``` |
| 159 | +gh issue comment {issue_number} --repo {repo_owner}/{repo_name} --body "..." |
| 160 | +``` |
| 161 | + |
| 162 | +```markdown |
| 163 | +## Step 10: Architecture Completeness Validation |
| 164 | + |
| 165 | +**Status:** [VALID | INVALID] |
| 166 | + |
| 167 | +### PRD Coverage |
| 168 | +- Requirements found: [N] |
| 169 | +- Requirements covered: [M]/[N] |
| 170 | +- Missing: [list or "None"] |
| 171 | + |
| 172 | +### Layer Completeness |
| 173 | +- Entry points: [Yes/No] |
| 174 | +- API routes: [Yes/No] |
| 175 | +- Type definitions: [Yes/No] |
| 176 | +- State management: [Yes/No/N/A] |
| 177 | + |
| 178 | +### Dependency Graph |
| 179 | +- Circular dependencies: [None | list] |
| 180 | +- Orphan modules: [None | list] |
| 181 | +- Missing references: [None | list] |
| 182 | + |
| 183 | +### Errors (if any) |
| 184 | +[Detailed error list] |
| 185 | + |
| 186 | +--- |
| 187 | +*[Proceeding to Step 11 | Returning to Step 13 for fixes]* |
| 188 | +``` |
| 189 | + |
| 190 | +% Important |
| 191 | + |
| 192 | +- A skeleton is NOT valid - the architecture must cover ALL PRD requirements |
| 193 | +- Every user-facing feature needs: UI + API + data layer |
| 194 | +- Missing CRUD operations for an entity is an error |
| 195 | +- Orphan modules (except config/types/constants) indicate incomplete architecture |
| 196 | +- Always output `VALIDATION_RESULT: VALID` or `VALIDATION_RESULT: INVALID` |
| 197 | +- Always post findings to GitHub |
0 commit comments