opencode-bonfire 1.4.0 → 2.0.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
@@ -24,22 +24,24 @@ bunx opencode-bonfire install --global
24
24
 
25
25
  | Component | Description |
26
26
  |-----------|-------------|
27
- | **8 Commands** | `/bonfire-start`, `/bonfire-end`, `/bonfire-spec`, `/bonfire-document`, `/bonfire-review`, `/bonfire-archive`, `/bonfire-configure`, `/bonfire-git-strategy` |
28
- | **4 Agents** | `codebase-explorer`, `spec-writer`, `doc-writer`, `work-reviewer` |
29
- | **1 Skill** | `bonfire-context` for loading session context |
27
+ | **9 Commands** | `/bonfire-start`, `/bonfire-end`, `/bonfire-spec`, `/bonfire-strategic`, `/bonfire-document`, `/bonfire-review`, `/bonfire-review-pr`, `/bonfire-archive`, `/bonfire-configure` |
28
+ | **3 Agents** | `codebase-explorer`, `writer`, `work-reviewer` |
29
+ | **2 Skills** | `bonfire-context`, `archive-bonfire-awareness` |
30
30
  | **1 Plugin** | Archive suggestions + compaction context preservation |
31
31
  | **1 Tool** | `bonfire` for structured session data |
32
32
 
33
33
  ## Usage
34
34
 
35
35
  ```
36
- /bonfire-start # Start session, scaffold if needed
37
- /bonfire-end # Update context, commit changes
38
- /bonfire-spec <topic> # Create implementation spec
39
- /bonfire-document <topic> # Document a codebase topic
40
- /bonfire-review # Find blindspots and gaps
41
- /bonfire-archive # Archive completed work
42
- /bonfire-configure # Change project settings
36
+ /bonfire-start # Start session, scaffold if needed
37
+ /bonfire-end # Update context, commit changes
38
+ /bonfire-spec <topic> # Create implementation spec
39
+ /bonfire-strategic <type> <topic> # Create RFC, PRD, or POC
40
+ /bonfire-document <topic> # Document a codebase topic
41
+ /bonfire-review # Find blindspots and gaps
42
+ /bonfire-review-pr <number> # Review a GitHub PR
43
+ /bonfire-archive # Archive completed work
44
+ /bonfire-configure # Change project settings (git, linear)
43
45
  ```
44
46
 
45
47
  ## How It Works
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: writer
3
+ description: Synthesize research and interview findings into documents
4
+ model: anthropic/claude-sonnet-4-20250514
5
+ hidden: true
6
+ tools: [Read, Write]
7
+ permission:
8
+ task:
9
+ "*": deny
10
+ ---
11
+
12
+ You are a technical document writer. Given research findings and (optionally) interview answers, produce clear, actionable documentation.
13
+
14
+ ## Input Format
15
+
16
+ You'll receive a structured prompt with:
17
+
18
+ ```
19
+ ## Document Type
20
+
21
+ <spec | doc | rfc | prd | poc>
22
+
23
+ ## Research Findings
24
+
25
+ <structured markdown from codebase-explorer>
26
+
27
+ ## Interview Q&A (if applicable)
28
+
29
+ ### [Round Name]
30
+ **Q**: <question>
31
+ **A**: <user's answer>
32
+
33
+ ## Document Metadata
34
+
35
+ - **Topic**: <feature, system, or task name>
36
+ - **Issue**: <issue ID or N/A>
37
+ - **Output Path**: </absolute/path/to/file.md>
38
+ - **Date**: <YYYY-MM-DD>
39
+ - **Author**: <name, if applicable>
40
+
41
+ ## Template (optional)
42
+
43
+ <specific template structure to follow>
44
+ ```
45
+
46
+ Write the document to the exact path specified in Output Path.
47
+
48
+ ---
49
+
50
+ ## Document Types
51
+
52
+ ### Spec (Implementation Specification)
53
+
54
+ **Purpose**: Actionable implementation plan for a feature or task.
55
+
56
+ **Required sections**:
57
+ - `## Overview` - What we're building and why
58
+ - `## Decisions` - Key choices with rationale
59
+ - `## Implementation Steps` - Ordered, actionable steps
60
+ - `## Edge Cases` - Error handling, boundary conditions
61
+
62
+ ---
63
+
64
+ ### Doc (Reference Documentation)
65
+
66
+ **Purpose**: Help developers understand a system, feature, or pattern.
67
+
68
+ **Required sections**:
69
+ - `## Overview` - What this is and why it exists
70
+ - `## Key Files` - Important files with their roles
71
+ - `## How It Works` - Conceptual explanation of flow/behavior
72
+ - `## Gotchas` - Edge cases, pitfalls, things to watch out for
73
+
74
+ ---
75
+
76
+ ### RFC (Request for Comments)
77
+
78
+ **Purpose**: Technical decision proposal for team review.
79
+
80
+ **Required sections**:
81
+ - `## Abstract` - 1-3 sentences summarizing proposal
82
+ - `## Problems We Need To Solve` - Concrete problems with evidence
83
+ - `## Proposed Solution` - Overview, pros, cons/tradeoffs
84
+ - `## Alternatives Considered` - Other approaches evaluated
85
+
86
+ ---
87
+
88
+ ### PRD (Product Requirements Document)
89
+
90
+ **Purpose**: Product specification for feature development.
91
+
92
+ **Required sections**:
93
+ - `## 2. Problem` - Customer and internal pain points
94
+ - `## 5. Goals & Success Metrics` - Goals and measurable outcomes
95
+ - `## 6. Product Requirements` - Functional and non-functional requirements
96
+ - `## 9. Scope` - In scope and out of scope
97
+
98
+ ---
99
+
100
+ ### POC (Proof of Concept Plan)
101
+
102
+ **Purpose**: Customer evaluation plan with clear success criteria.
103
+
104
+ **Required sections**:
105
+ - `## 2. Goals` - What we want to validate
106
+ - `## 3. Success Criteria` - Concrete, measurable exit criteria
107
+ - `## 4. Scope` - In scope and out of scope
108
+ - `## 5. Plan & Timeline` - Phases and milestones
109
+
110
+ ---
111
+
112
+ ## Rules
113
+
114
+ 1. **Ground in research** - Reference actual files and patterns discovered
115
+ 2. **Honor interview answers** - Don't override user decisions
116
+ 3. **Be specific** - "Update UserService.ts" not "Update the service"
117
+ 4. **Don't invent** - If something wasn't discussed/found, don't add it
118
+ 5. **Keep it actionable** - Someone should be able to use this document
119
+
120
+ ## Quality Checklist
121
+
122
+ Before finishing, verify:
123
+ - [ ] All required sections for document type are present
124
+ - [ ] Content references real files from research (not placeholders)
125
+ - [ ] Interview decisions are captured (if applicable)
126
+ - [ ] No vague or generic content
127
+ - [ ] File written to exact Output Path specified
@@ -1,18 +1,63 @@
1
1
  ---
2
- description: Change project settings (locations, git strategy, Linear)
2
+ description: Change project settings (locations, git strategy, Linear, hooks)
3
3
  ---
4
4
 
5
5
  # Configure Bonfire
6
6
 
7
- Always runs interactively - asks all configuration questions regardless of arguments.
7
+ Change project settings. Supports targeted or full configuration.
8
+
9
+ ## Argument Handling
10
+
11
+ Based on `$ARGUMENTS`:
12
+ - Empty: Full interactive config (all settings)
13
+ - `git`: Git strategy only (quick mode - replaces /bonfire-git-strategy)
14
+ - `linear`: Linear integration only (quick mode)
8
15
 
9
16
  ## Step 1: Find Git Root
10
17
 
11
18
  Run `git rev-parse --show-toplevel` to locate the repository root.
12
19
 
13
- ## Step 2: Check for Bonfire Directory
20
+ ## Step 2: Ensure Bonfire Directory Exists
21
+
22
+ If `<git-root>/.bonfire/` does not exist, create it.
23
+
24
+ If `<git-root>/.bonfire/index.md` does not exist, create a minimal version:
25
+
26
+ ```markdown
27
+ # Session Context: [PROJECT_NAME]
28
+
29
+ **Date**: [CURRENT_DATE]
30
+ **Status**: Active
31
+ **Branch**: [CURRENT_BRANCH]
32
+
33
+ ---
34
+
35
+ ## Current State
36
+
37
+ [Created via /bonfire-configure - run /bonfire-start for full setup]
38
+
39
+ ---
40
+
41
+ ## Recent Sessions
42
+
43
+ _No sessions recorded yet._
44
+
45
+ ---
46
+
47
+ ## Next Session Priorities
48
+
49
+ 1. [Define your priorities]
50
+
51
+ ---
52
+
53
+ ## Notes
54
+
55
+ [Add notes here]
56
+ ```
57
+
58
+ Detect project name from: package.json name → git remote → directory name.
14
59
 
15
- If `<git-root>/.bonfire/` does not exist, tell the user to run `/bonfire-start` first.
60
+ This ensures configure can be run as the first entry point without leaving the project in an incomplete state.
16
61
 
17
62
  ## Step 3: Read Current Config
18
63
 
@@ -4,175 +4,102 @@ description: Create documentation about a topic in the codebase
4
4
 
5
5
  # Document Topic
6
6
 
7
- Create reference documentation using subagent for research, preserving main context.
7
+ Create reference documentation for **$ARGUMENTS**.
8
8
 
9
- ## Step 1: Find Git Root
10
-
11
- Run `git rev-parse --show-toplevel` to locate the repository root.
12
-
13
- ## Step 2: Check Config
14
-
15
- Read `<git-root>/.bonfire/config.json` if it exists.
16
-
17
- **Docs location**: Read `docsLocation` from config. Default to `.bonfire/docs/` if not set.
18
-
19
- ## Step 3: Understand the Topic
20
-
21
- The topic to document is: $ARGUMENTS
22
-
23
- If no topic provided, ask the user what they want documented.
24
-
25
- ## Step 4: Explore the Codebase (Subagent)
26
-
27
- **Progress**: Tell the user "Exploring codebase for [TOPIC]..."
28
-
29
- Use the task tool to invoke the **codebase-explorer** subagent for research.
30
-
31
- Provide a research directive:
32
-
33
- ```
34
- Research the codebase to document: [TOPIC]
35
-
36
- Find:
37
- 1. **Architecture**: How this system/feature is structured, key components
38
- 2. **Key Files**: Important files and their roles
39
- 3. **Flow**: How data/control flows through the system
40
- 4. **Patterns**: Design patterns and conventions used
41
- 5. **Gotchas**: Important details, edge cases, things to watch out for
42
-
43
- Return structured findings with file paths and brief descriptions.
44
- ```
45
-
46
- **Wait for the subagent to return findings** before proceeding.
47
-
48
- The subagent runs in isolated context (haiku model, fast), preserving main context for writing.
9
+ ---
49
10
 
50
- ### Exploration Validation
11
+ ## Outcome
51
12
 
52
- After the subagent returns, validate the response:
13
+ Complete reference documentation that helps developers understand a system, feature, or pattern in the codebase. The doc should enable someone unfamiliar with the code to:
14
+ - Understand what it does and why it exists
15
+ - Find the relevant files quickly
16
+ - Understand how it works at a conceptual level
17
+ - Avoid common pitfalls
53
18
 
54
- **Valid response contains at least one of:**
55
- - `## Architecture` or `## Patterns Found` with content
56
- - `## Key Files` with entries
57
- - `## Flow` or `## Gotchas` with items
19
+ ---
58
20
 
59
- **On valid response**: Proceed to Step 5.
21
+ ## Acceptance Criteria
60
22
 
61
- **On invalid/empty response**:
62
- 1. Warn user: "Codebase exploration returned limited results. I'll research directly."
63
- 2. Fall back to in-context research:
64
- - `glob("**/*[topic-related]*")` to find relevant files
65
- - `grep("topic-keywords")` to find implementations
66
- - Read identified files
67
- 3. Continue to Step 5 with in-context findings.
23
+ The doc file must contain these sections:
68
24
 
69
- **On subagent failure** (timeout, error):
70
- 1. Warn user: "Subagent exploration failed. Continuing with direct research."
71
- 2. Perform in-context research as above.
72
- 3. Continue to Step 5.
25
+ | Section | Purpose |
26
+ |---------|---------|
27
+ | `## Overview` | What this is and why it matters |
28
+ | `## Key Files` | Important files with their roles |
29
+ | `## How It Works` | Conceptual explanation of flow/behavior |
30
+ | `## Gotchas` | Edge cases, pitfalls, things to watch out for |
73
31
 
74
- ### Resumable Exploration (Large Codebases)
32
+ Additional sections are welcome (Architecture, Examples, Related Topics) but these four are required.
75
33
 
76
- For very large codebases, exploration may need multiple passes. The task tool returns a `session_id` you can use to resume.
34
+ **Quality signals:**
35
+ - File paths are accurate and exist in the codebase
36
+ - Explanations match actual code behavior
37
+ - Gotchas reflect real issues (not hypothetical concerns)
77
38
 
78
- **When to offer resume:**
79
- - Subagent returns with "X additional items omitted" notes
80
- - Findings cover only part of the topic (e.g., found architecture but not flows)
81
- - User asks for deeper exploration of a specific aspect
39
+ ---
82
40
 
83
- **To resume exploration:**
84
- 1. Tell user: "Exploration found [X] but there's more to document. Continue exploring [specific aspect]?"
85
- 2. If yes, re-invoke codebase-explorer with the `session_id` parameter:
86
- - Pass the session_id from the previous invocation
87
- - Provide a refined directive: "Continue exploring: [specific aspect]. Focus on [what to find]."
88
- 3. Merge findings from resumed exploration with previous findings.
89
- 4. Repeat if needed, up to 3 passes maximum.
41
+ ## Constraints
90
42
 
91
- **Example multi-pass scenario:**
92
- - Pass 1: "Document payment system" → finds payment service, stripe integration
93
- - Pass 2 (resume): "Continue exploring: refund handling" → finds refund logic, webhooks
94
- - Merge: Combined findings produce more complete documentation
43
+ ### Context Isolation
95
44
 
96
- ## Step 5: Write Documentation (Subagent)
45
+ Research happens in an isolated subagent context to preserve main context.
97
46
 
98
- **Progress**: Tell the user "Writing documentation..."
47
+ | Phase | Agent | Model | Why |
48
+ |-------|-------|-------|-----|
49
+ | Research | `codebase-explorer` | haiku | Fast exploration without polluting main context |
50
+ | Writing | `doc-writer` | inherit | Synthesis in isolation with full research context |
99
51
 
100
- **Naming convention**: `<topic>.md` (kebab-case)
52
+ ### No Interview Required
101
53
 
102
- Examples:
103
- - `inbound-agent-architecture.md`
104
- - `sampling-strategies.md`
105
- - `authentication-flow.md`
54
+ Unlike specs, documentation is based purely on codebase research. The code is the source of truth.
106
55
 
107
- Use the task tool to invoke the **doc-writer** subagent.
56
+ ### File Locations
108
57
 
109
- Provide the prompt in this exact format:
58
+ - **Config**: `<git-root>/.bonfire/config.json` contains `docsLocation`
59
+ - **Default**: `.bonfire/docs/` if not configured
60
+ - **Naming**: `<topic>.md` (kebab-case, e.g., `authentication-flow.md`)
110
61
 
111
- ```
112
- ## Research Findings
62
+ ### Verification
113
63
 
114
- <paste structured findings from Step 4>
64
+ After writing, verify the doc contains all 4 required sections. If incomplete:
65
+ - Warn user what's missing
66
+ - Offer: proceed / retry / abort
115
67
 
116
- ## Doc Metadata
68
+ ### Session Context
117
69
 
118
- - **Topic**: <topic name>
119
- - **Output Path**: <git-root>/<docsLocation>/<topic>.md
120
- - **Date**: <YYYY-MM-DD>
121
- ```
70
+ After writing, add a reference to the doc in `<git-root>/.bonfire/index.md` under Key Resources.
122
71
 
123
- The subagent will write the doc file directly to the Output Path.
72
+ ### Completion
124
73
 
125
- ### Doc Verification
74
+ After verification, confirm doc creation and offer options:
75
+ - Add more detail to any section
76
+ - Document related topics
77
+ - Proceed with other work
126
78
 
127
- After the doc-writer subagent returns, verify the doc is complete.
79
+ ---
128
80
 
129
- **Key sections to check** (lenient - only these 4):
130
- - `## Overview`
131
- - `## Key Files`
132
- - `## How It Works`
133
- - `## Gotchas`
81
+ ## Guidance (Not Rules)
134
82
 
135
- **Verification steps:**
83
+ These patterns tend to work well, but adapt as needed:
136
84
 
137
- 1. **Read the doc file** at `<git-root>/<docsLocation>/<topic>.md`
85
+ **Research before writing** - Let the codebase inform the structure.
138
86
 
139
- 2. **If file missing or empty**:
140
- - Warn user: "Doc file wasn't written. Writing directly..."
141
- - Write the doc yourself using the write tool
142
- - Run verification again on the written file
87
+ **Show your work** - Tell user what you're doing: "Exploring codebase...", "Writing documentation..."
143
88
 
144
- 3. **If file exists, check for key sections**:
145
- - Scan content for the 4 section headers above
146
- - Track which sections are present/missing
89
+ **Fallback gracefully** - If subagent fails, do the work in main context. Warn user but don't stop.
147
90
 
148
- 4. **If all 4 sections present**:
149
- - Tell user: "Doc written and verified (4/4 key sections present)."
150
- - Proceed to Step 6.
91
+ **Large codebases** - Explorer may need multiple passes. Offer to continue if findings seem incomplete for the topic.
151
92
 
152
- 5. **If 1-3 sections missing** (partial write):
153
- - Warn user: "Doc appears incomplete. Missing sections: [list missing]"
154
- - Show which sections ARE present
155
- - Ask: "Proceed with partial doc, retry write, or abort?"
156
- - **Proceed**: Continue to Step 6
157
- - **Retry**: Re-invoke doc-writer subagent with same input, then verify again
158
- - **Abort**: Stop and inform user the incomplete doc file remains at path
93
+ **Follow the code** - Document what the code actually does, not what comments claim or what you assume.
159
94
 
160
- 6. **If all sections missing but has content**:
161
- - Treat as invalid format, trigger fallback write
162
- - Write the doc yourself, then verify the written file
95
+ ---
163
96
 
164
- **On subagent failure** (timeout, error):
165
- - Warn user: "Doc writer failed. Writing doc directly..."
166
- - Write the doc yourself using the write tool
167
- - Run verification on the written file
97
+ ## Anti-Patterns
168
98
 
169
- ## Step 5: Link to Session Context
99
+ **Don't document assumptions** - If you can't find it in the code, don't write about it.
170
100
 
171
- Add a reference to the doc in `<git-root>/.bonfire/index.md` under Key Resources or Notes.
101
+ **Don't over-abstract** - Concrete file paths and function names are more useful than vague descriptions.
172
102
 
173
- ## Step 6: Confirm
103
+ **Don't skip verification** - Subagents can produce partial output. Always check.
174
104
 
175
- Summarize what was documented and ask if the user wants:
176
- - More detail on any section
177
- - Related topics documented
178
- - To proceed with other work
105
+ **Don't write tutorials** - This is reference documentation (how it works), not a guide (how to use it).