codecruise 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/bin/codecruise.js +68 -0
  4. package/config/CLAUDE.md +107 -0
  5. package/config/agents/analyst.md +48 -0
  6. package/config/agents/architect-reviewer.md +161 -0
  7. package/config/agents/architect.md +119 -0
  8. package/config/agents/critic.md +63 -0
  9. package/config/agents/developer.md +96 -0
  10. package/config/agents/devops.md +81 -0
  11. package/config/agents/orchestrator.md +91 -0
  12. package/config/agents/planner.md +139 -0
  13. package/config/agents/retro.md +52 -0
  14. package/config/agents/reviewer.md +101 -0
  15. package/config/agents/security-reviewer.md +57 -0
  16. package/config/agents/stack/expo/AGENT.md +473 -0
  17. package/config/agents/stack/expo/rules/critical.md +427 -0
  18. package/config/agents/stack/expo/rules/native.md +455 -0
  19. package/config/agents/stack/expo/rules/navigation.md +445 -0
  20. package/config/agents/stack/expo/rules/performance.md +415 -0
  21. package/config/agents/stack/fastify/AGENT.md +397 -0
  22. package/config/agents/stack/fastify/rules/api-design.md +283 -0
  23. package/config/agents/stack/fastify/rules/critical.md +232 -0
  24. package/config/agents/stack/fastify/rules/queues.md +303 -0
  25. package/config/agents/stack/fastify/rules/security.md +384 -0
  26. package/config/agents/stack/index.yaml +48 -0
  27. package/config/agents/stack/nextjs/AGENT.md +421 -0
  28. package/config/agents/stack/nextjs/rules/components.md +413 -0
  29. package/config/agents/stack/nextjs/rules/critical.md +391 -0
  30. package/config/agents/stack/nextjs/rules/performance.md +403 -0
  31. package/config/agents/stack/nextjs/rules/styling.md +334 -0
  32. package/config/agents/stack/shared-ts/AGENT.md +384 -0
  33. package/config/agents/stack/shared-ts/rules/critical.md +315 -0
  34. package/config/agents/stack/shared-ts/rules/patterns.md +384 -0
  35. package/config/agents/stack/shared-ts/rules/zod.md +427 -0
  36. package/config/agents/tester.md +79 -0
  37. package/config/commands/architect-discuss.md +366 -0
  38. package/config/commands/architect-list.md +160 -0
  39. package/config/commands/architect-review.md +111 -0
  40. package/config/commands/architect.md +118 -0
  41. package/config/commands/compact.md +118 -0
  42. package/config/commands/companion.md +279 -0
  43. package/config/commands/dashboard.md +152 -0
  44. package/config/commands/doctor.md +227 -0
  45. package/config/commands/dogfood-report.md +101 -0
  46. package/config/commands/flags/run-autonomous.md +110 -0
  47. package/config/commands/flags/run-pause.md +80 -0
  48. package/config/commands/ingest.md +173 -0
  49. package/config/commands/init.md +128 -0
  50. package/config/commands/metrics.md +87 -0
  51. package/config/commands/parallel.md +320 -0
  52. package/config/commands/pause.md +55 -0
  53. package/config/commands/plan-review.md +130 -0
  54. package/config/commands/plan.md +216 -0
  55. package/config/commands/production-check.md +308 -0
  56. package/config/commands/refine.md +323 -0
  57. package/config/commands/resume.md +72 -0
  58. package/config/commands/retro.md +121 -0
  59. package/config/commands/retry.md +75 -0
  60. package/config/commands/role.md +310 -0
  61. package/config/commands/run.md +417 -0
  62. package/config/commands/scope.md +85 -0
  63. package/config/commands/setup-permissions.md +104 -0
  64. package/config/commands/skip.md +75 -0
  65. package/config/commands/spec-forge.md +213 -0
  66. package/config/commands/spec-help.md +194 -0
  67. package/config/commands/spec-patch.md +342 -0
  68. package/config/commands/spec-resolve.md +110 -0
  69. package/config/commands/spec-review.md +153 -0
  70. package/config/commands/status.md +114 -0
  71. package/config/commands/sync.md +131 -0
  72. package/config/commands/task.md +138 -0
  73. package/config/commands/verify.md +124 -0
  74. package/config/hooks/README.md +632 -0
  75. package/config/hooks/activity-log.sh +187 -0
  76. package/config/hooks/anti-rationalize.sh +52 -0
  77. package/config/hooks/capture-verification.sh +112 -0
  78. package/config/hooks/collect-metrics.sh +135 -0
  79. package/config/hooks/enforce-file-scope.sh +75 -0
  80. package/config/hooks/enforce-state-machine.sh +161 -0
  81. package/config/hooks/enforce-tdd.sh +180 -0
  82. package/config/hooks/format.sh +40 -0
  83. package/config/hooks/lib/activity-helpers.sh +162 -0
  84. package/config/hooks/lib/read-settings.sh +71 -0
  85. package/config/hooks/load-context-skills.sh +95 -0
  86. package/config/hooks/notify.sh +81 -0
  87. package/config/hooks/pre-commit.sample +35 -0
  88. package/config/hooks/protect-files.sh +63 -0
  89. package/config/hooks/track-agents.sh +41 -0
  90. package/config/hooks/track-commands.sh +37 -0
  91. package/config/hooks/track-enforcement.sh +44 -0
  92. package/config/hooks/track-ooda.sh +77 -0
  93. package/config/hooks/validate-commit-msg.sh +35 -0
  94. package/config/hooks/validate-plan.sh +213 -0
  95. package/config/hooks/verify-criteria.sh +46 -0
  96. package/config/hooks/verify-todo-completion.sh +140 -0
  97. package/config/rules/comments.md +25 -0
  98. package/config/rules/decision-rules.md +308 -0
  99. package/config/rules/hygiene.md +247 -0
  100. package/config/rules/pattern-detection.md +372 -0
  101. package/config/rules/profiles.md +193 -0
  102. package/config/rules/recovery.md +83 -0
  103. package/config/rules/scope-detection.md +213 -0
  104. package/config/rules/standards.md +127 -0
  105. package/config/rules/workflow.md +121 -0
  106. package/config/schemas.md +767 -0
  107. package/config/settings.json +195 -0
  108. package/config/skills/backend/SKILL.md +734 -0
  109. package/config/skills/database/SKILL.md +426 -0
  110. package/config/skills/frontend/SKILL.md +434 -0
  111. package/config/skills/git/SKILL.md +396 -0
  112. package/config/skills/index.yaml +36 -0
  113. package/config/skills/observability/SKILL.md +430 -0
  114. package/config/skills/package-dev/SKILL.md +498 -0
  115. package/config/skills/performance/SKILL.md +378 -0
  116. package/config/skills/resilience/SKILL.md +573 -0
  117. package/config/skills/testing/SKILL.md +398 -0
  118. package/config/skills/testing-patterns/SKILL.md +276 -0
  119. package/config/skills/typescript/SKILL.md +152 -0
  120. package/config/templates/CLAUDE.md +70 -0
  121. package/config/templates/README.md +117 -0
  122. package/config/templates/steering/adr-template.md +102 -0
  123. package/config/templates/steering/product.md +60 -0
  124. package/config/templates/steering/rfc-template.md +159 -0
  125. package/config/templates/steering/structure.md +146 -0
  126. package/config/templates/steering/tech.md +85 -0
  127. package/package.json +40 -0
  128. package/src/install.js +163 -0
  129. package/src/report.js +310 -0
@@ -0,0 +1,366 @@
1
+ ---
2
+ name: architect-discuss
3
+ description: Interactive discussion on specific architecture phase or feature with expert analysis
4
+ disable-model-invocation: true
5
+ tools: Read, Glob, Grep, WebSearch
6
+ model: opus
7
+ ---
8
+
9
+ # /architect-discuss — Architecture Discussion
10
+
11
+ ## Goal
12
+
13
+ Facilitate peer-to-peer discussion on a specific phase or feature of the architecture. Provide summary, expert analysis, and engage in discussion until finalized.
14
+
15
+ ## Workflow
16
+
17
+ `/architect` → `/architect-list` → **`/architect-discuss`** ← YOU ARE HERE → `/architect-review` → `/plan`
18
+
19
+ ## When to Use
20
+
21
+ | Situation | Use /architect-discuss? |
22
+ |-----------|------------------------|
23
+ | Review specific phase before planning | ✅ Yes |
24
+ | Deep dive on database/api/security design | ✅ Yes |
25
+ | Want expert analysis on a feature | ✅ Yes |
26
+ | Stakeholder walkthrough | ✅ Yes |
27
+ | Quick question about one decision | ❌ Use architect agent |
28
+ | Full architecture validation | ❌ Use /architect-review |
29
+
30
+ ## Usage
31
+
32
+ ```
33
+ /architect-discuss "Phase 1" # Discuss entire phase by name
34
+ /architect-discuss "1" # Discuss phase by number
35
+ /architect-discuss "database" # Discuss specific feature by name
36
+ /architect-discuss "1.2" # Discuss feature by number (e.g., auth)
37
+ /architect-discuss "api" --validate # Include validation in analysis
38
+ ```
39
+
40
+ ### Arguments
41
+
42
+ | Argument | Description | Example |
43
+ |----------|-------------|---------|
44
+ | (positional) | Phase name/number or feature name/number | `"Phase 1"`, `"database"`, `"1.2"` |
45
+ | `--validate` | Include architect-reviewer validation | `/architect-discuss "api" --validate` |
46
+ | `--brief` | Show summary only, skip expert analysis | `/architect-discuss "Phase 1" --brief` |
47
+
48
+ ### Target Resolution
49
+
50
+ | Input | Resolves To |
51
+ |-------|-------------|
52
+ | `"Phase 1"` | Phase 1 (all features) |
53
+ | `"1"` | Phase 1 |
54
+ | `"database"` | Feature: database |
55
+ | `"1.2"` | Phase 1, Feature 2 (e.g., auth) |
56
+ | `"auth"` | Feature: auth |
57
+
58
+ ## Cost Estimate
59
+
60
+ | Scope | Estimated Cost |
61
+ |-------|----------------|
62
+ | Single feature | $0.30 - $0.50 |
63
+ | Entire phase (3-4 features) | $0.50 - $1.00 |
64
+ | With validation | +$0.20 - $0.30 |
65
+
66
+ *Opus model for expert-level analysis.*
67
+
68
+ ## Inputs (read-only)
69
+
70
+ **Required:**
71
+ - `docs/architecture/*.md` — Architecture documents
72
+ - Target phase or feature specified
73
+
74
+ **Context (automatically loaded):**
75
+ - `docs/canon/spec.md` — Requirements to reference
76
+ - `docs/context/*.yaml` — Feature constraints/decisions
77
+ - `docs/canon/decisions.md` — Existing ADRs
78
+
79
+ ## Outputs
80
+
81
+ Discussion is conversational. Changes are applied to architecture files only with explicit user approval.
82
+
83
+ Optional output:
84
+ - Updates to `docs/canon/decisions.md` — New ADRs from discussion
85
+
86
+ ## Process
87
+
88
+ ### 1) Pre-flight Check
89
+
90
+ ```bash
91
+ # Verify architecture exists
92
+ [ -d docs/architecture ] || echo "ERROR: Run /architect first"
93
+
94
+ # Verify target exists
95
+ # Parse argument to identify phase/feature
96
+ ```
97
+
98
+ ### 2) Load Context
99
+
100
+ ```yaml
101
+ loaded_context:
102
+ target:
103
+ type: phase | feature
104
+ id: "Phase 1" | "database"
105
+
106
+ architecture:
107
+ relevant_sections: [overview.md, database.md, ...]
108
+
109
+ spec:
110
+ relevant_requirements: [FR-001, FR-012, NFR-002, ...]
111
+
112
+ decisions:
113
+ relevant_adrs: [ADR-001, ADR-003, ...]
114
+ ```
115
+
116
+ ### 3) Present Summary
117
+
118
+ **For Phase:**
119
+
120
+ ```markdown
121
+ ## Phase 1: Foundation — Summary
122
+
123
+ **Features:**
124
+ 1.1 database - PostgreSQL schema, Prisma models
125
+ 1.2 auth - JWT + session, OAuth providers
126
+ 1.3 api-core - tRPC routers, REST endpoints
127
+
128
+ **Tech Stack:**
129
+ - Database: PostgreSQL 16 + Prisma ORM
130
+ - Auth: JWT access + session refresh, OAuth (Google, Apple)
131
+ - API: tRPC (internal) + REST (auth, uploads)
132
+
133
+ **Spec Coverage:**
134
+ - FR-001 to FR-015 (15 requirements)
135
+ - NFR-001 to NFR-003 (3 non-functional)
136
+ - UC-001 to UC-005 (5 use cases)
137
+
138
+ **Key Decisions:**
139
+ - ADR-001: Hybrid tRPC + REST
140
+ - ADR-003: PostgreSQL over MySQL
141
+ - ADR-005: UUID primary keys
142
+ ```
143
+
144
+ **For Feature:**
145
+
146
+ ```markdown
147
+ ## Feature: database — Summary
148
+
149
+ **Phase:** 1 (Foundation)
150
+ **Architecture File:** docs/architecture/database.md
151
+
152
+ **Tech:**
153
+ - PostgreSQL 16
154
+ - Prisma ORM
155
+ - 12 tables, 18 indexes
156
+
157
+ **Key Entities:**
158
+ - users, wallets, transactions, budgets, categories
159
+ - groups, settlements, receipts
160
+
161
+ **Spec Coverage:**
162
+ ✅ FR-012: Multi-wallet support
163
+ ✅ FR-015: Transaction history with pagination
164
+ ✅ FR-018: Budget tracking per category
165
+ ✅ NFR-002: Query response < 100ms
166
+
167
+ **Related Decisions:**
168
+ - ADR-003: PostgreSQL for JSONB support
169
+ - ADR-005: UUID primary keys for distributed-friendly IDs
170
+ ```
171
+
172
+ ### 4) Provide Expert Analysis
173
+
174
+ ```markdown
175
+ ## Expert Analysis
176
+
177
+ ### ✅ Strengths
178
+
179
+ 1. **Schema Design**
180
+ - All spec entities properly modeled
181
+ - Relationships correctly normalized
182
+ - Good use of enums for fixed values
183
+
184
+ 2. **Index Strategy**
185
+ - Compound index on `transactions(user_id, date)` supports history queries
186
+ - Foreign keys indexed for join performance
187
+
188
+ 3. **Future-Proofing**
189
+ - UUID keys allow distributed scaling
190
+ - Extensibility notes for v2 features documented
191
+
192
+ ### ⚠️ Concerns
193
+
194
+ 1. **Connection Pooling**
195
+ - Not documented in architecture
196
+ - NFR-001 mentions 10k+ concurrent users
197
+ - **Recommendation:** Add PgBouncer or Prisma connection pooling
198
+
199
+ 2. **Soft Deletes**
200
+ - Not specified for any entities
201
+ - GDPR requires data deletion capability
202
+ - **Recommendation:** Add `deleted_at` to users, transactions (audit trail)
203
+
204
+ 3. **Missing Index**
205
+ - Budget queries filter by `user_id + category_id`
206
+ - No compound index exists
207
+ - **Recommendation:** Add `idx_budget_user_category`
208
+
209
+ ### 🔍 Version Check
210
+
211
+ | Component | Current | Latest | Status |
212
+ |-----------|---------|--------|--------|
213
+ | PostgreSQL | 16 | 17 | ⚠️ Consider upgrade |
214
+ | Prisma | 5.x | 6.x | ⚠️ Major version available |
215
+
216
+ *Searched: "PostgreSQL latest version 2025", "Prisma ORM latest version 2025"*
217
+
218
+ ### 🎯 Spec Alignment
219
+
220
+ | Requirement | Status | Notes |
221
+ |-------------|--------|-------|
222
+ | FR-012 | ✅ Covered | wallets table with user_id FK |
223
+ | FR-015 | ✅ Covered | Proper indexes for pagination |
224
+ | FR-022 | ⚠️ Partial | Recurring transactions schema exists, no trigger |
225
+ | NFR-002 | ⚠️ Unclear | Indexes present but no benchmark targets |
226
+
227
+ ### 💡 Suggestions
228
+
229
+ 1. Document connection pooling strategy (PgBouncer config)
230
+ 2. Add soft delete columns for GDPR compliance
231
+ 3. Consider PostgreSQL 17 for improved performance
232
+ 4. Add performance benchmark targets to verify NFR-002
233
+ ```
234
+
235
+ ### 5) Open Discussion
236
+
237
+ ```markdown
238
+ ---
239
+
240
+ What would you like to discuss or change?
241
+
242
+ You can:
243
+ - Ask questions about any aspect
244
+ - Request changes (I'll note them)
245
+ - Ask me to elaborate on concerns
246
+ - Request validation with architect-reviewer
247
+ - Move on when satisfied
248
+ ```
249
+
250
+ ### 6) Handle Discussion
251
+
252
+ **User asks question:**
253
+ - Provide detailed answer with references to spec/architecture
254
+ - Offer expert opinion when relevant
255
+
256
+ **User requests change:**
257
+ - Confirm understanding
258
+ - Ask if they want it applied now or noted for later
259
+ - If applied: Update architecture file with their approval
260
+
261
+ **User says "done" or "satisfied":**
262
+ - Summarize any changes made or noted
263
+ - Suggest next steps
264
+
265
+ ### 7) Discussion Summary (on completion)
266
+
267
+ ```markdown
268
+ ## Discussion Summary: database
269
+
270
+ **Duration:** ~10 minutes
271
+
272
+ **Changes Applied:**
273
+ 1. Added connection pooling section to database.md
274
+ 2. Added soft delete columns to users and transactions
275
+
276
+ **Changes Noted (apply later):**
277
+ 1. Consider PostgreSQL 17 upgrade
278
+
279
+ **Decisions Made:**
280
+ - DD-001: Use PgBouncer for connection pooling
281
+ - DD-002: Soft deletes for users and transactions only
282
+
283
+ **Next Steps:**
284
+ - /architect-discuss "auth" → Continue with next feature
285
+ - /architect-review --section database → Validate changes
286
+ ```
287
+
288
+ ## Expert Analysis Components
289
+
290
+ ### 1. Strengths Identification
291
+
292
+ Look for:
293
+ - Good patterns followed
294
+ - Proper normalization
295
+ - Index coverage
296
+ - Security considerations
297
+ - Scalability provisions
298
+
299
+ ### 2. Concerns Identification
300
+
301
+ Check for:
302
+ - Missing patterns (caching, pooling, rate limiting)
303
+ - Spec gaps (requirements not covered)
304
+ - Security gaps (auth, validation, encryption)
305
+ - Scalability issues (N+1, missing indexes)
306
+ - Version currency (outdated dependencies)
307
+
308
+ ### 3. Version Validation
309
+
310
+ **Required searches:**
311
+ ```
312
+ "[technology] latest stable version 2025"
313
+ "[technology] LTS version current"
314
+ ```
315
+
316
+ Report:
317
+ - Current version in architecture
318
+ - Latest stable available
319
+ - Recommendation (upgrade/keep)
320
+
321
+ ### 4. Spec Alignment Check
322
+
323
+ Cross-reference:
324
+ - Functional requirements (FR-XXX)
325
+ - Non-functional requirements (NFR-XXX)
326
+ - Use cases (UC-XXX)
327
+
328
+ Report status: ✅ Covered | ⚠️ Partial | ❌ Missing
329
+
330
+ ### 5. Cross-Section Consistency
331
+
332
+ Check for misalignments:
333
+ - Types match between database and API schemas
334
+ - Security model consistent across components
335
+ - Naming conventions consistent
336
+
337
+ ## Quality Bar
338
+
339
+ - Expert analysis is specific and actionable
340
+ - All relevant spec requirements referenced
341
+ - Version checks performed with web search
342
+ - Concerns include concrete recommendations
343
+ - Discussion is collaborative, not one-sided
344
+ - Changes are confirmed before applying
345
+
346
+ ## Error Handling
347
+
348
+ ### Target Not Found
349
+
350
+ ```
351
+ ❌ Feature "payments" not found in architecture
352
+
353
+ Available features:
354
+ Phase 1: database, auth, api-core
355
+ Phase 2: transactions, budgets, categories
356
+
357
+ Try: /architect-discuss "transactions"
358
+ ```
359
+
360
+ ### Architecture Not Found
361
+
362
+ ```
363
+ ❌ No architecture found
364
+
365
+ Run /architect first to generate architecture documentation.
366
+ ```
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: architect-list
3
+ description: List phases and features from existing architecture
4
+ disable-model-invocation: true
5
+ tools: Read, Glob
6
+ model: haiku
7
+ ---
8
+
9
+ # /architect-list — Architecture Quick Reference
10
+
11
+ ## Goal
12
+
13
+ Display phases and features from existing architecture documentation. Quick reference without regenerating anything.
14
+
15
+ ## Workflow
16
+
17
+ `/architect` → **`/architect-list`** ← YOU ARE HERE → `/architect-discuss` → `/architect-review`
18
+
19
+ ## When to Use
20
+
21
+ | Situation | Use /architect-list? |
22
+ |-----------|---------------------|
23
+ | Need quick reference of architecture | ✅ Yes |
24
+ | Forgot what phases/features exist | ✅ Yes |
25
+ | Before running /architect-discuss | ✅ Yes |
26
+ | No architecture exists yet | ❌ Run /architect first |
27
+
28
+ ## Usage
29
+
30
+ ```
31
+ /architect-list
32
+ ```
33
+
34
+ No arguments needed.
35
+
36
+ ## Cost Estimate
37
+
38
+ | Architecture Size | Estimated Cost |
39
+ |-------------------|----------------|
40
+ | Any size | < $0.05 |
41
+
42
+ *Haiku model - fast and cheap.*
43
+
44
+ ## Inputs (read-only)
45
+
46
+ **Required:**
47
+ - `docs/architecture/overview.md` — Contains phases/features structure
48
+
49
+ **Optional:**
50
+ - `docs/architecture/*.md` — Other architecture documents
51
+
52
+ ## Outputs
53
+
54
+ None - display only.
55
+
56
+ ## Process
57
+
58
+ ### 1) Pre-flight Check
59
+
60
+ ```bash
61
+ # Verify architecture exists
62
+ [ -d docs/architecture ] || echo "ERROR: Run /architect first"
63
+ [ -f docs/architecture/overview.md ] || echo "ERROR: No architecture found"
64
+ ```
65
+
66
+ ### 2) Extract Phases & Features
67
+
68
+ Read `overview.md` and extract:
69
+ - Project name and version
70
+ - Generation date
71
+ - Phases with features
72
+ - Architecture sections
73
+
74
+ ### 3) Display Overview
75
+
76
+ ```
77
+ ╔═══════════════════════════════════════════════════════════════╗
78
+ ║ ARCHITECTURE OVERVIEW ║
79
+ ╠═══════════════════════════════════════════════════════════════╣
80
+ ║ ║
81
+ ║ Project: {name} ║
82
+ ║ Version: {version} ║
83
+ ║ Generated: {date} ║
84
+ ║ ║
85
+ ╠═══════════════════════════════════════════════════════════════╣
86
+ ║ PHASES & FEATURES ║
87
+ ╠═══════════════════════════════════════════════════════════════╣
88
+ ║ ║
89
+ ║ Phase 1: Foundation ║
90
+ ║ 1.1 database - PostgreSQL schema, Prisma models ║
91
+ ║ 1.2 auth - JWT + session, OAuth providers ║
92
+ ║ 1.3 api-core - tRPC routers, REST endpoints ║
93
+ ║ ║
94
+ ║ Phase 2: Core Features ║
95
+ ║ 2.1 transactions - CRUD, receipts, OCR integration ║
96
+ ║ 2.2 budgets - Limits, alerts, tracking ║
97
+ ║ 2.3 categories - User-defined, default set ║
98
+ ║ ║
99
+ ║ Phase 3: Advanced ║
100
+ ║ 3.1 analytics - Reports, charts, insights ║
101
+ ║ 3.2 groups - Shared expenses, settlements ║
102
+ ║ ║
103
+ ╠═══════════════════════════════════════════════════════════════╣
104
+ ║ ARCHITECTURE SECTIONS ║
105
+ ╠═══════════════════════════════════════════════════════════════╣
106
+ ║ ║
107
+ ║ overview.md System context, tech stack, principles ║
108
+ ║ database.md Schema, indexes, migrations ║
109
+ ║ api.md Endpoints, contracts, OpenAPI ║
110
+ ║ components.md Module structure, dependencies ║
111
+ ║ security.md Auth, encryption, access control ║
112
+ ║ data-flow.md Transaction flows, sync patterns ║
113
+ ║ integrations.md External services, webhooks ║
114
+ ║ decisions.md Architecture Decision Records ║
115
+ ║ extensibility.md Future feature extension points ║
116
+ ║ ║
117
+ ╠═══════════════════════════════════════════════════════════════╣
118
+ ║ COMMANDS ║
119
+ ╠═══════════════════════════════════════════════════════════════╣
120
+ ║ ║
121
+ ║ /architect-discuss "Phase 1" → Discuss entire phase ║
122
+ ║ /architect-discuss "database" → Discuss specific feature ║
123
+ ║ /architect-discuss "1.2" → Discuss by number (auth) ║
124
+ ║ /architect-review → Full architecture validation ║
125
+ ║ ║
126
+ ╚═══════════════════════════════════════════════════════════════╝
127
+ ```
128
+
129
+ ## Error Handling
130
+
131
+ ### No Architecture Found
132
+
133
+ ```
134
+ ❌ No architecture found
135
+
136
+ Run /architect first to generate architecture documentation.
137
+
138
+ Required: docs/architecture/overview.md
139
+ ```
140
+
141
+ ### Partial Architecture
142
+
143
+ ```
144
+ ⚠️ Partial architecture found
145
+
146
+ Available sections:
147
+ ✓ overview.md
148
+ ✓ database.md
149
+ ✗ api.md (missing)
150
+ ✗ security.md (missing)
151
+
152
+ Run /architect to regenerate, or /architect --section api to add missing sections.
153
+ ```
154
+
155
+ ## Quality Bar
156
+
157
+ - Fast execution (< 2 seconds)
158
+ - Clear, scannable output
159
+ - Shows all phases/features with numbers
160
+ - Includes helpful next commands
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: architect-review
3
+ description: Audit architecture documents against spec for completeness and consistency
4
+ disable-model-invocation: true
5
+ tools: Read, Write, Edit, Glob, Grep
6
+ model: opus
7
+ ---
8
+
9
+ # /architect-review — Architecture Audit
10
+
11
+ Validate architecture against spec.md for coverage, consistency, and security.
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ /architect-review # Full audit
17
+ /architect-review --section database # Specific section
18
+ /architect-review --check-versions # Validate tech versions
19
+ /architect-review --strict # Fail on warnings
20
+ ```
21
+
22
+ ## Inputs
23
+
24
+ **Required**: `docs/canon/spec.md`, `docs/architecture/*.md`
25
+
26
+ **Optional**: `docs/context/*.yaml`, `docs/canon/decisions.md`
27
+
28
+ ## Audits
29
+
30
+ ### Database Schema
31
+
32
+ | Check | Criteria |
33
+ |-------|----------|
34
+ | Entity coverage | All spec entities have tables |
35
+ | Field coverage | Entity fields mapped to columns |
36
+ | Relationship support | FKs support use cases |
37
+ | Index coverage | Query patterns have indexes |
38
+
39
+ ### API Contracts
40
+
41
+ | Check | Criteria |
42
+ |-------|----------|
43
+ | FR coverage | Every FR has endpoint |
44
+ | UC coverage | Use case flows supported |
45
+ | Auth coverage | Protected endpoints require auth |
46
+ | CRUD completeness | Entities have operations |
47
+
48
+ ### Security
49
+
50
+ | Check | Criteria |
51
+ |-------|----------|
52
+ | Auth flow complete | Login, logout, refresh documented |
53
+ | Encryption | Sensitive data encrypted |
54
+ | Compliance | GDPR, PCI-DSS addressed |
55
+ | Headers | Security headers configured |
56
+
57
+ ### Components
58
+
59
+ | Check | Criteria |
60
+ |-------|----------|
61
+ | No circular deps | Acyclic graph |
62
+ | Layer violations | Routers don't bypass services |
63
+ | Module boundaries | Clear separation |
64
+
65
+ ### ADRs
66
+
67
+ | Check | Criteria |
68
+ |-------|----------|
69
+ | Decision coverage | D-XXX have ADRs |
70
+ | Rationale present | Clear reasoning |
71
+ | Consequences documented | Trade-offs explicit |
72
+
73
+ ## Grading
74
+
75
+ | Grade | Meaning | Action |
76
+ |-------|---------|--------|
77
+ | A+ | Perfect | Proceed to /init |
78
+ | A | Minor polish | Can proceed |
79
+ | B | Few gaps | Fix, re-review |
80
+ | C | Significant gaps | Multiple fixes |
81
+ | D | Major issues | Re-run /architect |
82
+
83
+ **Minimum to proceed**: B (all critical resolved)
84
+
85
+ ## Output
86
+
87
+ ```
88
+ ✓ Architecture audit complete
89
+
90
+ Grade: B+
91
+
92
+ Coverage:
93
+ - Database: 12/12 entities (100%)
94
+ - API: 43/45 requirements (96%)
95
+ - Security: 8/9 controls (89%)
96
+ - ADRs: 13/15 decisions (87%)
97
+
98
+ Critical: 2 (must fix)
99
+ Warnings: 3 (should fix)
100
+
101
+ Report: docs/architecture/audit-report.md
102
+
103
+ Next: Fix critical, re-run
104
+ ```
105
+
106
+ ## Quality Bar
107
+
108
+ - Every spec requirement traced
109
+ - No critical issues for B+
110
+ - Actionable recommendations
111
+ - Clear next steps