Adapted from PR #108 by @vieko (Vercel). Original: https://github.com/anthropics/claude-plugins-official/pull/108
5.9 KiB
description, allowed-tools, model
| description | allowed-tools | model |
|---|---|---|
| Start a new session - reads context and scaffolds .bonfire/ if needed | Bash(git:*), Bash(gh:*), Bash(mkdir:*), Read, Write, Glob, AskUserQuestion, mcp__linear__* | 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:
-
Tell the user: "No bonfire directory found. Let me set that up for you."
-
Use AskUserQuestion to ask setup questions (4 questions, one round):
-
"Where should specs be saved?" (Header: "Specs")
- .bonfire/specs/ (Recommended) - Keep with session context
- specs/ - Project root level
-
"Where should docs be saved?" (Header: "Docs")
- .bonfire/docs/ (Recommended) - Keep with session context
- docs/ - Project root level
-
"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
-
"Enable Linear MCP integration?" (Header: "Linear")
- No (Recommended) - Skip Linear integration
- Yes - Fetch/create Linear issues (requires Linear MCP)
-
-
Create the directory structure based on user choices:
Always create in .bonfire/:
.bonfire/ ├── index.md ├── config.json ├── archive/ ├── scripts/ └── .gitignoreIf specsLocation is
.bonfire/specs/: create.bonfire/specs/If specsLocation isspecs/: create<git-root>/specs/If docsLocation is
.bonfire/docs/: create.bonfire/docs/If docsLocation isdocs/: create<git-root>/docs/ -
Detect project name from: package.json name → git remote → directory name
-
Create
config.jsonwith user's answers:{ "specsLocation": "<user-answer>", "docsLocation": "<user-answer>", "gitStrategy": "<user-answer>", "linearEnabled": <true-or-false> } -
Create
index.mdwith template:# 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] -
Create
.gitignorebased on chosen strategy and locations:Ignore all:
* !.gitignoreHybrid (only include dirs that are inside .bonfire/):
* !.gitignoreIf 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:
# [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:
## 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
#, containsgithub.com, or doesn't match Linear pattern - Linear: Matches
[A-Z]+-[0-9]+pattern (e.g.,ENG-123,ABC-456) or containslinear.app
GitHub Issues/PRs
Use gh CLI:
gh pr view [URL] --json title,body,state,labelsgh 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:
- Use Linear MCP
linear_search_issuestool to find the issue by ID (e.g.,ENG-123) - Extract: title, description, state, priority, labels, assignee
- On success: Summarize the issue context
- 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.mdunder 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.