opencode-athena 0.0.1 → 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.
package/README.md CHANGED
@@ -72,14 +72,39 @@ Load SM agent → *sprint-planning → *create-story
72
72
 
73
73
  ### 2. Implement with Athena (Phase 4)
74
74
 
75
- Use Athena bridge commands:
75
+ Use Athena bridge commands in an iterative loop:
76
76
 
77
77
  ```
78
78
  /athena-dev # Load story, implement with Sisyphus
79
- /athena-review # Quality gate
79
+ /athena-review # Quality gate with collaborative discussion
80
+ ```
81
+
82
+ **If review passes:**
83
+ ```
80
84
  /athena-status # Mark complete, get next story
81
85
  ```
82
86
 
87
+ **If review finds issues:**
88
+ 1. Sisyphus auto-updates story status to `in_progress`
89
+ 2. You discuss findings together and decide which to address
90
+ 3. Sisyphus updates story file with implementation notes
91
+ 4. Sisyphus recommends: **Stay in session** or **Restart `/athena-dev`**
92
+ 5. You decide and proceed:
93
+ - **Stay in session**: Continue fixing in current session
94
+ - **Restart**: Exit and run `/athena-dev` again (loads implementation notes)
95
+ 6. After fixes, run `/athena-review` again (respects previous decisions)
96
+
97
+ **Iterative Quality Loop:**
98
+ ```
99
+ Implement → Review → Discuss → Fix → Review → ... → PASS
100
+ ```
101
+
102
+ **Key Features:**
103
+ - Review discussions are preserved in story file
104
+ - Subsequent reviews don't re-block on deferred/rejected items
105
+ - Checkboxed implementation notes track progress
106
+ - Flexible: stay in session for simple fixes, restart for complex rework
107
+
83
108
  ### 3. Repeat
84
109
 
85
110
  Continue until sprint is complete, then run retrospective with BMAD SM.
@@ -165,6 +190,96 @@ Common issues:
165
190
  | BMAD not found | Run `npx bmad-method@alpha install` in your project |
166
191
  | Commands not available | Verify commands are in `~/.config/opencode/command/` |
167
192
 
193
+ ## Publishing Releases
194
+
195
+ This package uses **Trusted Publishing (OIDC)** for secure, credential-free releases via GitHub Actions.
196
+
197
+ ### For Maintainers: Creating a New Release
198
+
199
+ 1. **Update version:**
200
+ ```bash
201
+ npm version patch # 0.0.3 -> 0.0.4
202
+ npm version minor # 0.1.0 -> 0.2.0
203
+ npm version major # 1.0.0 -> 2.0.0
204
+ ```
205
+
206
+ 2. **Commit and push:**
207
+ ```bash
208
+ git add package.json
209
+ git commit -m "Bump version to X.Y.Z"
210
+ git push origin main
211
+ ```
212
+
213
+ 3. **Create and push tag:**
214
+ ```bash
215
+ git tag vX.Y.Z
216
+ git push origin vX.Y.Z
217
+ ```
218
+
219
+ 4. **Monitor:** GitHub Actions publishes automatically
220
+ - Watch: [Actions](https://github.com/ZebulonRouseFrantzich/opencode-athena/actions)
221
+ - Verify: [npm package](https://www.npmjs.com/package/opencode-athena)
222
+ - Check: [GitHub Releases](https://github.com/ZebulonRouseFrantzich/opencode-athena/releases)
223
+
224
+ ### Security Features
225
+
226
+ **Trusted Publishing (OIDC):**
227
+ - ✅ Zero stored credentials (no npm tokens in GitHub)
228
+ - ✅ Short-lived authentication (hours, not years)
229
+ - ✅ Cannot be leaked (runtime-only tokens)
230
+ - ✅ Automatic provenance attestations
231
+ - ✅ OpenSSF industry standard
232
+
233
+ **Provenance Attestations:**
234
+
235
+ Every release includes cryptographically signed provenance via [Sigstore](https://www.sigstore.dev/), providing:
236
+ - Verifiable link between npm package and GitHub source code
237
+ - Proof of which GitHub Actions workflow built the package
238
+ - Immutable transparency log entry
239
+ - Supply chain security guarantees
240
+
241
+ **Verify any published version:**
242
+ ```bash
243
+ npm install opencode-athena
244
+ npm audit signatures
245
+ ```
246
+
247
+ ### CI/CD Configuration
248
+
249
+ The release workflow uses:
250
+ - **Trusted Publishing** - OIDC authentication (no long-lived tokens)
251
+ - **npm CLI 11+** - Required for Trusted Publishing support
252
+ - **GitHub-hosted runners** - Secure, isolated build environment
253
+ - **Automatic provenance** - Generated without `--provenance` flag
254
+
255
+ Trusted Publisher configuration:
256
+ - **Provider:** GitHub Actions
257
+ - **Repository:** `ZebulonRouseFrantzich/opencode-athena`
258
+ - **Workflow:** `release.yml`
259
+ - **Permissions:** `id-token: write`, `contents: write`
260
+
261
+ ### Troubleshooting Releases
262
+
263
+ | Issue | Solution |
264
+ |-------|----------|
265
+ | "Unable to authenticate" | Verify Trusted Publisher config on npmjs.com matches exactly (case-sensitive) |
266
+ | Workflow filename mismatch | Must be `release.yml` (not `Release.yml` or full path) |
267
+ | npm version error | Ensure npm 11.5.1+ (workflow upgrades automatically) |
268
+ | No provenance generated | Automatic with Trusted Publishing - check npmjs.com package page |
269
+ | Self-hosted runner error | Use GitHub-hosted runners only (required for OIDC) |
270
+
271
+ For detailed setup: [`.github/workflows/release.yml`](.github/workflows/release.yml)
272
+
273
+ ### Why Trusted Publishing?
274
+
275
+ We use Trusted Publishing instead of traditional npm tokens because:
276
+ - **Security:** Eliminates risks from npm credential breaches
277
+ - **Compliance:** Implements OpenSSF Trusted Publishers standard
278
+ - **Simplicity:** No manual token management or rotation
279
+ - **Transparency:** Automatic provenance provides supply chain visibility
280
+
281
+ Learn more: [npm Trusted Publishing Documentation](https://docs.npmjs.com/trusted-publishers)
282
+
168
283
  ## Credits
169
284
 
170
285
  Built on top of:
@@ -28,6 +28,55 @@ This returns:
28
28
  - **PRD**: Relevant functional requirements
29
29
  - **Sprint progress**: Where this story fits in the overall sprint
30
30
 
31
+ **CRITICAL: Check for Implementation Notes from Previous Review**
32
+
33
+ After loading the story, check if the story file contains an **Implementation Notes** section.
34
+
35
+ ### If Implementation Notes Exist:
36
+
37
+ This means `/athena-review` was run previously and findings were discussed with the user.
38
+
39
+ **What to do:**
40
+ 1. **Read the Implementation Notes section carefully** - It contains:
41
+ - **Findings to Address**: Checkboxed list of fixes the user agreed to implement
42
+ - **Deferred to Future Work**: Items the user decided not to fix now
43
+ - **Not Implemented**: Items the user decided not to implement at all
44
+
45
+ 2. **Prioritize the "Findings to Address" items** - These are your PRIMARY work items for this session
46
+
47
+ 3. **Check off items as you complete them**:
48
+ - Use the Read tool to load the story file
49
+ - Use the Edit tool to change `- [ ]` to `- [x]` for completed items
50
+ - This provides progress tracking
51
+
52
+ 4. **Respect the decisions**:
53
+ - DO NOT work on items marked as "Deferred" or "Not Implemented"
54
+ - These represent user decisions from the review discussion
55
+ - Focus only on agreed fixes
56
+
57
+ 5. **Verify your fixes**:
58
+ - Run `lsp_diagnostics` on changed files after each fix
59
+ - When all checkboxes are complete, run `/athena-review` again to verify
60
+
61
+ **Your approach with Implementation Notes:**
62
+ ```
63
+ 1. Load story context (athena_get_story)
64
+ 2. Review implementation notes
65
+ 3. Work through checkboxed items systematically
66
+ 4. Check off completed items
67
+ 5. Verify with lsp_diagnostics
68
+ 6. When done, recommend running /athena-review
69
+ ```
70
+
71
+ ### If No Implementation Notes Exist:
72
+
73
+ This is a **fresh implementation** - proceed with the normal workflow:
74
+ - Understand requirements and acceptance criteria
75
+ - Plan your approach (Step 2)
76
+ - Implement the story (Step 3)
77
+ - Verify implementation (Step 4)
78
+ - Complete the story (Step 5)
79
+
31
80
  ## Step 2: Plan Your Approach
32
81
 
33
82
  Before diving into code, plan your implementation strategy:
@@ -22,6 +22,20 @@ This returns:
22
22
  - Relevant PRD sections
23
23
  - Sprint context
24
24
 
25
+ **CRITICAL: Check for Previous Review Decisions**
26
+
27
+ After loading the story, check if the story file contains an **Implementation Notes** section from a previous review. This section will be present if `/athena-review` was run before and findings were discussed.
28
+
29
+ If **Implementation Notes exist**:
30
+ - Extract the **Deferred to Future Work** items
31
+ - Extract the **Not Implemented** items
32
+ - These represent USER DECISIONS from previous reviews
33
+ - You MUST NOT re-raise these issues in the current review
34
+ - Only flag NEW issues or issues the user agreed to fix
35
+
36
+ If **No Implementation Notes exist**:
37
+ - This is the first review - proceed normally with all findings
38
+
25
39
  ## Step 2: Identify Changed Files
26
40
 
27
41
  Use git to identify what files were modified for this story:
@@ -245,6 +259,20 @@ Capture test results.
245
259
 
246
260
  **After receiving both Oracle reviews and automated check results**, synthesize a unified quality gate report.
247
261
 
262
+ **CRITICAL: Filter Against Previous Decisions**
263
+
264
+ Before generating the report, if Implementation Notes exist from Step 1:
265
+
266
+ 1. **Load previous decisions** from the story file's Implementation Notes section
267
+ 2. **Extract deferred/not-implemented items** (exact descriptions or keywords)
268
+ 3. **Filter Oracle findings**:
269
+ - EXCLUDE any finding that matches items marked as "Deferred to Future Work"
270
+ - EXCLUDE any finding that matches items marked as "Not Implemented"
271
+ - INCLUDE only NEW findings or items the user agreed to fix
272
+ 4. **Note filtered items**: If you filter out findings, mention this in the report: "X findings excluded (previously deferred/rejected in prior review)"
273
+
274
+ This ensures you don't re-block the story on issues the user has already made decisions about.
275
+
248
276
  Generate this structured report:
249
277
 
250
278
  ```markdown
@@ -368,12 +396,14 @@ Generate this structured report:
368
396
  3. Re-run quality gate after critical fixes
369
397
  ```
370
398
 
371
- ## Step 7: Update Story Status
399
+ ## Step 7: Discuss Findings and Update Story
372
400
 
373
- Based on the Quality Gate Decision:
401
+ Based on the Quality Gate Decision, take different actions:
374
402
 
375
403
  ### If PASS (no critical issues, no blockers, LSP clean, build/tests pass):
376
404
 
405
+ Auto-update status to completed:
406
+
377
407
  ```
378
408
  athena_update_status({
379
409
  storyId: "{storyId}",
@@ -382,24 +412,257 @@ athena_update_status({
382
412
  })
383
413
  ```
384
414
 
385
- ### If FAIL (critical issues OR blockers OR LSP errors OR build/test failures):
415
+ Congratulate the user and move on.
416
+
417
+ ### If FAIL or NEEDS WORK (issues found after filtering):
418
+
419
+ Follow this collaborative process:
420
+
421
+ **Step 7a: Update Status to In Progress**
422
+
423
+ First, immediately update the story status:
386
424
 
387
425
  ```
388
426
  athena_update_status({
389
427
  storyId: "{storyId}",
390
428
  status: "in_progress",
391
- notes: "Quality gate FAILED. Must fix: {count} critical issues, {count} blockers, {count} LSP errors. See quality gate report above. Re-run /athena-review after fixes."
429
+ notes: "Quality gate completed. Found {count} critical issues, {count} blockers, {count} warnings, {count} gaps. Awaiting user input on which findings to address."
392
430
  })
393
431
  ```
394
432
 
395
- ### If NEEDS WORK (warnings/gaps but no critical issues):
433
+ **Step 7b: Discuss Findings with User**
434
+
435
+ Present the findings collaboratively (remember: already filtered against previous decisions):
396
436
 
397
437
  ```
398
- athena_update_status({
399
- storyId: "{storyId}",
400
- status: "needs_review",
401
- notes: "Quality gate: NEEDS WORK. Critical issues resolved, but {count} warnings and {count} gaps found. Recommend addressing before completion. See quality gate report above."
402
- })
438
+ I've completed the quality gate review for Story {storyId}. Here's what I found:
439
+
440
+ **Critical Issues**: {count}
441
+ {list each with file/line if available}
442
+
443
+ **Blockers**: {count}
444
+ {list each with scenario that would fail}
445
+
446
+ **Warnings & Gaps**: {count}
447
+ {list each with severity}
448
+
449
+ **Automated Checks**:
450
+ - LSP Errors: {count}
451
+ - Build: {PASS/FAIL}
452
+ - Tests: {PASS/FAIL}
453
+
454
+ {if previous review existed}
455
+ Note: {X} findings from Oracle were excluded because you previously decided to defer or not implement them.
456
+ {endif}
457
+
458
+ **My Assessment**:
459
+
460
+ **Must Fix** (blocks story completion):
461
+ - {item 1}
462
+ - {item 2}
463
+ ...
464
+
465
+ **Should Fix** (significantly improves quality):
466
+ - {item 1}
467
+ - {item 2}
468
+ ...
469
+
470
+ **Optional** (nice-to-have):
471
+ - {item 1}
472
+ - {item 2}
473
+ ...
474
+
475
+ Let's discuss:
476
+ 1. Which findings do you want to address in this story?
477
+ 2. Are there any findings you want to defer to future work?
478
+ 3. Are there any findings you disagree with or want to mark as "Not Implemented"?
479
+
480
+ Once we agree on scope, I'll update the story file with implementation notes.
481
+ ```
482
+
483
+ **Wait for user response before proceeding to Step 7c.**
484
+
485
+ **Step 7c: Update Story File with Implementation Notes**
486
+
487
+ After the user has decided which findings to address, update the story file.
488
+
489
+ If this is the **first review** (no Implementation Notes section exists):
490
+
491
+ Append this section to the story file at `docs/stories/story-{epic}-{number}.md`:
492
+
493
+ ```markdown
494
+ ## Implementation Notes
495
+
496
+ ### Quality Review - {current date and time}
497
+
498
+ **Findings to Address:**
499
+ - [ ] {Finding description} - Priority: Critical - File: {file}:{line}
500
+ - [ ] {Finding description} - Priority: High - File: {file}:{line}
501
+ - [ ] {Finding description} - Priority: Medium
502
+
503
+ **Deferred to Future Work:**
504
+ - {Finding description} - Reason: {user's reason} - Target: {Epic X, Story Y if mentioned}
505
+
506
+ **Not Implemented:**
507
+ - {Finding description} - Reason: {user's reason - e.g., "Out of scope", "Disagree with finding", "Accepted risk"}
508
+
509
+ **Review Conducted By**: Sisyphus + Oracle (Code Review + Adversarial Review)
510
+ **Automated Checks**: LSP: {result}, Build: {result}, Tests: {result}
511
+ ```
512
+
513
+ If this is a **subsequent review** (Implementation Notes section already exists):
514
+
515
+ **Preserve the previous review notes** and append a new section:
516
+
517
+ ```markdown
518
+ ### Quality Review - {current date and time} (Follow-up Review)
519
+
520
+ **Previous Review Status:**
521
+ - {X} items were addressed from previous review
522
+ - {Y} items remain in progress
523
+ - {Z} items remain deferred
524
+
525
+ **New Findings to Address:**
526
+ - [ ] {New finding} - Priority: {level}
527
+
528
+ **Additional Deferred Items:**
529
+ - {Finding description} - Reason: {user's reason}
530
+
531
+ **Additional Not Implemented Items:**
532
+ - {Finding description} - Reason: {user's reason}
533
+
534
+ **Review Conducted By**: Sisyphus + Oracle
535
+ **Automated Checks**: LSP: {result}, Build: {result}, Tests: {result}
536
+ ```
537
+
538
+ Use the Read tool to load the story file, then use the Edit tool to append these notes.
539
+
540
+ **Step 7d: Recommend Approach (Stay in Session vs Restart)**
541
+
542
+ After updating the story file, analyze the situation and recommend an approach to the user:
543
+
544
+ Evaluate:
545
+ 1. **Fix Complexity**: Are the fixes simple (type errors, minor logic) or complex (architectural changes)?
546
+ 2. **Fix Scope**: How many files need changes? How many lines?
547
+ 3. **Session Health**: Is the current session reasonably sized or bloated with context?
548
+ 4. **Fix Type**: Bug fixes vs refactoring vs new features?
549
+
550
+ Then provide a recommendation:
551
+
552
+ ```
553
+ I've updated the story file with our agreed implementation notes.
554
+
555
+ **My Recommendation**: {Stay in Current Session / Start Fresh Session}
556
+
557
+ {if recommending STAY IN SESSION}:
558
+ **Reasoning**:
559
+ - The fixes are straightforward: {brief explanation}
560
+ - Estimated changes: {X files, Y lines, simple/moderate complexity}
561
+ - Current session context is valuable and not too bloated
562
+ - Estimated fix time: {rough estimate based on complexity}
563
+ - Benefits: Maintain context, efficient iteration
564
+
565
+ **Shall I proceed with the fixes in this session?**
566
+
567
+ {if recommending START FRESH SESSION}:
568
+ **Reasoning**:
569
+ - The fixes require: {architectural changes / major refactoring / cross-cutting concerns}
570
+ - Estimated changes: {X files, Y lines, high complexity}
571
+ - Current session is {too long / context-heavy / would benefit from fresh start}
572
+ - Benefits: Clean context, better planning, clearer focus
573
+
574
+ **I recommend:**
575
+ 1. Exit this session
576
+ 2. Run `/athena-dev` to reload the story (it will pick up the implementation notes)
577
+ 3. Implement the fixes with a clear strategy
578
+ 4. Run `/athena-review` again when complete
579
+
580
+ **What would you like to do?**
581
+
582
+ {always provide options}:
583
+ 1. **Continue in this session** - I'll start fixing the items now
584
+ 2. **Exit and restart `/athena-dev`** - Fresh session approach
585
+ 3. **Something else** - Discuss further or modify the plan
586
+ ```
587
+
588
+ **Wait for user decision before proceeding.**
589
+
590
+ ## Step 8: Execute Based on User Decision
591
+
592
+ After presenting your recommendation in Step 7d, the user will choose one of the following paths:
593
+
594
+ ### Path A: User Chooses to Continue in Current Session
595
+
596
+ If the user wants to proceed with fixes in the current session:
597
+
598
+ ```
599
+ Great, I'll proceed with the fixes in this session.
600
+
601
+ I'll work through the implementation notes systematically:
602
+ {list the checkboxed items from the story file}
603
+
604
+ As I complete each fix, I'll check it off in the story file.
605
+
606
+ When all fixes are complete, I'll run `/athena-review` again to verify the quality gate passes.
607
+ ```
608
+
609
+ Then:
610
+ 1. Work through each item in the "Findings to Address" list
611
+ 2. Use the Read tool to check off completed items (convert `- [ ]` to `- [x]`)
612
+ 3. Run `lsp_diagnostics` on changed files
613
+ 4. When all items are checked off, inform the user and recommend running `/athena-review` again
614
+
615
+ ### Path B: User Chooses to Exit and Restart
616
+
617
+ If the user wants to start a fresh session:
618
+
619
+ ```
620
+ Understood. The story file has been updated with implementation notes at:
621
+ `docs/stories/story-{epic}-{number}.md`
622
+
623
+ The implementation notes detail exactly what needs to be fixed based on our discussion.
624
+
625
+ When you run `/athena-dev` again:
626
+ - Sisyphus will automatically load these implementation notes
627
+ - The notes will guide the fix implementation
628
+ - After fixes are complete, run `/athena-review` again
629
+
630
+ The sprint status remains at 'in_progress' until the quality gate passes.
631
+
632
+ Good luck with the fixes!
633
+ ```
634
+
635
+ Then end the session.
636
+
637
+ ### Path C: User Wants to Defer All Fixes or Make Other Changes
638
+
639
+ If the user wants to modify the plan or defer all work:
640
+
641
+ ```
642
+ I understand you want to {take a different approach}.
643
+
644
+ Options:
645
+ 1. **Modify the implementation notes** - We can adjust what's in "Findings to Address" vs "Deferred"
646
+ 2. **Mark story as blocked** - If waiting on external dependencies
647
+ 3. **Keep as in_progress** - Come back to this later
648
+ 4. **Mark complete despite findings** - (Not recommended, but your choice)
649
+
650
+ What would you like to do?
651
+ ```
652
+
653
+ Then follow the user's guidance and update the story status accordingly using `athena_update_status`.
654
+
655
+ ### Re-running the Review
656
+
657
+ When `/athena-review` is run again after fixes:
658
+ - Step 1 will load the implementation notes
659
+ - Step 6 will filter out previously deferred/not-implemented items
660
+ - Only NEW issues or unfixed items will be flagged
661
+ - If all agreed fixes are complete and no new issues found → PASS
662
+
663
+ This creates an iterative loop:
664
+ ```
665
+ Review → Discuss → Fix → Review → Discuss → Fix → ... → PASS
403
666
  ```
404
667
 
405
668
  ## Important Notes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-athena",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Strategic wisdom meets practical execution - Unified oh-my-opencode + BMAD METHOD toolkit for OpenCode",
5
5
  "keywords": [
6
6
  "opencode",
@@ -38,8 +38,8 @@
38
38
  "main": "./dist/index.js",
39
39
  "types": "./dist/index.d.ts",
40
40
  "bin": {
41
- "opencode-athena": "./dist/cli/index.js",
42
- "athena": "./dist/cli/index.js"
41
+ "opencode-athena": "dist/cli/index.js",
42
+ "athena": "dist/cli/index.js"
43
43
  },
44
44
  "files": [
45
45
  "dist",