panopticon-cli 0.4.6 → 0.4.7

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.
Files changed (102) hide show
  1. package/package.json +2 -1
  2. package/skills/beads/README.md +120 -0
  3. package/skills/beads/SKILL.md +214 -0
  4. package/skills/beads/adr/0001-bd-prime-as-source-of-truth.md +59 -0
  5. package/skills/beads/resources/AGENTS.md +62 -0
  6. package/skills/beads/resources/ASYNC_GATES.md +168 -0
  7. package/skills/beads/resources/BOUNDARIES.md +469 -0
  8. package/skills/beads/resources/CHEMISTRY_PATTERNS.md +197 -0
  9. package/skills/beads/resources/CLI_REFERENCE.md +558 -0
  10. package/skills/beads/resources/DEPENDENCIES.md +747 -0
  11. package/skills/beads/resources/INTEGRATION_PATTERNS.md +407 -0
  12. package/skills/beads/resources/ISSUE_CREATION.md +139 -0
  13. package/skills/beads/resources/MOLECULES.md +354 -0
  14. package/skills/beads/resources/PATTERNS.md +341 -0
  15. package/skills/beads/resources/RESUMABILITY.md +207 -0
  16. package/skills/beads/resources/STATIC_DATA.md +54 -0
  17. package/skills/beads/resources/TROUBLESHOOTING.md +489 -0
  18. package/skills/beads/resources/WORKFLOWS.md +623 -0
  19. package/skills/beads/resources/WORKTREES.md +94 -0
  20. package/skills/beads-completion-check/SKILL.md +90 -0
  21. package/skills/beads-panopticon-guide/SKILL.md +171 -0
  22. package/skills/bug-fix/SKILL.md +32 -0
  23. package/skills/clear-writing/SKILL.md +105 -0
  24. package/skills/clear-writing/references/elements-of-style/01-introductory.md +3 -0
  25. package/skills/clear-writing/references/elements-of-style/02-elementary-rules-of-usage.md +214 -0
  26. package/skills/clear-writing/references/elements-of-style/03-elementary-principles-of-composition.md +398 -0
  27. package/skills/clear-writing/references/elements-of-style/04-a-few-matters-of-form.md +89 -0
  28. package/skills/clear-writing/references/elements-of-style/05-words-and-expressions-commonly-misused.md +342 -0
  29. package/skills/clear-writing/references/signs-of-ai-writing.md +901 -0
  30. package/skills/code-review/SKILL.md +37 -0
  31. package/skills/code-review-performance/SKILL.md +53 -0
  32. package/skills/code-review-security/SKILL.md +35 -0
  33. package/skills/dependency-update/SKILL.md +30 -0
  34. package/skills/feature-work/SKILL.md +39 -0
  35. package/skills/incident-response/SKILL.md +32 -0
  36. package/skills/knowledge-capture/SKILL.md +463 -0
  37. package/skills/onboard-codebase/SKILL.md +34 -0
  38. package/skills/opus-plan/SKILL.md +400 -0
  39. package/skills/pan-approve/SKILL.md +136 -0
  40. package/skills/pan-code-review/SKILL.md +249 -0
  41. package/skills/pan-config/SKILL.md +164 -0
  42. package/skills/pan-convoy-synthesis/SKILL.md +249 -0
  43. package/skills/pan-diagnose/SKILL.md +360 -0
  44. package/skills/pan-docker/SKILL.md +279 -0
  45. package/skills/pan-docs/SKILL.md +113 -0
  46. package/skills/pan-down/SKILL.md +434 -0
  47. package/skills/pan-health/SKILL.md +240 -0
  48. package/skills/pan-help/SKILL.md +237 -0
  49. package/skills/pan-install/SKILL.md +339 -0
  50. package/skills/pan-issue/SKILL.md +596 -0
  51. package/skills/pan-kill/SKILL.md +172 -0
  52. package/skills/pan-logs/SKILL.md +255 -0
  53. package/skills/pan-network/SKILL.md +320 -0
  54. package/skills/pan-oversee/SKILL.md +290 -0
  55. package/skills/pan-plan/SKILL.md +521 -0
  56. package/skills/pan-projects/SKILL.md +239 -0
  57. package/skills/pan-quickstart/SKILL.md +440 -0
  58. package/skills/pan-reload/SKILL.md +44 -0
  59. package/skills/pan-rescue/SKILL.md +271 -0
  60. package/skills/pan-restart/SKILL.md +53 -0
  61. package/skills/pan-setup/SKILL.md +478 -0
  62. package/skills/pan-skill-creator/SKILL.md +168 -0
  63. package/skills/pan-skill-creator/references/output-patterns.md +141 -0
  64. package/skills/pan-skill-creator/references/workflows.md +90 -0
  65. package/skills/pan-skill-creator/scripts/init_skill.py +176 -0
  66. package/skills/pan-status/SKILL.md +493 -0
  67. package/skills/pan-subagent-creator/SKILL.md +295 -0
  68. package/skills/pan-subagent-creator/assets/validate-readonly-query.sh +35 -0
  69. package/skills/pan-subagent-creator/references/example-agents.md +308 -0
  70. package/skills/pan-subagent-creator/scripts/init_agent.py +126 -0
  71. package/skills/pan-sync/SKILL.md +272 -0
  72. package/skills/pan-tell/SKILL.md +157 -0
  73. package/skills/pan-test-config/SKILL.md +208 -0
  74. package/skills/pan-tracker/SKILL.md +288 -0
  75. package/skills/pan-up/SKILL.md +458 -0
  76. package/skills/pan-workspace-config/SKILL.md +303 -0
  77. package/skills/refactor/SKILL.md +30 -0
  78. package/skills/refactor-radar/SKILL.md +475 -0
  79. package/skills/release/SKILL.md +25 -0
  80. package/skills/send-feedback-to-agent/SKILL.md +98 -0
  81. package/skills/session-health/SKILL.md +76 -0
  82. package/skills/session-health/scripts/check_sessions.py +166 -0
  83. package/skills/skill-creator/SKILL.md +92 -0
  84. package/skills/skill-creator/scripts/init_skill.py +152 -0
  85. package/skills/skill-creator/scripts/package_skill.py +123 -0
  86. package/skills/stitch-design-md/README.md +34 -0
  87. package/skills/stitch-design-md/SKILL.md +172 -0
  88. package/skills/stitch-design-md/examples/DESIGN.md +154 -0
  89. package/skills/stitch-react-components/README.md +36 -0
  90. package/skills/stitch-react-components/SKILL.md +47 -0
  91. package/skills/stitch-react-components/examples/gold-standard-card.tsx +80 -0
  92. package/skills/stitch-react-components/package-lock.json +231 -0
  93. package/skills/stitch-react-components/package.json +16 -0
  94. package/skills/stitch-react-components/resources/architecture-checklist.md +15 -0
  95. package/skills/stitch-react-components/resources/component-template.tsx +37 -0
  96. package/skills/stitch-react-components/resources/stitch-api-reference.md +14 -0
  97. package/skills/stitch-react-components/resources/style-guide.json +27 -0
  98. package/skills/stitch-react-components/scripts/fetch-stitch.sh +30 -0
  99. package/skills/stitch-react-components/scripts/validate.js +68 -0
  100. package/skills/stitch-setup/SKILL.md +94 -0
  101. package/skills/web-design-guidelines/SKILL.md +39 -0
  102. package/skills/work-complete/SKILL.md +79 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panopticon-cli",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Multi-agent orchestration for AI coding assistants (Claude Code, Codex, Cursor, Gemini CLI)",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -38,6 +38,7 @@
38
38
  "files": [
39
39
  "dist",
40
40
  "templates",
41
+ "skills",
41
42
  "scripts/git-hooks",
42
43
  "README.md",
43
44
  "LICENSE"
@@ -0,0 +1,120 @@
1
+ # Beads Skill for Claude Code
2
+
3
+ A comprehensive skill for using [beads](https://github.com/steveyegge/beads) (bd) issue tracking with Claude Code.
4
+
5
+ ## What This Skill Does
6
+
7
+ This skill teaches Claude Code how to use bd effectively for:
8
+ - **Multi-session work tracking** - Persistent memory across conversation compactions
9
+ - **Dependency management** - Graph-based issue relationships
10
+ - **Session handoff** - Writing notes that survive context resets
11
+ - **Molecules and wisps** (v0.34.0+) - Reusable work templates and ephemeral workflows
12
+
13
+ ## Installation
14
+
15
+ Copy the `beads/` directory to your Claude Code skills location:
16
+
17
+ ```bash
18
+ # Global installation
19
+ cp -r beads ~/.claude/skills/
20
+
21
+ # Or project-local
22
+ cp -r beads .claude/skills/
23
+ ```
24
+
25
+ ## When Claude Uses This Skill
26
+
27
+ The skill activates when conversations involve:
28
+ - "multi-session", "complex dependencies", "resume after weeks"
29
+ - "project memory", "persistent context", "side quest tracking"
30
+ - Work that spans multiple days or compaction cycles
31
+ - Tasks too complex for simple TodoWrite lists
32
+
33
+ ## File Structure
34
+
35
+ ```
36
+ beads/
37
+ ├── SKILL.md # Main skill file (Claude reads this first)
38
+ ├── CLAUDE.md # Maintenance guide for updating the skill
39
+ ├── README.md # This file (for humans)
40
+ ├── adr/ # Architectural Decision Records
41
+ │ └── 0001-bd-prime-as-source-of-truth.md
42
+ └── resources/ # Detailed documentation (loaded on demand)
43
+ ├── BOUNDARIES.md # When to use bd vs TodoWrite
44
+ ├── CLI_REFERENCE.md # CLI command reference
45
+ ├── DEPENDENCIES.md # Dependency semantics (A blocks B vs B blocks A)
46
+ ├── INTEGRATION_PATTERNS.md # TodoWrite and other tool integration
47
+ ├── ISSUE_CREATION.md # When and how to create issues
48
+ ├── MOLECULES.md # Protos, mols, wisps (v0.34.0+)
49
+ ├── PATTERNS.md # Common usage patterns
50
+ ├── RESUMABILITY.md # Writing notes for post-compaction recovery
51
+ ├── STATIC_DATA.md # Using bd for reference databases
52
+ ├── TROUBLESHOOTING.md # Common issues and fixes
53
+ ├── WORKFLOWS.md # Step-by-step workflow guides
54
+ ├── AGENTS.md # Agent bead tracking (v0.40+)
55
+ ├── ASYNC_GATES.md # Human-in-the-loop gates
56
+ ├── CHEMISTRY_PATTERNS.md # Mol vs Wisp decision tree
57
+ └── WORKTREES.md # Parallel development patterns
58
+ ```
59
+
60
+ ## Key Concepts
61
+
62
+ ### bd vs TodoWrite
63
+
64
+ | Use bd when... | Use TodoWrite when... |
65
+ |----------------|----------------------|
66
+ | Work spans multiple sessions | Single-session tasks |
67
+ | Complex dependencies exist | Linear step-by-step work |
68
+ | Need to resume after weeks | Just need a quick checklist |
69
+ | Knowledge work with fuzzy boundaries | Clear, immediate tasks |
70
+
71
+ ### The Dependency Direction Trap
72
+
73
+ `bd dep add A B` means **"A depends on B"** (B must complete before A can start).
74
+
75
+ ```bash
76
+ # Want: "Setup must complete before Implementation"
77
+ bd dep add implementation setup # ✓ CORRECT
78
+ # NOT: bd dep add setup implementation # ✗ WRONG
79
+ ```
80
+
81
+ ### Surviving Compaction
82
+
83
+ When Claude's context gets compacted, conversation history is lost but bd state survives. Write notes as if explaining to a future Claude with zero context:
84
+
85
+ ```bash
86
+ bd update issue-123 --notes "COMPLETED: JWT auth with RS256
87
+ KEY DECISION: RS256 over HS256 for key rotation
88
+ IN PROGRESS: Password reset flow
89
+ NEXT: Implement rate limiting"
90
+ ```
91
+
92
+ ## Requirements
93
+
94
+ - [bd CLI](https://github.com/steveyegge/beads) installed (`brew install steveyegge/beads/bd`)
95
+ - A git repository (bd requires git for sync)
96
+ - Initialized database (`bd init` in project root)
97
+
98
+ ## Version Compatibility
99
+
100
+ | Version | Features |
101
+ |---------|----------|
102
+ | v0.43.0+ | Full support: agents, gates, worktrees, chemistry patterns |
103
+ | v0.40.0+ | Agent beads, async gates, worktree management |
104
+ | v0.34.0+ | Molecules, wisps, cross-project dependencies |
105
+ | v0.15.0+ | Core: dependencies, notes, status tracking |
106
+ | Earlier | Basic functionality, some features missing |
107
+
108
+ ## Contributing
109
+
110
+ This skill is maintained at [github.com/steveyegge/beads](https://github.com/steveyegge/beads) in the `skills/beads/` directory.
111
+
112
+ Issues and PRs welcome for:
113
+ - Documentation improvements
114
+ - New workflow patterns
115
+ - Bug fixes in examples
116
+ - Additional troubleshooting scenarios
117
+
118
+ ## License
119
+
120
+ MIT (same as beads)
@@ -0,0 +1,214 @@
1
+ ---
2
+ name: beads
3
+ description: >
4
+ Git-backed issue tracker for multi-session work with dependencies and persistent
5
+ memory across conversation compaction. Use when work spans sessions, has blockers,
6
+ or needs context recovery after compaction.
7
+ allowed-tools: "Read,Bash(bd:*)"
8
+ version: "0.43.0"
9
+ author: "Steve Yegge <https://github.com/steveyegge>"
10
+ license: "MIT"
11
+ ---
12
+
13
+ # Beads - Persistent Task Memory for AI Agents
14
+
15
+ Graph-based issue tracker that survives conversation compaction. Provides persistent memory for multi-session work with complex dependencies.
16
+
17
+ ## bd vs TodoWrite
18
+
19
+ | bd (persistent) | TodoWrite (ephemeral) |
20
+ |-----------------|----------------------|
21
+ | Multi-session work | Single-session tasks |
22
+ | Complex dependencies | Linear execution |
23
+ | Survives compaction | Conversation-scoped |
24
+ | Git-backed, team sync | Local to session |
25
+
26
+ **Decision test**: "Will I need this context in 2 weeks?" → YES = bd
27
+
28
+ ## ID Systems
29
+
30
+ **Beads uses a unique ID format** that differs from GitHub/Linear issue IDs:
31
+
32
+ | System | Format | Example |
33
+ |--------|--------|---------|
34
+ | **Beads** | `repo-hash` | `panopticon-3eb7`, `panopticon-6ax` |
35
+ | **Beads (hierarchical)** | `repo-hash.N` | `panopticon-3eb7.4` |
36
+ | **GitHub Issues** | `PREFIX-number` | `PAN-84`, `PAN-73` |
37
+ | **Linear Issues** | `PREFIX-number` | `MIN-123`, `HH-456` |
38
+
39
+ **CRITICAL**: Commands like `bd dep add`, `--parent`, and `--deps` expect **beads IDs** (e.g., `panopticon-abc1`), NOT external tracker IDs (e.g., `PAN-5`).
40
+
41
+ ### Linking to External Trackers
42
+
43
+ To link a beads issue to a GitHub or Linear issue, use `--external-ref` when creating:
44
+
45
+ ```bash
46
+ # Link beads issue to GitHub issue PAN-84
47
+ bd create "Fix auth bug" --external-ref PAN-84 --json
48
+
49
+ # Link to Linear issue
50
+ bd create "Add feature" --external-ref MIN-123 --json
51
+ ```
52
+
53
+ **Current limitation**: No `bd list --external-ref PAN-84` filter exists. Use labels or title conventions as workaround until upstream feature is available.
54
+
55
+ **When to use bd**:
56
+ - Work spans multiple sessions or days
57
+ - Tasks have dependencies or blockers
58
+ - Need to survive conversation compaction
59
+ - Exploratory/research work with fuzzy boundaries
60
+ - Collaboration with team (git sync)
61
+
62
+ **When to use TodoWrite**:
63
+ - Single-session linear tasks
64
+ - Simple checklist for immediate work
65
+ - All context is in current conversation
66
+ - Will complete within current session
67
+
68
+ ## Prerequisites
69
+
70
+ ```bash
71
+ bd --version # Requires v0.34.0+
72
+ ```
73
+
74
+ - **bd CLI** installed and in PATH
75
+ - **Git repository** (bd requires git for sync)
76
+ - **Initialization**: `bd init` run once (humans do this, not agents)
77
+
78
+ ## CLI Reference
79
+
80
+ **Run `bd prime`** for AI-optimized workflow context (auto-loaded by hooks).
81
+ **Run `bd <command> --help`** for specific command usage.
82
+
83
+ Essential commands: `bd ready`, `bd create`, `bd show`, `bd update`, `bd close`, `bd sync`
84
+
85
+ ## Session Protocol
86
+
87
+ 1. `bd ready` — Find unblocked work
88
+ 2. `bd show <id>` — Get full context
89
+ 3. `bd update <id> --status in_progress` — Start work
90
+ 4. Add notes as you work (critical for compaction survival)
91
+ 5. `bd close <id> --reason "..."` — Complete task
92
+ 6. `bd sync` — Persist to git (always run at session end)
93
+
94
+ ## Quick Reference (Exact Syntax)
95
+
96
+ **DO NOT GUESS FLAGS** - use exactly these commands.
97
+
98
+ For advanced commands not listed here:
99
+ 1. Run `bd --help` to see all available commands
100
+ 2. Run `bd <command> --help` for specific command syntax
101
+
102
+ ### Find Work
103
+ ```bash
104
+ bd ready --json # Find unblocked work (no blockers)
105
+ bd stale --days 30 --json # Find stale issues
106
+ bd prime # AI-optimized workflow context
107
+ ```
108
+
109
+ ### Create Issues
110
+ ```bash
111
+ bd create "Title" -t bug|feature|task -p 0-4 -d "Description" --json
112
+ bd create "Title" -t task -p 2 -l label1,label2 --json # with labels
113
+ bd create "Title" --deps blocks:pan-1 --json # with dependency
114
+ ```
115
+
116
+ ### Dependencies (Blocked-By)
117
+ ```bash
118
+ # Make issue-A blocked by issue-B (A cannot start until B is done)
119
+ bd dep add <blocked-issue> <blocker-issue> --type blocks
120
+
121
+ # Example: panopticon-abc1 is blocked by panopticon-def2
122
+ bd dep add panopticon-abc1 panopticon-def2 --type blocks
123
+
124
+ # View dependency tree
125
+ bd dep tree <id>
126
+ ```
127
+
128
+ ### Related Issues (No Blocking)
129
+ ```bash
130
+ bd dep add <issue-a> <issue-b> --type related
131
+ ```
132
+
133
+ ### Update Issues
134
+ ```bash
135
+ bd update <id> --status in_progress|open|closed --json
136
+ bd update <id> --priority 0-4 --json
137
+ bd update <id> --assignee "name" --json
138
+ bd update <id> --notes "Progress notes here" --json
139
+ bd update <id> --design "Design decisions" --json
140
+ bd update <id> --due "+2d" --json # Due in 2 days
141
+ bd update <id> --claim --json # Claim issue (atomic)
142
+
143
+ # NOTE: No --blocked-by flag exists! Use 'bd dep add' instead
144
+ ```
145
+
146
+ ### Comments (For Progress Notes)
147
+ ```bash
148
+ bd comments <id> --json # List comments
149
+ bd comments add <id> "Comment text" --json # Add comment
150
+ ```
151
+
152
+ ### Labels
153
+ ```bash
154
+ bd label add <id> <label> --json
155
+ bd label remove <id> <label> --json
156
+ bd update <id> --add-label urgent --json # Alternative
157
+ bd update <id> --remove-label wip --json
158
+ ```
159
+
160
+ ### View & Search
161
+ ```bash
162
+ bd show <id> --json # Full issue details
163
+ bd list --status open --json # Filter by status
164
+ bd list --label bug --json # Filter by label
165
+ bd list --assignee me --json # My issues
166
+ bd search "keyword" --json # Full-text search
167
+ bd count --status open --json # Count issues
168
+ ```
169
+
170
+ ### Close & Reopen
171
+ ```bash
172
+ bd close <id> --reason "Completed" --json
173
+ bd reopen <id> --reason "Need more work" --json
174
+ ```
175
+
176
+ ### Sync (End of Session)
177
+ ```bash
178
+ bd sync # Commit and push to git (ALWAYS run at session end)
179
+ ```
180
+
181
+ ## Advanced Features
182
+
183
+ | Feature | CLI | Resource |
184
+ |---------|-----|----------|
185
+ | Molecules (templates) | `bd mol --help` | [MOLECULES.md](resources/MOLECULES.md) |
186
+ | Chemistry (pour/wisp) | `bd pour`, `bd wisp` | [CHEMISTRY_PATTERNS.md](resources/CHEMISTRY_PATTERNS.md) |
187
+ | Agent beads | `bd agent --help` | [AGENTS.md](resources/AGENTS.md) |
188
+ | Async gates | `bd gate --help` | [ASYNC_GATES.md](resources/ASYNC_GATES.md) |
189
+ | Worktrees | `bd worktree --help` | [WORKTREES.md](resources/WORKTREES.md) |
190
+
191
+ ## Resources
192
+
193
+ | Resource | Content |
194
+ |----------|---------|
195
+ | [BOUNDARIES.md](resources/BOUNDARIES.md) | bd vs TodoWrite detailed comparison |
196
+ | [CLI_REFERENCE.md](resources/CLI_REFERENCE.md) | Complete command syntax |
197
+ | [DEPENDENCIES.md](resources/DEPENDENCIES.md) | Dependency system deep dive |
198
+ | [INTEGRATION_PATTERNS.md](resources/INTEGRATION_PATTERNS.md) | TodoWrite and tool integration |
199
+ | [ISSUE_CREATION.md](resources/ISSUE_CREATION.md) | When and how to create issues |
200
+ | [MOLECULES.md](resources/MOLECULES.md) | Proto definitions, component labels |
201
+ | [PATTERNS.md](resources/PATTERNS.md) | Common usage patterns |
202
+ | [RESUMABILITY.md](resources/RESUMABILITY.md) | Compaction survival guide |
203
+ | [STATIC_DATA.md](resources/STATIC_DATA.md) | Database schema reference |
204
+ | [TROUBLESHOOTING.md](resources/TROUBLESHOOTING.md) | Error handling and fixes |
205
+ | [WORKFLOWS.md](resources/WORKFLOWS.md) | Step-by-step workflow patterns |
206
+ | [AGENTS.md](resources/AGENTS.md) | Agent bead tracking (v0.40+) |
207
+ | [ASYNC_GATES.md](resources/ASYNC_GATES.md) | Human-in-the-loop gates |
208
+ | [CHEMISTRY_PATTERNS.md](resources/CHEMISTRY_PATTERNS.md) | Mol vs Wisp decision tree |
209
+ | [WORKTREES.md](resources/WORKTREES.md) | Parallel development patterns |
210
+
211
+ ## Full Documentation
212
+
213
+ - **bd prime**: AI-optimized workflow context
214
+ - **GitHub**: [github.com/steveyegge/beads](https://github.com/steveyegge/beads)
@@ -0,0 +1,59 @@
1
+ # ADR-0001: Use bd prime as CLI Reference Source of Truth
2
+
3
+ ## Status
4
+
5
+ Accepted
6
+
7
+ ## Context
8
+
9
+ The beads skill maintained CLI reference documentation in multiple locations:
10
+
11
+ - `SKILL.md` inline (~2,000+ words of CLI reference)
12
+ - `references/CLI_REFERENCE.md` (~2,363 words)
13
+ - Scattered examples throughout resource files
14
+
15
+ This created:
16
+ - **Duplication**: Same commands documented 2-3 times
17
+ - **Drift risk**: Documentation can fall behind bd versions
18
+ - **Token overhead**: ~3,000+ tokens loaded even for simple operations
19
+
20
+ Meanwhile, bd provides `bd prime` which generates AI-optimized workflow context automatically.
21
+
22
+ ## Decision
23
+
24
+ Use `bd prime` as the single source of truth for CLI commands:
25
+
26
+ 1. **SKILL.md** contains only value-add content (decision frameworks, cognitive patterns)
27
+ 2. **CLI reference** points to `bd prime` (auto-loaded by hooks) and `bd --help`
28
+ 3. **Resources** provide depth for advanced features (molecules, agents, gates)
29
+
30
+ ## Consequences
31
+
32
+ ### Positive
33
+
34
+ - **Zero maintenance**: CLI docs auto-update with bd versions
35
+ - **DRY**: Single source of truth
36
+ - **Accurate**: No version drift possible
37
+ - **Lighter SKILL.md**: ~500 words vs ~3,300
38
+
39
+ ### Negative
40
+
41
+ - **Dependency on bd prime format**: If output changes significantly, may need adaptation
42
+ - **External tool requirement**: Skill assumes bd is installed
43
+
44
+ ## Implementation
45
+
46
+ Files restructured:
47
+ - `SKILL.md` — Reduced from 3,306 to ~500 words
48
+ - `references/` → `resources/` — Directory rename for consistency
49
+ - New resources added: `agents.md`, `async-gates.md`, `chemistry-patterns.md`, `worktrees.md`
50
+ - Existing resources preserved with path updates
51
+
52
+ ## Related
53
+
54
+ - Claude Code skill progressive disclosure guidelines
55
+ - Similar pattern implemented in other Claude Code skill ecosystems
56
+
57
+ ## Date
58
+
59
+ 2025-01-02
@@ -0,0 +1,62 @@
1
+ # Agent Beads
2
+
3
+ > Adapted from ACF beads skill
4
+
5
+ **v0.40+**: First-class support for agent tracking via `type=agent` beads.
6
+
7
+ ## When to Use Agent Beads
8
+
9
+ | Scenario | Agent Bead? | Why |
10
+ |----------|-------------|-----|
11
+ | Multi-agent orchestration | Yes | Track state, assign work via slots |
12
+ | Single Claude session | No | Overkill—just use regular beads |
13
+ | Long-running background agents | Yes | Heartbeats enable liveness detection |
14
+ | Role-based agent systems | Yes | Role beads define agent capabilities |
15
+
16
+ ## Bead Types
17
+
18
+ | Type | Purpose | Has Slots? |
19
+ |------|---------|------------|
20
+ | `agent` | AI agent tracking | Yes (hook, role) |
21
+ | `role` | Role definitions for agents | No |
22
+
23
+ Other types (`task`, `bug`, `feature`, `epic`) remain unchanged.
24
+
25
+ ## State Machine
26
+
27
+ Agent beads track state for coordination:
28
+
29
+ ```
30
+ idle → spawning → running/working → done → idle
31
+
32
+ stuck → (needs intervention)
33
+ ```
34
+
35
+ **Key states**: `idle`, `spawning`, `running`, `working`, `stuck`, `done`, `stopped`, `dead`
36
+
37
+ The `dead` state is set by Witness (monitoring system) via heartbeat timeout—agents don't set this themselves.
38
+
39
+ ## Slot Architecture
40
+
41
+ Slots are named references from agent beads to other beads:
42
+
43
+ | Slot | Cardinality | Purpose |
44
+ |------|-------------|---------|
45
+ | `hook` | 0..1 | Current work attached to agent |
46
+ | `role` | 1 | Role definition bead (required) |
47
+
48
+ **Why slots?** They enforce constraints (one work item at a time) and enable queries like "what is agent X working on?" or "which agent has this work?"
49
+
50
+ ## Monitoring Integration
51
+
52
+ Agent beads enable:
53
+
54
+ - **Witness System**: Monitors agent health via heartbeats
55
+ - **State Coordination**: ZFC-compliant state machine for multi-agent systems
56
+ - **Work Attribution**: Track which agent owns which work
57
+
58
+ ## CLI Reference
59
+
60
+ Run `bd agent --help` for state/heartbeat/show commands.
61
+ Run `bd slot --help` for set/clear/show commands.
62
+ Run `bd create --help` for `--type=agent` and `--type=role` options.
@@ -0,0 +1,168 @@
1
+ # Async Gates for Workflow Coordination
2
+
3
+ > Adapted from ACF beads skill
4
+
5
+ `bd gate` provides async coordination primitives for cross-session and external-condition workflows. Gates are **wisps** (ephemeral issues) that block until a condition is met.
6
+
7
+ ---
8
+
9
+ ## Gate Types
10
+
11
+ | Type | Await Syntax | Use Case |
12
+ |------|--------------|----------|
13
+ | Human | `human:<prompt>` | Cross-session human approval |
14
+ | CI | `gh:run:<id>` | Wait for GitHub Actions completion |
15
+ | PR | `gh:pr:<id>` | Wait for PR merge/close |
16
+ | Timer | `timer:<duration>` | Deployment propagation delay |
17
+ | Mail | `mail:<pattern>` | Wait for matching email |
18
+
19
+ ---
20
+
21
+ ## Creating Gates
22
+
23
+ ```bash
24
+ # Human approval gate
25
+ bd gate create --await human:deploy-approval \
26
+ --title "Approve production deploy" \
27
+ --timeout 4h
28
+
29
+ # CI gate (GitHub Actions)
30
+ bd gate create --await gh:run:123456789 \
31
+ --title "Wait for CI" \
32
+ --timeout 30m
33
+
34
+ # PR merge gate
35
+ bd gate create --await gh:pr:42 \
36
+ --title "Wait for PR approval" \
37
+ --timeout 24h
38
+
39
+ # Timer gate (deployment propagation)
40
+ bd gate create --await timer:15m \
41
+ --title "Wait for deployment propagation"
42
+ ```
43
+
44
+ **Required options**:
45
+ - `--await <spec>` — Gate condition (see types above)
46
+ - `--timeout <duration>` — Recommended: prevents forever-open gates
47
+
48
+ **Optional**:
49
+ - `--title <text>` — Human-readable description
50
+ - `--notify <recipients>` — Email/beads addresses to notify
51
+
52
+ ---
53
+
54
+ ## Monitoring Gates
55
+
56
+ ```bash
57
+ bd gate list # All open gates
58
+ bd gate list --all # Include closed
59
+ bd gate show <gate-id> # Details for specific gate
60
+ bd gate eval # Auto-close elapsed/completed gates
61
+ bd gate eval --dry-run # Preview what would close
62
+ ```
63
+
64
+ **Auto-close behavior** (`bd gate eval`):
65
+ - `timer:*` — Closes when duration elapsed
66
+ - `gh:run:*` — Checks GitHub API, closes on success/failure
67
+ - `gh:pr:*` — Checks GitHub API, closes on merge/close
68
+ - `human:*` — Requires explicit `bd gate approve`
69
+
70
+ ---
71
+
72
+ ## Closing Gates
73
+
74
+ ```bash
75
+ # Human gates require explicit approval
76
+ bd gate approve <gate-id>
77
+ bd gate approve <gate-id> --comment "Reviewed and approved by Steve"
78
+
79
+ # Manual close (any gate)
80
+ bd gate close <gate-id>
81
+ bd gate close <gate-id> --reason "No longer needed"
82
+
83
+ # Auto-close via evaluation
84
+ bd gate eval
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Best Practices
90
+
91
+ 1. **Always set timeouts**: Prevents forever-open gates
92
+ ```bash
93
+ bd gate create --await human:... --timeout 24h
94
+ ```
95
+
96
+ 2. **Clear titles**: Title should indicate what's being gated
97
+ ```bash
98
+ --title "Approve Phase 2: Core Implementation"
99
+ ```
100
+
101
+ 3. **Eval periodically**: Run at session start to close elapsed gates
102
+ ```bash
103
+ bd gate eval
104
+ ```
105
+
106
+ 4. **Clean up obsolete gates**: Close gates that are no longer needed
107
+ ```bash
108
+ bd gate close <id> --reason "superseded by new approach"
109
+ ```
110
+
111
+ 5. **Check before creating**: Avoid duplicate gates
112
+ ```bash
113
+ bd gate list | grep "spec-myfeature"
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Gates vs Issues
119
+
120
+ | Aspect | Gates (Wisp) | Issues |
121
+ |--------|--------------|--------|
122
+ | Persistence | Ephemeral (not synced) | Permanent (synced to git) |
123
+ | Purpose | Block on external condition | Track work items |
124
+ | Lifecycle | Auto-close when condition met | Manual close |
125
+ | Visibility | `bd gate list` | `bd list` |
126
+ | Use case | CI, approval, timers | Tasks, bugs, features |
127
+
128
+ Gates are designed to be temporary coordination primitives—they exist only until their condition is satisfied.
129
+
130
+ ---
131
+
132
+ ## Troubleshooting
133
+
134
+ ### Gate won't close
135
+
136
+ ```bash
137
+ # Check gate details
138
+ bd gate show <gate-id>
139
+
140
+ # For gh:run gates, verify the run exists
141
+ gh run view <run-id>
142
+
143
+ # Force close if stuck
144
+ bd gate close <gate-id> --reason "manual override"
145
+ ```
146
+
147
+ ### Can't find gate ID
148
+
149
+ ```bash
150
+ # List all gates (including closed)
151
+ bd gate list --all
152
+
153
+ # Search by title pattern
154
+ bd gate list | grep "Phase 2"
155
+ ```
156
+
157
+ ### CI run ID detection fails
158
+
159
+ ```bash
160
+ # Check GitHub CLI auth
161
+ gh auth status
162
+
163
+ # List runs manually
164
+ gh run list --branch <branch>
165
+
166
+ # Use specific workflow
167
+ gh run list --workflow ci.yml --branch <branch>
168
+ ```