opencode-bonfire 0.9.6
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 +73 -0
- package/dist/cli.js +156 -0
- package/files/agent/codebase-explorer.md +115 -0
- package/files/agent/doc-writer.md +120 -0
- package/files/agent/spec-writer.md +142 -0
- package/files/agent/work-reviewer.md +130 -0
- package/files/command/bonfire-archive.md +128 -0
- package/files/command/bonfire-configure.md +96 -0
- package/files/command/bonfire-document.md +178 -0
- package/files/command/bonfire-end.md +62 -0
- package/files/command/bonfire-git-strategy.md +91 -0
- package/files/command/bonfire-review.md +158 -0
- package/files/command/bonfire-spec.md +272 -0
- package/files/command/bonfire-start.md +245 -0
- package/files/opencode.json +4 -0
- package/files/package.json +7 -0
- package/files/plugin/bonfire-hooks.ts +51 -0
- package/files/skill/bonfire-context/SKILL.md +56 -0
- package/files/tool/bonfire.ts +103 -0
- package/package.json +37 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Strategic code review for blindspots, gaps, and improvements
|
|
3
|
+
mode: subagent
|
|
4
|
+
hidden: true
|
|
5
|
+
model: anthropic/claude-sonnet-4-20250514
|
|
6
|
+
maxSteps: 30
|
|
7
|
+
tools:
|
|
8
|
+
write: false
|
|
9
|
+
edit: false
|
|
10
|
+
todowrite: false
|
|
11
|
+
todoread: false
|
|
12
|
+
permission:
|
|
13
|
+
task:
|
|
14
|
+
"*": deny
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
You are a senior code reviewer focused on strategic quality, not nitpicks. Your job is to find what the developer might have missed.
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
|
|
21
|
+
You'll receive:
|
|
22
|
+
1. **Review scope** - Branch diff, specific files, or session context
|
|
23
|
+
2. **Intent** - What was the developer trying to accomplish
|
|
24
|
+
3. **Session context** - Recent work and decisions (if available)
|
|
25
|
+
|
|
26
|
+
## Review Focus Areas
|
|
27
|
+
|
|
28
|
+
### Blindspots (what are we not seeing?)
|
|
29
|
+
- Edge cases not handled
|
|
30
|
+
- Error scenarios not considered
|
|
31
|
+
- User flows not covered
|
|
32
|
+
- Dependencies not accounted for
|
|
33
|
+
|
|
34
|
+
### Gaps (what's incomplete?)
|
|
35
|
+
- Missing tests
|
|
36
|
+
- Missing documentation
|
|
37
|
+
- Incomplete implementations
|
|
38
|
+
- TODOs left unaddressed
|
|
39
|
+
|
|
40
|
+
### Quick Wins (small effort, big value)
|
|
41
|
+
- Easy refactors
|
|
42
|
+
- Low-hanging performance gains
|
|
43
|
+
- Simple UX improvements
|
|
44
|
+
|
|
45
|
+
### Best Practices (convention violations)
|
|
46
|
+
- Project patterns not followed
|
|
47
|
+
- Language/framework idioms ignored
|
|
48
|
+
- Security practices missed
|
|
49
|
+
- Accessibility standards skipped
|
|
50
|
+
|
|
51
|
+
### Maintainability (will future-us thank present-us?)
|
|
52
|
+
- Unclear naming or structure
|
|
53
|
+
- Missing or excessive abstractions
|
|
54
|
+
- Technical debt introduced
|
|
55
|
+
|
|
56
|
+
## Output Format
|
|
57
|
+
|
|
58
|
+
Return findings as structured markdown, categorized by action:
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
## Summary
|
|
62
|
+
|
|
63
|
+
- **Total findings**: X
|
|
64
|
+
- **Fix now (trivial)**: Y
|
|
65
|
+
- **Needs spec**: Z
|
|
66
|
+
- **Create issues**: W
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Fix Now (trivial effort, do immediately)
|
|
71
|
+
|
|
72
|
+
### [Finding title]
|
|
73
|
+
- **What**: [Description]
|
|
74
|
+
- **Where**: `path/to/file.ts:123`
|
|
75
|
+
- **Fix**: [Specific action]
|
|
76
|
+
- **Why**: [Impact if not fixed]
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Needs Spec (important, needs planning)
|
|
81
|
+
|
|
82
|
+
### [Finding title]
|
|
83
|
+
- **What**: [Description]
|
|
84
|
+
- **Effort**: small | medium
|
|
85
|
+
- **Impact**: [Why this matters]
|
|
86
|
+
- **Consideration**: [Key decision needed]
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Create Issues (large effort or nice-to-have)
|
|
91
|
+
|
|
92
|
+
### [Finding title]
|
|
93
|
+
- **What**: [Description]
|
|
94
|
+
- **Effort**: medium | large
|
|
95
|
+
- **Priority**: important | nice-to-have
|
|
96
|
+
- **Suggested issue title**: [Title for GitHub/Linear]
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## No Issues Found In
|
|
101
|
+
|
|
102
|
+
- [Area reviewed that looks good]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Rules
|
|
106
|
+
|
|
107
|
+
1. **Strategic, not pedantic** - Skip style nitpicks, focus on substance
|
|
108
|
+
2. **Consider intent** - Review against what they were trying to do
|
|
109
|
+
3. **Categorize by action** - Fix now vs spec vs issue
|
|
110
|
+
4. **Estimate effort** - trivial/small/medium/large
|
|
111
|
+
5. **Be specific** - Include file paths and line numbers
|
|
112
|
+
6. **Acknowledge good work** - Note areas that are solid
|
|
113
|
+
|
|
114
|
+
## Severity Guide
|
|
115
|
+
|
|
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 |
|
|
122
|
+
|
|
123
|
+
## Effort Guide
|
|
124
|
+
|
|
125
|
+
| Effort | Definition |
|
|
126
|
+
|--------|------------|
|
|
127
|
+
| Trivial | < 5 minutes, obvious fix |
|
|
128
|
+
| Small | < 30 minutes, contained change |
|
|
129
|
+
| Medium | 1-4 hours, multiple files |
|
|
130
|
+
| Large | > 4 hours, needs planning |
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Archive completed session work
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Archive Session
|
|
6
|
+
|
|
7
|
+
## Step 1: Find Git Root
|
|
8
|
+
|
|
9
|
+
Run `git rev-parse --show-toplevel` to locate the repository root.
|
|
10
|
+
|
|
11
|
+
## Step 2: Review Completed Work
|
|
12
|
+
|
|
13
|
+
Read `<git-root>/.bonfire/index.md` and identify completed work:
|
|
14
|
+
- Sessions with merged PRs
|
|
15
|
+
- Completed features/tasks
|
|
16
|
+
- Work that's no longer active
|
|
17
|
+
|
|
18
|
+
## Step 3: Create Archive Entry
|
|
19
|
+
|
|
20
|
+
Move completed session content to `<git-root>/.bonfire/archive/`.
|
|
21
|
+
|
|
22
|
+
**Naming convention**: `YYYY-MM-DD-<issue-id>-<topic>.md`
|
|
23
|
+
|
|
24
|
+
Examples:
|
|
25
|
+
- `2025-12-22-GTMENG-387-inbound-improvements.md` (with issue ID)
|
|
26
|
+
- `2025-12-22-fix-login-redirect.md` (without issue ID)
|
|
27
|
+
|
|
28
|
+
Use this template:
|
|
29
|
+
```markdown
|
|
30
|
+
# [TOPIC]
|
|
31
|
+
|
|
32
|
+
**Date**: [DATE]
|
|
33
|
+
**Issue**: [ISSUE-ID or N/A]
|
|
34
|
+
**PR**: [PR link if available]
|
|
35
|
+
**Status**: Completed
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Summary
|
|
40
|
+
|
|
41
|
+
[Brief description of what was accomplished]
|
|
42
|
+
|
|
43
|
+
## Accomplished
|
|
44
|
+
|
|
45
|
+
- [List of completed items]
|
|
46
|
+
|
|
47
|
+
## Decisions Made
|
|
48
|
+
|
|
49
|
+
- [Key decisions and rationale]
|
|
50
|
+
|
|
51
|
+
## Impact
|
|
52
|
+
|
|
53
|
+
- [Before/after metrics if applicable]
|
|
54
|
+
- Files changed: [count]
|
|
55
|
+
|
|
56
|
+
## Related
|
|
57
|
+
|
|
58
|
+
- [Links to related docs, specs, or code]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Step 4: Clean Up Index
|
|
62
|
+
|
|
63
|
+
Update `<git-root>/.bonfire/index.md`:
|
|
64
|
+
- Remove archived session entries from Recent Sessions
|
|
65
|
+
- Keep Current State focused on active work
|
|
66
|
+
- Update Next Session Priorities
|
|
67
|
+
- Add link to archive file in Archived Sessions section:
|
|
68
|
+
```markdown
|
|
69
|
+
## Archived Sessions
|
|
70
|
+
|
|
71
|
+
- [YYYY-MM-DD - Topic](archive/YYYY-MM-DD-issue-topic.md)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Step 5: Clean Up Specs (if applicable)
|
|
75
|
+
|
|
76
|
+
Read `specsLocation` from `<git-root>/.bonfire/config.json` (default `.bonfire/specs/`).
|
|
77
|
+
|
|
78
|
+
Check if any specs in the configured location are now complete:
|
|
79
|
+
- If the spec was fully implemented, delete the spec file (archive has the record)
|
|
80
|
+
- If the spec has reusable reference material, move that content to `docs/` first
|
|
81
|
+
|
|
82
|
+
## Step 6: Update Linear Issue (if applicable)
|
|
83
|
+
|
|
84
|
+
Read `<git-root>/.bonfire/config.json` and check `linearEnabled`.
|
|
85
|
+
|
|
86
|
+
**If `linearEnabled` is true**:
|
|
87
|
+
|
|
88
|
+
1. Check if archived work references a Linear issue (look in session context for `[A-Z]+-[0-9]+` pattern)
|
|
89
|
+
2. If Linear issue found, ask user: "Mark Linear issue [ISSUE-ID] as Done?"
|
|
90
|
+
3. If user confirms:
|
|
91
|
+
- Use linear-cli to update the issue:
|
|
92
|
+
```bash
|
|
93
|
+
linear issue update ENG-123 --state "Done"
|
|
94
|
+
```
|
|
95
|
+
- Optionally add a comment with link to archive/PR:
|
|
96
|
+
```bash
|
|
97
|
+
linear issue comment add ENG-123 -b "Archived: [link]"
|
|
98
|
+
```
|
|
99
|
+
4. On failure: Warn user - "Couldn't update Linear issue. You may need to update it manually."
|
|
100
|
+
|
|
101
|
+
Note: Run `linear issue update --help` to see available options.
|
|
102
|
+
|
|
103
|
+
**If `linearEnabled` is false or not set**: Skip this step.
|
|
104
|
+
|
|
105
|
+
## Step 7: Commit Archive (if tracked)
|
|
106
|
+
|
|
107
|
+
Read `gitStrategy` from `<git-root>/.bonfire/config.json`.
|
|
108
|
+
|
|
109
|
+
**If gitStrategy is "ignore-all"**: Skip committing - archive is local only.
|
|
110
|
+
|
|
111
|
+
**If gitStrategy is "hybrid" or "commit-all"**:
|
|
112
|
+
1. **NEVER use `git add -f`** - respect gitignore
|
|
113
|
+
2. Stage unignored files:
|
|
114
|
+
```bash
|
|
115
|
+
git add .bonfire/
|
|
116
|
+
```
|
|
117
|
+
3. Check if anything was staged before committing:
|
|
118
|
+
```bash
|
|
119
|
+
git diff --cached --quiet .bonfire/ || git commit -m "docs: archive completed session work"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Step 8: Confirm
|
|
123
|
+
|
|
124
|
+
Report:
|
|
125
|
+
- What was archived
|
|
126
|
+
- Any specs cleaned up
|
|
127
|
+
- Current state of index.md
|
|
128
|
+
- Ready for next session
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Change project settings (locations, git strategy, Linear)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Configure Bonfire
|
|
6
|
+
|
|
7
|
+
Always runs interactively - asks all configuration questions regardless of arguments.
|
|
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 for Bonfire Directory
|
|
14
|
+
|
|
15
|
+
If `<git-root>/.bonfire/` does not exist, tell the user to run `/bonfire-start` first.
|
|
16
|
+
|
|
17
|
+
## Step 3: Read Current Config
|
|
18
|
+
|
|
19
|
+
Read `<git-root>/.bonfire/config.json` if it exists to see current settings.
|
|
20
|
+
|
|
21
|
+
## Step 4: Ask All Configuration Questions
|
|
22
|
+
|
|
23
|
+
Use the question tool to ask configuration questions (4 questions, one round):
|
|
24
|
+
|
|
25
|
+
1. "Where should specs be saved?" (Header: "Specs")
|
|
26
|
+
- .bonfire/specs/ (Default) - Keep with session context
|
|
27
|
+
- specs/ - Project root level
|
|
28
|
+
|
|
29
|
+
2. "Where should docs be saved?" (Header: "Docs")
|
|
30
|
+
- .bonfire/docs/ (Default) - Keep with session context
|
|
31
|
+
- docs/ - Project root level
|
|
32
|
+
|
|
33
|
+
3. "How should `.bonfire/` be handled in git?" (Header: "Git")
|
|
34
|
+
- ignore-all (Default) - Keep sessions private/local
|
|
35
|
+
- hybrid - Commit docs/specs, keep notes private
|
|
36
|
+
- commit-all - Share everything with team
|
|
37
|
+
|
|
38
|
+
4. "Enable Linear integration?" (Header: "Linear")
|
|
39
|
+
- No (Default) - Skip Linear integration
|
|
40
|
+
- Yes - Fetch/create Linear issues (requires linear-cli)
|
|
41
|
+
|
|
42
|
+
## Step 5: Update Config
|
|
43
|
+
|
|
44
|
+
**Completely overwrite** `<git-root>/.bonfire/config.json` with only these fields (do not preserve old fields like `models`):
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"specsLocation": "<user-answer>",
|
|
49
|
+
"docsLocation": "<user-answer>",
|
|
50
|
+
"gitStrategy": "<user-answer>",
|
|
51
|
+
"linearEnabled": <true-or-false>
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Step 6: Update Git Strategy
|
|
56
|
+
|
|
57
|
+
If git strategy or locations changed, update `<git-root>/.bonfire/.gitignore`:
|
|
58
|
+
|
|
59
|
+
**Ignore all**:
|
|
60
|
+
```
|
|
61
|
+
*
|
|
62
|
+
!.gitignore
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Hybrid** (only include dirs that are inside .bonfire/):
|
|
66
|
+
```
|
|
67
|
+
*
|
|
68
|
+
!.gitignore
|
|
69
|
+
```
|
|
70
|
+
If docsLocation is `.bonfire/docs/`, add:
|
|
71
|
+
```
|
|
72
|
+
!docs/
|
|
73
|
+
!docs/**
|
|
74
|
+
```
|
|
75
|
+
If specsLocation is `.bonfire/specs/`, add:
|
|
76
|
+
```
|
|
77
|
+
!specs/
|
|
78
|
+
!specs/**
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Commit all**:
|
|
82
|
+
```
|
|
83
|
+
data/
|
|
84
|
+
scratch/
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If switching FROM commit/hybrid TO ignore:
|
|
88
|
+
- Warn user that existing tracked files will remain tracked
|
|
89
|
+
- Offer to run: `git rm -r --cached .bonfire/`
|
|
90
|
+
|
|
91
|
+
## Step 7: Confirm
|
|
92
|
+
|
|
93
|
+
Report:
|
|
94
|
+
- Settings updated
|
|
95
|
+
- Any manual steps needed (git cleanup)
|
|
96
|
+
- New configuration summary
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create documentation about a topic in the codebase
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Document Topic
|
|
6
|
+
|
|
7
|
+
Create reference documentation using subagent for research, preserving main context.
|
|
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.
|
|
49
|
+
|
|
50
|
+
### Exploration Validation
|
|
51
|
+
|
|
52
|
+
After the subagent returns, validate the response:
|
|
53
|
+
|
|
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
|
|
58
|
+
|
|
59
|
+
**On valid response**: Proceed to Step 5.
|
|
60
|
+
|
|
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.
|
|
68
|
+
|
|
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.
|
|
73
|
+
|
|
74
|
+
### Resumable Exploration (Large Codebases)
|
|
75
|
+
|
|
76
|
+
For very large codebases, exploration may need multiple passes. The task tool returns a `session_id` you can use to resume.
|
|
77
|
+
|
|
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
|
|
82
|
+
|
|
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.
|
|
90
|
+
|
|
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
|
|
95
|
+
|
|
96
|
+
## Step 5: Write Documentation (Subagent)
|
|
97
|
+
|
|
98
|
+
**Progress**: Tell the user "Writing documentation..."
|
|
99
|
+
|
|
100
|
+
**Naming convention**: `<topic>.md` (kebab-case)
|
|
101
|
+
|
|
102
|
+
Examples:
|
|
103
|
+
- `inbound-agent-architecture.md`
|
|
104
|
+
- `sampling-strategies.md`
|
|
105
|
+
- `authentication-flow.md`
|
|
106
|
+
|
|
107
|
+
Use the task tool to invoke the **doc-writer** subagent.
|
|
108
|
+
|
|
109
|
+
Provide the prompt in this exact format:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
## Research Findings
|
|
113
|
+
|
|
114
|
+
<paste structured findings from Step 4>
|
|
115
|
+
|
|
116
|
+
## Doc Metadata
|
|
117
|
+
|
|
118
|
+
- **Topic**: <topic name>
|
|
119
|
+
- **Output Path**: <git-root>/<docsLocation>/<topic>.md
|
|
120
|
+
- **Date**: <YYYY-MM-DD>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The subagent will write the doc file directly to the Output Path.
|
|
124
|
+
|
|
125
|
+
### Doc Verification
|
|
126
|
+
|
|
127
|
+
After the doc-writer subagent returns, verify the doc is complete.
|
|
128
|
+
|
|
129
|
+
**Key sections to check** (lenient - only these 4):
|
|
130
|
+
- `## Overview`
|
|
131
|
+
- `## Key Files`
|
|
132
|
+
- `## How It Works`
|
|
133
|
+
- `## Gotchas`
|
|
134
|
+
|
|
135
|
+
**Verification steps:**
|
|
136
|
+
|
|
137
|
+
1. **Read the doc file** at `<git-root>/<docsLocation>/<topic>.md`
|
|
138
|
+
|
|
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
|
|
143
|
+
|
|
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
|
|
147
|
+
|
|
148
|
+
4. **If all 4 sections present**:
|
|
149
|
+
- Tell user: "Doc written and verified (4/4 key sections present)."
|
|
150
|
+
- Proceed to Step 6.
|
|
151
|
+
|
|
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
|
|
159
|
+
|
|
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
|
|
163
|
+
|
|
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
|
|
168
|
+
|
|
169
|
+
## Step 5: Link to Session Context
|
|
170
|
+
|
|
171
|
+
Add a reference to the doc in `<git-root>/.bonfire/index.md` under Key Resources or Notes.
|
|
172
|
+
|
|
173
|
+
## Step 6: Confirm
|
|
174
|
+
|
|
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
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: End session - update context and commit changes
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# End Session
|
|
6
|
+
|
|
7
|
+
## Step 1: Find Git Root
|
|
8
|
+
|
|
9
|
+
Run `git rev-parse --show-toplevel` to locate the repository root.
|
|
10
|
+
|
|
11
|
+
## Step 2: Review Session Work
|
|
12
|
+
|
|
13
|
+
Review what was accomplished this session by examining:
|
|
14
|
+
- Recent git commits
|
|
15
|
+
- Files changed
|
|
16
|
+
- Conversation context
|
|
17
|
+
|
|
18
|
+
## Step 3: Update Session Context
|
|
19
|
+
|
|
20
|
+
Update `<git-root>/.bonfire/index.md`:
|
|
21
|
+
|
|
22
|
+
1. Update the session entry with:
|
|
23
|
+
- **Accomplished**: List what was completed
|
|
24
|
+
- **Decisions**: Key decisions made and rationale
|
|
25
|
+
- **Files Modified**: Important files changed (if relevant)
|
|
26
|
+
- **Blockers**: Any issues encountered
|
|
27
|
+
|
|
28
|
+
2. Update "Next Session Priorities" based on remaining work
|
|
29
|
+
|
|
30
|
+
3. Update "Current State" to reflect new status
|
|
31
|
+
|
|
32
|
+
## Step 4: Commit Changes (if tracked)
|
|
33
|
+
|
|
34
|
+
Read `<git-root>/.bonfire/config.json` to check `gitStrategy`.
|
|
35
|
+
|
|
36
|
+
**If gitStrategy is "ignore-all"**: Skip committing - nothing is tracked. Tell the user session context was updated locally.
|
|
37
|
+
|
|
38
|
+
**If gitStrategy is "hybrid" or "commit-all"**:
|
|
39
|
+
|
|
40
|
+
1. **Check what can be staged**: Run `git status .bonfire/` to see what files are not ignored
|
|
41
|
+
2. **NEVER use `git add -f`** - if a file is gitignored, respect that
|
|
42
|
+
3. **Stage only unignored files**:
|
|
43
|
+
```bash
|
|
44
|
+
git add .bonfire/
|
|
45
|
+
```
|
|
46
|
+
4. **Check if anything was staged**: Run `git diff --cached --quiet .bonfire/`
|
|
47
|
+
- If nothing staged (exit code 0), tell user "Session context updated locally (files are gitignored)"
|
|
48
|
+
- If changes staged, commit:
|
|
49
|
+
```bash
|
|
50
|
+
git commit -m "docs: update session context"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If the commit fails due to hooks, help resolve the issue (but never bypass hooks with `--no-verify`).
|
|
54
|
+
|
|
55
|
+
## Step 5: Confirm
|
|
56
|
+
|
|
57
|
+
Summarize:
|
|
58
|
+
- What was documented
|
|
59
|
+
- Next priorities
|
|
60
|
+
- Any follow-up needed
|
|
61
|
+
|
|
62
|
+
Let the user know they can run `/bonfire-archive` when this work is merged and complete.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Change how .bonfire/ is handled in git
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Change Git Strategy
|
|
6
|
+
|
|
7
|
+
## Step 1: Find Git Root
|
|
8
|
+
|
|
9
|
+
Run `git rev-parse --show-toplevel` to locate the repository root.
|
|
10
|
+
|
|
11
|
+
## Step 2: Read Current Config
|
|
12
|
+
|
|
13
|
+
Read `<git-root>/.bonfire/config.json` to check current `specsLocation` and `docsLocation` settings.
|
|
14
|
+
|
|
15
|
+
## Step 3: Explain Options
|
|
16
|
+
|
|
17
|
+
Present the git strategy options:
|
|
18
|
+
|
|
19
|
+
1. **Ignore all** - Keep sessions completely local
|
|
20
|
+
- Everything in .bonfire/ is gitignored
|
|
21
|
+
- Most private, nothing shared
|
|
22
|
+
- Good for: solo work, sensitive projects
|
|
23
|
+
|
|
24
|
+
2. **Hybrid** - Commit docs/specs, keep notes private
|
|
25
|
+
- docs/ and specs/ are committed
|
|
26
|
+
- index.md and archive/ stay local
|
|
27
|
+
- Good for: teams that want shared docs but private notes
|
|
28
|
+
|
|
29
|
+
3. **Commit all** - Share everything with team
|
|
30
|
+
- All session content is committed
|
|
31
|
+
- Only data/ and scratch/ ignored
|
|
32
|
+
- Good for: full transparency, team continuity
|
|
33
|
+
|
|
34
|
+
## Step 4: Get User Choice
|
|
35
|
+
|
|
36
|
+
Use the question tool to ask which strategy:
|
|
37
|
+
|
|
38
|
+
"Which git strategy for `.bonfire/`?" (Header: "Git")
|
|
39
|
+
- ignore-all (Recommended) - Keep sessions private/local
|
|
40
|
+
- hybrid - Commit docs/specs, keep notes private
|
|
41
|
+
- commit-all - Share everything with team
|
|
42
|
+
|
|
43
|
+
## Step 5: Update .gitignore
|
|
44
|
+
|
|
45
|
+
Write the appropriate `.gitignore` to `<git-root>/.bonfire/.gitignore`:
|
|
46
|
+
|
|
47
|
+
**Ignore all**:
|
|
48
|
+
```
|
|
49
|
+
*
|
|
50
|
+
!.gitignore
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Hybrid** (only include dirs that are inside .bonfire/):
|
|
54
|
+
```
|
|
55
|
+
*
|
|
56
|
+
!.gitignore
|
|
57
|
+
```
|
|
58
|
+
If docsLocation is `.bonfire/docs/`, add:
|
|
59
|
+
```
|
|
60
|
+
!docs/
|
|
61
|
+
!docs/**
|
|
62
|
+
```
|
|
63
|
+
If specsLocation is `.bonfire/specs/`, add:
|
|
64
|
+
```
|
|
65
|
+
!specs/
|
|
66
|
+
!specs/**
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Commit all**:
|
|
70
|
+
```
|
|
71
|
+
data/
|
|
72
|
+
scratch/
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Step 6: Handle Git Tracking
|
|
76
|
+
|
|
77
|
+
If switching FROM commit/hybrid TO ignore:
|
|
78
|
+
- Warn user that existing tracked files will remain tracked
|
|
79
|
+
- Offer to run: `git rm -r --cached .bonfire/` (removes from git but keeps files)
|
|
80
|
+
- They'll need to commit this change
|
|
81
|
+
|
|
82
|
+
If switching TO commit/hybrid:
|
|
83
|
+
- Files will be picked up on next commit
|
|
84
|
+
- No special action needed
|
|
85
|
+
|
|
86
|
+
## Step 7: Confirm
|
|
87
|
+
|
|
88
|
+
Report:
|
|
89
|
+
- New strategy applied
|
|
90
|
+
- Any manual steps needed
|
|
91
|
+
- How to verify the change
|