panopticon-cli 0.4.6 → 0.4.8

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 (114) hide show
  1. package/package.json +3 -2
  2. package/scripts/heartbeat-hook +149 -0
  3. package/scripts/install-git-hooks.sh +66 -0
  4. package/scripts/notify-complete +79 -0
  5. package/scripts/postinstall.mjs +49 -0
  6. package/scripts/pre-tool-hook +60 -0
  7. package/scripts/record-cost-event.js +94 -0
  8. package/scripts/record-cost-event.ts +113 -0
  9. package/scripts/restart-dashboard.sh +59 -0
  10. package/scripts/setup-certs.sh +66 -0
  11. package/scripts/specialist-stop-hook +106 -0
  12. package/scripts/stop-hook +58 -0
  13. package/scripts/validate-merge.sh +119 -0
  14. package/skills/beads/README.md +120 -0
  15. package/skills/beads/SKILL.md +214 -0
  16. package/skills/beads/adr/0001-bd-prime-as-source-of-truth.md +59 -0
  17. package/skills/beads/resources/AGENTS.md +62 -0
  18. package/skills/beads/resources/ASYNC_GATES.md +168 -0
  19. package/skills/beads/resources/BOUNDARIES.md +469 -0
  20. package/skills/beads/resources/CHEMISTRY_PATTERNS.md +197 -0
  21. package/skills/beads/resources/CLI_REFERENCE.md +558 -0
  22. package/skills/beads/resources/DEPENDENCIES.md +747 -0
  23. package/skills/beads/resources/INTEGRATION_PATTERNS.md +407 -0
  24. package/skills/beads/resources/ISSUE_CREATION.md +139 -0
  25. package/skills/beads/resources/MOLECULES.md +354 -0
  26. package/skills/beads/resources/PATTERNS.md +341 -0
  27. package/skills/beads/resources/RESUMABILITY.md +207 -0
  28. package/skills/beads/resources/STATIC_DATA.md +54 -0
  29. package/skills/beads/resources/TROUBLESHOOTING.md +489 -0
  30. package/skills/beads/resources/WORKFLOWS.md +623 -0
  31. package/skills/beads/resources/WORKTREES.md +94 -0
  32. package/skills/beads-completion-check/SKILL.md +90 -0
  33. package/skills/beads-panopticon-guide/SKILL.md +171 -0
  34. package/skills/bug-fix/SKILL.md +32 -0
  35. package/skills/clear-writing/SKILL.md +105 -0
  36. package/skills/clear-writing/references/elements-of-style/01-introductory.md +3 -0
  37. package/skills/clear-writing/references/elements-of-style/02-elementary-rules-of-usage.md +214 -0
  38. package/skills/clear-writing/references/elements-of-style/03-elementary-principles-of-composition.md +398 -0
  39. package/skills/clear-writing/references/elements-of-style/04-a-few-matters-of-form.md +89 -0
  40. package/skills/clear-writing/references/elements-of-style/05-words-and-expressions-commonly-misused.md +342 -0
  41. package/skills/clear-writing/references/signs-of-ai-writing.md +901 -0
  42. package/skills/code-review/SKILL.md +37 -0
  43. package/skills/code-review-performance/SKILL.md +53 -0
  44. package/skills/code-review-security/SKILL.md +35 -0
  45. package/skills/dependency-update/SKILL.md +30 -0
  46. package/skills/feature-work/SKILL.md +39 -0
  47. package/skills/incident-response/SKILL.md +32 -0
  48. package/skills/knowledge-capture/SKILL.md +463 -0
  49. package/skills/onboard-codebase/SKILL.md +34 -0
  50. package/skills/opus-plan/SKILL.md +400 -0
  51. package/skills/pan-approve/SKILL.md +136 -0
  52. package/skills/pan-code-review/SKILL.md +249 -0
  53. package/skills/pan-config/SKILL.md +164 -0
  54. package/skills/pan-convoy-synthesis/SKILL.md +249 -0
  55. package/skills/pan-diagnose/SKILL.md +360 -0
  56. package/skills/pan-docker/SKILL.md +279 -0
  57. package/skills/pan-docs/SKILL.md +113 -0
  58. package/skills/pan-down/SKILL.md +434 -0
  59. package/skills/pan-health/SKILL.md +240 -0
  60. package/skills/pan-help/SKILL.md +237 -0
  61. package/skills/pan-install/SKILL.md +339 -0
  62. package/skills/pan-issue/SKILL.md +596 -0
  63. package/skills/pan-kill/SKILL.md +172 -0
  64. package/skills/pan-logs/SKILL.md +255 -0
  65. package/skills/pan-network/SKILL.md +320 -0
  66. package/skills/pan-oversee/SKILL.md +290 -0
  67. package/skills/pan-plan/SKILL.md +521 -0
  68. package/skills/pan-projects/SKILL.md +239 -0
  69. package/skills/pan-quickstart/SKILL.md +440 -0
  70. package/skills/pan-reload/SKILL.md +44 -0
  71. package/skills/pan-rescue/SKILL.md +271 -0
  72. package/skills/pan-restart/SKILL.md +53 -0
  73. package/skills/pan-setup/SKILL.md +478 -0
  74. package/skills/pan-skill-creator/SKILL.md +168 -0
  75. package/skills/pan-skill-creator/references/output-patterns.md +141 -0
  76. package/skills/pan-skill-creator/references/workflows.md +90 -0
  77. package/skills/pan-skill-creator/scripts/init_skill.py +176 -0
  78. package/skills/pan-status/SKILL.md +493 -0
  79. package/skills/pan-subagent-creator/SKILL.md +295 -0
  80. package/skills/pan-subagent-creator/assets/validate-readonly-query.sh +35 -0
  81. package/skills/pan-subagent-creator/references/example-agents.md +308 -0
  82. package/skills/pan-subagent-creator/scripts/init_agent.py +126 -0
  83. package/skills/pan-sync/SKILL.md +272 -0
  84. package/skills/pan-tell/SKILL.md +157 -0
  85. package/skills/pan-test-config/SKILL.md +208 -0
  86. package/skills/pan-tracker/SKILL.md +288 -0
  87. package/skills/pan-up/SKILL.md +458 -0
  88. package/skills/pan-workspace-config/SKILL.md +303 -0
  89. package/skills/refactor/SKILL.md +30 -0
  90. package/skills/refactor-radar/SKILL.md +475 -0
  91. package/skills/release/SKILL.md +25 -0
  92. package/skills/send-feedback-to-agent/SKILL.md +98 -0
  93. package/skills/session-health/SKILL.md +76 -0
  94. package/skills/session-health/scripts/check_sessions.py +166 -0
  95. package/skills/skill-creator/SKILL.md +92 -0
  96. package/skills/skill-creator/scripts/init_skill.py +152 -0
  97. package/skills/skill-creator/scripts/package_skill.py +123 -0
  98. package/skills/stitch-design-md/README.md +34 -0
  99. package/skills/stitch-design-md/SKILL.md +172 -0
  100. package/skills/stitch-design-md/examples/DESIGN.md +154 -0
  101. package/skills/stitch-react-components/README.md +36 -0
  102. package/skills/stitch-react-components/SKILL.md +47 -0
  103. package/skills/stitch-react-components/examples/gold-standard-card.tsx +80 -0
  104. package/skills/stitch-react-components/package-lock.json +231 -0
  105. package/skills/stitch-react-components/package.json +16 -0
  106. package/skills/stitch-react-components/resources/architecture-checklist.md +15 -0
  107. package/skills/stitch-react-components/resources/component-template.tsx +37 -0
  108. package/skills/stitch-react-components/resources/stitch-api-reference.md +14 -0
  109. package/skills/stitch-react-components/resources/style-guide.json +27 -0
  110. package/skills/stitch-react-components/scripts/fetch-stitch.sh +30 -0
  111. package/skills/stitch-react-components/scripts/validate.js +68 -0
  112. package/skills/stitch-setup/SKILL.md +94 -0
  113. package/skills/web-design-guidelines/SKILL.md +39 -0
  114. package/skills/work-complete/SKILL.md +79 -0
@@ -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
+ ```