belay-harness 0.1.0__tar.gz

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 (168) hide show
  1. belay_harness-0.1.0/.claude/skills/belay-begin/SKILL.md +78 -0
  2. belay_harness-0.1.0/.claude/skills/belay-begin/references/proposals.md +96 -0
  3. belay_harness-0.1.0/.claude/skills/belay-begin-fast/SKILL.md +138 -0
  4. belay_harness-0.1.0/.claude/skills/belay-begin-fast/references/gather-context.md +103 -0
  5. belay_harness-0.1.0/.claude/skills/belay-end/SKILL.md +56 -0
  6. belay_harness-0.1.0/.claude/skills/belay-end-fast/SKILL.md +115 -0
  7. belay_harness-0.1.0/.claude/skills/belay-next/SKILL.md +125 -0
  8. belay_harness-0.1.0/.claude/skills/belay-report/SKILL.md +114 -0
  9. belay_harness-0.1.0/.claude/skills/belay-worktrees/SKILL.md +139 -0
  10. belay_harness-0.1.0/.claude/skills/prd-generator/SKILL.md +155 -0
  11. belay_harness-0.1.0/.claude/skills/prd-interview/SKILL.md +131 -0
  12. belay_harness-0.1.0/.claude/skills/tech-plan/SKILL.md +111 -0
  13. belay_harness-0.1.0/.github/workflows/ci.yml +38 -0
  14. belay_harness-0.1.0/.github/workflows/release.yml +93 -0
  15. belay_harness-0.1.0/.gitignore +25 -0
  16. belay_harness-0.1.0/.python-version +1 -0
  17. belay_harness-0.1.0/CHANGELOG.md +55 -0
  18. belay_harness-0.1.0/CLAUDE.md +228 -0
  19. belay_harness-0.1.0/CONTRIBUTING.md +57 -0
  20. belay_harness-0.1.0/LICENSE +202 -0
  21. belay_harness-0.1.0/PKG-INFO +202 -0
  22. belay_harness-0.1.0/README.md +175 -0
  23. belay_harness-0.1.0/RELEASING.md +70 -0
  24. belay_harness-0.1.0/SECURITY.md +37 -0
  25. belay_harness-0.1.0/VISION.md +89 -0
  26. belay_harness-0.1.0/assets/belay-logo.svg +16 -0
  27. belay_harness-0.1.0/docs/ROADMAP.md +254 -0
  28. belay_harness-0.1.0/docs/planning/_card/issue.md +54 -0
  29. belay_harness-0.1.0/docs/planning/deterministic-replay/prd.md +243 -0
  30. belay_harness-0.1.0/docs/planning/deterministic-replay/replay-engine/plan_20260716.md +140 -0
  31. belay_harness-0.1.0/docs/planning/deterministic-replay/replay-engine/spec.md +51 -0
  32. belay_harness-0.1.0/docs/planning/deterministic-replay/understanding.md +145 -0
  33. belay_harness-0.1.0/docs/planning/failure-corpus/corpus-engine/plan_20260718.md +152 -0
  34. belay_harness-0.1.0/docs/planning/failure-corpus/prd.md +168 -0
  35. belay_harness-0.1.0/docs/planning/failure-corpus/understanding.md +327 -0
  36. belay_harness-0.1.0/docs/planning/invariant-verdict-a1/invariant-engine/plan_20260718.md +124 -0
  37. belay_harness-0.1.0/docs/planning/invariant-verdict-a1/invariant-engine/spec.md +48 -0
  38. belay_harness-0.1.0/docs/planning/invariant-verdict-a1/prd.md +219 -0
  39. belay_harness-0.1.0/docs/planning/invariant-verdict-a1/understanding.md +153 -0
  40. belay_harness-0.1.0/docs/planning/mcp-proxy-capture/prd.md +553 -0
  41. belay_harness-0.1.0/docs/planning/mcp-proxy-capture/stdio-proxy-capture/plan_20260715.md +348 -0
  42. belay_harness-0.1.0/docs/planning/mcp-proxy-capture/stdio-proxy-capture/spec.md +109 -0
  43. belay_harness-0.1.0/docs/planning/mcp-proxy-capture/understanding.md +343 -0
  44. belay_harness-0.1.0/docs/planning/replay-verify-a2/prd.md +259 -0
  45. belay_harness-0.1.0/docs/planning/replay-verify-a2/understanding.md +168 -0
  46. belay_harness-0.1.0/docs/planning/replay-verify-a2/verdict-engine/plan_20260717.md +139 -0
  47. belay_harness-0.1.0/docs/planning/replay-verify-a2/verdict-engine/spec.md +47 -0
  48. belay_harness-0.1.0/docs/planning/sandbox-snapshot-restore/prd.md +305 -0
  49. belay_harness-0.1.0/docs/planning/sandbox-snapshot-restore/seatbelt-sandbox/plan_20260715.md +265 -0
  50. belay_harness-0.1.0/docs/planning/sandbox-snapshot-restore/seatbelt-sandbox/spec.md +61 -0
  51. belay_harness-0.1.0/docs/planning/sandbox-snapshot-restore/spike-loopback.md +157 -0
  52. belay_harness-0.1.0/docs/planning/sandbox-snapshot-restore/understanding.md +341 -0
  53. belay_harness-0.1.0/docs/technical/CAPABILITY_ROADMAP.md +492 -0
  54. belay_harness-0.1.0/docs/technical/THREAT_MODEL.md +420 -0
  55. belay_harness-0.1.0/docs/technical/TRACE_FORMAT.md +639 -0
  56. belay_harness-0.1.0/pyproject.toml +69 -0
  57. belay_harness-0.1.0/src/belay/__init__.py +1 -0
  58. belay_harness-0.1.0/src/belay/annotations.py +258 -0
  59. belay_harness-0.1.0/src/belay/cli.py +1304 -0
  60. belay_harness-0.1.0/src/belay/connection.py +285 -0
  61. belay_harness-0.1.0/src/belay/corpus/__init__.py +14 -0
  62. belay_harness-0.1.0/src/belay/corpus/add.py +183 -0
  63. belay_harness-0.1.0/src/belay/corpus/case.py +195 -0
  64. belay_harness-0.1.0/src/belay/corpus/curate.py +53 -0
  65. belay_harness-0.1.0/src/belay/corpus/metrics.py +174 -0
  66. belay_harness-0.1.0/src/belay/corpus/run.py +279 -0
  67. belay_harness-0.1.0/src/belay/declared.py +54 -0
  68. belay_harness-0.1.0/src/belay/errors.py +151 -0
  69. belay_harness-0.1.0/src/belay/frames.py +47 -0
  70. belay_harness-0.1.0/src/belay/hashing.py +71 -0
  71. belay_harness-0.1.0/src/belay/index.py +200 -0
  72. belay_harness-0.1.0/src/belay/proxy.py +633 -0
  73. belay_harness-0.1.0/src/belay/replay/__init__.py +11 -0
  74. belay_harness-0.1.0/src/belay/replay/client.py +365 -0
  75. belay_harness-0.1.0/src/belay/replay/determinism.py +378 -0
  76. belay_harness-0.1.0/src/belay/replay/engine.py +424 -0
  77. belay_harness-0.1.0/src/belay/replay/persist.py +151 -0
  78. belay_harness-0.1.0/src/belay/replay/reader.py +148 -0
  79. belay_harness-0.1.0/src/belay/replay/report.py +332 -0
  80. belay_harness-0.1.0/src/belay/sandbox/__init__.py +1 -0
  81. belay_harness-0.1.0/src/belay/sandbox/gate.py +474 -0
  82. belay_harness-0.1.0/src/belay/sandbox/launch.py +231 -0
  83. belay_harness-0.1.0/src/belay/sandbox/scope.py +281 -0
  84. belay_harness-0.1.0/src/belay/sandbox/seatbelt.py +417 -0
  85. belay_harness-0.1.0/src/belay/snapshot/__init__.py +1 -0
  86. belay_harness-0.1.0/src/belay/snapshot/bth1.py +449 -0
  87. belay_harness-0.1.0/src/belay/snapshot/clone.py +299 -0
  88. belay_harness-0.1.0/src/belay/snapshot/substrate.py +521 -0
  89. belay_harness-0.1.0/src/belay/trace.py +373 -0
  90. belay_harness-0.1.0/src/belay/verify/__init__.py +6 -0
  91. belay_harness-0.1.0/src/belay/verify/effect.py +449 -0
  92. belay_harness-0.1.0/src/belay/verify/invariants.py +299 -0
  93. belay_harness-0.1.0/src/belay/verify/result.py +246 -0
  94. belay_harness-0.1.0/src/belay/verify/turn.py +221 -0
  95. belay_harness-0.1.0/src/belay/verify/verdict.py +82 -0
  96. belay_harness-0.1.0/tests/conftest.py +91 -0
  97. belay_harness-0.1.0/tests/fixtures/annotation_frames.py +48 -0
  98. belay_harness-0.1.0/tests/fixtures/cheat_test_runner_server.py +130 -0
  99. belay_harness-0.1.0/tests/fixtures/conforming_server.py +107 -0
  100. belay_harness-0.1.0/tests/fixtures/connection_frames.py +51 -0
  101. belay_harness-0.1.0/tests/fixtures/dies_midway_server.py +35 -0
  102. belay_harness-0.1.0/tests/fixtures/duplex_server.py +79 -0
  103. belay_harness-0.1.0/tests/fixtures/error_frames.py +83 -0
  104. belay_harness-0.1.0/tests/fixtures/fake_server.py +79 -0
  105. belay_harness-0.1.0/tests/fixtures/filesystem_server.py +117 -0
  106. belay_harness-0.1.0/tests/fixtures/mutating_server.py +69 -0
  107. belay_harness-0.1.0/tests/fixtures/nondeterministic_server.py +69 -0
  108. belay_harness-0.1.0/tests/fixtures/nonutf8_server.py +43 -0
  109. belay_harness-0.1.0/tests/fixtures/pipelining_server.py +70 -0
  110. belay_harness-0.1.0/tests/fixtures/probe_server.py +130 -0
  111. belay_harness-0.1.0/tests/fixtures/readonly_liar_server.py +105 -0
  112. belay_harness-0.1.0/tests/fixtures/sdk_proxy.py +75 -0
  113. belay_harness-0.1.0/tests/fixtures/torture_tree.py +215 -0
  114. belay_harness-0.1.0/tests/fixtures/weakening_editor_server.py +140 -0
  115. belay_harness-0.1.0/tests/test_annotations.py +272 -0
  116. belay_harness-0.1.0/tests/test_bounded_peek.py +51 -0
  117. belay_harness-0.1.0/tests/test_bth1.py +384 -0
  118. belay_harness-0.1.0/tests/test_capture_shutdown.py +176 -0
  119. belay_harness-0.1.0/tests/test_connection_context.py +179 -0
  120. belay_harness-0.1.0/tests/test_containment.py +684 -0
  121. belay_harness-0.1.0/tests/test_corpus_add.py +516 -0
  122. belay_harness-0.1.0/tests/test_corpus_case.py +125 -0
  123. belay_harness-0.1.0/tests/test_corpus_label.py +203 -0
  124. belay_harness-0.1.0/tests/test_corpus_metrics.py +209 -0
  125. belay_harness-0.1.0/tests/test_corpus_roundtrip.py +250 -0
  126. belay_harness-0.1.0/tests/test_corpus_run.py +329 -0
  127. belay_harness-0.1.0/tests/test_correlation.py +189 -0
  128. belay_harness-0.1.0/tests/test_corrupt_success_case.py +73 -0
  129. belay_harness-0.1.0/tests/test_default_scope.py +457 -0
  130. belay_harness-0.1.0/tests/test_determinism.py +407 -0
  131. belay_harness-0.1.0/tests/test_differential.py +65 -0
  132. belay_harness-0.1.0/tests/test_errors.py +156 -0
  133. belay_harness-0.1.0/tests/test_fixture_guard.py +76 -0
  134. belay_harness-0.1.0/tests/test_import_guard.py +140 -0
  135. belay_harness-0.1.0/tests/test_inferred_invariants.py +166 -0
  136. belay_harness-0.1.0/tests/test_invariant_eval.py +148 -0
  137. belay_harness-0.1.0/tests/test_invariants.py +160 -0
  138. belay_harness-0.1.0/tests/test_launch.py +153 -0
  139. belay_harness-0.1.0/tests/test_launch_demo.py +299 -0
  140. belay_harness-0.1.0/tests/test_persist_relative_tree.py +114 -0
  141. belay_harness-0.1.0/tests/test_proxy_containment.py +348 -0
  142. belay_harness-0.1.0/tests/test_real_client.py +98 -0
  143. belay_harness-0.1.0/tests/test_replay_cli.py +430 -0
  144. belay_harness-0.1.0/tests/test_replay_client.py +264 -0
  145. belay_harness-0.1.0/tests/test_replay_engine.py +479 -0
  146. belay_harness-0.1.0/tests/test_sandbox_check.py +333 -0
  147. belay_harness-0.1.0/tests/test_sbpl_limits.py +103 -0
  148. belay_harness-0.1.0/tests/test_smoke.py +6 -0
  149. belay_harness-0.1.0/tests/test_snapshot.py +183 -0
  150. belay_harness-0.1.0/tests/test_snapshot_mutations.py +487 -0
  151. belay_harness-0.1.0/tests/test_snapshot_persist.py +198 -0
  152. belay_harness-0.1.0/tests/test_substrate.py +410 -0
  153. belay_harness-0.1.0/tests/test_teeth.py +109 -0
  154. belay_harness-0.1.0/tests/test_trace_format.py +265 -0
  155. belay_harness-0.1.0/tests/test_trace_reader.py +210 -0
  156. belay_harness-0.1.0/tests/test_turn_gate.py +803 -0
  157. belay_harness-0.1.0/tests/test_verdict.py +94 -0
  158. belay_harness-0.1.0/tests/test_verify_cli.py +249 -0
  159. belay_harness-0.1.0/tests/test_verify_cli_invariants.py +185 -0
  160. belay_harness-0.1.0/tests/test_verify_effect.py +293 -0
  161. belay_harness-0.1.0/tests/test_verify_network.py +224 -0
  162. belay_harness-0.1.0/tests/test_verify_pass_on_cheat.py +271 -0
  163. belay_harness-0.1.0/tests/test_verify_replays_floor.py +43 -0
  164. belay_harness-0.1.0/tests/test_verify_result.py +377 -0
  165. belay_harness-0.1.0/tests/test_verify_turn.py +341 -0
  166. belay_harness-0.1.0/tests/test_verify_turn_a1.py +198 -0
  167. belay_harness-0.1.0/tests/test_verify_zero_llm.py +166 -0
  168. belay_harness-0.1.0/uv.lock +1271 -0
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: belay-begin
3
+ description: Use when starting work on a Belay unit of work (a GitHub issue id or an inline brief) and you need stakeholder proposals (technical + non-technical PDFs with diagrams) before planning. Triggers on "belay-begin", "bb", "bb bug 12", "bb feat mcp-proxy-capture", "begin full".
4
+ arguments: "type id"
5
+ ---
6
+
7
+ # Belay Begin (Full Track)
8
+
9
+ ## Overview
10
+
11
+ Same pipeline as `belay-begin-fast`, plus a **proposal phase**: after the PRD is approved, produce diagrams and two review PDFs (technical + non-technical) for stakeholders, get approval, then plan.
12
+
13
+ **Invocation:** `bb <type> <id>` — e.g. `bb bug 12`, `bb feat mcp-proxy-capture`.
14
+ Arguments and conventions (type set, `<type>/<id>/aliz` branch, descriptive slug, worktree from `master`, GitHub-issue-or-inline-brief source) are identical to `belay-begin-fast`.
15
+
16
+ The two non-negotiables carry over from `belay-begin-fast`: **always work through the agents team** (every phase, including diagrams and the two proposals), and **implementation is test-first** via `superpowers:test-driven-development`, executed by the agents team.
17
+
18
+ ## Pipeline
19
+
20
+ **REQUIRED SUB-SKILL:** Use `belay-begin-fast` for the base pipeline.
21
+
22
+ Run its **Phase 0 → Phase 4 and the ⛔ PRD review gate exactly as written** (worktree → gather context → deep dig → `prd-interview` → `prd-generator` → stop for PRD approval).
23
+
24
+ **Then, instead of going straight to tech-plan, insert Phase A below. Only after Phase A's approval gate do you run `belay-begin-fast`'s Phase 5 (tech-plan) and Phase 6 (implement — TDD via the agents team).**
25
+
26
+ ### Phase A — Proposals (diagrams → PDFs)
27
+
28
+ Detailed steps, proposal structure, and `md-to-pdf` invocation: see `references/proposals.md`.
29
+
30
+ 1. **Diagram** — Use `excalidraw`. From the approved PRD, draw as many diagrams as the work needs (system/architecture, data flow, sequence, before/after, etc.). Save to `docs/planning/{slug}/diagrams/*.excalidraw`.
31
+ 2. **Export** — Use `excalidraw-to-svg` to render every diagram to `.svg` alongside the source.
32
+ 3. **Write two proposals** (markdown, in `docs/planning/{slug}/proposals/`), embedding the SVGs. Both filenames are prefixed with the type and id so stakeholders can identify the source at a glance:
33
+ - `<type>-<id>-technical-proposal.md` (e.g. `feat-mcp-proxy-capture-technical-proposal.md`) — for engineers: architecture, components, data flow, risks, effort.
34
+ - `<type>-<id>-non-technical-proposal.md` — for stakeholders: problem, value, what changes for users, timeline, plain language.
35
+ Generate the two in parallel (see Agents team).
36
+ 4. **PDF** — Use `md-to-pdf` to produce `<type>-<id>-technical-proposal.pdf` and `<type>-<id>-non-technical-proposal.pdf`.
37
+
38
+ ### ⛔ Approval gate — STOP
39
+
40
+ Present both PDFs. **Wait for the user's explicit approval** of the proposals before planning. Do not auto-advance.
41
+
42
+ ### Final phases — Plan & implement
43
+
44
+ Run `belay-begin-fast`'s **Phase 5 (tech-plan)** → `docs/planning/{slug}/{aspect}/plan_YYYYMMDD.md`, then its **Phase 6 (implement)** — strict TDD (`superpowers:test-driven-development`) executed through the agents team (`superpowers:subagent-driven-development`), one agent per plan task, branch kept green (`uv run pytest`, once the Python core exists).
45
+
46
+ ## Artifact layout (inside the worktree)
47
+
48
+ ```
49
+ docs/planning/
50
+ ├── _card/issue.md ← gh dump or inline brief
51
+ ├── {slug}/prd.md ← PRD (approved at the first gate)
52
+ ├── {slug}/diagrams/*.excalidraw|.svg ← Phase A
53
+ ├── {slug}/proposals/<type>-<id>-technical-proposal.{md,pdf}
54
+ ├── {slug}/proposals/<type>-<id>-non-technical-proposal.{md,pdf}
55
+ └── {slug}/{aspect}/plan_*.md ← tech-plan
56
+ ```
57
+
58
+ ## Agents team (mandatory)
59
+
60
+ Run **every** phase through the agents team — never serially in the main thread.
61
+
62
+ **REQUIRED SUB-SKILL:** Use `superpowers:dispatching-parallel-agents`; use `superpowers:subagent-driven-development` for Phase 6.
63
+
64
+ - Base pipeline: fan out context-gathering across related issues/PRs (as in `belay-begin-fast`).
65
+ - Phase A: generate independent diagrams with parallel agents; write the technical and non-technical proposals concurrently (two agents, same PRD + SVGs).
66
+ - Phase 6: one agent per independent plan task, each in strict TDD.
67
+
68
+ ## Common mistakes
69
+
70
+ | Mistake | Fix |
71
+ |---|---|
72
+ | Writing proposals before the PRD is approved | Phase A starts only after the first ⛔ gate |
73
+ | One proposal for both audiences | Always two: technical and non-technical |
74
+ | Embedding `.excalidraw` instead of `.svg` | PDFs embed the exported SVGs |
75
+ | Skipping the proposal approval gate | Proposals must be approved before tech-plan |
76
+ | Diagrams/PDFs outside the worktree | Everything lives under the worktree's `docs/planning/{slug}/` |
77
+ | Overstating what a verdict proves in a proposal | Say which axis (A1/A2/A3) checks it; `UNVERIFIED` is never drawn as `PASS` |
78
+ | Implementing serially or test-after | Phase 6 is agents-team + strict TDD (RED before GREEN) |
@@ -0,0 +1,96 @@
1
+ # Phase A — Diagrams & proposal PDFs
2
+
3
+ Runs after the PRD approval gate. Everything is written inside the worktree under
4
+ `docs/planning/{slug}/`.
5
+
6
+ ## 1. Diagrams (`excalidraw`)
7
+
8
+ Use the `excalidraw` skill. Decide how many diagrams the work actually needs —
9
+ don't pad. Typical set for Belay:
10
+
11
+ | Diagram | When to include |
12
+ |---|---|
13
+ | System / architecture | Almost always — where the change lives relative to the MCP tool-call proxy that sits between the agent and its MCP servers |
14
+ | Data flow | Data moves across steps (agent → proxy → tool call → captured trace → replay → verdict) |
15
+ | Sequence | A multi-turn interaction matters (capture, then re-execute the call in the sandbox and diff observed vs claimed state) |
16
+ | Before / after | Behavior or structure changes visibly |
17
+ | State machine | A run/turn lifecycle or a verdict transition changes |
18
+
19
+ Save sources to `docs/planning/{slug}/diagrams/`, descriptive names
20
+ (e.g. `architecture.excalidraw`, `replay-flow.excalidraw`).
21
+
22
+ **Every text element must set `fontFamily: 2` (Helvetica)** — the excalidraw default is hand-drawn (Virgil/Excalifont) and unreadable in stakeholder PDFs. See the excalidraw skill's Rule 5.
23
+
24
+ **Diagram the verdict honestly.** If a diagram shows verdicts, keep the four states distinct (`PASS` / `WARN` / `FAIL` / `UNVERIFIED`) and never collapse `UNVERIFIED` into `PASS` for visual tidiness. Where an axis is shown, label which one it is: **A1** invariant (deterministic, sandbox policy), **A2** replay (deterministic, result-equivalence + effect-conformance), **A3** claim re-derivation (LLM writes the check, execution decides; **never emits PASS**).
25
+
26
+ ## 2. Export to SVG (`excalidraw-to-svg`)
27
+
28
+ Use the `excalidraw-to-svg` skill to render every `.excalidraw` to a sibling `.svg`.
29
+ Batch-export the whole `diagrams/` directory. SVG (not PNG) keeps text crisp in the PDF.
30
+
31
+ ## 3. Write the two proposals
32
+
33
+ Markdown, in `docs/planning/{slug}/proposals/`. Embed the SVGs with **relative** paths
34
+ (`../diagrams/architecture.svg`) so `md-to-pdf` inlines them. Generate the two
35
+ concurrently — same PRD + diagrams, different audience.
36
+
37
+ ### `<type>-<id>-technical-proposal.md` (engineers)
38
+
39
+ Filename is prefixed with the type and id (e.g. `feat-mcp-proxy-capture-technical-proposal.md`) so stakeholders can identify which unit of work a proposal belongs to at a glance.
40
+
41
+ - **Summary** — one paragraph: what we're building and why.
42
+ - **Current state** — how it works today (link before/after diagram).
43
+ - **Proposed design** — architecture + components (embed architecture/data-flow/sequence SVGs).
44
+ - **Data & interface changes** — trace format, sandbox boundaries, tool-call/verdict contracts.
45
+ - **Risks & trade-offs** — failure modes, replay-determinism impact, alternatives considered.
46
+ - **Effort & sequencing** — rough phases, dependencies. Reference the capability (`C1`..`C9`) and phase it belongs to.
47
+ - **Open questions** — carried from the PRD.
48
+
49
+ ### `<type>-<id>-non-technical-proposal.md` (stakeholders)
50
+
51
+ Same naming convention (e.g. `feat-mcp-proxy-capture-non-technical-proposal.md`).
52
+
53
+ - **The problem** — in plain language, no jargon.
54
+ - **What we'll do** — the solution at a high level (embed a simplified diagram).
55
+ - **Why it matters** — value to teams running agents unattended.
56
+ - **What changes for users** — visible impact.
57
+ - **Timeline** — rough, in weeks, not story points.
58
+ - **Risks** — stated honestly, in plain terms.
59
+
60
+ Keep the non-technical version free of stack names, code, and acronyms unless defined. Don't claim the harness proves more than it checks: if a step can only reach `UNVERIFIED`, say so in plain words rather than implying it passed.
61
+
62
+ ## 4. Convert to PDF (`md-to-pdf`)
63
+
64
+ Use the `md-to-pdf` skill. On macOS, point Puppeteer at system Chrome. Output lands
65
+ next to the input as `<name>.pdf`.
66
+
67
+ ⚠️ **The proposals embed `../diagrams/*.svg`, which sits ABOVE the `proposals/` folder.**
68
+ md-to-pdf's file server is rooted at the markdown's own directory by default, so `../` paths
69
+ **silently render as broken images**. You MUST pass `--basedir ..` (the `{slug}` dir, which
70
+ contains both `proposals/` and `diagrams/`):
71
+
72
+ ```bash
73
+ cd docs/planning/{slug}/proposals
74
+ PUPPETEER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
75
+ md-to-pdf <type>-<id>-technical-proposal.md --basedir ..
76
+ PUPPETEER_EXECUTABLE_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
77
+ md-to-pdf <type>-<id>-non-technical-proposal.md --basedir ..
78
+ ```
79
+
80
+ Result: `<type>-<id>-technical-proposal.pdf` and `<type>-<id>-non-technical-proposal.pdf`.
81
+
82
+ **Verify before the approval gate (do not skip):** a missing image does NOT fail the command,
83
+ so you must *look* at the output. Render a page to an image and inspect it:
84
+
85
+ ```bash
86
+ pdftoppm -png -r 70 -f 1 -l 1 <type>-<id>-technical-proposal.pdf /tmp/check # then Read /tmp/check-1.png
87
+ ```
88
+
89
+ Both PDFs must exist, be non-trivial in size, and show the diagrams (not broken-image icons).
90
+ If an image is broken, the path escaped the basedir — fix `--basedir`/filenames (URL-encode
91
+ spaces as `%20`) and re-run.
92
+
93
+ ## 5. Approval gate
94
+
95
+ Present both PDFs to the user and **stop**. Only after explicit approval continue to the
96
+ `tech-plan` phase.
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: belay-begin-fast
3
+ description: Use when starting work on a Belay unit of work (a GitHub issue id or an inline brief) and you want the fast path straight to an implementation plan. Triggers on "belay-begin-fast", "bbf", "bbf bug 12", "bbf feat mcp-proxy-capture", "begin fast".
4
+ arguments: "type id"
5
+ ---
6
+
7
+ # Belay Begin (Fast Track)
8
+
9
+ ## Overview
10
+
11
+ Turn a single unit of work into shipped, test-driven code. The fast track is: **isolate → gather → dig → PRD → plan → implement (TDD).** No proposal/diagram deliverables (use `belay-begin` / `bb` when you need those).
12
+
13
+ **Two non-negotiables for this whole pipeline:**
14
+ - **Always work through the agents team.** Every phase with independent units of work is dispatched to agents and synthesized — never done serially in the main thread. See *Agents team (mandatory)*.
15
+ - **Implementation is always test-first**, via `superpowers:test-driven-development`, and is itself executed by the agents team. See Phase 6.
16
+
17
+ **Invocation:** `bbf <type> <id>` — e.g. `bbf bug 12`, `bbf feat mcp-proxy-capture`, `bbf chore pin-uv-version`.
18
+
19
+ - `type` ∈ `bug | feat | feature | task | chore` (normalize `feature` → `feat`).
20
+ - `id` = a **GitHub issue number** when one exists, otherwise a short descriptive **slug** for the work.
21
+ - Owner is `aliz`.
22
+
23
+ ## Task source: GitHub issue, tolerate absence
24
+
25
+ Belay's tracker is GitHub Issues, but the repo/issues may not be reachable (`gh` unauthenticated, Issues disabled, or the work was never filed). The pipeline degrades gracefully:
26
+
27
+ - If `id` is numeric and `gh issue view <id>` succeeds → use it as the source (Phase 1).
28
+ - Otherwise → ask the user for a one-paragraph **inline brief** and treat that as the source. Skip the `gh` fetch; everything else is identical.
29
+
30
+ ## Pipeline
31
+
32
+ Run phases in order. **Do not skip the review gate.** Every phase runs through the agents team, and Phase 6 is strict TDD — never do parallelizable work or implementation serially in the main thread.
33
+
34
+ ### Phase 0 — Isolate in a worktree
35
+
36
+ **REQUIRED SUB-SKILL:** Use `belay-worktrees`.
37
+
38
+ - Branch name: `<type>/<id>/aliz` (e.g. `bug/12/aliz`, `feat/mcp-proxy-capture/aliz`).
39
+ - Worktree dir: `.claude/worktrees/<type>-<id>` (e.g. `.claude/worktrees/bug-12`).
40
+ - Create from `origin/master` — Belay's base branch is **`master`**, never `main`. Belay has no `.worktreeinclude` files to copy today.
41
+ - **Greenfield:** `origin/master` exists (planning docs are pushed), but there is still no `pyproject.toml`, so `uv sync` will fail. Run `uv sync` in the worktree only once the Python core is scaffolded — if your work *is* the scaffolding, the failing test comes first. See `belay-worktrees`.
42
+ - All subsequent work (context dump, PRD, plan) happens **inside this worktree.**
43
+
44
+ ### Phase 1 — Gather context (`gh`, or inline brief)
45
+
46
+ Pull what's available and save a raw dump to `docs/planning/_card/issue.md` in the worktree so later phases (and the PRD) have a single source. (Filename is id-free on purpose — the id lives in the branch/PR; the worktree is already dedicated to one unit of work.)
47
+
48
+ Gather: the issue body, labels, linked/related issues and PRs, and **comments**. If there's no reachable issue, write the user's inline brief into the same file under a "Brief" heading.
49
+
50
+ **Commands and parsing:** see `references/gather-context.md`.
51
+
52
+ ### Phase 2 — Deep dig
53
+
54
+ Before any PRD work, understand the real problem and the code it touches.
55
+
56
+ - Read the saved dump.
57
+ - Map the relevant code paths. Belay is **greenfield** — today only `CLAUDE.md`, `VISION.md`, and `docs/` exist, so for most work the "code paths" are the design docs plus whatever has landed since. Read `docs/technical/CAPABILITY_ROADMAP.md` (the C1..C9 capabilities) and `docs/ROADMAP.md` (the phases) to place the work. Once the engine exists it will live under `src/belay/`; if a `graphify-out/` graph is ever added, query it first per `CLAUDE.md`, then read the files it points to.
58
+ - Produce a short written "understanding" note: what the work is really asking, affected areas, ambiguities, and open questions.
59
+ - Surface contradictions between the issue/brief and the code/docs — flag them, don't paper over them.
60
+ - Honor the strategic constraints in `CLAUDE.md`. The moat is the **sandbox / replay / execution-grounded verification** engine plus the compounding failure corpus — **not** an agent framework, and **not** a bare LLM judge. If the work drifts into Belay authoring or orchestrating the agent, or into scoring by an LLM's opinion instead of by re-execution, flag it before planning.
61
+ - Place the work on the verdict axes: **A1 invariant** (deterministic, sandbox policy), **A2 replay** (deterministic, result-equivalence + effect-conformance), **A3 claim re-derivation** (LLM writes the check, execution decides the verdict; **A3 can never emit PASS**). If the work touches verdicts, say which axis it changes.
62
+
63
+ ### Phase 3 — Requirements interview
64
+
65
+ **REQUIRED SUB-SKILL:** Use `prd-interview`.
66
+
67
+ - Feed it the Phase 1 dump + Phase 2 understanding as the product brief.
68
+ - Answer from the gathered context where you can; ask the user only what the context can't resolve.
69
+ - Confirm a **descriptive** feature slug (kebab-case, e.g. `mcp-proxy-capture`) for `docs/planning/{slug}/`. Do **not** name the slug `<type>-<id>` — the id lives in the branch and PR, not in committed doc paths.
70
+ - Output: `docs/planning/{slug}/prd.md` (+ aspect `spec.md` files if decomposed).
71
+
72
+ ### Phase 4 — Generate & self-critique the PRD
73
+
74
+ **REQUIRED SUB-SKILL:** Use `prd-generator`.
75
+
76
+ - Refine `prd.md`, run its self-critique, and surface the 🔴/🟡 gaps.
77
+
78
+ ### ⛔ Review gate — STOP
79
+
80
+ Present the PRD and its flagged gaps. **Wait for the user's explicit approval** before planning. Do not auto-advance to tech-plan.
81
+
82
+ ### Phase 5 — Implementation plan
83
+
84
+ **REQUIRED SUB-SKILL:** Use `tech-plan`.
85
+
86
+ - Plan one aspect at a time from `prd.md` (+ `spec.md`).
87
+ - Output: `docs/planning/{slug}/{aspect}/plan_YYYYMMDD.md`.
88
+
89
+ ### Phase 6 — Implement (TDD, agents team)
90
+
91
+ Start only after the plan is approved. Implementation is **always test-first** and **always run through the agents team** — never hand-written serially in the main thread.
92
+
93
+ **REQUIRED SUB-SKILL:** Use `superpowers:test-driven-development` — strict RED → GREEN → REFACTOR; no production code before a failing test.
94
+ **REQUIRED SUB-SKILL:** Use `superpowers:subagent-driven-development` to execute the plan — dispatch one agent per independent task from `plan_YYYYMMDD.md`; parallelize independent tasks with `superpowers:dispatching-parallel-agents`.
95
+
96
+ - Each dispatched agent owns one task and follows the TDD cycle inside it: write the failing test, make it pass, refactor.
97
+ - Run the suite after each task and keep the branch green: `uv run pytest` for the Python core; the dashboard's test/build commands for UI work once it exists. If the suite doesn't exist yet, the first task's failing test creates it.
98
+ - Commit per task on the `<type>/<id>/aliz` branch (id lives in the commit/PR, never in code).
99
+ - You stay the integrator: sequence dependent tasks, synthesize agent results, and surface blockers at each checkpoint.
100
+
101
+ ## Artifact layout (inside the worktree)
102
+
103
+ ```
104
+ docs/planning/
105
+ ├── _card/issue.md ← gh dump or inline brief (Phase 1)
106
+ ├── {slug}/prd.md ← prd-interview / prd-generator
107
+ └── {slug}/{aspect}/plan_*.md ← tech-plan
108
+ ```
109
+
110
+ Phase 6 produces **code commits** on the `<type>/<id>/aliz` branch — not documents.
111
+
112
+ ## Agents team (mandatory)
113
+
114
+ This pipeline is **always** run through a team of agents, never serially in the main thread. For each phase, dispatch agents for the independent units of work and synthesize their results yourself.
115
+
116
+ **REQUIRED SUB-SKILL:** Use `superpowers:dispatching-parallel-agents` for independent work, and `superpowers:subagent-driven-development` for executing plan tasks in Phase 6.
117
+
118
+ - **Phase 1–2:** one agent per related issue/PR (5-line summary + relevance) + one agent to map the affected area (the roadmap docs today; `src/belay/` once it exists). Keep the `gh` calls themselves batched in a single message.
119
+ - **Phase 6:** one agent per independent plan task; each agent works in strict TDD.
120
+
121
+ Gates, user-facing summaries, and integration stay with you — the agents do the fan-out work.
122
+
123
+ ## Common mistakes
124
+
125
+ | Mistake | Fix |
126
+ |---|---|
127
+ | Working in the primary checkout | Always create the Phase 0 worktree first |
128
+ | Branching from `main` | Belay's base branch is `master`; `main` doesn't exist |
129
+ | Slug = `bug-12` | Use a descriptive slug; the id stays in branch/PR |
130
+ | Treating a `gh` failure as fatal | Fall back to an inline brief, keep going |
131
+ | Treating a missing `pyproject.toml` / `origin/master` as fatal | Belay is greenfield — see `belay-worktrees` for both fallbacks |
132
+ | Skipping the review gate | PRD must be approved before tech-plan |
133
+ | Building an agent framework (Belay authoring/orchestrating the agent) | Stop and flag — that's the crowded layer we wrap, not the moat |
134
+ | Verdicts from an LLM's opinion instead of re-execution | Stop and flag — verification is execution-grounded; A3 can never emit PASS |
135
+ | Rendering `UNVERIFIED` as `PASS` | Never — the verdict contract is honest by design |
136
+ | Inventing requirements the issue doesn't support | Flag as open question in the PRD instead |
137
+ | Implementing serially in the main thread | Execute the plan through the agents team (subagent-driven-development) |
138
+ | Writing code before a failing test | Implementation is strict TDD — RED before GREEN, always |
@@ -0,0 +1,103 @@
1
+ # Gathering context with `gh` (tolerate absence)
2
+
3
+ Goal: dump the issue, its linked issues/PRs, and comments into
4
+ `docs/planning/_card/issue.md` inside the worktree. If nothing is reachable,
5
+ fall back to an inline brief from the user.
6
+
7
+ ## Prerequisites
8
+
9
+ - GitHub CLI authenticated: `gh auth status`. If it errors, you're not logged in.
10
+ - Repo: `haqaliz/belay`. The current checkout's `origin` is this repo, so `gh`
11
+ commands run from the worktree pick it up automatically.
12
+ - **Greenfield note:** the repo has no pushed commits yet, so Issues may be empty
13
+ or disabled. A `FALLBACK` result below is the expected case today, not a bug.
14
+
15
+ ## 0. Reachability probe
16
+
17
+ ```bash
18
+ gh issue view "$ID" --json number,title >/dev/null 2>&1 && echo OK || echo FALLBACK
19
+ ```
20
+
21
+ - `OK` → continue with the `gh` path below.
22
+ - `FALLBACK` (issue missing, Issues disabled, repo unresolved, or `ID` is a slug)
23
+ → ask the user for a one-paragraph brief and write it to the dump under a
24
+ **Brief** heading. Skip the rest of this file.
25
+
26
+ ## 1. The issue itself
27
+
28
+ ```bash
29
+ gh issue view "$ID" --json number,title,state,labels,author,body,url,assignees,milestone
30
+ ```
31
+
32
+ `body` is Markdown already — no tag-stripping needed.
33
+
34
+ ## 2. Linked / related issues and PRs
35
+
36
+ Cross-references and the timeline expose linked items:
37
+
38
+ ```bash
39
+ # Comments + events, including cross-references to other issues/PRs
40
+ gh issue view "$ID" --json number,title -q .number >/dev/null
41
+ gh api "repos/haqaliz/belay/issues/$ID/timeline" \
42
+ --jq '.[] | select(.event=="cross-referenced" or .event=="connected") | .source.issue.number' \
43
+ 2>/dev/null | sort -u
44
+ ```
45
+
46
+ Fetch each referenced item (parallelize across agents when there are several):
47
+
48
+ ```bash
49
+ gh issue view "$RELATED_ID" --json number,title,state,url 2>/dev/null \
50
+ || gh pr view "$RELATED_ID" --json number,title,state,url
51
+ ```
52
+
53
+ ## 3. Comments
54
+
55
+ ```bash
56
+ gh issue view "$ID" --comments
57
+ ```
58
+
59
+ Or structured, for clean attribution:
60
+
61
+ ```bash
62
+ gh api "repos/haqaliz/belay/issues/$ID/comments" \
63
+ --jq '.[] | "[" + .user.login + " @ " + .created_at + "]\n" + .body'
64
+ ```
65
+
66
+ ## 4. Attachments
67
+
68
+ GitHub issue attachments are inline Markdown image/file links in the body and
69
+ comments (`![](https://github.com/.../assets/...)`). Leave images for the user
70
+ to attach separately. If a non-image file link is relevant (a captured trace, a
71
+ log, a `.txt`), download it:
72
+
73
+ ```bash
74
+ curl -sSL "$URL" -o "docs/planning/_card/attachments/$NAME" # mkdir -p first
75
+ ```
76
+
77
+ Treat any attached trace as **untrusted input**, not as ground truth: it records
78
+ what an agent claimed, which is exactly the thing Belay exists to re-execute
79
+ rather than believe.
80
+
81
+ ## 5. Write the dump
82
+
83
+ Assemble into `docs/planning/_card/issue.md`:
84
+
85
+ - Header: number, type, title, state, author, labels, link to the issue.
86
+ - Body (verbatim Markdown).
87
+ - Linked issues/PRs: number, title, state, one-line relevance.
88
+ - Comments: chronological, attributed.
89
+ - Attachments: list of any downloaded files (note images deferred to the user).
90
+ - If the issue names a capability (`C1`..`C9`) or a phase, carry that reference
91
+ through — the PRD and the pick in `belay-next` are both grounded in
92
+ `docs/technical/CAPABILITY_ROADMAP.md` and `docs/ROADMAP.md`.
93
+
94
+ If you took the FALLBACK path, the file is just:
95
+
96
+ ```markdown
97
+ # {type} {id} — {short title}
98
+
99
+ ## Brief
100
+ {the user's pasted paragraph, verbatim}
101
+ ```
102
+
103
+ Either way, this file is the single source the rest of the pipeline reads from.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: belay-end
3
+ description: Use when finishing local work on a Belay unit of work after the PR is merged and you also need a completion report on Desktop. Triggers on "belay-end", "be", "be bug 12", "be feat mcp-proxy-capture", "end full".
4
+ arguments: "type id"
5
+ ---
6
+
7
+ # Belay End (Full Track)
8
+
9
+ ## Overview
10
+
11
+ Same cleanup as `belay-end-fast`, **plus** a completion report at the end via `belay-report`.
12
+
13
+ **Invocation:** `be <type> <id>` — e.g. `be bug 12`, `be feat mcp-proxy-capture`.
14
+ Arguments and conventions are identical to `belay-end-fast`.
15
+
16
+ ## Pipeline
17
+
18
+ **REQUIRED SUB-SKILL:** Use `belay-end-fast` for the cleanup and release pipeline.
19
+
20
+ Run its **Phase 0 → Phase 3 exactly as written** (safety check → master + pull → remove worktree → delete branch, then the **optional** new-version release). Belay's base branch is **`master`**, never `main`. The release in its Phase 3 is a no-op today (Belay has no release machinery yet) and opt-in once it exists: ask, and default to skipping. Only proceed to the report once cleanup verification passes.
21
+
22
+ ### Phase 4 — Completion report
23
+
24
+ **REQUIRED SUB-SKILL:** Use `belay-report` with the unit-of-work id and the corresponding type.
25
+
26
+ The two skills use slightly different type vocabularies — map before invoking:
27
+
28
+ | `be` arg | `belay-report` arg |
29
+ |---|---|
30
+ | `bug` | `bug` |
31
+ | `task` | `task` |
32
+ | `chore` | `task` |
33
+ | `feat` | `feature` |
34
+ | `feature` | `feature` |
35
+
36
+ Example: `be bug 12` → invoke `belay-report` with `bug` + `12` → writes `/Users/aliz/Desktop/bug-12-completion.md`.
37
+
38
+ `belay-report` fetches the issue via `gh` when reachable (otherwise works from the merged PR / what we just did) and produces the standard template. If it asks for a screenshot/video, provide one (or hand it to the user to attach), then confirm the file landed on Desktop.
39
+
40
+ ### Phase 5 — Comment on the issue (optional)
41
+
42
+ Same approach as `belay-end-fast` Phase 4 — ask the user, draft (using the issue + the just-generated report as source material), confirm, then `gh issue comment <id>`. Skip if there's no reachable issue.
43
+
44
+ The comment can mirror the report's plain-English summary in a sentence or two. Same tone rules: no em dashes, no jargon, no commit hashes. Skip entirely if the user declines.
45
+
46
+ ## Common mistakes
47
+
48
+ | Mistake | Fix |
49
+ |---|---|
50
+ | Running the report before cleanup | Phases 0–2 first; the report is last |
51
+ | Skipping the report on purpose | Use `belay-end-fast` / `bef` instead |
52
+ | Passing the wrong type to `belay-report` | Apply the mapping table (`feat`/`feature` → `feature`, `chore` → `task`) |
53
+ | Posting the issue comment before the report | The comment (Phase 5) comes after the report (Phase 4); the report's plain-English summary is good source material |
54
+ | Cleaning up against `main` | Belay's base branch is `master` |
55
+ | Auto-releasing during end | The release is `belay-end-fast` Phase 3: a no-op today, opt-in later, and it belongs to haqaliz not playdolphia |
56
+ | Posting the comment without confirmation | Draft first, confirm with the user, then post |
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: belay-end-fast
3
+ description: Use when finishing local work on a Belay unit of work after the PR is merged and you want to clean up without generating a completion report. Triggers on "belay-end-fast", "bef", "bef bug 12", "bef feat mcp-proxy-capture", "end fast".
4
+ arguments: "type id"
5
+ ---
6
+
7
+ # Belay End (Fast Track)
8
+
9
+ ## Overview
10
+
11
+ Closes out a unit of work's local state after the PR has merged: **master → pull → remove worktree → delete branch**, with an **optional new-version release**. No report (use `belay-end` / `be` for that).
12
+
13
+ **Invocation:** `bef <type> <id>` — e.g. `bef bug 12`, `bef feat mcp-proxy-capture`.
14
+
15
+ - `type` ∈ `bug | feat | feature | task | chore` (normalize `feature` → `feat`)
16
+ - `id` = the GitHub issue number, or the slug used at begin time
17
+ - Owner is `aliz`
18
+ - Branch: `<type>/<id>/aliz`; worktree dir: `.claude/worktrees/<type>-<id>`
19
+
20
+ Belay is a single repo, so this runs once. The base branch is **`master`**, never `main`.
21
+
22
+ ## Pipeline
23
+
24
+ ### Phase 0 — Safety check
25
+
26
+ Before removing anything:
27
+
28
+ - **Worktree clean?** `git -C <worktree> status --porcelain` must be empty. If not, stop — commit or stash first.
29
+ - **Branch merged?** Confirm the PR is merged (`gh pr view <PR> --json state,mergedAt` if reachable). `git branch -d` will refuse an unmerged branch on purpose; do not bypass with `-D` without explicit user OK.
30
+ - **You may be inside the worktree being removed.** Resolve the primary checkout first (Phase 1) and run all commands from there.
31
+
32
+ ### Phase 1 — Master, pulled
33
+
34
+ Resolve the **primary** checkout (not the worktree). The first line of `git worktree list` is the primary:
35
+
36
+ ```bash
37
+ PRIMARY=$(git worktree list | head -1 | awk '{print $1}')
38
+ ```
39
+
40
+ Switch and pull, fast-forward only:
41
+
42
+ ```bash
43
+ git -C "$PRIMARY" checkout master
44
+ git -C "$PRIMARY" pull --ff-only origin master
45
+ ```
46
+
47
+ ### Phase 2 — Remove worktree, delete branch
48
+
49
+ ```bash
50
+ WORKTREE_NAME="<type>-<id>" # e.g. bug-12, feat-mcp-proxy-capture
51
+ BRANCH="<type>/<id>/aliz" # e.g. bug/12/aliz, feat/mcp-proxy-capture/aliz
52
+
53
+ git -C "$PRIMARY" worktree remove ".claude/worktrees/$WORKTREE_NAME"
54
+ git -C "$PRIMARY" branch -d "$BRANCH"
55
+ ```
56
+
57
+ If `worktree remove` refuses due to uncommitted/untracked files, go back to Phase 0 — don't pass `--force` silently.
58
+
59
+ If `branch -d` refuses because the branch isn't merged into master, surface the message — the PR may not be merged, or there are unpushed commits. Don't use `-D` silently.
60
+
61
+ After both succeed, verify:
62
+
63
+ ```bash
64
+ git -C "$PRIMARY" worktree list # the worktree should be gone
65
+ git -C "$PRIMARY" branch --list "$BRANCH" # should print nothing
66
+ ```
67
+
68
+ ### Phase 3 — Release a new version (optional)
69
+
70
+ ⚠️ **Belay has no release machinery today.** There is no `pyproject.toml`, no `CHANGELOG.md`, no `RELEASING.md`, no release workflow, and no publish channel (no PyPI package, no container image, no tap). **Until those exist, this phase is a no-op: say so and go to Phase 4.** Do not invent a release process, do not hand-craft a tag as a substitute, and do not `gh release create` by hand.
71
+
72
+ Once release machinery lands, `RELEASING.md` becomes the source of truth and this phase follows it from the **primary** checkout on `master` (the merged work is already there after Phase 1). The rules that will apply then, stated now so they aren't lost:
73
+
74
+ - **Opt-in, default to skipping.** Most units of work do not release on their own (fixes batch into a later version). Ask: *"Cut and publish a new version for this, or batch it for later?"* Default to **skipping**.
75
+ - **Release identity, do not get this wrong:** the release belongs to the **haqaliz** account (`git@github.com:haqaliz/belay.git`), never `playdolphia`. Any manual asset upload must run with `gh` active as haqaliz (`gh auth switch --user haqaliz`).
76
+ - **Version from the work type:** `feat` → minor, `bug`/`chore`/`task` → patch. Confirm the exact `vX.Y.Z` with the user.
77
+ - **Verify each channel is live before calling it done.** Report which channels published and surface any job that failed; never claim a channel shipped without checking it. This is the same honesty rule the product enforces — an unchecked channel is `UNVERIFIED`, not `PASS`.
78
+
79
+ ### Phase 4 — Comment on the issue (optional)
80
+
81
+ Optional, and only if there's a reachable GitHub issue. Ask first: *"Want me to post a short comment on the issue explaining what we did?"* If the user declines, there's nothing meaningful to say, or there's no issue (the work came from an inline brief), skip.
82
+
83
+ Otherwise:
84
+
85
+ 1. **Draft a short note** (2–4 sentences). Sources, in order of preference:
86
+ - What the user tells you to say.
87
+ - The merged PR's title + description (`gh pr view <PR>`), if accessible.
88
+ - A best-effort summary from the issue title and the change verb.
89
+
90
+ Keep it friendly, light on jargon, no em dashes, no commit hashes, no file paths. The change verb matches the type: `bug → fixed`, `task → done`, `feat`/`feature → shipped`, `chore → done`. Example: *"Shipped the tool call recorder. Every call an agent makes through the proxy is now captured exactly, so a run can be replayed later instead of taken on trust. Let me know if anything looks off."*
91
+
92
+ 2. **Confirm the draft** with the user before posting.
93
+
94
+ 3. **Post it** via `gh`:
95
+
96
+ ```bash
97
+ gh issue comment "$ID" --body "<confirmed comment text>"
98
+ ```
99
+
100
+ On success `gh` prints the comment URL. Tell the user it landed. If `gh` errors (not authenticated, Issues disabled), surface it and stop — don't retry blindly.
101
+
102
+ ## Common mistakes
103
+
104
+ | Mistake | Fix |
105
+ |---|---|
106
+ | Running from inside the worktree being removed | Resolve `PRIMARY` first, run commands from there |
107
+ | Checking out / pulling `main` | Belay's base branch is `master`; `main` doesn't exist |
108
+ | Using `git pull` (allowing merge) | Use `--ff-only` |
109
+ | Forcing branch delete with `-D` | Only after explicit user OK — `-d` refuses unmerged for a reason |
110
+ | Forcing worktree remove with `--force` | Same — never silently discard uncommitted work |
111
+ | Worktree dir vs branch confusion | Worktree dir is `<type>-<id>` (e.g. `bug-12`); branch is `<type>/<id>/aliz` |
112
+ | Posting the issue comment without confirmation | Draft first, show the user, only post after explicit OK |
113
+ | Trying to comment when the work has no issue | Skip Phase 4 — it came from an inline brief |
114
+ | Inventing a release process because Phase 3 exists | Belay has no release machinery yet; the phase is a no-op until `RELEASING.md` does |
115
+ | Cutting a future release as `playdolphia` | The release is haqaliz's; switch with `gh auth switch --user haqaliz` |