opencode-athena 0.1.1 → 0.2.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Strategic wisdom meets practical execution**
4
4
 
5
- Unified [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) + [BMAD METHOD v6](https://github.com/bmad-method/bmad-method) toolkit for [OpenCode](https://opencode.ai).
5
+ Unified [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) + [BMAD METHOD v6](https://github.com/bmad-code-org/BMAD-METHOD) toolkit for [OpenCode](https://opencode.ai).
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/opencode-athena)](https://www.npmjs.com/package/opencode-athena)
8
8
  [![License: MIT-0](https://img.shields.io/badge/License-MIT--0-yellow.svg)](https://opensource.org/licenses/MIT-0)
@@ -57,6 +57,7 @@ After installation, these commands are available in OpenCode:
57
57
  | `/athena-parallel` | Execute multiple stories in parallel |
58
58
  | `/athena-status` | View/update sprint status |
59
59
  | `/athena-info` | Show toolkit configuration |
60
+ | `/athena-review-story` | Party review stories for security/logic/performance gaps (pre-dev) |
60
61
 
61
62
  ## Workflow
62
63
 
@@ -109,6 +110,75 @@ Implement → Review → Discuss → Fix → Review → ... → PASS
109
110
 
110
111
  Continue until sprint is complete, then run retrospective with BMAD SM.
111
112
 
113
+ ## Pre-Development Story Review
114
+
115
+ The `/athena-review-story` command runs a comprehensive "party review" of stories **before** development begins, catching issues when they're cheap to fix (in markdown, not code).
116
+
117
+ ### Usage
118
+
119
+ ```bash
120
+ /athena-review-story epic-2 # Review all stories in Epic 2
121
+ /athena-review-story 2.3 # Deep dive on Story 2.3
122
+ /athena-review-story --thorough # Force advanced model
123
+ ```
124
+
125
+ ### 3-Phase Review Architecture
126
+
127
+ ```
128
+ ┌─────────────────────────────────────────┐
129
+ │ PHASE 1: Automated Analysis │
130
+ │ • Oracle finds security/logic gaps │
131
+ │ • Recommends BMAD agents by findings │
132
+ │ • Saves review to docs/reviews/ │
133
+ └─────────────────────────────────────────┘
134
+
135
+
136
+ User: [Q]uick review or [D]iscuss?
137
+
138
+ [D]
139
+
140
+ ┌─────────────────────────────────────────┐
141
+ │ PHASE 2: Parallel Agent Analysis │
142
+ │ • Architect, DEV, TEA, PM in parallel │
143
+ │ • Each analyzes ALL stories │
144
+ │ • Cross-story pattern detection │
145
+ └─────────────────────────────────────────┘
146
+
147
+
148
+ ┌─────────────────────────────────────────┐
149
+ │ PHASE 3: Informed Discussion │
150
+ │ • BMAD *party-mode with pre-context │
151
+ │ • Interactive agent debate │
152
+ │ • Decisions captured to story files │
153
+ └─────────────────────────────────────────┘
154
+ ```
155
+
156
+ ### Finding Categories
157
+
158
+ | Category | Icon | Examples |
159
+ |----------|------|----------|
160
+ | Security | 🔒 | Missing auth, input validation, data exposure |
161
+ | Logic | 🧠 | Edge cases, error handling, race conditions |
162
+ | Best Practices | ✨ | Anti-patterns, testing gaps, accessibility |
163
+ | Performance | ⚡ | N+1 queries, caching, large data handling |
164
+
165
+ ### Agent Selection
166
+
167
+ Agents are recommended based on finding types:
168
+
169
+ | Finding Type | Agents Recommended |
170
+ |--------------|-------------------|
171
+ | Security issues | Architect (Winston), DEV (Amelia), TEA (Murat) |
172
+ | Logic gaps | DEV, TEA, Analyst (Mary) |
173
+ | Performance concerns | Architect, DEV |
174
+ | Best practice issues | DEV, Tech Writer (Paige) |
175
+ | High severity (any) | PM (John) - always required |
176
+
177
+ ### Quick vs Full Review
178
+
179
+ - **Quick Review [Q]**: Accept Phase 1 findings, skip discussion. Best for low-severity issues.
180
+ - **Full Discussion [D]**: Run Phases 2-3 with parallel agents and party-mode debate. Best for complex or high-severity findings.
181
+
112
182
  ## Configuration
113
183
 
114
184
  Configuration files are stored in `~/.config/opencode/`:
@@ -157,8 +227,9 @@ Create `.opencode/athena.json` in your project root to override global settings.
157
227
  │ │
158
228
  │ ┌─────────────────────────────────────────────────────────────────────┐ │
159
229
  │ │ Bridge Commands │ │
160
- │ │ /athena-dev /athena-review /athena-debug │ │
161
- │ │ /athena-research /athena-parallel /athena-status │ │
230
+ │ │ /athena-dev /athena-review /athena-debug │ │
231
+ │ │ /athena-research /athena-parallel /athena-status │ │
232
+ │ │ /athena-review-story │ │
162
233
  │ └─────────────────────────────────────────────────────────────────────┘ │
163
234
  │ │
164
235
  │ ┌──────────────────────┐ ┌──────────────────────┐ ┌────────────────┐ │
@@ -286,7 +357,7 @@ Built on top of:
286
357
 
287
358
  - [OpenCode](https://opencode.ai) by SST
288
359
  - [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) by code-yeongyu
289
- - [BMAD METHOD](https://github.com/bmad-method/bmad-method) by bmad-method
360
+ - [BMAD METHOD](https://github.com/bmad-code-org/BMAD-METHOD) by bmad-code-org
290
361
 
291
362
  ## License
292
363
 
@@ -0,0 +1,384 @@
1
+ ---
2
+ description: 3-phase party review of BMAD stories with parallel agent analysis and BMAD party-mode discussion
3
+ ---
4
+
5
+ # Athena Review Story - Enhanced Party Review (3-Phase)
6
+
7
+ Run a comprehensive "party review" on BMAD stories **after story creation but before development**.
8
+
9
+ **Architecture:**
10
+ - **Phase 1**: Background agent performs Oracle analysis (saves context)
11
+ - **Phase 2**: Parallel BMAD agents analyze from their perspectives
12
+ - **Phase 3**: BMAD party-mode discussion with pre-informed agents
13
+
14
+ ---
15
+
16
+ ## Phase 1: Automated Review (Background Agent)
17
+
18
+ ### Step 1.1: Parse Arguments
19
+
20
+ The command receives: `$ARGUMENTS`
21
+
22
+ **Scope Detection:**
23
+ - Epic: `2`, `epic-2` → Reviews all stories in epic
24
+ - Story: `2.3`, `story-2-3` → Deep dive on single story
25
+ - Path: `docs/stories/story-2-3.md` → Explicit file
26
+ - Flag: `--thorough` → Force advanced model
27
+
28
+ ### Step 1.2: Spawn Background Review Agent
29
+
30
+ This review runs in a **separate context** to preserve main session tokens.
31
+
32
+ ```
33
+ Use background_task to spawn a review agent:
34
+
35
+ background_task({
36
+ agent: "general",
37
+ description: "Party review of {identifier}",
38
+ prompt: `
39
+ You are performing a party review for Athena.
40
+
41
+ 1. Call the athena_review_story tool:
42
+ athena_review_story({ identifier: "{identifier}", thorough: {thorough} })
43
+
44
+ 2. Using the oraclePrompt from the result, invoke @oracle to analyze the stories.
45
+
46
+ 3. Parse Oracle's response and count findings by category and severity.
47
+
48
+ 4. Determine which BMAD agents should participate based on findings:
49
+ - Security issues → Architect (Winston), DEV (Amelia), TEA (Murat)
50
+ - Logic gaps → Analyst (Mary), DEV (Amelia), TEA (Murat)
51
+ - Performance issues → Architect (Winston), DEV (Amelia)
52
+ - Best practices → DEV (Amelia), Tech Writer (Paige)
53
+ - High severity issues → PM (John) always required
54
+
55
+ 5. Save the review document to: docs/reviews/party-review-{scope}-{identifier}-{date}.md
56
+
57
+ 6. Return a JSON summary:
58
+ {
59
+ "success": true,
60
+ "scope": "epic|story",
61
+ "identifier": "...",
62
+ "reviewDocumentPath": "...",
63
+ "findings": {
64
+ "total": N,
65
+ "high": N,
66
+ "medium": N,
67
+ "low": N,
68
+ "byCategory": { "security": N, "logic": N, "bestPractices": N, "performance": N }
69
+ },
70
+ "recommendedAgents": [
71
+ { "agent": "architect", "reason": "...", "priority": "required|recommended|optional" },
72
+ ...
73
+ ],
74
+ "oracleAnalysis": "..."
75
+ }
76
+ `
77
+ })
78
+ ```
79
+
80
+ ### Step 1.3: Wait for Background Result
81
+
82
+ Wait for the background task to complete and retrieve the Phase 1 result.
83
+
84
+ ```
85
+ background_output({ task_id: "<task_id_from_step_1.2>" })
86
+ ```
87
+
88
+ ### Step 1.4: Present Summary to User
89
+
90
+ ```
91
+ 📋 **Phase 1 Complete: Automated Review**
92
+
93
+ **Scope**: {Epic/Story} {identifier}
94
+ **Review Document**: {reviewDocumentPath}
95
+
96
+ **Findings Summary**:
97
+ - 🔴 High: {high} issues (must address)
98
+ - 🟡 Medium: {medium} issues (should address)
99
+ - 🟢 Low: {low} issues (nice to have)
100
+
101
+ **By Category**:
102
+ - 🔒 Security: {security}
103
+ - 🧠 Logic: {logic}
104
+ - ✨ Best Practices: {bestPractices}
105
+ - ⚡ Performance: {performance}
106
+
107
+ **Recommended BMAD Agents for Discussion**:
108
+ {list recommended agents with reasons}
109
+
110
+ ---
111
+
112
+ **Options**:
113
+ [Q] Quick review - Accept/Defer/Reject findings without discussion
114
+ [D] Discuss with team - Launch Phase 2 parallel analysis + Phase 3 party mode
115
+ [V] View full report - Open the review document
116
+ [E] Exit - End review session
117
+ ```
118
+
119
+ **If user selects [Q]**: Skip to Quick Decision Flow (below)
120
+ **If user selects [D]**: Continue to Phase 2
121
+ **If user selects [V]**: Display the review document, then return to options
122
+ **If user selects [E]**: End session
123
+
124
+ ---
125
+
126
+ ## Phase 2: Parallel Agent Pre-Analysis
127
+
128
+ When user selects [D], spawn parallel background agents for each recommended BMAD agent.
129
+
130
+ ### Step 2.1: Spawn Parallel Agent Analyses
131
+
132
+ For each recommended agent, spawn a background task:
133
+
134
+ ```
135
+ # Spawn in parallel - all at once
136
+ background_task({
137
+ agent: "general",
138
+ description: "Architect analysis of {identifier}",
139
+ prompt: `
140
+ You are Winston, the Software Architect from BMAD.
141
+
142
+ **Your Expertise**: System design, security architecture, scalability, technical debt
143
+ **Your Perspective**: Architecture and system design implications
144
+
145
+ **Review the following stories and findings**:
146
+ {storiesContent}
147
+
148
+ **Oracle's Findings**:
149
+ {oracleAnalysis}
150
+
151
+ **Your Task**:
152
+ 1. Analyze each finding from your architecture perspective
153
+ 2. Identify any cross-story patterns (shared components, dependencies)
154
+ 3. Prioritize issues based on architectural impact
155
+ 4. Note any findings you agree with, disagree with, or want to add to
156
+
157
+ **Return JSON**:
158
+ {
159
+ "agent": "architect",
160
+ "perspective": "architecture and system design",
161
+ "findings": {
162
+ "agreements": ["I agree with finding X because..."],
163
+ "concerns": ["From an architecture view, Y is concerning because..."],
164
+ "suggestions": ["Consider also addressing Z..."]
165
+ },
166
+ "crossStoryPatterns": [
167
+ { "pattern": "...", "affectedStories": ["2.1", "2.3"], "recommendation": "..." }
168
+ ],
169
+ "prioritizedIssues": [
170
+ { "findingId": "...", "priority": "critical|important|minor", "rationale": "..." }
171
+ ],
172
+ "summary": "Brief 2-3 sentence summary of my analysis"
173
+ }
174
+ `
175
+ })
176
+
177
+ # Similar for DEV (Amelia), TEA (Murat), PM (John), etc.
178
+ ```
179
+
180
+ ### Step 2.2: Collect All Agent Analyses
181
+
182
+ ```
183
+ # Wait for all parallel tasks
184
+ architect_result = background_output({ task_id: "..." })
185
+ dev_result = background_output({ task_id: "..." })
186
+ tea_result = background_output({ task_id: "..." })
187
+ pm_result = background_output({ task_id: "..." })
188
+ ```
189
+
190
+ ### Step 2.3: Synthesize Agent Perspectives
191
+
192
+ Combine all agent analyses into a discussion context:
193
+
194
+ ```
195
+ **Agent Analysis Summary**:
196
+
197
+ **Consensus Points** (agents agree):
198
+ - {list points where multiple agents agree}
199
+
200
+ **Debate Points** (agents disagree):
201
+ - {topic}:
202
+ - Winston (Architect): {position}
203
+ - Amelia (DEV): {different position}
204
+
205
+ **Priority Votes**:
206
+ | Finding | Architect | DEV | TEA | PM | Consensus |
207
+ |---------|-----------|-----|-----|----|-----------|
208
+ | SEC-001 | Critical | Critical | Important | Critical | Strong |
209
+ | LOG-002 | Minor | Important | Critical | Important | Disputed |
210
+ ```
211
+
212
+ ---
213
+
214
+ ## Phase 3: Informed Discussion (BMAD Party Mode)
215
+
216
+ ### Step 3.1: Prepare Party Mode Context
217
+
218
+ Create a context document for party mode:
219
+
220
+ ```markdown
221
+ # Party Review Discussion: {identifier}
222
+
223
+ **Date**: {date}
224
+ **Phase 1 Findings**: {total} issues ({high} high, {medium} medium, {low} low)
225
+ **Agents Present**: {list of agents}
226
+
227
+ ## Pre-Analysis Summaries
228
+
229
+ ### Winston (Architect)
230
+ {architect summary}
231
+
232
+ ### Amelia (DEV)
233
+ {dev summary}
234
+
235
+ ### Murat (TEA)
236
+ {tea summary}
237
+
238
+ ### John (PM)
239
+ {pm summary}
240
+
241
+ ## Discussion Agenda
242
+
243
+ 1. **High Severity Issues** ({count})
244
+ - {list with agent positions}
245
+
246
+ 2. **Disputed Findings** ({count})
247
+ - {list where agents disagree}
248
+
249
+ 3. **Cross-Story Patterns** ({count})
250
+ - {patterns identified by agents}
251
+
252
+ ---
253
+
254
+ Agents are pre-informed. Ready for discussion.
255
+ ```
256
+
257
+ ### Step 3.2: Invoke BMAD Party Mode
258
+
259
+ ```
260
+ Tell the user:
261
+
262
+ "🎉 **Launching BMAD Party Mode**
263
+
264
+ The following agents have completed their pre-analysis and are ready to discuss:
265
+ - {list agents with their key insights}
266
+
267
+ I'm now invoking BMAD party mode with this context pre-loaded.
268
+ Each agent will enter the discussion already informed about the findings.
269
+
270
+ ---
271
+
272
+ *party-mode
273
+
274
+ {Paste the prepared context document}
275
+
276
+ Let's start with the high severity issues. {Agent with strongest opinion}, what's your view on {first high severity issue}?"
277
+ ```
278
+
279
+ ### Step 3.3: Facilitate Discussion
280
+
281
+ During party mode:
282
+ - Let agents discuss each finding
283
+ - Capture user decisions (Accept/Defer/Reject)
284
+ - Note action items and assignments
285
+ - Track which findings have been addressed
286
+
287
+ ### Step 3.4: Conclude and Capture Decisions
288
+
289
+ When discussion ends:
290
+
291
+ ```
292
+ 📋 **Discussion Summary**
293
+
294
+ **Decisions Made**:
295
+ - ✅ Accepted: {count} findings
296
+ - ⏸️ Deferred: {count} findings (to {target stories})
297
+ - ❌ Rejected: {count} findings
298
+
299
+ **Action Items**:
300
+ - {list action items with assignments}
301
+
302
+ **Stories to Update**:
303
+ - Story {2.1}: Add {count} acceptance criteria
304
+ - Story {2.3}: Modify {count} criteria
305
+
306
+ Would you like me to update the story files now? [Y/N]
307
+ ```
308
+
309
+ ---
310
+
311
+ ## Quick Decision Flow
312
+
313
+ If user selected [Q] in Phase 1, skip Phases 2-3 and go directly to decisions:
314
+
315
+ ```
316
+ Let's go through the findings quickly.
317
+
318
+ 🔴 **HIGH SEVERITY** ({count}):
319
+
320
+ 1. [{category}] {title}
321
+ Impact: {impact}
322
+ Suggestion: {suggestion}
323
+
324
+ [A]ccept / [D]efer / [R]eject?
325
+
326
+ {Continue for each finding}
327
+
328
+ ---
329
+
330
+ Summary:
331
+ - Accepted: {count}
332
+ - Deferred: {count}
333
+ - Rejected: {count}
334
+
335
+ Update stories now? [Y/N]
336
+ ```
337
+
338
+ ---
339
+
340
+ ## Story Update Flow
341
+
342
+ After decisions are captured:
343
+
344
+ 1. Load each affected story file
345
+ 2. Add new acceptance criteria for accepted findings
346
+ 3. Add notes for deferred items (with target)
347
+ 4. Update the review document with decisions
348
+ 5. Report completion
349
+
350
+ ```
351
+ ✅ **Updates Complete**
352
+
353
+ **Modified Files**:
354
+ - docs/stories/story-2-1.md (added 2 ACs)
355
+ - docs/stories/story-2-3.md (added 1 AC, 1 note)
356
+ - docs/reviews/party-review-epic-2-2025-12-23.md (decisions recorded)
357
+
358
+ 🚀 Stories are ready for development!
359
+ ```
360
+
361
+ ---
362
+
363
+ ## Usage Examples
364
+
365
+ ```bash
366
+ # Epic review with full 3-phase workflow
367
+ /athena-review-story epic-2
368
+
369
+ # Story review (focused)
370
+ /athena-review-story 2.3
371
+
372
+ # Force thorough analysis
373
+ /athena-review-story 2.3 --thorough
374
+ ```
375
+
376
+ ---
377
+
378
+ ## Tips
379
+
380
+ - **Phase 1 runs in background** - Your main session stays responsive
381
+ - **Phase 2 agents run in parallel** - Faster than sequential analysis
382
+ - **Phase 3 uses real BMAD party mode** - Familiar interactive experience
383
+ - **Skip to quick review** for simple stories with few findings
384
+ - **Use --thorough** for security-critical or complex stories