Skip to content

Commit 301df30

Browse files
committed
Enhance AGENTS.md with detailed usage instructions for bv as an AI sidecar, including triage commands and graph analysis features. Update package.json to add a CI script for linting, type checking, and testing. Remove obsolete ralph-afk.sh script and modify ralph-once.sh to streamline task execution and quality checks.
1 parent 2858f6a commit 301df30

File tree

4 files changed

+97
-6
lines changed

4 files changed

+97
-6
lines changed

AGENTS.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,92 @@ git push # Push to remote
101101
- Always `bd sync` before ending session
102102

103103
<!-- end-bv-agent-instructions -->
104+
105+
106+
### Using bv as an AI sidecar
107+
108+
bv is a graph-aware triage engine for Beads projects (.beads/beads.jsonl). Instead of parsing JSONL or hallucinating graph traversal, use robot flags for deterministic, dependency-aware outputs with precomputed metrics (PageRank, betweenness, critical path, cycles, HITS, eigenvector, k-core).
109+
110+
**Scope boundary:** bv handles *what to work on* (triage, priority, planning). For agent-to-agent coordination (messaging, work claiming, file reservations), use [MCP Agent Mail](https://github.com/Dicklesworthstone/mcp_agent_mail).
111+
112+
**⚠️ CRITICAL: Use ONLY `--robot-*` flags. Bare `bv` launches an interactive TUI that blocks your session.**
113+
114+
#### The Workflow: Start With Triage
115+
116+
**`bv --robot-triage` is your single entry point.** It returns everything you need in one call:
117+
- `quick_ref`: at-a-glance counts + top 3 picks
118+
- `recommendations`: ranked actionable items with scores, reasons, unblock info
119+
- `quick_wins`: low-effort high-impact items
120+
- `blockers_to_clear`: items that unblock the most downstream work
121+
- `project_health`: status/type/priority distributions, graph metrics
122+
- `commands`: copy-paste shell commands for next steps
123+
124+
bv --robot-triage # THE MEGA-COMMAND: start here
125+
bv --robot-next # Minimal: just the single top pick + claim command
126+
127+
#### Other Commands
128+
129+
**Planning:**
130+
| Command | Returns |
131+
|---------|---------|
132+
| `--robot-plan` | Parallel execution tracks with `unblocks` lists |
133+
| `--robot-priority` | Priority misalignment detection with confidence |
134+
135+
**Graph Analysis:**
136+
| Command | Returns |
137+
|---------|---------|
138+
| `--robot-insights` | Full metrics: PageRank, betweenness, HITS (hubs/authorities), eigenvector, critical path, cycles, k-core, articulation points, slack |
139+
| `--robot-label-health` | Per-label health: `health_level` (healthy\|warning\|critical), `velocity_score`, `staleness`, `blocked_count` |
140+
| `--robot-label-flow` | Cross-label dependency: `flow_matrix`, `dependencies`, `bottleneck_labels` |
141+
| `--robot-label-attention [--attention-limit=N]` | Attention-ranked labels by: (pagerank × staleness × block_impact) / velocity |
142+
143+
**History & Change Tracking:**
144+
| Command | Returns |
145+
|---------|---------|
146+
| `--robot-history` | Bead-to-commit correlations: `stats`, `histories` (per-bead events/commits/milestones), `commit_index` |
147+
| `--robot-diff --diff-since <ref>` | Changes since ref: new/closed/modified issues, cycles introduced/resolved |
148+
149+
**Other Commands:**
150+
| Command | Returns |
151+
|---------|---------|
152+
| `--robot-burndown <sprint>` | Sprint burndown, scope changes, at-risk items |
153+
| `--robot-forecast <id\|all>` | ETA predictions with dependency-aware scheduling |
154+
| `--robot-alerts` | Stale issues, blocking cascades, priority mismatches |
155+
| `--robot-suggest` | Hygiene: duplicates, missing deps, label suggestions, cycle breaks |
156+
| `--robot-graph [--graph-format=json\|dot\|mermaid]` | Dependency graph export |
157+
| `--export-graph <file.html>` | Self-contained interactive HTML visualization |
158+
159+
#### Scoping & Filtering
160+
161+
bv --robot-plan --label backend # Scope to label's subgraph
162+
bv --robot-insights --as-of HEAD~30 # Historical point-in-time
163+
bv --recipe actionable --robot-plan # Pre-filter: ready to work (no blockers)
164+
bv --recipe high-impact --robot-triage # Pre-filter: top PageRank scores
165+
bv --robot-triage --robot-triage-by-track # Group by parallel work streams
166+
bv --robot-triage --robot-triage-by-label # Group by domain
167+
168+
#### Understanding Robot Output
169+
170+
**All robot JSON includes:**
171+
- `data_hash` — Fingerprint of source beads.jsonl (verify consistency across calls)
172+
- `status` — Per-metric state: `computed|approx|timeout|skipped` + elapsed ms
173+
- `as_of` / `as_of_commit` — Present when using `--as-of`; contains ref and resolved SHA
174+
175+
**Two-phase analysis:**
176+
- **Phase 1 (instant):** degree, topo sort, density — always available immediately
177+
- **Phase 2 (async, 500ms timeout):** PageRank, betweenness, HITS, eigenvector, cycles — check `status` flags
178+
179+
**For large graphs (>500 nodes):** Some metrics may be approximated or skipped. Always check `status`.
180+
181+
#### jq Quick Reference
182+
183+
bv --robot-triage | jq '.quick_ref' # At-a-glance summary
184+
bv --robot-triage | jq '.recommendations[0]' # Top recommendation
185+
bv --robot-plan | jq '.plan.summary.highest_impact' # Best unblock target
186+
bv --robot-insights | jq '.status' # Check metric readiness
187+
bv --robot-insights | jq '.Cycles' # Circular deps (must fix!)
188+
bv --robot-label-health | jq '.results.labels[] | select(.health_level == "critical")'
189+
190+
**Performance:** Phase 1 instant, Phase 2 async (500ms timeout). Prefer `--robot-plan` over `--robot-insights` when speed matters. Results cached by data hash.
191+
192+
Use bv instead of parsing beads.jsonl—it computes PageRank, critical paths, cycles, and parallel tracks deterministically.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"private": true,
33
"scripts": {
44
"build": "turbo run build --filter={./packages/*} --filter=@proofkit/docs",
5+
"ci": "turbo run lint && turbo run typecheck && turbo run test",
56
"dev": "turbo run dev",
67
"lint": "turbo run lint",
78
"typecheck": "turbo run typecheck",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ for ((i=1; i<=$1; i++)); do
1313
3. Pick ONE task and run 'bd update <id> --status=in_progress'. \
1414
4. Run 'bd show <id>' to understand the task. \
1515
5. Implement the task. \
16-
6. Run tests and type checks. \
16+
6. Run `pnpm ci` at the root to check tests, linters, and other quality gates. \
1717
7. Run 'bd close <id>'. \
18-
8. Run 'git add . && git commit' with a descriptive message. \
19-
9. Run 'bd sync --from-main'. \
18+
8. Use the graphite CLI to create a new branch with the name of the task and commit the changes. \
19+
9. Run 'bd sync'. \
2020
STOP AFTER ONE TASK.")
2121

2222
echo "$result"

scripts/ralph-once.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ claude --dangerously-skip-permissions "\
55
2. Pick ONE task and run 'bd update <id> --status=in_progress'. \
66
3. Run 'bd show <id>' to understand the task. \
77
4. Implement the task. \
8-
5. Run 'bd close <id>'. \
9-
6. Run 'git add . && git commit' with a descriptive message. \
10-
7. Run 'bd sync --from-main'. \
8+
5. Run `pnpm ci` at the root to check tests, type checks, and other quality gates. \
9+
6. Run 'bd close <id>'. \
10+
7. Use the graphite CLI to create a new branch with the name of the task and commit the changes. \
11+
8. Run 'bd sync --from-main'. \
1112
STOP AFTER ONE TASK."

0 commit comments

Comments
 (0)