mirror of
https://github.com/anthropics/claude-plugins-official.git
synced 2026-03-17 10:33:08 +00:00
add(plugin): bonfire — session-context workflow tooling
Adapted from PR #108 by @vieko (Vercel). Original: https://github.com/anthropics/claude-plugins-official/pull/108
This commit is contained in:
13
external_plugins/bonfire/.claude-plugin/plugin.json
Normal file
13
external_plugins/bonfire/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "bonfire",
|
||||
"description": "AI forgets everything between sessions. Bonfire fixes that.",
|
||||
"version": "0.8.1",
|
||||
"author": {
|
||||
"name": "Vieko Franetovic",
|
||||
"url": "https://vieko.dev"
|
||||
},
|
||||
"homepage": "https://vieko.dev/bonfire",
|
||||
"repository": "https://github.com/vieko/bonfire",
|
||||
"license": "MIT",
|
||||
"keywords": ["bonfire", "context", "memory", "workflow", "subagents"]
|
||||
}
|
||||
150
external_plugins/bonfire/README.md
Normal file
150
external_plugins/bonfire/README.md
Normal file
@@ -0,0 +1,150 @@
|
||||
# Bonfire
|
||||
|
||||
<p align="center">
|
||||
<img src="bonfire.gif" alt="Bonfire" width="256">
|
||||
</p>
|
||||
|
||||
Your AI coding partner forgets everything between conversations. Bonfire remembers.
|
||||
|
||||
```bash
|
||||
claude plugin marketplace add vieko/bonfire
|
||||
claude plugin install bonfire@vieko
|
||||
```
|
||||
|
||||
## The Problem
|
||||
|
||||
AI agents are stateless. Every conversation starts from zero. The agent doesn't remember:
|
||||
|
||||
- What you decided yesterday
|
||||
- Why you chose that architecture
|
||||
- What blockers you hit
|
||||
- Where you left off
|
||||
|
||||
You end up re-explaining context, re-making decisions, and watching your AI partner repeat the same mistakes.
|
||||
|
||||
## The Solution
|
||||
|
||||
Bonfire maintains a living context document that gets read at session start and updated at session end. Your AI partner picks up exactly where you left off. It's like a saved game for your work.
|
||||
|
||||
`/bonfire:start` → *reads context* → WORK → `/bonfire:end` → *saves context*
|
||||
|
||||
That's it. No complex setup. No external services. Just Markdown files in your repo.
|
||||
|
||||
## Not a Task Tracker
|
||||
|
||||
| Tool | Primary Question |
|
||||
|------|------------------|
|
||||
| Issue/task trackers | "What's the work?" |
|
||||
| Bonfire | "Where are we and what did we decide?" |
|
||||
|
||||
Bonfire complements your issue tracker. Use GitHub Issues, Linear, Beads, or Beans for tasks. Use Bonfire for workflow context.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Install
|
||||
claude plugin marketplace add vieko/bonfire
|
||||
claude plugin install bonfire@vieko
|
||||
|
||||
# First run scaffolds .bonfire/ and asks setup questions
|
||||
/bonfire:start
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
| Command | What it does |
|
||||
|---------|--------------|
|
||||
| `/bonfire:start` | Read context, scaffold on first run |
|
||||
| `/bonfire:end` | Update context, commit changes |
|
||||
| `/bonfire:spec <topic>` | Create implementation spec (researches codebase, interviews you) |
|
||||
| `/bonfire:document <topic>` | Document a codebase topic |
|
||||
| `/bonfire:review` | Find blindspots, gaps, and quick wins |
|
||||
| `/bonfire:archive` | Archive completed work |
|
||||
| `/bonfire:configure` | Change project settings |
|
||||
|
||||
## What Gets Created
|
||||
|
||||
```
|
||||
.bonfire/
|
||||
├── index.md # Living context (the important one)
|
||||
├── config.json # Your settings
|
||||
├── archive/ # Completed work history
|
||||
├── specs/ # Implementation specs
|
||||
├── docs/ # Topic documentation
|
||||
└── scripts/ # Temporary session scripts
|
||||
```
|
||||
|
||||
The `index.md` is where the magic happens. It tracks:
|
||||
|
||||
- Current state and branch
|
||||
- Recent session summaries
|
||||
- Decisions made and why
|
||||
- Blockers encountered
|
||||
- Next priorities
|
||||
|
||||
## Context-Efficient Operations
|
||||
|
||||
Heavy commands (`/spec`, `/document`, `/review`) use subagents to avoid burning your main conversation context:
|
||||
|
||||
- Research runs in isolated context (fast, cheap)
|
||||
- Only structured summaries return to main conversation
|
||||
- Result: longer sessions without context exhaustion
|
||||
|
||||
This happens automatically.
|
||||
|
||||
## Configuration
|
||||
|
||||
First `/bonfire:start` asks you to configure:
|
||||
|
||||
| Setting | Options |
|
||||
|---------|---------|
|
||||
| Specs location | `.bonfire/specs/` or `specs/` |
|
||||
| Docs location | `.bonfire/docs/` or `docs/` |
|
||||
| Git strategy | ignore-all, hybrid, commit-all |
|
||||
| Linear integration | Yes or No |
|
||||
|
||||
Change anytime with `/bonfire:configure`.
|
||||
|
||||
### Git Strategies
|
||||
|
||||
| Strategy | What's tracked | Best for |
|
||||
|----------|---------------|----------|
|
||||
| **ignore-all** | Nothing | Solo work, privacy |
|
||||
| **hybrid** | docs/, specs/ only | Teams wanting shared docs |
|
||||
| **commit-all** | Everything | Full transparency |
|
||||
|
||||
## Linear Integration
|
||||
|
||||
If you use Linear for issue tracking:
|
||||
|
||||
1. Install [Linear MCP](https://github.com/anthropics/anthropic-quickstarts/tree/main/mcp-linear)
|
||||
2. Enable via `/bonfire:configure`
|
||||
3. Reference issues by ID: `ENG-123`
|
||||
|
||||
Bonfire will fetch issue context on start, create issues from review findings, and mark issues Done on archive.
|
||||
|
||||
## Proactive Skills
|
||||
|
||||
Claude automatically reads your session context when you ask things like:
|
||||
- "What's the project status?"
|
||||
- "What were we working on?"
|
||||
- "What decisions have we made?"
|
||||
|
||||
And suggests archiving when you merge PRs or mention shipping.
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Claude Code CLI](https://claude.ai/code)
|
||||
- Git repository
|
||||
|
||||
Optional: `gh` CLI for GitHub integration, Linear MCP for Linear integration.
|
||||
|
||||
## Learn More
|
||||
|
||||
**Blog post**: [Save Your Progress](https://vieko.dev/bonfire)
|
||||
|
||||
**Changelog**: [CHANGELOG.md](CHANGELOG.md)
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Vieko Franetovic](https://vieko.dev)
|
||||
90
external_plugins/bonfire/agents/codebase-explorer.md
Normal file
90
external_plugins/bonfire/agents/codebase-explorer.md
Normal file
@@ -0,0 +1,90 @@
|
||||
---
|
||||
name: codebase-explorer
|
||||
description: Fast codebase exploration for patterns, architecture, and constraints. Use for research phases in spec and document commands.
|
||||
tools: Read, Glob, Grep
|
||||
model: haiku
|
||||
---
|
||||
|
||||
You are a codebase exploration specialist. Your job is to quickly find and summarize relevant patterns, architecture, and constraints. Return structured findings, not raw file contents.
|
||||
|
||||
## Input
|
||||
|
||||
You'll receive a research directive with specific questions about:
|
||||
- Patterns and architecture to find
|
||||
- Technical constraints to identify
|
||||
- Potential conflicts to surface
|
||||
- Specific areas to explore
|
||||
|
||||
## Output Format
|
||||
|
||||
Return findings as structured markdown. Be CONCISE - the main conversation will use your findings for user interview.
|
||||
|
||||
```markdown
|
||||
## Patterns Found
|
||||
|
||||
- **[Pattern name]**: Found in `path/to/file.ts` - [1-2 sentence description]
|
||||
|
||||
## Key Files
|
||||
|
||||
| File | Role |
|
||||
|------|------|
|
||||
| `path/to/file.ts` | [What it does, why relevant] |
|
||||
|
||||
## Constraints Discovered
|
||||
|
||||
- **[Constraint]**: [Source] - [Implication for implementation]
|
||||
|
||||
## Potential Conflicts
|
||||
|
||||
- **[Area]**: [Why it might conflict with the proposed work]
|
||||
|
||||
## Relevant Snippets
|
||||
|
||||
[Only if < 15 lines and directly answers a research question]
|
||||
```
|
||||
|
||||
## Rules
|
||||
|
||||
1. **DO NOT** return entire file contents
|
||||
2. **DO NOT** include files that aren't directly relevant
|
||||
3. **BE CONCISE** - aim for < 100 lines total output
|
||||
4. **ANSWER** the research questions, don't just explore randomly
|
||||
5. **PRIORITIZE** - most important findings first
|
||||
6. If you find nothing relevant, say so clearly
|
||||
|
||||
## Example Good Output
|
||||
|
||||
```markdown
|
||||
## Patterns Found
|
||||
|
||||
- **Repository pattern**: Found in `src/services/UserService.ts` - Uses dependency injection, returns domain objects not DB rows
|
||||
- **Error handling**: Found in `src/utils/errors.ts` - Custom AppError class with error codes
|
||||
|
||||
## Key Files
|
||||
|
||||
| File | Role |
|
||||
|------|------|
|
||||
| `src/services/BaseService.ts` | Abstract base class all services extend |
|
||||
| `src/types/index.ts` | Shared type definitions |
|
||||
|
||||
## Constraints Discovered
|
||||
|
||||
- **No direct DB access in handlers**: Services abstract all database calls
|
||||
- **Async/await only**: No callbacks, promises must use async/await
|
||||
|
||||
## Potential Conflicts
|
||||
|
||||
- **AuthService singleton**: Currently instantiated once at startup, may need refactor for multi-tenant
|
||||
```
|
||||
|
||||
## Example Bad Output (don't do this)
|
||||
|
||||
```markdown
|
||||
Here's what I found in the codebase:
|
||||
|
||||
[500 lines of file contents]
|
||||
|
||||
Let me also show you this file:
|
||||
|
||||
[300 more lines]
|
||||
```
|
||||
101
external_plugins/bonfire/agents/spec-writer.md
Normal file
101
external_plugins/bonfire/agents/spec-writer.md
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
name: spec-writer
|
||||
description: Synthesizes research findings and interview answers into implementation specs. Use after codebase exploration and user interview.
|
||||
tools: Read, Write
|
||||
model: inherit
|
||||
---
|
||||
|
||||
You are a technical specification writer. Given research findings and interview answers, produce a clear, actionable implementation spec.
|
||||
|
||||
## Input
|
||||
|
||||
You'll receive:
|
||||
1. **Research findings** - Structured output from codebase-explorer
|
||||
2. **Interview Q&A** - User's answers to clarifying questions
|
||||
3. **Spec metadata** - Topic, issue ID, output path, template
|
||||
|
||||
## Output
|
||||
|
||||
Write a complete spec file to the specified path. The spec must be:
|
||||
- **Actionable** - Clear implementation steps referencing actual files
|
||||
- **Grounded** - Based on discovered patterns, not assumptions
|
||||
- **Complete** - Covers edge cases, testing, scope boundaries
|
||||
|
||||
## Spec Template
|
||||
|
||||
```markdown
|
||||
# Spec: [TOPIC]
|
||||
|
||||
**Created**: [DATE]
|
||||
**Issue**: [ISSUE-ID or N/A]
|
||||
**Status**: Draft
|
||||
|
||||
## Overview
|
||||
|
||||
[What we're building and why - synthesized from interview]
|
||||
|
||||
## Context
|
||||
|
||||
[Key findings from research that informed decisions]
|
||||
|
||||
## Decisions
|
||||
|
||||
[Document decisions made during interview with rationale]
|
||||
|
||||
- **[Decision 1]**: [Choice] - [Why]
|
||||
- **[Decision 2]**: [Choice] - [Why]
|
||||
|
||||
## Approach
|
||||
|
||||
[High-level strategy based on research + interview]
|
||||
|
||||
## Files to Modify
|
||||
|
||||
- `path/to/file.ts` - [what changes]
|
||||
|
||||
## Files to Create
|
||||
|
||||
- `path/to/new.ts` - [purpose]
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
1. [ ] Step one (reference actual files)
|
||||
2. [ ] Step two
|
||||
3. [ ] Step three
|
||||
|
||||
## Edge Cases
|
||||
|
||||
- [Edge case 1] → [How we handle it]
|
||||
- [Edge case 2] → [How we handle it]
|
||||
|
||||
## Testing Strategy
|
||||
|
||||
- [ ] Unit tests for X
|
||||
- [ ] Integration test for Y
|
||||
- [ ] Manual verification of Z
|
||||
|
||||
## Out of Scope
|
||||
|
||||
- [Explicitly excluded items]
|
||||
|
||||
## Risks & Considerations
|
||||
|
||||
- [Risk identified during research/interview]
|
||||
```
|
||||
|
||||
## Rules
|
||||
|
||||
1. **Ground in research** - Reference actual files and patterns discovered
|
||||
2. **Honor interview answers** - Don't override user decisions
|
||||
3. **Be specific** - "Update UserService.ts" not "Update the service"
|
||||
4. **Don't invent** - If something wasn't discussed, don't add it
|
||||
5. **Keep it actionable** - Someone should be able to implement from this spec
|
||||
|
||||
## Quality Checklist
|
||||
|
||||
Before finishing, verify:
|
||||
- [ ] All interview decisions are captured
|
||||
- [ ] Implementation steps reference real files from research
|
||||
- [ ] Edge cases from interview are documented
|
||||
- [ ] Scope boundaries are clear
|
||||
- [ ] No vague or generic steps
|
||||
121
external_plugins/bonfire/agents/work-reviewer.md
Normal file
121
external_plugins/bonfire/agents/work-reviewer.md
Normal file
@@ -0,0 +1,121 @@
|
||||
---
|
||||
name: work-reviewer
|
||||
description: Strategic code review for blindspots, gaps, and improvements. Returns categorized findings with severity and effort estimates.
|
||||
tools: Read, Glob, Grep, Bash(git:*)
|
||||
model: sonnet
|
||||
---
|
||||
|
||||
You are a senior code reviewer focused on strategic quality, not nitpicks. Your job is to find what the developer might have missed.
|
||||
|
||||
## Input
|
||||
|
||||
You'll receive:
|
||||
1. **Review scope** - Branch diff, specific files, or session context
|
||||
2. **Intent** - What was the developer trying to accomplish
|
||||
3. **Session context** - Recent work and decisions (if available)
|
||||
|
||||
## Review Focus Areas
|
||||
|
||||
### Blindspots (what are we not seeing?)
|
||||
- Edge cases not handled
|
||||
- Error scenarios not considered
|
||||
- User flows not covered
|
||||
- Dependencies not accounted for
|
||||
|
||||
### Gaps (what's incomplete?)
|
||||
- Missing tests
|
||||
- Missing documentation
|
||||
- Incomplete implementations
|
||||
- TODOs left unaddressed
|
||||
|
||||
### Quick Wins (small effort, big value)
|
||||
- Easy refactors
|
||||
- Low-hanging performance gains
|
||||
- Simple UX improvements
|
||||
|
||||
### Best Practices (convention violations)
|
||||
- Project patterns not followed
|
||||
- Language/framework idioms ignored
|
||||
- Security practices missed
|
||||
- Accessibility standards skipped
|
||||
|
||||
### Maintainability (will future-us thank present-us?)
|
||||
- Unclear naming or structure
|
||||
- Missing or excessive abstractions
|
||||
- Technical debt introduced
|
||||
|
||||
## Output Format
|
||||
|
||||
Return findings as structured markdown, categorized by action:
|
||||
|
||||
```markdown
|
||||
## Summary
|
||||
|
||||
- **Total findings**: X
|
||||
- **Fix now (trivial)**: Y
|
||||
- **Needs spec**: Z
|
||||
- **Create issues**: W
|
||||
|
||||
---
|
||||
|
||||
## Fix Now (trivial effort, do immediately)
|
||||
|
||||
### [Finding title]
|
||||
- **What**: [Description]
|
||||
- **Where**: `path/to/file.ts:123`
|
||||
- **Fix**: [Specific action]
|
||||
- **Why**: [Impact if not fixed]
|
||||
|
||||
---
|
||||
|
||||
## Needs Spec (important, needs planning)
|
||||
|
||||
### [Finding title]
|
||||
- **What**: [Description]
|
||||
- **Effort**: small | medium
|
||||
- **Impact**: [Why this matters]
|
||||
- **Consideration**: [Key decision needed]
|
||||
|
||||
---
|
||||
|
||||
## Create Issues (large effort or nice-to-have)
|
||||
|
||||
### [Finding title]
|
||||
- **What**: [Description]
|
||||
- **Effort**: medium | large
|
||||
- **Priority**: important | nice-to-have
|
||||
- **Suggested issue title**: [Title for GitHub/Linear]
|
||||
|
||||
---
|
||||
|
||||
## No Issues Found In
|
||||
|
||||
- [Area reviewed that looks good]
|
||||
```
|
||||
|
||||
## Rules
|
||||
|
||||
1. **Strategic, not pedantic** - Skip style nitpicks, focus on substance
|
||||
2. **Consider intent** - Review against what they were trying to do
|
||||
3. **Categorize by action** - Fix now vs spec vs issue
|
||||
4. **Estimate effort** - trivial/small/medium/large
|
||||
5. **Be specific** - Include file paths and line numbers
|
||||
6. **Acknowledge good work** - Note areas that are solid
|
||||
|
||||
## Severity Guide
|
||||
|
||||
| Severity | Definition | Action |
|
||||
|----------|------------|--------|
|
||||
| Critical | Breaks functionality, security issue | Fix now |
|
||||
| Important | Significant gap, will cause problems | Fix now or spec |
|
||||
| Moderate | Should address, not urgent | Spec or issue |
|
||||
| Minor | Nice to have, low impact | Issue or skip |
|
||||
|
||||
## Effort Guide
|
||||
|
||||
| Effort | Definition |
|
||||
|--------|------------|
|
||||
| Trivial | < 5 minutes, obvious fix |
|
||||
| Small | < 30 minutes, contained change |
|
||||
| Medium | 1-4 hours, multiple files |
|
||||
| Large | > 4 hours, needs planning |
|
||||
BIN
external_plugins/bonfire/bonfire.gif
Normal file
BIN
external_plugins/bonfire/bonfire.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
126
external_plugins/bonfire/commands/archive.md
Normal file
126
external_plugins/bonfire/commands/archive.md
Normal file
@@ -0,0 +1,126 @@
|
||||
---
|
||||
description: Archive completed session work
|
||||
allowed-tools: Bash(git:*), Read, Write, Glob, mcp__linear__*
|
||||
model: haiku
|
||||
---
|
||||
|
||||
# Archive Session
|
||||
|
||||
## Step 1: Find Git Root
|
||||
|
||||
Run `git rev-parse --show-toplevel` to locate the repository root.
|
||||
|
||||
## Step 2: Review Completed Work
|
||||
|
||||
Read `<git-root>/.bonfire/index.md` and identify completed work:
|
||||
- Sessions with merged PRs
|
||||
- Completed features/tasks
|
||||
- Work that's no longer active
|
||||
|
||||
## Step 3: Create Archive Entry
|
||||
|
||||
Move completed session content to `<git-root>/.bonfire/archive/`.
|
||||
|
||||
**Naming convention**: `YYYY-MM-DD-<issue-id>-<topic>.md`
|
||||
|
||||
Examples:
|
||||
- `2025-12-22-GTMENG-387-inbound-improvements.md` (with issue ID)
|
||||
- `2025-12-22-fix-login-redirect.md` (without issue ID)
|
||||
|
||||
Use this template:
|
||||
```markdown
|
||||
# [TOPIC]
|
||||
|
||||
**Date**: [DATE]
|
||||
**Issue**: [ISSUE-ID or N/A]
|
||||
**PR**: [PR link if available]
|
||||
**Status**: Completed
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
[Brief description of what was accomplished]
|
||||
|
||||
## Accomplished
|
||||
|
||||
- [List of completed items]
|
||||
|
||||
## Decisions Made
|
||||
|
||||
- [Key decisions and rationale]
|
||||
|
||||
## Impact
|
||||
|
||||
- [Before/after metrics if applicable]
|
||||
- Files changed: [count]
|
||||
|
||||
## Related
|
||||
|
||||
- [Links to related docs, specs, or code]
|
||||
```
|
||||
|
||||
## Step 4: Clean Up Index
|
||||
|
||||
Update `<git-root>/.bonfire/index.md`:
|
||||
- Remove archived session entries from Recent Sessions
|
||||
- Keep Current State focused on active work
|
||||
- Update Next Session Priorities
|
||||
- Add link to archive file in Archived Sessions section:
|
||||
```markdown
|
||||
## Archived Sessions
|
||||
|
||||
- [YYYY-MM-DD - Topic](archive/YYYY-MM-DD-issue-topic.md)
|
||||
```
|
||||
|
||||
## Step 5: Clean Up Specs (if applicable)
|
||||
|
||||
Read `specsLocation` from `<git-root>/.bonfire/config.json` (default `.bonfire/specs/`).
|
||||
|
||||
Check if any specs in the configured location are now complete:
|
||||
- If the spec was fully implemented, delete the spec file (archive has the record)
|
||||
- If the spec has reusable reference material, move that content to `docs/` first
|
||||
|
||||
## Step 6: Update Linear Issue (if applicable)
|
||||
|
||||
Read `<git-root>/.bonfire/config.json` and check `linearEnabled`.
|
||||
|
||||
**If `linearEnabled` is true**:
|
||||
|
||||
1. Check if archived work references a Linear issue (look in session context for `[A-Z]+-[0-9]+` pattern)
|
||||
2. If Linear issue found, ask user: "Mark Linear issue [ISSUE-ID] as Done?"
|
||||
3. If user confirms:
|
||||
- Use Linear MCP `linear_update_issue` tool with:
|
||||
- `id`: The issue ID (e.g., `ENG-123`)
|
||||
- `status`: Set to "Done" or completed state
|
||||
- Optionally use `linear_add_comment` to add link to archive/PR
|
||||
4. On failure: Warn user - "Couldn't update Linear issue. You may need to update it manually."
|
||||
|
||||
Note: Tool names may vary by Linear MCP implementation.
|
||||
|
||||
**If `linearEnabled` is false or not set**: Skip this step.
|
||||
|
||||
## Step 7: Commit Archive (if tracked)
|
||||
|
||||
Read `gitStrategy` from `<git-root>/.bonfire/config.json`.
|
||||
|
||||
**If gitStrategy is "ignore-all"**: Skip committing - archive is local only.
|
||||
|
||||
**If gitStrategy is "hybrid" or "commit-all"**:
|
||||
1. **NEVER use `git add -f`** - respect gitignore
|
||||
2. Stage unignored files:
|
||||
```bash
|
||||
git add .bonfire/
|
||||
```
|
||||
3. Check if anything was staged before committing:
|
||||
```bash
|
||||
git diff --cached --quiet .bonfire/ || git commit -m "docs: archive completed session work"
|
||||
```
|
||||
|
||||
## Step 8: Confirm
|
||||
|
||||
Report:
|
||||
- What was archived
|
||||
- Any specs cleaned up
|
||||
- Current state of index.md
|
||||
- Ready for next session
|
||||
99
external_plugins/bonfire/commands/configure.md
Normal file
99
external_plugins/bonfire/commands/configure.md
Normal file
@@ -0,0 +1,99 @@
|
||||
---
|
||||
description: Change project settings (locations, git strategy, Linear)
|
||||
allowed-tools: Bash(git:*), Read, Write, AskUserQuestion
|
||||
model: haiku
|
||||
---
|
||||
|
||||
# Configure Bonfire
|
||||
|
||||
Always runs interactively - asks all configuration questions regardless of arguments.
|
||||
|
||||
## Step 1: Find Git Root
|
||||
|
||||
Run `git rev-parse --show-toplevel` to locate the repository root.
|
||||
|
||||
## Step 2: Check for Bonfire Directory
|
||||
|
||||
If `<git-root>/.bonfire/` does not exist, tell the user to run `/bonfire:start` first.
|
||||
|
||||
## Step 3: Read Current Config
|
||||
|
||||
Read `<git-root>/.bonfire/config.json` if it exists to see current settings.
|
||||
|
||||
## Step 4: Ask All Configuration Questions
|
||||
|
||||
Use AskUserQuestion to ask configuration questions (4 questions, one round):
|
||||
|
||||
1. "Where should specs be saved?" (Header: "Specs")
|
||||
- .bonfire/specs/ (Recommended) - Keep with session context
|
||||
- specs/ - Project root level
|
||||
|
||||
2. "Where should docs be saved?" (Header: "Docs")
|
||||
- .bonfire/docs/ (Recommended) - Keep with session context
|
||||
- docs/ - Project root level
|
||||
|
||||
3. "How should `.bonfire/` be handled in git?" (Header: "Git")
|
||||
- ignore-all (Recommended) - Keep sessions private/local
|
||||
- hybrid - Commit docs/specs, keep notes private
|
||||
- commit-all - Share everything with team
|
||||
|
||||
4. "Enable Linear MCP integration?" (Header: "Linear")
|
||||
- No (Recommended) - Skip Linear integration
|
||||
- Yes - Fetch/create Linear issues (requires Linear MCP)
|
||||
|
||||
## Step 5: Update Config
|
||||
|
||||
**Completely overwrite** `<git-root>/.bonfire/config.json` with only these fields (do not preserve old fields like `models`):
|
||||
|
||||
```json
|
||||
{
|
||||
"specsLocation": "<user-answer>",
|
||||
"docsLocation": "<user-answer>",
|
||||
"gitStrategy": "<user-answer>",
|
||||
"linearEnabled": <true-or-false>
|
||||
}
|
||||
```
|
||||
|
||||
## Step 6: Update Git Strategy
|
||||
|
||||
If git strategy or locations changed, update `<git-root>/.bonfire/.gitignore`:
|
||||
|
||||
**Ignore all**:
|
||||
```
|
||||
*
|
||||
!.gitignore
|
||||
```
|
||||
|
||||
**Hybrid** (only include dirs that are inside .bonfire/):
|
||||
```
|
||||
*
|
||||
!.gitignore
|
||||
```
|
||||
If docsLocation is `.bonfire/docs/`, add:
|
||||
```
|
||||
!docs/
|
||||
!docs/**
|
||||
```
|
||||
If specsLocation is `.bonfire/specs/`, add:
|
||||
```
|
||||
!specs/
|
||||
!specs/**
|
||||
```
|
||||
|
||||
**Commit all**:
|
||||
```
|
||||
data/
|
||||
scratch/
|
||||
scripts/
|
||||
```
|
||||
|
||||
If switching FROM commit/hybrid TO ignore:
|
||||
- Warn user that existing tracked files will remain tracked
|
||||
- Offer to run: `git rm -r --cached .bonfire/`
|
||||
|
||||
## Step 7: Confirm
|
||||
|
||||
Report:
|
||||
- Settings updated
|
||||
- Any manual steps needed (git cleanup)
|
||||
- New configuration summary
|
||||
114
external_plugins/bonfire/commands/document.md
Normal file
114
external_plugins/bonfire/commands/document.md
Normal file
@@ -0,0 +1,114 @@
|
||||
---
|
||||
description: Create documentation about a topic in the codebase
|
||||
allowed-tools: Read, Write, Bash(git:*), Task
|
||||
---
|
||||
|
||||
# Document Topic
|
||||
|
||||
Create reference documentation using subagent for research, preserving main context.
|
||||
|
||||
## Step 1: Find Git Root
|
||||
|
||||
Run `git rev-parse --show-toplevel` to locate the repository root.
|
||||
|
||||
## Step 2: Check Config
|
||||
|
||||
Read `<git-root>/.bonfire/config.json` if it exists.
|
||||
|
||||
**Docs location**: Read `docsLocation` from config. Default to `.bonfire/docs/` if not set.
|
||||
|
||||
## Step 3: Understand the Topic
|
||||
|
||||
The topic to document is: $ARGUMENTS
|
||||
|
||||
If no topic provided, ask the user what they want documented.
|
||||
|
||||
## Step 4: Explore the Codebase (Subagent)
|
||||
|
||||
Use the Task tool to invoke the **codebase-explorer** subagent for research.
|
||||
|
||||
Provide a research directive:
|
||||
|
||||
```
|
||||
Research the codebase to document: [TOPIC]
|
||||
|
||||
Find:
|
||||
1. **Architecture**: How this system/feature is structured, key components
|
||||
2. **Key Files**: Important files and their roles
|
||||
3. **Flow**: How data/control flows through the system
|
||||
4. **Patterns**: Design patterns and conventions used
|
||||
5. **Gotchas**: Important details, edge cases, things to watch out for
|
||||
|
||||
Return structured findings with file paths and brief descriptions.
|
||||
```
|
||||
|
||||
**Wait for the subagent to return findings** before proceeding.
|
||||
|
||||
The subagent runs in isolated context (haiku model, fast), preserving main context for writing.
|
||||
|
||||
## Step 5: Create Documentation
|
||||
|
||||
**Naming convention**: `<topic>.md` (kebab-case)
|
||||
|
||||
Examples:
|
||||
- `inbound-agent-architecture.md`
|
||||
- `sampling-strategies.md`
|
||||
- `authentication-flow.md`
|
||||
|
||||
Write the documentation to `<git-root>/<docsLocation>/<topic>.md`
|
||||
|
||||
Structure the documentation using the research findings:
|
||||
|
||||
```markdown
|
||||
# [TOPIC]
|
||||
|
||||
## Overview
|
||||
|
||||
[What this is and why it exists - synthesized from research]
|
||||
|
||||
## Architecture
|
||||
|
||||
[How it's structured - from research findings]
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
A[Component A] --> B[Component B]
|
||||
B --> C[Component C]
|
||||
```
|
||||
|
||||
## Key Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `path/to/file.ts` | [From research findings] |
|
||||
| `path/to/other.ts` | [From research findings] |
|
||||
|
||||
## How It Works
|
||||
|
||||
[Step-by-step flow and behavior - from research]
|
||||
|
||||
## Usage Examples
|
||||
|
||||
[Code examples, CLI commands, etc.]
|
||||
|
||||
## Gotchas
|
||||
|
||||
- [From research findings]
|
||||
- [Common mistakes or edge cases]
|
||||
|
||||
## Related
|
||||
|
||||
- [Link to related doc](other-doc.md)
|
||||
- [Code reference]: `path/to/file.ts`
|
||||
```
|
||||
|
||||
## Step 6: Link to Session Context
|
||||
|
||||
Add a reference to the doc in `<git-root>/.bonfire/index.md` under Key Resources or Notes.
|
||||
|
||||
## Step 7: Confirm
|
||||
|
||||
Summarize what was documented and ask if the user wants:
|
||||
- More detail on any section
|
||||
- Related topics documented
|
||||
- To proceed with other work
|
||||
84
external_plugins/bonfire/commands/end.md
Normal file
84
external_plugins/bonfire/commands/end.md
Normal file
@@ -0,0 +1,84 @@
|
||||
---
|
||||
description: End session - update context and commit changes
|
||||
allowed-tools: Bash(git:*), Bash(rm:*), Bash(mv:*), Bash(mkdir:*), Read, Write, Glob, AskUserQuestion
|
||||
model: haiku
|
||||
---
|
||||
|
||||
# End Session
|
||||
|
||||
## Step 1: Find Git Root
|
||||
|
||||
Run `git rev-parse --show-toplevel` to locate the repository root.
|
||||
|
||||
## Step 2: Review Session Work
|
||||
|
||||
Review what was accomplished this session by examining:
|
||||
- Recent git commits
|
||||
- Files changed
|
||||
- Conversation context
|
||||
|
||||
## Step 3: Update Session Context
|
||||
|
||||
Update `<git-root>/.bonfire/index.md`:
|
||||
|
||||
1. Update the session entry with:
|
||||
- **Accomplished**: List what was completed
|
||||
- **Decisions**: Key decisions made and rationale
|
||||
- **Files Modified**: Important files changed (if relevant)
|
||||
- **Blockers**: Any issues encountered
|
||||
|
||||
2. Update "Next Session Priorities" based on remaining work
|
||||
|
||||
3. Update "Current State" to reflect new status
|
||||
|
||||
## Step 4: Manage Session Scripts
|
||||
|
||||
Check if `<git-root>/.bonfire/scripts/` exists and contains any files.
|
||||
|
||||
**If scripts exist**, use AskUserQuestion to ask what to do with each script:
|
||||
|
||||
"What should happen to these session scripts?" (Header: "Scripts", multiSelect: false)
|
||||
|
||||
For each script found, present options:
|
||||
- **Keep** - Leave in `.bonfire/scripts/` for next session
|
||||
- **Move to project** - Move to `<git-root>/scripts/` (create if needed)
|
||||
- **Delete** - Remove the script
|
||||
|
||||
Execute the user's choices:
|
||||
- **Keep**: No action needed
|
||||
- **Move to project**: `mkdir -p <git-root>/scripts/ && mv <script> <git-root>/scripts/`
|
||||
- **Delete**: `rm <script>`
|
||||
|
||||
**If no scripts exist**, skip this step.
|
||||
|
||||
## Step 5: Commit Changes (if tracked)
|
||||
|
||||
Read `<git-root>/.bonfire/config.json` to check `gitStrategy`.
|
||||
|
||||
**If gitStrategy is "ignore-all"**: Skip committing - nothing is tracked. Tell the user session context was updated locally.
|
||||
|
||||
**If gitStrategy is "hybrid" or "commit-all"**:
|
||||
|
||||
1. **Check what can be staged**: Run `git status .bonfire/` to see what files are not ignored
|
||||
2. **NEVER use `git add -f`** - if a file is gitignored, respect that
|
||||
3. **Stage only unignored files**:
|
||||
```bash
|
||||
git add .bonfire/
|
||||
```
|
||||
4. **Check if anything was staged**: Run `git diff --cached --quiet .bonfire/`
|
||||
- If nothing staged (exit code 0), tell user "Session context updated locally (files are gitignored)"
|
||||
- If changes staged, commit:
|
||||
```bash
|
||||
git commit -m "docs: update session context"
|
||||
```
|
||||
|
||||
If the commit fails due to hooks, help resolve the issue (but never bypass hooks with `--no-verify`).
|
||||
|
||||
## Step 6: Confirm
|
||||
|
||||
Summarize:
|
||||
- What was documented
|
||||
- Next priorities
|
||||
- Any follow-up needed
|
||||
|
||||
Let the user know they can run `/bonfire:archive` when this work is merged and complete.
|
||||
94
external_plugins/bonfire/commands/git-strategy.md
Normal file
94
external_plugins/bonfire/commands/git-strategy.md
Normal file
@@ -0,0 +1,94 @@
|
||||
---
|
||||
description: Change how .bonfire/ is handled in git
|
||||
allowed-tools: Bash(git:*), Read, Write, AskUserQuestion
|
||||
model: haiku
|
||||
---
|
||||
|
||||
# Change Git Strategy
|
||||
|
||||
## Step 1: Find Git Root
|
||||
|
||||
Run `git rev-parse --show-toplevel` to locate the repository root.
|
||||
|
||||
## Step 2: Read Current Config
|
||||
|
||||
Read `<git-root>/.bonfire/config.json` to check current `specsLocation` and `docsLocation` settings.
|
||||
|
||||
## Step 3: Explain Options
|
||||
|
||||
Present the git strategy options:
|
||||
|
||||
1. **Ignore all** - Keep sessions completely local
|
||||
- Everything in .bonfire/ is gitignored
|
||||
- Most private, nothing shared
|
||||
- Good for: solo work, sensitive projects
|
||||
|
||||
2. **Hybrid** - Commit docs/specs, keep notes private
|
||||
- docs/ and specs/ are committed
|
||||
- index.md and archive/ stay local
|
||||
- Good for: teams that want shared docs but private notes
|
||||
|
||||
3. **Commit all** - Share everything with team
|
||||
- All session content is committed
|
||||
- Only data/ and scratch/ ignored
|
||||
- Good for: full transparency, team continuity
|
||||
|
||||
## Step 4: Get User Choice
|
||||
|
||||
Use AskUserQuestion to ask which strategy:
|
||||
|
||||
"Which git strategy for `.bonfire/`?" (Header: "Git")
|
||||
- ignore-all (Recommended) - Keep sessions private/local
|
||||
- hybrid - Commit docs/specs, keep notes private
|
||||
- commit-all - Share everything with team
|
||||
|
||||
## Step 5: Update .gitignore
|
||||
|
||||
Write the appropriate `.gitignore` to `<git-root>/.bonfire/.gitignore`:
|
||||
|
||||
**Ignore all**:
|
||||
```
|
||||
*
|
||||
!.gitignore
|
||||
```
|
||||
|
||||
**Hybrid** (only include dirs that are inside .bonfire/):
|
||||
```
|
||||
*
|
||||
!.gitignore
|
||||
```
|
||||
If docsLocation is `.bonfire/docs/`, add:
|
||||
```
|
||||
!docs/
|
||||
!docs/**
|
||||
```
|
||||
If specsLocation is `.bonfire/specs/`, add:
|
||||
```
|
||||
!specs/
|
||||
!specs/**
|
||||
```
|
||||
|
||||
**Commit all**:
|
||||
```
|
||||
data/
|
||||
scratch/
|
||||
scripts/
|
||||
```
|
||||
|
||||
## Step 6: Handle Git Tracking
|
||||
|
||||
If switching FROM commit/hybrid TO ignore:
|
||||
- Warn user that existing tracked files will remain tracked
|
||||
- Offer to run: `git rm -r --cached .bonfire/` (removes from git but keeps files)
|
||||
- They'll need to commit this change
|
||||
|
||||
If switching TO commit/hybrid:
|
||||
- Files will be picked up on next commit
|
||||
- No special action needed
|
||||
|
||||
## Step 7: Confirm
|
||||
|
||||
Report:
|
||||
- New strategy applied
|
||||
- Any manual steps needed
|
||||
- How to verify the change
|
||||
119
external_plugins/bonfire/commands/review.md
Normal file
119
external_plugins/bonfire/commands/review.md
Normal file
@@ -0,0 +1,119 @@
|
||||
---
|
||||
description: Review work for blindspots, gaps, and improvements
|
||||
allowed-tools: Bash(git:*), Bash(gh:*), Read, Write, Task, mcp__linear__*
|
||||
---
|
||||
|
||||
# Review Work
|
||||
|
||||
Strategic review using subagent for analysis, preserving main context for action decisions.
|
||||
|
||||
## Step 1: Determine Scope
|
||||
|
||||
Based on $ARGUMENTS:
|
||||
- No args: Review current branch vs base
|
||||
- `--session`: Review work captured in current session context
|
||||
- Topic/area: Focus review on specific aspect
|
||||
|
||||
## Step 2: Gather Context
|
||||
|
||||
- Read session context from `<git-root>/.bonfire/index.md`
|
||||
- Get branch diff: `git diff main...HEAD` (or appropriate base)
|
||||
- Read relevant specs/docs from `.bonfire/`
|
||||
- Understand intent: what were we trying to accomplish?
|
||||
|
||||
## Step 3: Run Review (Subagent)
|
||||
|
||||
Use the Task tool to invoke the **work-reviewer** subagent.
|
||||
|
||||
Provide the review context:
|
||||
|
||||
```
|
||||
Review this work for blindspots, gaps, and improvements.
|
||||
|
||||
**Scope**: [Branch diff / session work / specific area]
|
||||
|
||||
**Intent**: [What we were trying to accomplish - from session context]
|
||||
|
||||
**Files changed**:
|
||||
[List of modified files from git diff]
|
||||
|
||||
**Session context**:
|
||||
[Relevant notes from index.md]
|
||||
|
||||
Return categorized findings with severity and effort estimates.
|
||||
```
|
||||
|
||||
**Wait for the subagent to return findings** before proceeding.
|
||||
|
||||
The subagent runs in isolated context (sonnet model), preserving main context for action decisions.
|
||||
|
||||
## Step 4: Session Scripts Review
|
||||
|
||||
Check if `<git-root>/.bonfire/scripts/` contains any files.
|
||||
|
||||
If scripts exist, include in findings:
|
||||
- List scripts that may need attention
|
||||
- Note if any appear to be temporary/one-off vs reusable
|
||||
- Suggest moving useful scripts to project `scripts/` directory
|
||||
|
||||
This is informational - actual script management happens during `/bonfire:end`.
|
||||
|
||||
## Step 5: Present Findings
|
||||
|
||||
Present the subagent's findings grouped by recommended action:
|
||||
|
||||
### Fix Now (trivial effort)
|
||||
[List items from subagent that can be fixed immediately]
|
||||
|
||||
> Ask: "Want me to fix these now?"
|
||||
|
||||
### Needs Spec (important, needs planning)
|
||||
[List items that need implementation planning]
|
||||
|
||||
> Ask: "Want me to create an implementation spec?"
|
||||
|
||||
### Create Issues (large effort or nice-to-have)
|
||||
[List items for future sessions]
|
||||
|
||||
> Ask: "Want me to create GitHub/Linear issues?"
|
||||
|
||||
## Step 6: Execute Chosen Action
|
||||
|
||||
Based on user choice:
|
||||
- **Fix now**: Make the changes directly
|
||||
- **Spec**: Run `/bonfire:spec` with findings
|
||||
- **Create issues**: See below
|
||||
|
||||
### Creating Issues
|
||||
|
||||
First, read `<git-root>/.bonfire/config.json` and check `linearEnabled`.
|
||||
|
||||
**Offer choices based on config:**
|
||||
- Always offer: "Create GitHub issue"
|
||||
- If `linearEnabled` is true: Also offer "Create Linear issue"
|
||||
|
||||
**GitHub Issue Creation:**
|
||||
```bash
|
||||
gh issue create --title "Finding title" --body "Finding details"
|
||||
```
|
||||
|
||||
**Linear Issue Creation (if enabled):**
|
||||
1. Use Linear MCP `linear_create_issue` tool with:
|
||||
- `title`: Finding summary
|
||||
- `description`: Finding details with context
|
||||
- `teamId`: Infer from session context if available, otherwise use default
|
||||
2. On success: Return issue URL/ID
|
||||
3. On failure: Warn user, offer to create GitHub issue instead
|
||||
|
||||
Note: Tool names may vary by Linear MCP implementation.
|
||||
|
||||
**For each created issue:**
|
||||
- Record the issue ID and URL
|
||||
- Note which tracker (GitHub/Linear) was used
|
||||
|
||||
## Step 7: Update Session Context
|
||||
|
||||
Add review outcomes to `<git-root>/.bonfire/index.md`:
|
||||
- Key findings noted
|
||||
- Issues created (with links)
|
||||
- Work deferred to future sessions
|
||||
149
external_plugins/bonfire/commands/spec.md
Normal file
149
external_plugins/bonfire/commands/spec.md
Normal file
@@ -0,0 +1,149 @@
|
||||
---
|
||||
description: Create an implementation spec for a feature or task
|
||||
allowed-tools: Read, Write, Bash(git:*), AskUserQuestion, Task
|
||||
---
|
||||
|
||||
# Create Implementation Spec
|
||||
|
||||
A hybrid approach using subagents: research in isolated context, interview in main context, write in isolated context.
|
||||
|
||||
## Step 1: Find Git Root
|
||||
|
||||
Run `git rev-parse --show-toplevel` to locate the repository root.
|
||||
|
||||
## Step 2: Check Config
|
||||
|
||||
Read `<git-root>/.bonfire/config.json` if it exists.
|
||||
|
||||
**Specs location**: Read `specsLocation` from config. Default to `.bonfire/specs/` if not set.
|
||||
|
||||
## Step 3: Gather Initial Context
|
||||
|
||||
Get the topic from $ARGUMENTS or ask if unclear.
|
||||
|
||||
Check for existing context:
|
||||
- Read `<git-root>/.bonfire/index.md` for project state
|
||||
- Check for `SPEC.md` or `spec.md` in git root (user's spec template)
|
||||
- If issue ID provided, note for filename
|
||||
|
||||
## Step 4: Research Phase (Subagent)
|
||||
|
||||
Use the Task tool to invoke the **codebase-explorer** subagent for research.
|
||||
|
||||
Provide a research directive with these questions:
|
||||
|
||||
```
|
||||
Research the codebase for implementing: [TOPIC]
|
||||
|
||||
Find:
|
||||
1. **Patterns & Architecture**: How similar features are implemented, existing abstractions to reuse, naming conventions
|
||||
2. **Technical Constraints**: Dependencies, API boundaries, performance considerations
|
||||
3. **Potential Conflicts**: Files that need changes, intersections with existing code, migration concerns
|
||||
|
||||
Return structured findings only - no raw file contents.
|
||||
```
|
||||
|
||||
**Wait for the subagent to return findings** before proceeding.
|
||||
|
||||
The subagent runs in isolated context (haiku model, fast), preserving main context for interview.
|
||||
|
||||
## Step 5: Interview Phase (Main Context)
|
||||
|
||||
Using the research findings, interview the user with **informed questions** via AskUserQuestion.
|
||||
|
||||
### Round 1: Core Decisions
|
||||
|
||||
Ask about fundamental approach based on patterns found:
|
||||
|
||||
Example questions (adapt based on actual findings):
|
||||
- "I found [Pattern A] in `services/` and [Pattern B] in `handlers/`. Which pattern should this feature follow?"
|
||||
- "The existing [Component] handles [X]. Should we extend it or create a new [Y]?"
|
||||
- "I see [Library] is used for [purpose]. Should we use it here or try [Alternative]?"
|
||||
|
||||
### Round 2: Edge Cases & Tradeoffs
|
||||
|
||||
Based on Round 1 answers and research, ask about:
|
||||
- Error handling approach
|
||||
- Edge cases identified in research
|
||||
- Performance vs simplicity tradeoffs
|
||||
- User experience considerations
|
||||
|
||||
Example questions:
|
||||
- "What should happen when [edge case from research]?"
|
||||
- "I found [potential conflict]. How should we handle it?"
|
||||
- "[Approach A] is simpler but [tradeoff]. [Approach B] is more complex but [benefit]. Preference?"
|
||||
|
||||
### Round 3: Scope & Boundaries (if needed)
|
||||
|
||||
If scope is still unclear:
|
||||
- What's explicitly out of scope?
|
||||
- MVP vs full implementation?
|
||||
- Dependencies on other work?
|
||||
|
||||
### Continue Until Complete
|
||||
|
||||
Keep asking rounds of questions until you have clarity on:
|
||||
- [ ] Core approach and architecture
|
||||
- [ ] Key technical decisions
|
||||
- [ ] Error handling strategy
|
||||
- [ ] Edge cases covered
|
||||
- [ ] Testing approach
|
||||
- [ ] Scope boundaries
|
||||
|
||||
Tell the user "I have enough to write the spec" when ready.
|
||||
|
||||
## Step 6: Write the Spec (Subagent)
|
||||
|
||||
Use the Task tool to invoke the **spec-writer** subagent.
|
||||
|
||||
Provide:
|
||||
1. **Research findings** from Step 4
|
||||
2. **Interview Q&A** from Step 5
|
||||
3. **Metadata**: topic, issue ID, output path (`<git-root>/<specsLocation>/<filename>.md`)
|
||||
|
||||
The subagent will write the spec file directly.
|
||||
|
||||
**Naming convention**: `<issue-id>-<topic>.md` or `<topic>.md`
|
||||
|
||||
## Step 7: Link to Session Context
|
||||
|
||||
Add a reference to the spec in `<git-root>/.bonfire/index.md` under Current State.
|
||||
|
||||
## Step 8: Confirm
|
||||
|
||||
Read the generated spec and present a summary. Ask if user wants to:
|
||||
- Proceed with implementation
|
||||
- Refine specific sections
|
||||
- Add more detail to any area
|
||||
- Save for later
|
||||
|
||||
## Interview Tips
|
||||
|
||||
**Good questions are:**
|
||||
- Informed by research (not generic)
|
||||
- About tradeoffs (not yes/no)
|
||||
- Specific to the codebase
|
||||
- Non-obvious (user wouldn't think to mention)
|
||||
|
||||
**Bad questions:**
|
||||
- "What features do you want?" (too broad)
|
||||
- "Should we add error handling?" (obvious)
|
||||
- Generic without codebase context
|
||||
|
||||
**Examples of good informed questions:**
|
||||
- "I found `UserService` uses repository pattern but `OrderService` uses direct DB access. Which approach?"
|
||||
- "The `auth` middleware validates JWT but doesn't check permissions. Should this feature add permission checks or assume auth is enough?"
|
||||
- "There's a `BaseController` with shared logic. Extend it or keep this feature standalone?"
|
||||
|
||||
## Spec Lifecycle
|
||||
|
||||
Specs are **temporary artifacts** - they exist to guide implementation:
|
||||
|
||||
1. **Draft** → Created, ready for review
|
||||
2. **In Progress** → Being implemented
|
||||
3. **Completed** → Implementation done
|
||||
|
||||
**When a spec is fully implemented**:
|
||||
- If it contains reusable reference material, move to `docs/`
|
||||
- Delete the spec file - archive has the record
|
||||
- Don't let specs accumulate
|
||||
246
external_plugins/bonfire/commands/start.md
Normal file
246
external_plugins/bonfire/commands/start.md
Normal file
@@ -0,0 +1,246 @@
|
||||
---
|
||||
description: Start a new session - reads context and scaffolds .bonfire/ if needed
|
||||
allowed-tools: Bash(git:*), Bash(gh:*), Bash(mkdir:*), Read, Write, Glob, AskUserQuestion, mcp__linear__*
|
||||
model: haiku
|
||||
---
|
||||
|
||||
# Start Session
|
||||
|
||||
## Step 1: Find Git Root
|
||||
|
||||
Run `git rev-parse --show-toplevel` to locate the repository root. All session files live at `<git-root>/.bonfire/`.
|
||||
|
||||
## Step 2: Check for Bonfire Directory
|
||||
|
||||
Check if `<git-root>/.bonfire/index.md` exists.
|
||||
|
||||
**If .bonfire/ does NOT exist**, scaffold it:
|
||||
|
||||
1. Tell the user: "No bonfire directory found. Let me set that up for you."
|
||||
|
||||
2. Use AskUserQuestion to ask setup questions (4 questions, one round):
|
||||
|
||||
1. "Where should specs be saved?" (Header: "Specs")
|
||||
- .bonfire/specs/ (Recommended) - Keep with session context
|
||||
- specs/ - Project root level
|
||||
|
||||
2. "Where should docs be saved?" (Header: "Docs")
|
||||
- .bonfire/docs/ (Recommended) - Keep with session context
|
||||
- docs/ - Project root level
|
||||
|
||||
3. "How should `.bonfire/` be handled in git?" (Header: "Git")
|
||||
- ignore-all (Recommended) - Keep sessions private/local
|
||||
- hybrid - Commit docs/specs, keep notes private
|
||||
- commit-all - Share everything with team
|
||||
|
||||
4. "Enable Linear MCP integration?" (Header: "Linear")
|
||||
- No (Recommended) - Skip Linear integration
|
||||
- Yes - Fetch/create Linear issues (requires Linear MCP)
|
||||
|
||||
3. Create the directory structure based on user choices:
|
||||
|
||||
**Always create in .bonfire/**:
|
||||
```
|
||||
.bonfire/
|
||||
├── index.md
|
||||
├── config.json
|
||||
├── archive/
|
||||
├── scripts/
|
||||
└── .gitignore
|
||||
```
|
||||
|
||||
**If specsLocation is `.bonfire/specs/`**: create `.bonfire/specs/`
|
||||
**If specsLocation is `specs/`**: create `<git-root>/specs/`
|
||||
|
||||
**If docsLocation is `.bonfire/docs/`**: create `.bonfire/docs/`
|
||||
**If docsLocation is `docs/`**: create `<git-root>/docs/`
|
||||
|
||||
4. Detect project name from: package.json name → git remote → directory name
|
||||
|
||||
5. Create `config.json` with user's answers:
|
||||
```json
|
||||
{
|
||||
"specsLocation": "<user-answer>",
|
||||
"docsLocation": "<user-answer>",
|
||||
"gitStrategy": "<user-answer>",
|
||||
"linearEnabled": <true-or-false>
|
||||
}
|
||||
```
|
||||
|
||||
6. Create `index.md` with template:
|
||||
```markdown
|
||||
# Session Context: [PROJECT_NAME]
|
||||
|
||||
**Date**: [CURRENT_DATE]
|
||||
**Status**: Active
|
||||
**Branch**: main
|
||||
|
||||
---
|
||||
|
||||
## Current State
|
||||
|
||||
[Describe what you're working on]
|
||||
|
||||
---
|
||||
|
||||
## Recent Sessions
|
||||
|
||||
### Session 1 - [CURRENT_DATE]
|
||||
|
||||
**Goal**: [What you want to accomplish]
|
||||
|
||||
**Accomplished**:
|
||||
- [List completed items]
|
||||
|
||||
**Decisions**:
|
||||
- [Key decisions made]
|
||||
|
||||
**Blockers**: None
|
||||
|
||||
---
|
||||
|
||||
## Next Session Priorities
|
||||
|
||||
1. [Priority items]
|
||||
|
||||
---
|
||||
|
||||
## Key Resources
|
||||
|
||||
**Code References**:
|
||||
- [Component/feature]: `path/to/file.ts`
|
||||
|
||||
**External Links**:
|
||||
- [Issue Tracker](url)
|
||||
|
||||
---
|
||||
|
||||
## Archived Sessions
|
||||
|
||||
[Links to archived sessions will appear here]
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
[Any additional context]
|
||||
```
|
||||
|
||||
7. Create `.gitignore` based on chosen strategy and locations:
|
||||
|
||||
**Ignore all**:
|
||||
```
|
||||
*
|
||||
!.gitignore
|
||||
```
|
||||
|
||||
**Hybrid** (only include dirs that are inside .bonfire/):
|
||||
```
|
||||
*
|
||||
!.gitignore
|
||||
```
|
||||
If docsLocation is `.bonfire/docs/`, add:
|
||||
```
|
||||
!docs/
|
||||
!docs/**
|
||||
```
|
||||
If specsLocation is `.bonfire/specs/`, add:
|
||||
```
|
||||
!specs/
|
||||
!specs/**
|
||||
```
|
||||
|
||||
**Commit all**:
|
||||
```
|
||||
data/
|
||||
scratch/
|
||||
scripts/
|
||||
```
|
||||
|
||||
**If .bonfire/ EXISTS**, proceed to Step 3.
|
||||
|
||||
## Step 3: Check/Update CLAUDE.md
|
||||
|
||||
Check if `<git-root>/CLAUDE.md` exists.
|
||||
|
||||
**If CLAUDE.md does NOT exist**, create it:
|
||||
```markdown
|
||||
# [PROJECT_NAME]
|
||||
|
||||
## Quick Context
|
||||
|
||||
Read `.bonfire/index.md` for current project state, recent work, and priorities.
|
||||
|
||||
## Bonfire Commands
|
||||
|
||||
- `/bonfire:start` - Start a session (reads context)
|
||||
- `/bonfire:end` - End session (updates context)
|
||||
- `/bonfire:spec` - Create implementation spec
|
||||
- `/bonfire:document <topic>` - Document a topic
|
||||
- `/bonfire:review` - Review work for blindspots and improvements
|
||||
- `/bonfire:archive` - Archive completed work
|
||||
- `/bonfire:configure` - Change project settings
|
||||
```
|
||||
|
||||
**If CLAUDE.md EXISTS**, check if it references `.bonfire/index.md`. If not, append:
|
||||
```markdown
|
||||
|
||||
## Session Context
|
||||
|
||||
Read `.bonfire/index.md` for current project state, recent work, and priorities.
|
||||
```
|
||||
|
||||
## Step 4: Read Session Context
|
||||
|
||||
Read `<git-root>/.bonfire/index.md` and report when ready.
|
||||
|
||||
Summarize:
|
||||
- Current state
|
||||
- Recent work
|
||||
- Next priorities
|
||||
|
||||
Then ask: "What do you want to work on this session?"
|
||||
|
||||
## Step 5: Fetch External Context (Optional)
|
||||
|
||||
**Only fetch if user provides a new URL or issue ID:**
|
||||
|
||||
### Detecting Issue Type
|
||||
|
||||
- **GitHub**: Starts with `#`, contains `github.com`, or doesn't match Linear pattern
|
||||
- **Linear**: Matches `[A-Z]+-[0-9]+` pattern (e.g., `ENG-123`, `ABC-456`) or contains `linear.app`
|
||||
|
||||
### GitHub Issues/PRs
|
||||
|
||||
Use `gh` CLI:
|
||||
- `gh pr view [URL] --json title,body,state,labels`
|
||||
- `gh issue view [URL] --json title,body,state,labels`
|
||||
|
||||
### Linear Issues
|
||||
|
||||
First, read `<git-root>/.bonfire/config.json` and check `linearEnabled`.
|
||||
|
||||
**If `linearEnabled` is false or not set**: Skip Linear, treat as ad-hoc task.
|
||||
|
||||
**If `linearEnabled` is true**:
|
||||
1. Use Linear MCP `linear_search_issues` tool to find the issue by ID (e.g., `ENG-123`)
|
||||
2. Extract: title, description, state, priority, labels, assignee
|
||||
3. On success: Summarize the issue context
|
||||
4. On failure: Warn user - "Couldn't fetch Linear issue. Linear MCP may not be configured. Continue without issue context?"
|
||||
|
||||
Note: Tool names may vary by Linear MCP implementation. Common tools: `linear_search_issues`, `linear_create_issue`, `linear_update_issue`.
|
||||
|
||||
### Update Session Context
|
||||
|
||||
If issue was fetched successfully:
|
||||
- Add reference to `index.md` under Current State
|
||||
- Include issue ID, title, and link
|
||||
- Note the issue tracker type (GitHub/Linear)
|
||||
|
||||
### Fallback
|
||||
|
||||
If no URL/issue ID provided (continuing work, ad-hoc task):
|
||||
- Proceed with existing session context
|
||||
- Session notes are the source of truth for ongoing work
|
||||
|
||||
Confirm understanding and ask how to proceed.
|
||||
53
external_plugins/bonfire/skills/archive-bonfire/SKILL.md
Normal file
53
external_plugins/bonfire/skills/archive-bonfire/SKILL.md
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
description: Suggest archiving completed work when PRs are merged or work is completed. Triggers when user asks to merge a PR ("merge it", "merge the PR"), after successful gh pr merge, or mentions completion ("shipped", "done with X", "merged to main"). Does NOT archive automatically - suggests running /bonfire:archive.
|
||||
allowed-tools: Read, Glob, Bash(gh:*)
|
||||
---
|
||||
|
||||
# Archive Bonfire Awareness
|
||||
|
||||
This skill detects when session work may be ready for archiving and suggests the appropriate action.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Trigger when:
|
||||
- User asks to merge: "merge it", "merge the PR", "go ahead and merge", "ship it"
|
||||
- After you successfully run `gh pr merge`
|
||||
- User mentions completion: "PR merged", "shipped", "done with X", "finished"
|
||||
- User references merged state: "merged to main", "closed the issue"
|
||||
|
||||
## Instructions
|
||||
|
||||
1. If user asks to merge a PR:
|
||||
- Perform the merge as requested
|
||||
- On success, continue to step 2
|
||||
- On failure, help resolve the issue (don't suggest archiving)
|
||||
|
||||
2. Find git root and check if `.bonfire/index.md` exists
|
||||
|
||||
3. If it exists, read it to assess work state
|
||||
|
||||
4. If user provided a PR URL/number (or you just merged one), verify status:
|
||||
```
|
||||
gh pr view [URL/number] --json state,mergedAt,title
|
||||
```
|
||||
|
||||
5. Assess if work appears complete:
|
||||
- PR merged?
|
||||
- Related tasks marked done in session notes?
|
||||
- No obvious follow-up work mentioned?
|
||||
|
||||
6. If work appears complete, suggest archiving:
|
||||
> "PR merged successfully. This session's work looks complete - want me to archive it?
|
||||
> Run `/bonfire:archive` to move completed work to the archive."
|
||||
|
||||
7. If there's more work in the session:
|
||||
> "PR merged. I see there's still [X, Y] in the session notes - want to continue
|
||||
> with those or archive what's done so far?"
|
||||
|
||||
## Important
|
||||
|
||||
- This skill **suggests** archiving, it does NOT archive automatically
|
||||
- User must explicitly run `/bonfire:archive` to perform the archive
|
||||
- Trigger AFTER merge succeeds, not before
|
||||
- Multiple PRs may be part of one logical session - check context
|
||||
- If `.bonfire/` doesn't exist, don't suggest archiving
|
||||
51
external_plugins/bonfire/skills/bonfire-context/SKILL.md
Normal file
51
external_plugins/bonfire/skills/bonfire-context/SKILL.md
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
description: Read project session context from .bonfire/index.md to understand ongoing work, previous decisions, blockers, and history. Use when the user asks about project context, previous sessions, what was worked on before, architectural decisions, blockers, or when they reference "last time", "previously", "the session", or "what we decided".
|
||||
allowed-tools: Read, Glob
|
||||
---
|
||||
|
||||
# Bonfire Context
|
||||
|
||||
This project may use the Bonfire pattern to maintain continuity across AI coding sessions. Context is stored in `.bonfire/index.md` rather than relying on conversation memory.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
Read session context when the user:
|
||||
- Asks about previous work or decisions
|
||||
- References "last time", "previously", "before"
|
||||
- Wants to know about blockers or pending issues
|
||||
- Asks what the project status is
|
||||
- Starts a significant task that might have prior context
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Find the git root: `git rev-parse --show-toplevel`
|
||||
|
||||
2. Check if `.bonfire/index.md` exists at the git root
|
||||
|
||||
3. If it exists, read it to understand:
|
||||
- Current project status and recent work
|
||||
- Active decisions and their rationale
|
||||
- Known blockers or pending issues
|
||||
- Links to relevant specs or documentation
|
||||
|
||||
4. Check `.bonfire/specs/` if the user asks about implementation specs
|
||||
|
||||
5. Check `.bonfire/docs/` if the user asks about documented topics
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
.bonfire/
|
||||
├── index.md # Main session context (read this first)
|
||||
├── config.json # Project settings
|
||||
├── archive/ # Completed work history
|
||||
├── docs/ # Topic documentation
|
||||
└── specs/ # Implementation specs
|
||||
```
|
||||
|
||||
## Important
|
||||
|
||||
- This skill is for **reading** context, not updating it
|
||||
- Session updates happen via `/bonfire:end` command
|
||||
- Don't modify `.bonfire/index.md` unless explicitly asked
|
||||
- If `.bonfire/` doesn't exist, the project may not use this pattern
|
||||
Reference in New Issue
Block a user