opencode-athena 0.8.1-beta.0 → 0.8.1-beta.2

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.
@@ -1,405 +1,110 @@
1
1
  ---
2
- description: 3-phase party review of BMAD stories with parallel agent analysis and informed discussion
2
+ description: 3-phase party review of BMAD stories with Oracle and BMAD agents
3
3
  ---
4
4
 
5
- # Athena Review Story - Enhanced Party Review (3-Phase)
5
+ # Athena Review Story
6
6
 
7
- Run a comprehensive "party review" on BMAD stories **after story creation but before development**.
7
+ Run a comprehensive party review of BMAD stories **before development** to catch security, logic, best practice, and performance gaps.
8
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**: Athena-orchestrated informed discussion with pre-informed agents
9
+ ## Instructions
13
10
 
14
- ---
15
-
16
- ## Phase 1: Automated Review (Background Agent)
17
-
18
- ### Step 1.1: Parse Arguments
19
-
20
- The command receives: `$ARGUMENTS`
11
+ You receive: `$ARGUMENTS`
21
12
 
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:
13
+ Parse the identifier from arguments (e.g., "2", "epic-2", "2.3", "story-2-3", or file path).
34
14
 
35
- background_task({
36
- agent: "oracle",
37
- description: "Party review of {identifier}",
38
- prompt: `
39
- You are performing a party review for Athena.
15
+ ### Step 1: Phase 1 - Oracle Analysis
40
16
 
41
- 1. Call the athena_review_story tool:
42
- athena_review_story({ identifier: "{identifier}", thorough: {thorough} })
17
+ Call `athena_story_review_analyze` with the identifier:
43
18
 
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
- })
19
+ ```json
20
+ {
21
+ "identifier": "{parsed_identifier}"
22
+ }
78
23
  ```
79
24
 
80
- ### Step 1.3: Wait for Background Result
25
+ The tool spawns Oracle internally, analyzes stories, saves a review document, and returns findings with recommended BMAD agents.
81
26
 
82
- Wait for the background task to complete and retrieve the Phase 1 result.
27
+ If `success` is false, show the error and exit.
83
28
 
84
- ```
85
- background_output({ task_id: "<task_id_from_step_1.2>" })
86
- ```
29
+ ### Step 2: Present Summary and Get User Choice
87
30
 
88
- ### Step 1.4: Present Summary to User
31
+ Display Phase 1 results:
32
+ - Finding counts by severity (high, medium, low)
33
+ - Finding counts by category (security, logic, best practices, performance)
34
+ - Review document path
35
+ - Recommended BMAD agents
89
36
 
37
+ Ask the user:
90
38
  ```
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
39
+ [Q] Quick review - Simple accept/defer/reject without agent discussion
40
+ [D] Discuss with team - Run parallel agent analysis + party discussion
41
+ [V] View full report - Show the review document
116
42
  [E] Exit - End review session
117
43
  ```
118
44
 
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
45
+ ### Step 3: Handle User Choice
123
46
 
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: "oracle",
138
- description: "Architect analysis of {identifier}",
139
- prompt: `
140
- You are Winston, the Software Architect from BMAD.
47
+ **If [V]**: Read and display the review document, then return to Step 2.
141
48
 
142
- **Your Expertise**: System design, security architecture, scalability, technical debt
143
- **Your Perspective**: Architecture and system design implications
49
+ **If [E]**: Exit with message "Review document saved to {path}".
144
50
 
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**:
51
+ **If [Q]**: Call `athena_party_discussion` with only Phase 1 results (quick mode):
52
+ ```json
158
53
  {
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"
54
+ "action": "start",
55
+ "phase1Result": "{JSON.stringify(phase1Result)}"
173
56
  }
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
57
  ```
58
+ Skip to Step 5 (interactive discussion).
189
59
 
190
- ### Step 2.3: Synthesize Agent Perspectives
60
+ **If [D]**: Continue to Step 4.
191
61
 
192
- Combine all agent analyses into a discussion context:
62
+ ### Step 4: Phase 2 - Parallel Agent Consultation
193
63
 
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 (Athena Party Discussion)
215
-
216
- ### Step 3.1: Start Party Discussion
217
-
218
- Initialize the party discussion with Phase 1 and Phase 2 results:
219
-
220
- ```
221
- athena_party_discussion({
222
- action: "start",
223
- phase1Result: JSON.stringify(phase1Result),
224
- phase2Result: JSON.stringify(phase2Result)
225
- })
226
- ```
227
-
228
- This returns:
229
- - `sessionId` - Use this for subsequent calls
230
- - `currentItem` - First agenda item to discuss
231
- - `currentResponses` - Agent responses for the current item
232
- - `hasMoreItems` - Whether there are more items to discuss
233
-
234
- ### Step 3.2: Present Finding and Agent Responses
235
-
236
- For each agenda item, display:
237
-
238
- ```
239
- 🎉 **Party Discussion: {currentItem.topic}**
240
-
241
- **Severity**: {currentItem.severity} | **Category**: {currentItem.category}
242
- **Type**: {currentItem.type}
243
-
244
- ---
245
-
246
- **Agent Perspectives:**
247
-
248
- {For each response in currentResponses:}
249
- {response.icon} **{response.agentName}**: {response.response}
250
-
251
- ---
252
-
253
- **Your Decision:**
254
- [A] Accept - Add to acceptance criteria
255
- [D] Defer - Move to another story
256
- [R] Reject - Won't address
257
- [S] Skip - Discuss later
258
- [N] Next - Continue to next finding without deciding
259
- ```
260
-
261
- ### Step 3.3: Record User Decision
262
-
263
- When user decides:
264
-
265
- ```
266
- athena_party_discussion({
267
- action: "decide",
268
- sessionId: "{sessionId}",
269
- findingId: "{currentItem.findingId}",
270
- decision: "accept|defer|reject",
271
- reason: "{optional reason from user}",
272
- deferredTo: "{story ID if deferred}"
273
- })
274
- ```
275
-
276
- If user selects Skip:
277
- ```
278
- athena_party_discussion({
279
- action: "skip",
280
- sessionId: "{sessionId}",
281
- findingId: "{currentItem.findingId}"
282
- })
283
- ```
284
-
285
- ### Step 3.4: Continue or Complete
286
-
287
- If `hasMoreItems` is true:
288
- ```
289
- athena_party_discussion({
290
- action: "continue",
291
- sessionId: "{sessionId}"
292
- })
293
- ```
294
-
295
- Display the next finding and repeat Step 3.2.
296
-
297
- If `hasMoreItems` is false, the tool returns a summary:
298
-
299
- ```
300
- 📋 **Discussion Complete**
301
-
302
- **Decisions Made**:
303
- - ✅ Accepted: {summary.decisions.accepted} findings
304
- - ⏸️ Deferred: {summary.decisions.deferred} findings
305
- - ❌ Rejected: {summary.decisions.rejected} findings
306
- - ⏳ Pending: {summary.decisions.pending} findings
307
-
308
- **Stories to Update**:
309
- {For each in summary.storyUpdatesNeeded:}
310
- - Story {storyId}: {additions.length} items to add
311
-
312
- Would you like me to update the story files now? [Y/N]
313
- ```
314
-
315
- ### Step 3.5: Apply Story Updates
316
-
317
- If user confirms, the story files will be updated with:
318
- - New acceptance criteria for accepted findings
319
- - Implementation notes for all decisions
320
- - Updated review document with decision log
321
-
322
- End the session:
323
- ```
324
- athena_party_discussion({
325
- action: "end",
326
- sessionId: "{sessionId}"
327
- })
328
- ```
329
-
330
- ---
331
-
332
- ## Quick Decision Flow
333
-
334
- If user selected [Q] in Phase 1, skip Phases 2-3 and go directly to decisions:
335
-
336
- ```
337
- Let's go through the findings quickly.
338
-
339
- 🔴 **HIGH SEVERITY** ({count}):
340
-
341
- 1. [{category}] {title}
342
- Impact: {impact}
343
- Suggestion: {suggestion}
344
-
345
- [A]ccept / [D]efer / [R]eject?
346
-
347
- {Continue for each finding}
348
-
349
- ---
350
-
351
- Summary:
352
- - Accepted: {count}
353
- - Deferred: {count}
354
- - Rejected: {count}
355
-
356
- Update stories now? [Y/N]
64
+ Call `athena_story_review_consult` with Phase 1 results:
65
+ ```json
66
+ {
67
+ "phase1Result": "{JSON.stringify(phase1Result)}"
68
+ }
357
69
  ```
358
70
 
359
- ---
71
+ The tool spawns all recommended agents in parallel, waits for completion, synthesizes responses, and returns consensus/debate points.
360
72
 
361
- ## Story Update Flow
73
+ Display Phase 2 summary (agents consulted, consensus points, debate points).
362
74
 
363
- After decisions are captured:
75
+ ### Step 5: Phase 3 - Party Discussion
364
76
 
365
- 1. Load each affected story file
366
- 2. Add new acceptance criteria for accepted findings
367
- 3. Add notes for deferred items (with target)
368
- 4. Update the review document with decisions
369
- 5. Report completion
77
+ Call `athena_party_discussion` to start interactive discussion:
370
78
 
79
+ **Full mode** (with Phase 2):
80
+ ```json
81
+ {
82
+ "action": "start",
83
+ "phase1Result": "{JSON.stringify(phase1Result)}",
84
+ "phase2Result": "{JSON.stringify(phase2Result)}"
85
+ }
371
86
  ```
372
- ✅ **Updates Complete**
373
-
374
- **Modified Files**:
375
- - docs/stories/story-2-1.md (added 2 ACs)
376
- - docs/stories/story-2-3.md (added 1 AC, 1 note)
377
- - docs/reviews/party-review-epic-2-2025-12-23.md (decisions recorded)
378
87
 
379
- 🚀 Stories are ready for development!
88
+ **Quick mode** (Phase 1 only - already called in Step 3):
89
+ ```json
90
+ {
91
+ "action": "start",
92
+ "phase1Result": "{JSON.stringify(phase1Result)}"
93
+ }
380
94
  ```
381
95
 
382
- ---
383
-
384
- ## Usage Examples
385
-
386
- ```bash
387
- # Epic review with full 3-phase workflow
388
- /athena-review-story epic-2
96
+ For each agenda item:
97
+ 1. Present the finding with agent perspectives
98
+ 2. Ask user: [A]ccept / [D]efer / [R]eject / [S]kip
99
+ 3. Call `athena_party_discussion` with action "decide" or "skip"
100
+ 4. Call `athena_party_discussion` with action "continue" to get next item
389
101
 
390
- # Story review (focused)
391
- /athena-review-story 2.3
102
+ When `hasMoreItems` is false, display final summary:
103
+ - Decisions made (accepted, deferred, rejected, skipped)
104
+ - Stories that need updates
392
105
 
393
- # Force thorough analysis
394
- /athena-review-story 2.3 --thorough
395
- ```
396
-
397
- ---
106
+ Call `athena_party_discussion` with action "end" to finalize.
398
107
 
399
- ## Tips
108
+ ## Done
400
109
 
401
- - **Phase 1 runs in background** - Your main session stays responsive
402
- - **Phase 2 agents run in parallel** - Faster than sequential analysis
403
- - **Phase 3 uses real BMAD party mode** - Familiar interactive experience
404
- - **Skip to quick review** for simple stories with few findings
405
- - **Use --thorough** for security-critical or complex stories
110
+ Review complete! Stories are ready for development.
package/dist/cli/index.js CHANGED
@@ -13,6 +13,7 @@ import { promisify } from 'util';
13
13
  import 'yaml';
14
14
  import { z } from 'zod';
15
15
  import * as semver from 'semver';
16
+ import semver__default from 'semver';
16
17
 
17
18
  var __defProp = Object.defineProperty;
18
19
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -3044,9 +3045,14 @@ async function uninstall(options) {
3044
3045
  // src/cli/commands/update.ts
3045
3046
  init_esm_shims();
3046
3047
  var execAsync3 = promisify(exec);
3047
- async function getLatestVersion(packageName) {
3048
+ function detectReleaseChannel(version) {
3049
+ if (version.includes("-beta")) return "beta";
3050
+ if (version.includes("-alpha")) return "alpha";
3051
+ return "latest";
3052
+ }
3053
+ async function getLatestVersion(packageName, tag = "latest") {
3048
3054
  try {
3049
- const { stdout } = await execAsync3(`npm view ${packageName} version`);
3055
+ const { stdout } = await execAsync3(`npm view ${packageName}@${tag} version`);
3050
3056
  return stdout.trim();
3051
3057
  } catch {
3052
3058
  return null;
@@ -3054,11 +3060,12 @@ async function getLatestVersion(packageName) {
3054
3060
  }
3055
3061
  async function checkPackageUpdate(name, currentVersion) {
3056
3062
  const latest = await getLatestVersion(name);
3063
+ const hasUpdate = latest !== null && semver__default.valid(latest) && semver__default.valid(currentVersion) ? semver__default.gt(latest, currentVersion) : latest !== null && latest !== currentVersion;
3057
3064
  return {
3058
3065
  name,
3059
3066
  current: currentVersion,
3060
3067
  latest: latest || currentVersion,
3061
- updateAvailable: latest !== null && latest !== currentVersion
3068
+ updateAvailable: hasUpdate
3062
3069
  };
3063
3070
  }
3064
3071
  async function update(options) {
@@ -3072,13 +3079,15 @@ async function update(options) {
3072
3079
  "opencode-openai-codex-auth"
3073
3080
  ];
3074
3081
  const updates = [];
3075
- const athenaLatest = await getLatestVersion("opencode-athena");
3082
+ const athenaChannel = detectReleaseChannel(VERSION);
3083
+ const athenaLatest = await getLatestVersion("opencode-athena", athenaChannel);
3076
3084
  if (athenaLatest) {
3085
+ const athenaHasUpdate = semver__default.valid(athenaLatest) && semver__default.valid(VERSION) ? semver__default.gt(athenaLatest, VERSION) : athenaLatest !== VERSION;
3077
3086
  updates.push({
3078
3087
  name: "opencode-athena",
3079
3088
  current: VERSION,
3080
3089
  latest: athenaLatest,
3081
- updateAvailable: athenaLatest !== VERSION
3090
+ updateAvailable: athenaHasUpdate
3082
3091
  });
3083
3092
  }
3084
3093
  for (const pkgName of packagesToCheck) {
@@ -3120,7 +3129,8 @@ async function update(options) {
3120
3129
  if (athenaUpdate) {
3121
3130
  const athenaSpinner = ora2("Updating opencode-athena...").start();
3122
3131
  try {
3123
- await execAsync3("npm install -g opencode-athena@latest");
3132
+ const channel = detectReleaseChannel(VERSION);
3133
+ await fileManager.installDependencies([`opencode-athena@${channel}`]);
3124
3134
  athenaSpinner.succeed(`opencode-athena updated to ${athenaUpdate.latest}`);
3125
3135
  } catch (err) {
3126
3136
  athenaSpinner.fail("Failed to update opencode-athena");