pantheon-opencode 1.6.2-beta.2 → 1.6.2-beta.4

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 (57) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/README.md +56 -16
  3. package/bin/pantheon-init.mjs +68 -13
  4. package/package.json +10 -3
  5. package/plugin.json +1 -1
  6. package/prompts/README.md +58 -0
  7. package/prompts/debug-issue.prompt.md +46 -0
  8. package/prompts/dynamic/agora-generated.txt +38 -0
  9. package/prompts/dynamic/orchestrate-generated.txt +51 -0
  10. package/prompts/focus.prompt.md +42 -0
  11. package/prompts/implement-feature.prompt.md +39 -0
  12. package/prompts/optimize-database.prompt.md +58 -0
  13. package/prompts/orchestrate-with-zeus.prompt.md +441 -0
  14. package/prompts/plan-architecture.prompt.md +59 -0
  15. package/prompts/quick-discovery-large-codebase.prompt.md +294 -0
  16. package/prompts/quick-plan-large-feature.prompt.md +197 -0
  17. package/prompts/semantic-summarize.md +50 -0
  18. package/prompts/sketch.prompt.md +91 -0
  19. package/prompts/subtask.prompt.md +131 -0
  20. package/pyproject.toml +1 -1
  21. package/scripts/decision-router-budget.mjs +781 -0
  22. package/scripts/decision-router.mjs +297 -0
  23. package/scripts/install/component-selection.mjs +9 -4
  24. package/scripts/install/decision-router-config.mjs +432 -0
  25. package/scripts/install/health-check.mjs +20 -11
  26. package/scripts/install/interactive.mjs +78 -14
  27. package/scripts/install/interrupt.mjs +4 -3
  28. package/scripts/install/migrate.mjs +123 -72
  29. package/scripts/install/opencode.mjs +162 -114
  30. package/scripts/install/plan.mjs +8 -1
  31. package/scripts/install/state.mjs +12 -0
  32. package/scripts/install/strings.mjs +10 -0
  33. package/scripts/install/venv.mjs +34 -17
  34. package/scripts/restore.mjs +22 -10
  35. package/scripts/test-opencode-v2-sandbox.sh +10 -6
  36. package/src/agents/zeus.md +12 -0
  37. package/src/pantheon/local-decision-agents.ts +170 -0
  38. package/src/pantheon/local-decision-budget.ts +1043 -0
  39. package/src/pantheon/local-decision-egress-gate.ts +264 -0
  40. package/src/pantheon/local-decision-prompt.ts +123 -0
  41. package/src/pantheon/local-decision-provider-matrix.ts +92 -0
  42. package/src/pantheon/local-decision-provider-protocol.ts +335 -0
  43. package/src/pantheon/local-decision-provider.internal.ts +260 -0
  44. package/src/pantheon/local-decision-router.ts +225 -0
  45. package/src/pantheon/local-decision-skills.ts +171 -0
  46. package/src/pantheon/local-decision-tool.ts +126 -0
  47. package/src/pantheon/local-decision-turn.ts +338 -0
  48. package/src/pantheon/local-decision-usage-evidence.internal.ts +207 -0
  49. package/src/pantheon/local-orchestration.ts +322 -0
  50. package/src/pantheon/pantheon-decision-catalog.ts +101 -0
  51. package/src/pantheon/v2-tools.ts +15 -14
  52. package/src/plugin-v2.ts +52 -19
  53. package/src/plugin.ts +4 -0
  54. package/src/plugins/tui/dist/tui-v2.js +3 -3
  55. package/src/plugins/tui/dist/tui.js +1 -1
  56. package/src/plugins/tui/package-lock.json +2 -2
  57. package/src/plugins/tui/package.json +1 -1
@@ -0,0 +1,294 @@
1
+ ---
2
+ name: "Quick Discovery - Large Codebase"
3
+ description: "Rapid discovery for large codebases using bounded search (8 min max)"
4
+ ---
5
+
6
+ # Quick Discovery for Large Codebases (Fast Path)
7
+
8
+ ## Problem This Solves
9
+ Discovery (Apollo) was taking 10-20+ minutes on large codebases. This prompt ensures **8-minute discoveries** with structured findings.
10
+
11
+ ## When to Use This Prompt
12
+
13
+ ✅ **USE THIS when**:
14
+ - Athena delegates: "Discover how authentication is currently implemented"
15
+ - Hermes needs: "Find all API versioning patterns"
16
+ - Aphrodite asks: "Where are reusable form components?"
17
+ - Broad, unfamiliar discovery where multiple independent searches materially help
18
+
19
+ ❌ **DO NOT USE** for:
20
+ - Single-file location (direct search is faster)
21
+ - Simple "find X" queries (use codebase search directly)
22
+
23
+ ---
24
+
25
+ ## Your Workflow (8 Minutes MAX)
26
+
27
+ ### Minute 0-1: Choose Relevant Searches
28
+ ```
29
+ From the parent request, identify only the independent queries needed to close
30
+ material knowledge gaps. Do not target a fixed search count:
31
+
32
+ Example: "Discover authentication patterns"
33
+ S1: "Find all authentication routers and endpoints"
34
+ S2: "Find JWT token handling (generation, validation)"
35
+ S3: "Find session/cookie management"
36
+ S4: "Find password reset/change flows"
37
+ S5: "Find OAuth/external auth integrations"
38
+ S6: (OPTIONAL) "Find authentication tests/mocks"
39
+ S7: (OPTIONAL) "Find configuration for auth"
40
+ S8: (OPTIONAL) "Find error handling for auth failures"
41
+ ```
42
+
43
+ ### Minute 1-4: Initial Search Batch
44
+ ```
45
+ Run the relevant independent searches together when supported by the runtime.
46
+ Gather their results and assess whether any material questions remain.
47
+
48
+ ENOUGH EVIDENCE → Compile findings and return
49
+ MATERIAL GAPS → Run another focused batch if useful
50
+ ```
51
+
52
+ ### Minute 4-7: Follow-up Search (only if useful)
53
+ ```
54
+ If the initial batch left material gaps, run only targeted follow-up searches
55
+ that can answer them. Stop when further searching is unlikely to change findings.
56
+
57
+ At 7:30 → wrap up current searches
58
+ ```
59
+
60
+ ### Minute 7-8: Compile & Return
61
+ ```
62
+ Structure findings as:
63
+ 📊 Discovery Report: [Topic]
64
+
65
+ 📁 Files Found:
66
+ - [File path]: [Brief purpose]
67
+ - [File path]: [Brief purpose]
68
+
69
+ 🔗 Relationships:
70
+ - Component A depends on B because...
71
+ - Pattern X is used in Y, Z files
72
+
73
+ ⚠️ Observations:
74
+ - Good patterns: [list]
75
+ - Technical debt: [list]
76
+ - Gaps: [list]
77
+
78
+ 💡 Recommendations:
79
+ - For Athena: [Planning guidance if needed]
80
+ - For implementation: [What to reuse/what to build]
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Batch Management
86
+
87
+ ### Batch Size: Scope-Driven
88
+
89
+ ```
90
+ Initial batch: core discovery
91
+ ✓ Main concepts/files
92
+ ✓ Entry points
93
+ ✓ Key models/schemas
94
+
95
+ Assess: can the requested question be answered with evidence?
96
+
97
+ YES → Stop here, return findings
98
+ NO → Continue only for material gaps
99
+
100
+ Follow-up: pattern analysis
101
+ ✓ How X is currently done
102
+ ✓ Edge cases/error handling
103
+ ✓ Related integrations
104
+
105
+ Timebox broad discovery to the available task budget. No fixed batch count or
106
+ parallel-search cap applies; stop when the answer is supported and additional
107
+ searches are unlikely to change it.
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Convergence Checklist
113
+
114
+ ✅ Stop searching when you can answer:
115
+ - "What files implement this?"
116
+ - "How does flow X work?"
117
+ - "What patterns are used?"
118
+ - "Where are the gaps?"
119
+ - "What should we reuse?"
120
+
121
+ ❌ Don't wait for:
122
+ - 100% coverage of all edge cases
123
+ - Perfect understanding of every integration
124
+ - All optimization details
125
+
126
+ ---
127
+
128
+ ## Findings Structure (Must Be Actionable)
129
+
130
+ ### ✅ Good Report
131
+ ```
132
+ 📊 Discovery: Multi-tenancy Approach
133
+
134
+ 📁 Files:
135
+ - `auth/models.py` → User, Organization models
136
+ - `middleware/tenant.py` → Tenant context injection
137
+ - `db/query_filters.py` → Org filter patterns
138
+
139
+ 🔗 Flow:
140
+ Request → [middleware extracts org_id]
141
+ → [query filters applied]
142
+ → Response
143
+
144
+ ⚠️ Issues:
145
+ - No tenant isolation in cache (risk!)
146
+ - Some endpoints missing org check
147
+
148
+ 💡 Recommendation:
149
+ Standardize: Add @require_org decorator to all routes
150
+ ```
151
+
152
+ ### ❌ Bad Report (Don't Do)
153
+ ```
154
+ Found these files:
155
+ - auth.py
156
+ - models.py
157
+ - middleware.py
158
+ - queries.py
159
+ - ...
160
+
161
+ (raw file list with no synthesis)
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Time Management
167
+
168
+ | Minute | Action |
169
+ |--------|--------|
170
+ | 0-1 | Plan searches |
171
+ | 1-4 | Batch 1 (5 searches) |
172
+ | 4-5.5 | Assess convergence |
173
+ | 5.5-7 | Batch 2 (if needed) + synthesis |
174
+ | 7-8 | Compile report, return findings |
175
+
176
+ **At 7:30**: Finish current batch, don't wait for all results.
177
+ **At 8:00**: Return whatever you have.
178
+
179
+ ---
180
+
181
+ ## Integration with Athena
182
+
183
+ When Athena delegates to you:
184
+
185
+ ```
186
+ @athena: "Need discovery: How is authentication implemented?"
187
+
188
+ @apollo runs:
189
+ 1. Plan searches (1 min)
190
+ 2. Batch 1 + Batch 2 (5 min)
191
+ 3. Compile findings (1 min)
192
+ 4. Return to Athena
193
+
194
+ Athena uses findings → creates plan (2 min)
195
+
196
+ Total: 8 min discovery + 2 min planning = 10 min
197
+ (vs. old 20-30 min approach)
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Red Flags
203
+
204
+ 🚩 **Launching >10 searches in first batch**
205
+ → You're over-planning. Start with 5, assess.
206
+
207
+ 🚩 **Searching past 7:30 min without wrapping up**
208
+ → Time management failure. Stop + return findings.
209
+
210
+ 🚩 **Output is just file lists**
211
+ → Synthesize: explain relationships, identify patterns.
212
+
213
+ 🚩 **Same search results across multiple queries**
214
+ → Convergence reached. Stop and return.
215
+
216
+ ---
217
+
218
+ ## Examples
219
+
220
+ ### Example 1: Authentication Discovery (Simple)
221
+ ```
222
+ Time: 0:00 - Athena: "Discover auth implementation"
223
+
224
+ Time: 0:00-1:00 - Plan 5 searches:
225
+ S1: "Find authentication routers and endpoints"
226
+ S2: "Find JWT token handling"
227
+ S3: "Find password hashing/validation"
228
+ S4: "Find user model and schema"
229
+ S5: "Find authentication middleware"
230
+
231
+ Time: 1:00-4:00 - Execute Batch 1 (5 searches)
232
+ Results: Found auth module, JWT token handler, user model, middleware
233
+
234
+ Time: 4:00 - Assess: 85% coverage
235
+ → Create findings report, return
236
+
237
+ Time: 4:00-5:00 - Return findings to Athena
238
+ ```
239
+
240
+ ### Example 2: Microservices Architecture (Complex)
241
+ ```
242
+ Time: 0:00 - Athena: "Discover service communication patterns"
243
+
244
+ Time: 0:00-1:00 - Plan 8 searches:
245
+ S1: "Find all service modules/packages"
246
+ S2: "Find all API routers"
247
+ S3: "Find message queue/event handlers"
248
+ S4: "Find service-to-service communication"
249
+ S5: "Find shared models and schemas"
250
+ S6: "Find error handling patterns"
251
+ S7: "Find retry/timeout logic"
252
+ S8: "Find logging and tracing"
253
+
254
+ Time: 1:00-4:00 - Batch 1 (S1-S5)
255
+ Results: Found services, routers, event handlers, communication patterns
256
+
257
+ Time: 4:00 - Assess: 70% coverage, need more detail on error handling
258
+
259
+ Time: 4:00-7:00 - Batch 2 (S6-S8)
260
+ Results: Found retry patterns, error types, logging
261
+
262
+ Time: 7:00 - Assess: enough evidence to answer the request
263
+ → Compile + synthesize findings
264
+
265
+ Time: 7:00-8:00 - Return structured findings to Athena
266
+ ```
267
+
268
+ ---
269
+
270
+ ## Measuring Quality
271
+
272
+ A "good" quick discovery:
273
+ - ✅ Takes 8 minutes (not 15+)
274
+ - ✅ Identifies relevant files at a depth appropriate to the question
275
+ - ✅ Has relationship/pattern analysis (not just lists)
276
+ - ✅ Actionable for planner/implementer
277
+ - ✅ <3 unknowns documented
278
+
279
+ ---
280
+
281
+ ## Never Break These Rules
282
+
283
+ ✅ **ALWAYS stop at 8 minutes**
284
+ Even if incomplete. Return findings and let parent agent ask for more detail.
285
+
286
+ ✅ **Use parallelism deliberately**
287
+ Batch independent searches when that improves discovery; search sequentially
288
+ when a later query depends on earlier findings. There is no fixed batch size.
289
+
290
+ ✅ **Synthesis required**
291
+ Never return raw file lists. Explain relationships and patterns.
292
+
293
+ ✅ **Convergence matters**
294
+ Enough evidence to answer the request → stop; do not hunt for completeness without a reason.
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: "Quick Plan - Large Feature"
3
+ description: "Rapid planning for large/complex features using bounded research (5 min max)"
4
+ ---
5
+
6
+ # Quick Planning for Large Features (Fast Path)
7
+
8
+ ## Problem This Solves
9
+ Planning for large sites has been slow (30+ min). This prompt ensures **5-minute plans** for even complex features.
10
+
11
+ ## When to Use This Prompt
12
+
13
+ ✅ **USE THIS when**:
14
+ - User: "@athena Plan: Add customer dashboard with analytics"
15
+ - User: "@athena Plan: Implement multi-tenant architecture"
16
+ - User: "@athena Design: Microservices migration strategy"
17
+ - Any Feature with >3 implementation phases
18
+
19
+ ❌ **DO NOT USE** for:
20
+ - Small bug fixes (use default plan-architecture.prompt)
21
+ - Single-component changes
22
+
23
+ ---
24
+
25
+ ## Your Workflow (5 Minutes)
26
+
27
+ ### Minute 0-2: Quick Codebase Scan
28
+ ```
29
+ Goal: Understand current structure (don't aim for comprehensive)
30
+
31
+ Search only relevant questions; run searches in parallel when they are
32
+ independent and the runtime supports it (otherwise sequence them):
33
+ 1. "Find main modules/routers related to [Feature]"
34
+ 2. "Find existing models/schemas for [Feature]"
35
+ 3. (OPTIONAL) "How is [similar feature] currently implemented?"
36
+
37
+ While searching: Review Memory Bank if it has content
38
+ - .pantheon/memory-bank/00-project.md (project scope)
39
+ - .pantheon/memory-bank/00-project.md (existing patterns)
40
+ ```
41
+
42
+ ### Minute 2-4: Synthesis
43
+ ```
44
+ From searches, extract:
45
+ - What exists? (reuse?)
46
+ - What's missing? (build?)
47
+ - What pattern fits? (async? repository? caching?)
48
+ - What are risks? (scale? complexity? performance?)
49
+
50
+ ⚠️ If unclear: record the uncertainty as an "Open Question" for Zeus and
51
+ continue with an explicit assumption or bounded alternative.
52
+ ```
53
+
54
+ ### Minute 4-5: Plan Creation
55
+ ```
56
+ Create a complete plan with 3-5 actionable phases:
57
+
58
+ Format:
59
+ 📋 Plan: [Feature Name]
60
+ 🎯 Goal: [One sentence outcome]
61
+ 📦 Scope and assumptions: [What is included; state assumptions]
62
+ 📂 Affected files or areas: [Known paths/areas; mark unknowns]
63
+ 🔗 Dependencies: [Required ordering or external dependencies]
64
+
65
+ 1️⃣ Phase: [Name] → @agent
66
+ - Actions and expected outcome
67
+ - Key files/areas: [list or explicitly unknown]
68
+ - Depends on: [phase/dependency or none]
69
+
70
+ 2️⃣ Phase: [Name] → @agent
71
+ ...
72
+
73
+ ✅ Verification and tests: [Focused checks for each behavior]
74
+ ⚠️ Risks: [Risks and mitigations]
75
+ 🤔 Open Questions / unknowns: [Unresolved facts; don't block the handoff]
76
+ 🎯 Acceptance criteria: [Observable completion conditions]
77
+ ```
78
+
79
+ Return the complete Markdown plan to Zeus.
80
+
81
+ ---
82
+
83
+ ## Decision: Direct vs. Delegate
84
+
85
+ At minute 2-3, assess:
86
+
87
+ ```
88
+ Are the main risks and dependencies understood well enough to plan?
89
+
90
+ YES → Create plan immediately (skip delegates)
91
+ NO → Check whether broad discovery would materially change the plan
92
+ YES → Delegate bounded discovery to @apollo if it fits the time budget
93
+ NO → Document unknowns as "Open Questions" and proceed with a bounded plan
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Red Flags (Plan is incomplete)
99
+
100
+ 🚩 **More than 3 open questions**
101
+ → State the highest-impact unknowns, their consequences, and any safe assumptions in the plan.
102
+
103
+ 🚩 **Can't identify affected modules**
104
+ → Use bounded Apollo discovery when likely to change the plan and within the time budget; otherwise mark affected areas unknown.
105
+
106
+ 🚩 **Risk assessment uncertain**
107
+ → Document risk/unknowns clearly in plan
108
+
109
+ 🚩 **Implementation unclear**
110
+ → Break the work into smaller phases or sub-features and state dependencies and scope assumptions.
111
+
112
+ ---
113
+
114
+ ## Examples
115
+
116
+ ### Example 1: Customer Dashboard (Medium Complexity)
117
+ ```
118
+ Time: 0:00 - User: "Plan: Add customer analytics dashboard"
119
+
120
+ Time: 0:00-2:00 - Search:
121
+ S1: "Find customer-related routers and models"
122
+ S2: "How are forms/charts rendered in existing UI?"
123
+ S3: (OPTIONAL) "What analytics libraries are available?"
124
+
125
+ Time: 2:00 - Understanding: 85% coverage
126
+ ✓ Found customer routes, models, existing charts
127
+ ✓ Know Frontend (React) + Backend (FastAPI) structure
128
+ ✓ Slight uncertainty: Analytics data aggregation approach
129
+
130
+ Time: 2:00-4:00 - Plan:
131
+ Phase 1: Backend analytics API (@hermes)
132
+ Phase 2: Dashboard component (@aphrodite)
133
+ Phase 3: Data aggregation query (@demeter)
134
+
135
+ Unresolved unknown: Real-time vs. daily snapshots; describe the impact of each option.
136
+
137
+ Time: 4:00-5:00 - Return the complete plan, verification, assumptions, and open question to Zeus.
138
+ Zeus publishes it and handles user approval in the main conversation.
139
+ ```
140
+
141
+ ### Example 2: Multi-Tenant Architecture (High Complexity)
142
+ ```
143
+ Time: 0:00 - User: "Plan: Make platform multi-tenant"
144
+
145
+ Time: 0:00-2:00 - Search:
146
+ S1: "Find all authentication/authorization code"
147
+ S2: "Find database schema (how is organization data structured?)"
148
+ S3: (OPTIONAL BOUNDED DISCOVERY) "How are other features accessing org context?"
149
+
150
+ Time: 2:00 - Assessment:
151
+ - Understand current auth: 70%
152
+ - Understand DB structure: 80%
153
+ - Tenant isolation strategy remains unknown
154
+
155
+ Time: 2:15 - Decision:
156
+ → If bounded Apollo discovery can materially reduce risk within the time budget, run it.
157
+ → Otherwise, record tenant isolation as an open question with its security/data-isolation impact.
158
+ → Athena returns the complete plan and unresolved unknowns to Zeus.
159
+ → Zeus publishes the plan and obtains user approval in the main conversation.
160
+ ```
161
+
162
+ ---
163
+
164
+ ## Non-Negotiable Rules
165
+
166
+ ✅ **You MUST stop at 5 minutes**
167
+ Even if uncertain. Plan with 80% knowledge, document unknowns.
168
+
169
+ ✅ **No re-planning**
170
+ One cycle per request. If Zeus discovers plan gaps, that's a new planning request.
171
+
172
+ ✅ **Synthesize, don't explore**
173
+ Fast 1-2 min search, then make decisions with the knowledge you have.
174
+
175
+ ✅ **Output only in chat**
176
+ Return the complete plan to Zeus; do not create artifacts unless the user explicitly requested them.
177
+
178
+ ---
179
+
180
+ ## Plan Handoff
181
+
182
+ The child session returns the complete Markdown plan to Zeus, including its
183
+ assumptions, verification, risks, acceptance criteria, and unresolved unknowns.
184
+ Zeus publishes the full plan in the main conversation and obtains user approval
185
+ there before implementation. The child session ends with the plan; it does not
186
+ open a user-facing decision or approval gate.
187
+
188
+ ---
189
+
190
+ ## Measuring Success
191
+
192
+ A "good" quick plan:
193
+ - ✅ Takes 5 minutes
194
+ - ✅ Has 3-5 phases
195
+ - ✅ <3 open questions
196
+ - ✅ Clear risk assessment
197
+ - ✅ Leads to smooth 1-pass implementation (no major revisions)
@@ -0,0 +1,50 @@
1
+ # Semantic Summarization — Template
2
+
3
+ ## Instruction
4
+ Summarize a completed subtask for context compression. Your summary will be read by the NEXT agent in the pipeline.
5
+
6
+ ## Input Fields
7
+ **Agent:** {agent_name}
8
+ **Phase:** {phase_number}
9
+ **Summary:** {raw_summary_text}
10
+ **Files changed:** {files_changed_list}
11
+ **Test results:** {test_status}
12
+ **Priority:** {priority_label}
13
+ **Next agent:** {next_agent_name}
14
+ **Next agent needs:** {what_next_agent_needs}
15
+
16
+ ## Output Format
17
+
18
+ ### Sentence 1 — What changed
19
+ One sentence describing the core change.
20
+
21
+ - For Hermes→Aphrodite: Include API contract details (endpoint, request/response shape, status codes)
22
+ - For Hermes→Demeter: Include model/schema details, table names, relationships
23
+ - For Demeter→Hermes: Include table/column names, migration version, FK references
24
+ - For Aphrodite→Hermes: Include component name, data requirements, API expectations
25
+ - For Hermes→Prometheus: Include ports, env vars, external dependencies
26
+ - For Prometheus→Hermes: Include service names, ports, healthcheck paths
27
+ - For Themis→any: Include only the verdict and critical issues
28
+
29
+ ### Sentence 2 — Why it matters to the reader
30
+ One sentence connecting this work to what {next_agent_name} will do next.
31
+ Be specific about what the next agent should USE or AVOID.
32
+
33
+ ### Sentence 3 (CRITICAL only) — Gotcha/Decision
34
+ One sentence about a key decision, trade-off, or pitfall the next agent must know.
35
+ If nothing notable, skip this sentence entirely.
36
+
37
+ ## Examples
38
+
39
+ **Input:** Agent=hermes, Phase=2, Summary="Created /api/users/preferences endpoint with PATCH method", Next=aphrodite, Next needs="frontend component to consume this API"
40
+ **Output:**
41
+ Created PATCH /api/users/preferences returning {theme, notifications, language}. Supports partial updates — the frontend can save fields independently. Use this contract for PreferencesPanel; opted for PATCH over PUT to avoid full-state requirements.
42
+
43
+ **Input:** Agent=demeter, Phase=2, Summary="Added user_preferences table migration abc123", Next=hermes, Next needs="update UserService to include preferences"
44
+ **Output:**
45
+ Added user_preferences table (migration abc123) with FK→users, columns: theme, notifications_enabled, language. Use joinedload(User.preferences) in UserService.get_profile to avoid N+1 on the profile endpoint.
46
+
47
+ ## Output Rules
48
+ - Return ONLY the summary text. No preamble, no markdown formatting.
49
+ - Max 60 words for HIGH, 90 words for CRITICAL.
50
+ - If there's no meaningful gotcha for CRITICAL, produce only 2 sentences.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: sketch
3
+ description: "Turn a rough idea into a structured spec through a short Q&A interview — ask 3–5 targeted questions, then produce a complete feature spec"
4
+ agent: athena
5
+ tools: ['search', 'agent/askQuestions']
6
+ ---
7
+
8
+ # Sketch — Idea to Spec (Athena)
9
+
10
+ ## Idea
11
+
12
+ {{TASK_INPUT}}
13
+
14
+ ---
15
+
16
+ ## Interview Protocol
17
+
18
+ ### Phase 1: Discover (3–5 questions, one at a time)
19
+
20
+ Ask questions in this priority order, stopping after enough clarity:
21
+
22
+ 1. **Scope** — "What's the minimum viable version of this feature?"
23
+ 2. **Users** — "Who uses this and what's their primary workflow?"
24
+ 3. **Constraints** — "Are there tech, time, or integration constraints?"
25
+ 4. **Success criteria** — "How will you know this is working correctly?"
26
+ 5. **Non-goals** — "What should this explicitly NOT do?"
27
+
28
+ **Rules:**
29
+ - Ask **one question at a time** — never batch
30
+ - Wait for the answer before asking the next
31
+ - Stop after at least 3 answers
32
+ - If the user is unsure, offer 2–3 concrete options
33
+
34
+ ### Phase 2: Confirm
35
+
36
+ Summarize understanding in 2–3 sentences. Ask: "Does this match what you have in mind?"
37
+
38
+ ### Phase 3: Write the Spec
39
+
40
+ Produce only after confirmation.
41
+
42
+ ---
43
+
44
+ ## Spec Output Format
45
+
46
+ ```markdown
47
+ # Feature Spec: {{FEATURE_NAME}}
48
+
49
+ **Date:** YYYY-MM-DD
50
+ **Status:** Draft
51
+
52
+ ## Overview
53
+ {{FEATURE_DESCRIPTION}}
54
+
55
+ ## Goals
56
+ - {{GOAL_1}}
57
+
58
+ ## Non-Goals
59
+ - {{EXPLICITLY_EXCLUDED}}
60
+
61
+ ## Functional Requirements
62
+
63
+ ### Must Have (MVP)
64
+ - [ ] {{REQUIREMENT_1}}
65
+
66
+ ### Should Have (v1.1)
67
+ - [ ] {{REQUIREMENT_4}}
68
+
69
+ ## Technical Constraints
70
+ - **Stack:** {{RELEVANT_TECH}}
71
+ - **Integrations:** {{INTEGRATIONS}}
72
+ - **Security:** {{SECURITY}}
73
+
74
+ ## Success Criteria
75
+ - [ ] {{MEASURABLE_OUTCOME_1}}
76
+
77
+ ## Open Questions
78
+ - [ ] {{UNRESOLVED_DECISION_1}}
79
+
80
+ ## Suggested Implementation Phases
81
+ 1. **Phase 1:** {{DATABASE_SCHEMA}}
82
+ 2. **Phase 2:** {{BACKEND_API}}
83
+ 3. **Phase 3:** {{FRONTEND}}
84
+ ```
85
+
86
+ ---
87
+
88
+ After the spec, hand off to Zeus:
89
+ ```
90
+ @zeus: Implement this feature based on the spec above
91
+ ```