opencode-bonfire 1.0.0 → 1.1.1

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.
@@ -55,21 +55,29 @@ You'll receive:
55
55
 
56
56
  ## Output Format
57
57
 
58
- Return findings as structured markdown, categorized by action:
58
+ Return findings as structured markdown with a clear verdict at the top:
59
59
 
60
60
  ```markdown
61
+ ## Verdict: APPROVE | CONDITIONAL | BLOCK
62
+
63
+ **Reason**: [One-line explanation of verdict]
64
+
65
+ ---
66
+
61
67
  ## Summary
62
68
 
63
69
  - **Total findings**: X
64
- - **Fix now (trivial)**: Y
65
- - **Needs spec**: Z
66
- - **Create issues**: W
70
+ - **Critical**: N (blocks)
71
+ - **Important**: N (blocks)
72
+ - **Moderate**: N (conditional)
73
+ - **Minor**: N (approve)
67
74
 
68
75
  ---
69
76
 
70
77
  ## Fix Now (trivial effort, do immediately)
71
78
 
72
79
  ### [Finding title]
80
+ - **Severity**: Critical | Important | Moderate | Minor
73
81
  - **What**: [Description]
74
82
  - **Where**: `path/to/file.ts:123`
75
83
  - **Fix**: [Specific action]
@@ -80,6 +88,7 @@ Return findings as structured markdown, categorized by action:
80
88
  ## Needs Spec (important, needs planning)
81
89
 
82
90
  ### [Finding title]
91
+ - **Severity**: Critical | Important | Moderate | Minor
83
92
  - **What**: [Description]
84
93
  - **Effort**: small | medium
85
94
  - **Impact**: [Why this matters]
@@ -90,6 +99,7 @@ Return findings as structured markdown, categorized by action:
90
99
  ## Create Issues (large effort or nice-to-have)
91
100
 
92
101
  ### [Finding title]
102
+ - **Severity**: Moderate | Minor
93
103
  - **What**: [Description]
94
104
  - **Effort**: medium | large
95
105
  - **Priority**: important | nice-to-have
@@ -97,11 +107,35 @@ Return findings as structured markdown, categorized by action:
97
107
 
98
108
  ---
99
109
 
110
+ ## Verdict Rationale
111
+
112
+ [Brief explanation of why this verdict was reached and key items to address]
113
+
114
+ ---
115
+
100
116
  ## No Issues Found In
101
117
 
102
118
  - [Area reviewed that looks good]
103
119
  ```
104
120
 
121
+ ## Verdict Rules
122
+
123
+ Determine verdict based on highest severity finding:
124
+
125
+ 1. **BLOCK** - Any Critical or Important findings exist
126
+ - Must address before proceeding
127
+ - Work is not ready to ship
128
+
129
+ 2. **CONDITIONAL** - Only Moderate findings exist
130
+ - Proceed with awareness
131
+ - Should address soon but not blocking
132
+
133
+ 3. **APPROVE** - Only Minor findings (or none)
134
+ - Safe to proceed
135
+ - Minor items can be addressed later
136
+
137
+ **Always state the verdict clearly at the top. Do not bury it.**
138
+
105
139
  ## Rules
106
140
 
107
141
  1. **Strategic, not pedantic** - Skip style nitpicks, focus on substance
@@ -113,12 +147,12 @@ Return findings as structured markdown, categorized by action:
113
147
 
114
148
  ## Severity Guide
115
149
 
116
- | Severity | Definition | Action |
117
- |----------|------------|--------|
118
- | Critical | Breaks functionality, security issue | Fix now |
119
- | Important | Significant gap, will cause problems | Fix now or spec |
120
- | Moderate | Should address, not urgent | Spec or issue |
121
- | Minor | Nice to have, low impact | Issue or skip |
150
+ | Severity | Definition | Verdict Impact | Action |
151
+ |----------|------------|----------------|--------|
152
+ | **Critical** | Breaks functionality, security issue, data loss | BLOCK | Fix now |
153
+ | **Important** | Significant gap, will cause problems later | BLOCK | Fix now or spec |
154
+ | **Moderate** | Should address, not urgent | CONDITIONAL | Spec or issue |
155
+ | **Minor** | Nice to have, low impact | APPROVE | Issue or skip |
122
156
 
123
157
  ## Effort Guide
124
158
 
@@ -94,3 +94,4 @@ Report:
94
94
  - Settings updated
95
95
  - Any manual steps needed (git cleanup)
96
96
  - New configuration summary
97
+ - Note: Context preservation during compaction is automatic (handled by Bonfire plugin hooks)
@@ -29,7 +29,46 @@ Update `<git-root>/.bonfire/index.md`:
29
29
 
30
30
  3. Update "Current State" to reflect new status
31
31
 
32
- ## Step 4: Commit Changes (if tracked)
32
+ ## Step 4: Update Codemap
33
+
34
+ Update the "Codemap" section in `index.md` with files referenced this session:
35
+
36
+ 1. **Identify key files** from this session:
37
+ - Files you read or edited
38
+ - Files mentioned in commits
39
+ - Files central to the work done
40
+
41
+ 2. **Update "This Session's Key Files"**:
42
+ - List up to 10 most relevant files
43
+ - Include brief description of what each does
44
+ - Format: `- \`path/to/file.ts\` - Brief description`
45
+
46
+ 3. **Preserve user-curated sections**:
47
+ - Keep "Entry Points" as-is (user maintains these)
48
+ - Keep "Core Components" as-is (user maintains these)
49
+
50
+ 4. **Keep it concise**:
51
+ - Only include files directly relevant to session work
52
+ - Remove stale entries from previous sessions
53
+ - Max 10 files in "This Session's Key Files"
54
+
55
+ Example:
56
+ ```markdown
57
+ ## Codemap
58
+
59
+ **Entry Points** (user-curated):
60
+ - `src/index.ts` - Main entry
61
+
62
+ **Core Components** (user-curated):
63
+ - `src/commands/` - CLI commands
64
+
65
+ **This Session's Key Files** (auto-updated):
66
+ - `claude/commands/configure.md` - Added PreCompact hook setup
67
+ - `claude/commands/end.md` - Added Codemap update step
68
+ - `.bonfire/specs/codemap-feature.md` - Feature specification
69
+ ```
70
+
71
+ ## Step 5: Commit Changes (if tracked)
33
72
 
34
73
  Read `<git-root>/.bonfire/config.json` to check `gitStrategy`.
35
74
 
@@ -52,7 +91,7 @@ Read `<git-root>/.bonfire/config.json` to check `gitStrategy`.
52
91
 
53
92
  If the commit fails due to hooks, help resolve the issue (but never bypass hooks with `--no-verify`).
54
93
 
55
- ## Step 5: Confirm
94
+ ## Step 6: Confirm
56
95
 
57
96
  Summarize:
58
97
  - What was documented
@@ -112,6 +112,19 @@ Check if `<git-root>/.bonfire/index.md` exists.
112
112
 
113
113
  ---
114
114
 
115
+ ## Codemap
116
+
117
+ **Entry Points** (user-curated):
118
+ - [Add main entry points here]
119
+
120
+ **Core Components** (user-curated):
121
+ - [Add key directories/modules here]
122
+
123
+ **This Session's Key Files** (auto-updated):
124
+ - [Files will be added by /bonfire-end]
125
+
126
+ ---
127
+
115
128
  ## Archived Sessions
116
129
 
117
130
  [Links to archived sessions will appear here]
@@ -1,4 +1,12 @@
1
1
  {
2
2
  "$schema": "https://opencode.ai/config.json",
3
- "instructions": ["CLAUDE.md", ".bonfire/index.md"]
3
+ "instructions": ["CLAUDE.md", ".bonfire/index.md"],
4
+ "skill": [
5
+ {
6
+ "directory": "skill/bonfire-context"
7
+ },
8
+ {
9
+ "directory": "skill/archive-bonfire-awareness"
10
+ }
11
+ ]
4
12
  }
@@ -2,8 +2,11 @@
2
2
  * Bonfire Plugin for OpenCode
3
3
  *
4
4
  * Provides event hooks for:
5
- * - Suggesting archive after PR merge
5
+ * - Suggesting archive after PR merge (backup to skill-based detection)
6
6
  * - Preserving session context during compaction
7
+ *
8
+ * Note: Archive suggestion also handled by archive-bonfire-awareness skill
9
+ * for better reliability across different OpenCode versions.
7
10
  */
8
11
 
9
12
  import type { Plugin } from "@opencode-ai/plugin"
@@ -30,6 +33,9 @@ export const BonfirePlugin: Plugin = async ({ directory }) => {
30
33
  const succeeded = !output.error && output.result
31
34
 
32
35
  if (isPrMerge && succeeded && existsSync(indexPath)) {
36
+ // Log for debugging - remove this once hook display is confirmed working
37
+ console.log("[Bonfire] PR merge detected, suggesting archive")
38
+
33
39
  return {
34
40
  message: `PR merged! Run \`/bonfire-archive\` to archive this session.`,
35
41
  }
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: Archive Bonfire Awareness
3
+ model: anthropic/claude-haiku-4-20250514
4
+ mode: task
5
+ hidden: true
6
+ tools:
7
+ - bash
8
+ - read
9
+ - glob
10
+ permission:
11
+ task:
12
+ "*": deny
13
+ ---
14
+
15
+ # Archive Bonfire Awareness
16
+
17
+ This skill detects when session work may be ready for archiving and suggests the appropriate action.
18
+
19
+ ## When to Use This Skill
20
+
21
+ Trigger when:
22
+ - User asks to merge: "merge it", "merge the PR", "go ahead and merge", "ship it"
23
+ - After you successfully run `gh pr merge`
24
+ - User mentions completion: "PR merged", "shipped", "done with X", "finished"
25
+ - User references merged state: "merged to main", "closed the issue"
26
+
27
+ ## Instructions
28
+
29
+ 1. If user asks to merge a PR:
30
+ - Perform the merge as requested
31
+ - On success, continue to step 2
32
+ - On failure, help resolve the issue (don't suggest archiving)
33
+
34
+ 2. Find git root and check if `.bonfire/index.md` exists
35
+
36
+ 3. If it exists, read it to assess work state
37
+
38
+ 4. If user provided a PR URL/number (or you just merged one), verify status:
39
+ ```
40
+ gh pr view [URL/number] --json state,mergedAt,title
41
+ ```
42
+
43
+ 5. Assess if work appears complete:
44
+ - PR merged?
45
+ - Related tasks marked done in session notes?
46
+ - No obvious follow-up work mentioned?
47
+
48
+ 6. If work appears complete, suggest archiving:
49
+ > "PR merged successfully. This session's work looks complete - want me to archive it?
50
+ > Run `/bonfire-archive` to move completed work to the archive."
51
+
52
+ 7. If there's more work in the session:
53
+ > "PR merged. I see there's still [X, Y] in the session notes - want to continue
54
+ > with those or archive what's done so far?"
55
+
56
+ ## Important
57
+
58
+ - This skill **suggests** archiving, it does NOT archive automatically
59
+ - User must explicitly run `/bonfire-archive` to perform the archive
60
+ - Trigger AFTER merge succeeds, not before
61
+ - Multiple PRs may be part of one logical session - check context
62
+ - If `.bonfire/` doesn't exist, don't suggest archiving
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-bonfire",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "OpenCode forgets everything between sessions. Bonfire remembers.",
5
5
  "type": "module",
6
6
  "bin": {