Skip to content

Commit 4dfd3f4

Browse files
LastStepclaude
andcommitted
feat: dogfood Bonsai on itself — generate station/ workspace with tech-lead agent
Ran `bonsai init` on the Bonsai repo itself. Migrated hand-crafted agent/ directory into Bonsai-generated station/ workspace with full scaffolding, protocols, sensors, workflows, routines, and customized identity/memory. Retired old agent/ and root Backlog.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 64d5dec commit 4dfd3f4

43 files changed

Lines changed: 2148 additions & 280 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bonsai.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
project_name: Bonsai
2+
description: CLI tool for scaffolding Claude Code agent workspaces
3+
docs_path: station/
4+
scaffolding:
5+
- index
6+
- playbook
7+
- logs
8+
- reports
9+
agents:
10+
tech-lead:
11+
agent_type: tech-lead
12+
workspace: station/
13+
skills:
14+
- planning-template
15+
- review-checklist
16+
workflows:
17+
- code-review
18+
- planning
19+
- pr-review
20+
- security-audit
21+
- session-logging
22+
- test-plan
23+
protocols:
24+
- memory
25+
- scope-boundaries
26+
- security
27+
- session-start
28+
sensors:
29+
- context-guard
30+
- scope-guard-files
31+
- session-context
32+
- status-bar
33+
- routine-check
34+
routines:
35+
- backlog-hygiene
36+
- dependency-audit
37+
- doc-freshness-check
38+
- infra-drift-check
39+
- memory-consolidation
40+
- roadmap-accuracy
41+
- status-hygiene
42+
- vulnerability-scan

.claude/settings.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"hooks": [
6+
{
7+
"type": "command",
8+
"command": "bash station/agent/Sensors/scope-guard-files.sh"
9+
}
10+
],
11+
"matcher": "Edit|Write"
12+
}
13+
],
14+
"SessionStart": [
15+
{
16+
"hooks": [
17+
{
18+
"type": "command",
19+
"command": "bash station/agent/Sensors/session-context.sh"
20+
},
21+
{
22+
"type": "command",
23+
"command": "bash station/agent/Sensors/routine-check.sh"
24+
}
25+
]
26+
}
27+
],
28+
"Stop": [
29+
{
30+
"hooks": [
31+
{
32+
"type": "command",
33+
"command": "bash station/agent/Sensors/status-bar.sh"
34+
}
35+
]
36+
}
37+
],
38+
"UserPromptSubmit": [
39+
{
40+
"hooks": [
41+
{
42+
"type": "command",
43+
"command": "bash station/agent/Sensors/context-guard.sh"
44+
}
45+
]
46+
}
47+
]
48+
}
49+
}

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ bonsai
33
bonsai.exe
44
Bonsai
55

6-
# Python
7-
.venv/
8-
96
# Go
107
*.test
118
*.out
129
vendor/
1310

11+
# Bonsai
12+
.bonsai-lock.yaml
13+
*.bak
14+
15+
# Legacy
16+
.venv/
1417

1518
# Research / scratch
1619
RESEARCH*.md

Backlog.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

CLAUDE.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**Stack:** Go 1.24+, Cobra, Huh (forms), LipGloss (styling), BubbleTea (TUI)
66

77
> [!warning]
8-
> **FIRST:** Read `agent/Core/identity.md`, then `agent/Core/memory.md`.
8+
> **FIRST:** Read `station/agent/Core/identity.md`, then `station/agent/Core/memory.md`.
99
1010
---
1111

@@ -14,7 +14,8 @@
1414
```
1515
Bonsai/
1616
├── CLAUDE.md ← you are here
17-
├── Backlog.md ← prioritized todo queue (bugs, features, debt, research)
17+
├── .bonsai.yaml ← project config (dogfooding — Bonsai manages itself)
18+
├── .bonsai-lock.yaml ← file tracking (hashes + sources)
1819
├── main.go ← entry point, embeds catalog/ via embed.FS
1920
├── go.mod / go.sum ← module config
2021
├── Makefile ← build, install, clean
@@ -29,7 +30,8 @@ Bonsai/
2930
│ ├── catalog/
3031
│ │ └── catalog.go ← loads YAML metadata from embedded catalog/
3132
│ ├── config/
32-
│ │ └── config.go ← ProjectConfig, InstalledAgent + YAML I/O
33+
│ │ ├── config.go ← ProjectConfig, InstalledAgent + YAML I/O
34+
│ │ └── lockfile.go ← LockFile, content hashing, conflict detection
3335
│ ├── generate/
3436
│ │ ├── generate.go ← renders templates, writes files to target project
3537
│ │ └── generate_test.go ← tests for core file generation
@@ -39,45 +41,44 @@ Bonsai/
3941
├── catalog/ ← bundled catalog (embedded into binary)
4042
│ ├── core/ ← shared core files (memory, self-awareness)
4143
│ ├── agents/ ← agent type definitions + identity templates
42-
│ │ ├── tech-lead/
43-
│ │ ├── backend/
44-
│ │ └── frontend/
4544
│ ├── skills/ ← à la carte skills (meta.yaml + content.md)
4645
│ ├── workflows/ ← à la carte workflows
4746
│ ├── protocols/ ← à la carte protocols
4847
│ ├── sensors/ ← auto-enforced hooks (meta.yaml + script.sh.tmpl)
4948
│ ├── routines/ ← periodic maintenance routines (meta.yaml + content.md.tmpl)
5049
│ └── scaffolding/ ← project management infrastructure templates
51-
│ ├── manifest.yaml ← scaffolding item definitions (name, description, required, affects)
52-
│ ├── INDEX.md.tmpl
53-
│ ├── Playbook/ ← Status, Roadmap, Backlog, Plans, SecurityStandards
54-
│ ├── Logs/ ← FieldNotes, KeyDecisionLog, RoutineLog
55-
│ └── Reports/ ← report-template, Pending/
56-
└── agent/ ← agent instructions (this agent)
57-
├── Core/ ← identity, memory
58-
└── Skills/ ← domain skills + references
50+
└── station/ ← tech-lead workspace (generated by bonsai init)
51+
├── CLAUDE.md ← workspace nav (generated, then customized)
52+
├── index.md ← code index — quick-nav to Go source
53+
├── INDEX.md ← project snapshot
54+
├── Playbook/ ← status, roadmap, backlog, plans, standards
55+
├── Logs/ ← field notes, key decisions, routine log
56+
├── Reports/ ← report templates, pending reports
57+
└── agent/ ← agent instructions
58+
├── Core/ ← identity, memory, self-awareness, routines dashboard
59+
├── Skills/ ← planning-template, review-checklist, bubbletea
60+
├── Workflows/ ← code-review, planning, pr-review, security-audit, etc.
61+
├── Protocols/ ← memory, scope-boundaries, security, session-start
62+
├── Sensors/ ← context-guard, scope-guard-files, session-context, status-bar, routine-check
63+
└── Routines/ ← backlog-hygiene, dependency-audit, doc-freshness-check, etc.
5964
```
6065

6166
---
6267

63-
## Skills (load when doing specific work)
68+
## Agent Instructions
6469

65-
| Need | Read this |
66-
|------|-----------|
67-
| BubbleTea TUI development | `agent/Skills/bubbletea.md` |
68-
69-
References for each skill live in a subdirectory (e.g. `agent/Skills/bubbletea/`) — load progressively as needed.
70+
All agent instructions live in `station/`. Start with `station/CLAUDE.md` for the full navigation table.
7071

7172
---
7273

7374
## Memory
7475

7576
> [!warning]
76-
> **Do NOT use Claude Code's auto-memory system** (`~/.claude/projects/*/memory/`). All persistent memory goes in `agent/Core/memory.md` — version-controlled, auditable, inside the project.
77+
> **Do NOT use Claude Code's auto-memory system** (`~/.claude/projects/*/memory/`). All persistent memory goes in `station/agent/Core/memory.md` — version-controlled, auditable, inside the project.
7778
78-
When you would normally write to auto-memory (feedback, references, project context, flags), write to the appropriate section in `agent/Core/memory.md` instead.
79+
When you would normally write to auto-memory (feedback, references, project context, flags), write to the appropriate section in `station/agent/Core/memory.md` instead.
7980

80-
When you discover bugs, improvement ideas, tech debt, or feature requests outside your current task scope, add them to `Backlog.md` instead of fixing them inline or noting them only in memory.
81+
When you discover bugs, improvement ideas, tech debt, or feature requests outside your current task scope, add them to `station/Playbook/Backlog.md` instead of fixing them inline or noting them only in memory.
8182

8283
---
8384

agent/Core/identity.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)