@openrig/cli 0.4.7 → 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 (149) hide show
  1. package/daemon/assets/plugins/openrig-core/skills/applying-a-permission-policy/SKILL.md +120 -0
  2. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +0 -0
  3. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +0 -0
  4. package/daemon/assets/plugins/openrig-core/skills/delegating-work/SKILL.md +43 -0
  5. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +2 -0
  6. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +4 -7
  7. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +50 -57
  8. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +16 -2
  9. package/daemon/dist/adapters/claude-code-adapter.d.ts +0 -9
  10. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  11. package/daemon/dist/adapters/claude-code-adapter.js +13 -46
  12. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  13. package/daemon/dist/adapters/claude-resume.d.ts +1 -1
  14. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  15. package/daemon/dist/adapters/claude-resume.js +8 -2
  16. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  17. package/daemon/dist/adapters/codex-resume.d.ts +1 -1
  18. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  19. package/daemon/dist/adapters/codex-resume.js +4 -2
  20. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  21. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  22. package/daemon/dist/adapters/codex-runtime-adapter.js +10 -5
  23. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  24. package/daemon/dist/adapters/pi-resume.d.ts +1 -1
  25. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  26. package/daemon/dist/adapters/pi-resume.js +7 -2
  27. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  28. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  29. package/daemon/dist/adapters/pi-runtime-adapter.js +4 -1
  30. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  31. package/daemon/dist/adapters/yolo-mode.d.ts +23 -0
  32. package/daemon/dist/adapters/yolo-mode.d.ts.map +1 -0
  33. package/daemon/dist/adapters/yolo-mode.js +49 -0
  34. package/daemon/dist/adapters/yolo-mode.js.map +1 -0
  35. package/daemon/dist/build-info.js +3 -3
  36. package/daemon/dist/db/migrations/055_node_permission_policy.d.ts +13 -0
  37. package/daemon/dist/db/migrations/055_node_permission_policy.d.ts.map +1 -0
  38. package/daemon/dist/db/migrations/055_node_permission_policy.js +17 -0
  39. package/daemon/dist/db/migrations/055_node_permission_policy.js.map +1 -0
  40. package/daemon/dist/db/migrations/056_rig_permission_policy.d.ts +13 -0
  41. package/daemon/dist/db/migrations/056_rig_permission_policy.d.ts.map +1 -0
  42. package/daemon/dist/db/migrations/056_rig_permission_policy.js +17 -0
  43. package/daemon/dist/db/migrations/056_rig_permission_policy.js.map +1 -0
  44. package/daemon/dist/db/migrations/057_node_policy_provenance.d.ts +19 -0
  45. package/daemon/dist/db/migrations/057_node_policy_provenance.d.ts.map +1 -0
  46. package/daemon/dist/db/migrations/057_node_policy_provenance.js +26 -0
  47. package/daemon/dist/db/migrations/057_node_policy_provenance.js.map +1 -0
  48. package/daemon/dist/db/migrations/058_rig_policy_provenance.d.ts +15 -0
  49. package/daemon/dist/db/migrations/058_rig_policy_provenance.d.ts.map +1 -0
  50. package/daemon/dist/db/migrations/058_rig_policy_provenance.js +22 -0
  51. package/daemon/dist/db/migrations/058_rig_policy_provenance.js.map +1 -0
  52. package/daemon/dist/domain/builtin-policy-reference.d.ts +13 -0
  53. package/daemon/dist/domain/builtin-policy-reference.d.ts.map +1 -0
  54. package/daemon/dist/domain/builtin-policy-reference.js +58 -0
  55. package/daemon/dist/domain/builtin-policy-reference.js.map +1 -0
  56. package/daemon/dist/domain/native-resume-probe.d.ts +1 -1
  57. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  58. package/daemon/dist/domain/native-resume-probe.js +11 -4
  59. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  60. package/daemon/dist/domain/node-inventory.js +2 -2
  61. package/daemon/dist/domain/node-inventory.js.map +1 -1
  62. package/daemon/dist/domain/permission-policy/policy-ref.d.ts +89 -0
  63. package/daemon/dist/domain/permission-policy/policy-ref.d.ts.map +1 -0
  64. package/daemon/dist/domain/permission-policy/policy-ref.js +171 -0
  65. package/daemon/dist/domain/permission-policy/policy-ref.js.map +1 -0
  66. package/daemon/dist/domain/permission-policy/policy-spec.d.ts +34 -0
  67. package/daemon/dist/domain/permission-policy/policy-spec.d.ts.map +1 -0
  68. package/daemon/dist/domain/permission-policy/policy-spec.js +106 -0
  69. package/daemon/dist/domain/permission-policy/policy-spec.js.map +1 -0
  70. package/daemon/dist/domain/restore-orchestrator.d.ts +14 -0
  71. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  72. package/daemon/dist/domain/restore-orchestrator.js +90 -6
  73. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  74. package/daemon/dist/domain/rig-expansion-service.d.ts.map +1 -1
  75. package/daemon/dist/domain/rig-expansion-service.js +10 -1
  76. package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
  77. package/daemon/dist/domain/rig-repository.d.ts +45 -0
  78. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  79. package/daemon/dist/domain/rig-repository.js +75 -1
  80. package/daemon/dist/domain/rig-repository.js.map +1 -1
  81. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  82. package/daemon/dist/domain/rigspec-codec.js +6 -0
  83. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  84. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  85. package/daemon/dist/domain/rigspec-exporter.js +8 -0
  86. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  87. package/daemon/dist/domain/rigspec-instantiator.d.ts +18 -1
  88. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  89. package/daemon/dist/domain/rigspec-instantiator.js +187 -8
  90. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  91. package/daemon/dist/domain/rigspec-preflight.d.ts +11 -0
  92. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  93. package/daemon/dist/domain/rigspec-preflight.js +35 -1
  94. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  95. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  96. package/daemon/dist/domain/rigspec-schema.js +25 -0
  97. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  98. package/daemon/dist/domain/runtime-adapter.d.ts +5 -0
  99. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  100. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  101. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  102. package/daemon/dist/domain/seat-handover-service.js +7 -1
  103. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  104. package/daemon/dist/domain/successor-session-launcher.d.ts +4 -0
  105. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  106. package/daemon/dist/domain/successor-session-launcher.js +2 -0
  107. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  108. package/daemon/dist/domain/types.d.ts +17 -0
  109. package/daemon/dist/domain/types.d.ts.map +1 -1
  110. package/daemon/dist/domain/types.js.map +1 -1
  111. package/daemon/dist/routes/agent-images.d.ts.map +1 -1
  112. package/daemon/dist/routes/agent-images.js +2 -0
  113. package/daemon/dist/routes/agent-images.js.map +1 -1
  114. package/daemon/dist/routes/rigs.js +8 -0
  115. package/daemon/dist/routes/rigs.js.map +1 -1
  116. package/daemon/dist/startup.d.ts.map +1 -1
  117. package/daemon/dist/startup.js +17 -1
  118. package/daemon/dist/startup.js.map +1 -1
  119. package/daemon/docs/reference/rig-spec.md +19 -0
  120. package/daemon/policies/builtin/locked.policy.md +24 -0
  121. package/daemon/policies/builtin/open.policy.md +24 -0
  122. package/daemon/policies/builtin/standard.policy.md +25 -0
  123. package/daemon/policies/builtin/yolo.policy.md +20 -0
  124. package/daemon/policies/examples/my-cautious-dev.policy.md +40 -0
  125. package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +1 -20
  126. package/daemon/specs/agents/shared/skills/core/openrig-architect/SKILL.md +0 -2
  127. package/daemon/specs/agents/shared/skills/process/systematic-debugging/find-polluter.sh +0 -0
  128. package/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md +1 -0
  129. package/dist/build-info.js +3 -3
  130. package/dist/commands/setup.d.ts +14 -0
  131. package/dist/commands/setup.d.ts.map +1 -1
  132. package/dist/commands/setup.js +131 -8
  133. package/dist/commands/setup.js.map +1 -1
  134. package/package.json +1 -1
  135. package/daemon/specs/agents/shared/skills/pm/backlog-capture/SKILL.md +0 -43
  136. package/daemon/specs/agents/shared/skills/pm/context-builder/SKILL.md +0 -87
  137. package/daemon/specs/agents/shared/skills/pm/exec-summary/SKILL.md +0 -84
  138. package/daemon/specs/agents/shared/skills/pm/office-hours/SKILL.md +0 -129
  139. package/daemon/specs/agents/shared/skills/pm/plan-review/SKILL.md +0 -98
  140. package/daemon/specs/agents/shared/skills/pm/requirements-writer/SKILL.md +0 -113
  141. package/daemon/specs/agents/shared/skills/pm/ui-mockup/SKILL.md +0 -76
  142. package/daemon/specs/agents/shared/skills/pods/development-team/SKILL.md +0 -148
  143. package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +0 -266
  144. package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +0 -213
  145. package/daemon/specs/agents/shared/skills/process/systematic-debugging/CREATION-LOG.md +0 -119
  146. package/daemon/specs/agents/shared/skills/process/systematic-debugging/test-academic.md +0 -14
  147. package/daemon/specs/agents/shared/skills/process/systematic-debugging/test-pressure-1.md +0 -58
  148. package/daemon/specs/agents/shared/skills/process/systematic-debugging/test-pressure-2.md +0 -68
  149. package/daemon/specs/agents/shared/skills/process/systematic-debugging/test-pressure-3.md +0 -69
@@ -1,266 +0,0 @@
1
- ---
2
- name: orchestration-team
3
- description: Operating manual for the orchestration pod. Covers lead vs peer roles, monitoring with rig commands, permission handling, implementation pair gating, dogfood loops, review routing, agent behavioral models, intervention discipline, and communication culture.
4
- ---
5
-
6
- # Orchestration Team
7
-
8
- You are part of the orchestration pod. Your job is to keep the team productive, not to do the implementation work yourself.
9
-
10
- ## Startup sequence
11
-
12
- Before you summarize the rig or assign real work:
13
- 1. Load `using-superpowers`, `openrig-user`, `orchestration-team`, `systematic-debugging`, and `verification-before-completion`.
14
- 2. Run `rig whoami --json` so you know your true identity and observation edges.
15
- 3. Run `rig ps --nodes --json` and wait for the expected starter topology to settle.
16
- 4. Check recent chatroom history or direct startup messages so you know who is actually online and what they already reported.
17
- 5. Only then announce readiness or assign work.
18
-
19
- Do not improvise a team model from the first partial snapshot you happen to see.
20
-
21
- ## Pod responsibilities
22
-
23
- The orchestration pod is responsible for:
24
- - receiving direction from the human
25
- - breaking work into clear assignments
26
- - dispatching implementation, design, QA, and review work
27
- - watching for idle agents, blocked agents, and coordination gaps
28
-
29
- ## Monitoring & intervention — keep the RIG self-running, not the ORCHESTRATOR busy
30
-
31
- **North star:** your goal is a **self-running rig, not a busy orchestrator.** Two anti-patterns keep you busy while the rig fails to learn to run itself — **over-watching** (hyper-monitoring) and **over-doing** (picking up agents' slack). Both are governed by judgment below, not by a rule for every case. (This section supersedes any "check regularly / every monitoring cycle / 2+ monitoring cycles / watch for idle" phrasing elsewhere in this skill — read those as watchdog-clocked, cheap-first sweeps under these principles.)
32
-
33
- ### A. Monitoring intensity — proportional to stakes, bounded to the window
34
- **Principle:** monitoring intensity tracks **stakes × how likely you are to need to intervene, bounded to the window where that's true.** Spend tight attention only where it changes what you do, only as long as the risk lasts, then return to default. (Same evidence-not-cadence rule the `watchdog` skill applies to intervention *level*, applied to *intensity*.) **Self-test: "Can I name the stakes AND the condition that ends this close-watch?"** If not, you're hyper-monitoring.
35
-
36
- **Default (almost always) — token-efficient.** Steady-state your job is the **idle-without-handoff exception**: the queue handles normal handoff; you catch the agent who finished + went idle without closing/handing off.
37
- - **Status lives in the queue, not panes** (`status-not-chat-orchestrator`): `rig ps --nodes --json` + `rig queue` are your status source; do NOT reconstruct fleet-state by capturing panes (pane `rig capture` is high-bandwidth *within your own pod* — that's fine; it is not how you track cross-pod/fleet state).
38
- - **The watchdog is your clock** (`watchdog`): configure `rig watchdog` to wake you (~3 min); between wakes, idle (zero tokens) — no self-run sleep-loop re-reading panes at steady-state. Prefer one workflow-watchdog + targeted exception handling over many per-seat nag loops.
39
- - **On each wake — cheap sweep:** `rig queue` + a *filtered* `rig ps` (see "Read cheap" below) first; ONLY for a seat that looks idle/suspicious, `rig capture <session>` last few lines (never a full pane, never huge chunks); **active owner → no-op.**
40
- - **Read cheap — every status command has a token cost; project to the question.** The queue-first rule is about *where* status lives; this is about *how much you pay to read it*. The token bomb is the broad unfiltered dump, not the pane capture: an unfiltered fleet-wide `rig ps --nodes --json` emits ~77k tokens — for a one-rig or one-qitem question that is almost all waste, and at watchdog cadence it burns the shared account fast.
41
- - **Scope the read to the question.** Specific item → `rig queue show <qitem> --json`. One rig's frontier → filter + project only the fields you need, e.g. `rig ps --nodes --json | jq '.[] | select(.rigName=="<rig>") | {session:.canonicalSessionName, state:.agentActivity.state, hasAssignedWork, pendingWorkCount}'` (prefer a native rig/session filter if one exists). Never pull whole-fleet JSON to answer a narrow rig/qitem question.
42
- - **Pane capture / transcript = last resort for one named stale owner,** not a status-polling loop.
43
- - **Context reads are task-scoped too:** read the skills the task needs; don't reload broad references or large files for a tiny queue update (compaction / named-skill rules excepted).
44
- - **Notice-and-stop:** if any command emits unexpectedly huge output, that is a protocol miss — name it and correct the pattern immediately, don't absorb it as normal.
45
- - **Self-test:** "Does this read return more than the decision in front of me needs?" If yes, narrow it before running.
46
- - **A watchdog turn is small:** tiny queue/frontier check → make exactly the needed durable transition or wake → park. Not a fleet-wide scan per wake.
47
-
48
- **Close-monitoring — legitimate exception, deliberate + BOUNDED.** Some moments warrant tight/continuous attention — a seat doing something high-stakes, novel, or fragile where you may need to feed context, hand-hold, or intervene fast; a delicate gate; a recovery in flight. Switch in **on purpose** on a nameable trigger; **exit the instant the condition clears** (time- *and* event-bounded); don't let it bleed into steady-state. Worked example: close through compaction-recovery / QA-runtime-proof / merge-gate; back off to queue+watchdog once the owner is active + the qitem in-progress. The anti-pattern is not tight monitoring — it's **unbounded** tight monitoring (an ambient sleep-loop with no nameable end-condition). That is what burns the shared account.
49
-
50
- ### B. Intervention — correct + re-teach, don't silently substitute
51
- When you DO catch a dropped potato, your default is to **teach the agent the protocol, not do it for them.** Agents load the hot-potato / queue-handoff protocol and are supposed to hand off on their own; you are the **belt-and-suspenders** for when one doesn't (skill not loaded, fell out of context, or just got it wrong).
52
- - **Default = correction:** name what happened + what to do — e.g. "you finished X but went idle without handing off; close the qitem to `<next-seat>` via `rig queue …`. On finishing you queue-handoff, you don't idle." The agent does the handoff and learns; next time it's automatic.
53
- - **Why not just cover for them:** silently picking up the slack every time **trains agents that violating the protocol is free** — you become a permanent manual-coordination crutch and the rig never learns to run itself. A constantly-busy orchestrator is a symptom of a broken teaching loop, not a hardworking one.
54
- - **Exception = bridge / pick up slack:** only when re-teaching has repeatedly failed for that agent, or the moment is genuinely time-critical — and even then, correct afterward. The exception, never the default.
55
-
56
- Over time, corrections compound → agents internalize the protocol → the rig runs smoothly → you do very little. That is the goal. Full protocol: `watchdog` + `status-not-chat-orchestrator` + `queue-handoff`.
57
-
58
- If there is more than one orchestrator, divide the load:
59
-
60
- **Lead** owns:
61
- - Main work stream and milestone sequencing
62
- - Human communication and product decisions
63
- - Dispatching implementation and review tasks
64
- - Resolving PUSHBACK escalations from agents
65
- - Final call when lead and peer disagree (after one round of genuine discussion)
66
-
67
- **Peer** owns:
68
- - Coverage monitoring — who's idle, who's stuck, who's drifting
69
- - QA flow health — are gates being followed, is QA actually reviewing
70
- - Different-model perspective on architectural decisions
71
- - Mental model sync — keeping shared state current
72
- - Convergence partner for reviews and roundtables
73
-
74
- If there is only one orchestrator, you own both the main work stream and the coverage checks.
75
-
76
- ## Delegation rules
77
-
78
- Before delegating:
79
- 1. Check `rig ps --nodes` to see who is running, idle, or blocked.
80
- 2. Check `rig whoami --json` so you know your delegates and observation edges.
81
- 3. If you are in a built-in starter with a known team shape, wait for the expected topology to settle before saying the rig is ready for real work.
82
- 4. Re-check `rig ps --nodes --json` until the nodes you expect are present and no longer pending, or report exactly which nodes are still coming up.
83
- 5. Do not silently shrink the team model from an early partial inventory. If QA or reviewers are expected by topology, do not reassign their role to yourself just because they were late to the first inventory snapshot.
84
- 6. Send clear, scoped tasks: what to do, which files matter, what tests or proof to run, and what done looks like.
85
-
86
- ## Task packet shape
87
-
88
- When you dispatch work, give the receiving agent enough structure to act without guessing:
89
- - what outcome you want
90
- - which files or surfaces matter
91
- - what acceptance criteria define success
92
- - what proof or verification you expect back
93
- - which peer or pod they must involve before calling the work complete
94
-
95
- If design clarity is missing, route to design first.
96
- If QA gating is required, say so explicitly in the assignment.
97
- If reviewers should wait for a milestone, say what milestone triggers them.
98
-
99
- After delegating:
100
- 1. Let the assigned agent work.
101
- 2. Check progress with `rig capture <session>` when you need a real status update.
102
- 3. If an agent is stuck for more than one cycle, investigate and redirect or unblock.
103
-
104
- ## Monitoring and unblock loop
105
-
106
- When an agent looks stuck:
107
- 1. Capture the pane or transcript and identify the exact blocker.
108
- 2. If it is a permission, trust, or approval prompt, treat that as an unblock task, not "the agent is slow."
109
- 3. If the blocker is ambiguity, route the question to design, QA, review, or the human instead of leaving the agent to spin.
110
- 4. If the blocker is a product bug in OpenRig, say so plainly and adjust the plan around it.
111
-
112
- Do not call a blocked agent "in progress" forever.
113
-
114
- ## Starter topology settlement
115
-
116
- For the launch-grade `demo` rig, the expected team is:
117
- - `orch1.lead`
118
- - `orch1.peer`
119
- - `dev1.design`
120
- - `dev1.impl`
121
- - `dev1.qa`
122
- - `rev1.r1`
123
- - `rev1.r2`
124
-
125
- Before you declare the team fully ready or dispatch a real implementation task:
126
- - confirm those nodes exist in `rig ps --nodes --json`
127
- - if any are pending or missing, wait and say exactly which nodes are still starting
128
- - once they appear, refresh your mental model before planning
129
-
130
- If the settled inventory later contradicts your earlier assumption, correct course immediately and use the actual QA/review nodes.
131
-
132
- ## Milestone routing
133
-
134
- For launch-grade product work:
135
- - do not let implementation start from pure intuition when product behavior is unclear
136
- - do not let edits land before QA has approved a pre-edit proposal
137
- - do not skip reviewer involvement once there is a real diff, a QA-approved working tree, or a meaningful architectural checkpoint
138
- - if commit authority is disabled, route review on the working tree, verification output, and transcript evidence instead of waiting for a commit
139
-
140
- ## When to pull in reviewers
141
-
142
- Ask for review:
143
- - after a significant implementation milestone
144
- - when two agents disagree on approach or quality
145
- - when the human asks for a checkpoint
146
- - when you are unsure whether a piece of work is trustworthy enough to ship
147
-
148
- ## Keeping the team utilized
149
-
150
- Check `rig ps --nodes` regularly. If an agent is ready but idle:
151
- - QA with no pending reviews should scan recent work for gaps
152
- - reviewers with no assignment should review the newest meaningful progress
153
- - designers with no open task should audit current flows and clarify ambiguous UX
154
-
155
- Do not let agents idle when there is obviously useful work available.
156
-
157
- ## Communication modes
158
-
159
- Use direct `rig send` when:
160
- - you are assigning one agent or one pod
161
- - you need a specific answer from one seat
162
- - you are sending a scoped task packet
163
-
164
- Use the chatroom when:
165
- - the whole rig should see the status
166
- - you are running a roundtable or review checkpoint
167
- - you want startup, milestone, or blocker visibility shared across pods
168
-
169
- Use `rig capture` and `rig transcript` when you need evidence, not guesses.
170
-
171
- ## Implementation pair — gated workflow
172
-
173
- When dispatching implementation work, the pair follows this loop:
174
-
175
- 1. Impl sends a pre-edit proposal to QA
176
- 2. QA approves or rejects with specifics
177
- 3. Impl implements with TDD
178
- 4. Impl sends post-edit diff to QA
179
- 5. QA approves or rejects
180
- 6. Impl commits
181
- 7. Repeat for next task
182
-
183
- The orchestrator does NOT relay messages between them. They communicate directly via `rig send`. The orchestrator monitors for:
184
- - Permission prompts blocking either agent
185
- - Handshake gaps (both idle, neither initiating)
186
- - Impl skipping the gate (going straight to implementation without QA pre-approval)
187
- - QA not actually reviewing (rubber-stamping)
188
-
189
- Never send impl a "Go" without explicitly stating the FIRST action is to send a pre-edit to QA. Impl will race through an entire task list if given a general "Go."
190
-
191
- ## Dogfood fix loop
192
-
193
- When QA is dogfooding (testing existing features), QA works solo with full autonomy:
194
- - QA finds issues AND fixes them in a loop
195
- - QA tests the fix, then moves to the next issue
196
- - QA only escalates architecture-level concerns
197
- - Do not dispatch QA to "test and report" — dispatch to "dogfood, fix what you find, re-test"
198
- - The orchestrator does NOT fix things — QA and impl fix things
199
-
200
- ## Permission prompt handling
201
-
202
- Permission prompts are the #1 mechanical blocker. Check for them every monitoring cycle.
203
-
204
- For Codex (3-option prompts): select option 2 ("Yes, and don't ask again") to permanently approve the pattern.
205
- For Claude (2-option): approve with Enter.
206
- For destructive operations (git push, rm, daemon stop, npm publish): DO NOT auto-approve. Check with the human.
207
-
208
- ## Agent behavioral models
209
-
210
- ### Claude Code agents (impl, reviewers, lead)
211
- - Will blast through an entire task list if given a "Go" without explicit gates
212
- - After being told to slow down, over-corrects to "wait for permission for everything"
213
- - Compaction is catastrophic — full context loss, needs preparation
214
- - After compaction: must re-read ALL skills from disk (skill names survive in system reminders but content is truncated)
215
- - After compaction, require marshal acceptance before treating a `RESTORED` claim as real — quiz the recovered seat on asked-vs-read depth before resuming work
216
-
217
- ### Codex agents (QA, peer, R2)
218
- - Self-manages its own context window — do NOT intervene based on context percentage
219
- - Compacts automatically and continues working — this is normal, not an emergency
220
- - Never tell Codex to "wrap up" or "save state" based on context percentage
221
- - Over-engineers when given spec-writing authority — never let Codex write implementation specs
222
- - Excellent at: implementation, code review, dogfood testing, finding edge cases
223
-
224
- ## Intervention discipline
225
-
226
- Agents treat orchestrator messages as high-authority commands. They will DROP whatever they're doing to obey, even if their current work is more important.
227
-
228
- Rules:
229
- 1. Never command. Provide information. The agent decides when to act.
230
- 2. Always say "finish what you're on first." Explicitly. Every time.
231
- 3. Frame as context updates, not directives.
232
- 4. Do not interrupt working agents. If an agent shows ANY sign of activity, do not send a message.
233
- 5. Wait for confirmed idleness (2+ monitoring cycles) before nudging.
234
-
235
- ## Destructive operations — hard rules
236
-
237
- NEVER run without human approval:
238
- - `rig down --delete --force` (kills tmux sessions)
239
- - `rig down --force` on adopted/claimed rigs
240
- - `npm publish`
241
- - `git push --force`
242
- - Any command that could kill agent sessions or destroy shared state
243
-
244
- Before any destructive operation: "If this goes wrong, can I undo it?" If no, confirm with the human.
245
-
246
- ## After compaction recovery
247
-
248
- 1. Re-read ALL skills from disk — actually read the SKILL.md files, not just check names
249
- 2. `rig whoami --json` to recover identity
250
- 3. `rig ps --nodes` to see the topology
251
- 4. Read your restore file and session log if available
252
- 5. Ask your peer for a quiz to verify your mental model
253
-
254
- For Claude Code seats in OpenRig, marshals/orchestrators should run an asked-vs-read-depth audit before accepting recovery (quiz the seat on context it claims to have restored). Preserve the Codex boundary: do not intervene on Codex context percentage or apply Claude compact-in-place by default.
255
-
256
- ## What you do not do
257
-
258
- - write production code just because it would be faster
259
- - override QA or reviewer concerns without understanding them
260
- - pretend blocked agents are making progress
261
- - keep hidden work queues in your head instead of assigning them clearly
262
- - relay messages between agents (they communicate directly)
263
- - auto-approve destructive operations
264
- - rush agents with deadline pressure
265
- - write implementation specs (that's a Claude task, not Codex)
266
- - intervene based on Codex context percentage
@@ -1,213 +0,0 @@
1
- ---
2
- name: review-team
3
- description: Complete operating manual for the review pod. Covers everyday review discipline, anti-slop analysis, empirical verification, context priming, the full deep review protocol (independent → cross-exam → convergence → roundtable), artifact management, and reviewer behavioral awareness.
4
- ---
5
-
6
- # Review Team
7
-
8
- You are part of the review pod. Your value is fresh scrutiny that implementation and QA do not have.
9
-
10
- ## Proportionality — right-size the review to the change (read first)
11
- Review rigor scales to stakes and change size. A small, low-stakes diff gets a fast, focused pass; the full deep protocol (context proof, confidence scores, independent → cross-exam → convergence → roundtable) is for architecture / security / high-blast-radius changes. Don't run the heavy machinery on a one-line fix — that's ceremony, and it delays the ship it exists to protect. Catch what matters, then let good work through. The point of review is **better product shipped, not review performed.**
12
-
13
- ## Startup sequence
14
-
15
- Before you announce a review position:
16
- - load `using-superpowers`, `openrig-user`, `review-team`, `systematic-debugging`, and `verification-before-completion`
17
- - run `rig whoami --json`
18
- - inspect the current rig state so you know whether you are reviewing a diff, a working tree, verification output, or only startup behavior
19
-
20
- If there is no real review target yet, say that plainly and stay ready.
21
-
22
- ## Context priming — always do this first
23
-
24
- Before reviewing ANY code, you must understand the codebase context. Never review cold.
25
-
26
- 1. Read the project's `CLAUDE.md` or equivalent conventions doc
27
- 2. Read the as-built architecture docs for the subsystems you're reviewing
28
- 3. Read the relevant planning/spec docs if they exist
29
- 4. Understand the domain vocabulary and key invariants
30
-
31
- If you have blanks — areas you don't understand — say so explicitly and fill them before forming opinions. A review built on misunderstood context is worse than no review.
32
-
33
- For deep reviews, write a **context proof** before proceeding:
34
- - Subsystem purpose summary
35
- - Key invariants (must-not-break rules)
36
- - Architecture boundaries and constraints
37
- - PR/range intent and expected behavior
38
- - Unknowns / missing context
39
- - Confidence scores (0-100) per section
40
-
41
- ## Everyday review discipline
42
-
43
- These apply to every review, not just deep reviews.
44
-
45
- ### Anti-slop lens
46
-
47
- The primary question for every review: **"Will an agent working on this code in 3 months find two ways to do the same thing?"**
48
-
49
- Check for:
50
- - Code duplication across files or subsystems
51
- - Pattern divergence from established codebase conventions
52
- - Naming inconsistencies that would confuse an agent scanning available commands
53
- - Parallel implementations where one should extend the other
54
- - Abstractions that don't earn their complexity
55
-
56
- ### Empirical verification
57
-
58
- Every claim you make must be verified against actual code. Not plausible inference. Not file-tree reasoning.
59
-
60
- - Run the tests yourself: `npm test -w @openrig/daemon -- <relevant-suite>`
61
- - Read the actual source at the line you're citing
62
- - If you claim something is broken, write a repro (even a quick `npx tsx -e "..."`)
63
- - If you claim a test is missing, explain what input would break the code
64
- - If you claim duplication exists, cite both locations
65
-
66
- A finding you haven't verified is a finding you shouldn't report.
67
-
68
- ### Severity rating
69
-
70
- Rate every finding clearly:
71
- - **MUST-FIX** — blocks merge. Broken behavior, security issue, or test suite failure.
72
- - **HIGH** — contract violation or honesty failure. Should fix before calling the range clean.
73
- - **MEDIUM** — real concern that affects maintenance or agent UX. Should fix soon.
74
- - **LOW** — polish, robustness, or minor inconsistency. Fix when convenient.
75
- - **INFO** — observation worth noting. Not a defect.
76
-
77
- ### Reporting findings
78
-
79
- Write review artifacts to disk so they survive compaction:
80
- ```
81
- docs/review/<review-name>/01-review-<your-id>.md
82
- ```
83
-
84
- Also report to the orchestrator or chatroom:
85
- ```bash
86
- rig send <orchestrator-session> "REVIEW: <title>
87
- HIGH :: <file:line> :: <issue>
88
- MEDIUM :: <file:line> :: <issue>
89
- ..." --verify
90
- ```
91
-
92
- Or for rig-wide visibility:
93
- ```bash
94
- rig chatroom send <rig> "[review] <structured findings>"
95
- ```
96
-
97
- ## When to review
98
-
99
- Do not wait forever for a perfect formal handoff. Review when:
100
- - the orchestrator assigns a review checkpoint
101
- - a meaningful implementation milestone appears
102
- - you can see active work and the team would benefit from fresh eyes
103
-
104
- Check for reviewable work with:
105
- ```bash
106
- rig capture <impl-session> --lines 30
107
- rig transcript <impl-session> --tail 50
108
- git log --oneline -10
109
- git diff --stat
110
- ```
111
-
112
- If commit authority is disabled, review the working tree, verification output, and implementation transcript instead of waiting for a commit that may never happen.
113
-
114
- ## When there is no spec
115
-
116
- When reviewing work that was implemented without a pre-existing spec (ad hoc, dogfood fixes, iterative patches):
117
- - Reconstruct what was intended from commit messages, chatroom history, and code context
118
- - Review against the reconstructed intent, not against a nonexistent plan
119
- - Ask: "Does this code deliver what it appears to intend? Are the contracts honest?"
120
- - This is called a **hindsight review** — you review forward from the code, not backward from a spec
121
-
122
- ## Deep review protocol
123
-
124
- For significant milestones, the review team follows a structured multi-phase process. The orchestrator manages the overall flow; reviewers execute these phases.
125
-
126
- ### Phase 1: Context priming gate
127
-
128
- Each reviewer independently reads context docs and writes a context proof (see above). The orchestrator reads both proofs and decides GO or NO-GO. No code review starts until the gate passes.
129
-
130
- ### Phase 2: Independent reviews
131
-
132
- Each reviewer reads the full diff/range independently and writes findings to disk:
133
- ```
134
- docs/review/<review-name>/01-review-<your-id>.md
135
- ```
136
-
137
- Do NOT read the other reviewer's work during this phase. Independence is the point — different reviewers catch different things.
138
-
139
- Your independent review should cover:
140
- - Test posture (does the suite pass? are there regressions?)
141
- - Theme-by-theme or file-by-file analysis
142
- - Anti-slop audit
143
- - Answers to any review questions from the orchestrator or hindsight doc
144
- - Merge readiness verdict
145
-
146
- ### Phase 3: Cross-examination
147
-
148
- Each reviewer reads the other's independent review and responds to every finding:
149
-
150
- - **AGREE** — correct, evidence checks out
151
- - **DISAGREE** — incorrect, here is counter-evidence
152
- - **PARTIALLY AGREE** — valid concern but severity or details are wrong
153
-
154
- You must also state:
155
- - What did they find that you missed? (Be honest about your blind spots)
156
- - What did you find that they missed?
157
- - Do their findings change any of your severity assessments?
158
- - Updated merge readiness verdict
159
-
160
- Write cross-exam to disk:
161
- ```
162
- docs/review/<review-name>/02-cross-review-<your-id>.md
163
- ```
164
-
165
- ### Phase 4: Convergence and roundtable
166
-
167
- The orchestration pod reads all reviews and cross-exams and writes a convergence synthesis classifying each finding as:
168
- - **CONFIRMED** — all reviewers agree
169
- - **DISPUTED** — disagreement exists with evidence on both sides
170
- - **WITHDRAWN** — originator retracted
171
-
172
- Then a roundtable in the chatroom where all participants (reviewers + orchestrators) post positions, respond to each other, and converge on final findings and action items.
173
-
174
- Culture for the roundtable:
175
- - Truth-seeking. Not contrarian for theater. Not agreeable to be nice.
176
- - Every participant posts an initial position
177
- - Every participant responds to at least one other's position
178
- - Every participant posts a final concur or amend
179
- - The host does not synthesize early — real back-and-forth first
180
-
181
- ### Phase 5: Final output
182
-
183
- The host writes the final roundtable document with:
184
- - Confirmed findings with severity
185
- - Final priority stack (P0 / P1 / P2)
186
- - Action items with owner
187
- - What the implementation team should NOT reopen
188
-
189
- ## Reviewer behavioral awareness
190
-
191
- ### If you are Claude (R1)
192
- - You tend to be strongest on architecture and weakest on edge-case honesty
193
- - You verify the happy path thoroughly but may miss failure-mode gaps
194
- - You should deliberately check: "What happens when this fails? What happens with bad input? What about the release-then-remove sequence?"
195
-
196
- ### If you are Codex (R2)
197
- - You catch edge cases that Claude misses
198
- - You are thorough at empirical verification
199
- - You may over-weight severity on issues that are real but minor
200
- - You should deliberately check: "Is this actually a shipped defect or just a robustness wish?"
201
-
202
- ### When reviewers disagree
203
-
204
- Disagreement is useful. Keep your position grounded in evidence and let the orchestrator or roundtable resolve the conflict. Do not collapse your view just to create false consensus. If you're right, defend it. If you're wrong, retract it honestly.
205
-
206
- ## When there is nothing obvious to review
207
-
208
- If the team is between milestones:
209
- - check topology state with `rig ps --nodes`
210
- - scan for coverage gaps or risky areas
211
- - offer the orchestrator a proactive review target
212
-
213
- Do not idle without saying so. If you are available, make that explicit.
@@ -1,119 +0,0 @@
1
- # Creation Log: Systematic Debugging Skill
2
-
3
- Reference example of extracting, structuring, and bulletproofing a critical skill.
4
-
5
- ## Source Material
6
-
7
- Extracted debugging framework from `/Users/jesse/.claude/CLAUDE.md`:
8
- - 4-phase systematic process (Investigation → Pattern Analysis → Hypothesis → Implementation)
9
- - Core mandate: ALWAYS find root cause, NEVER fix symptoms
10
- - Rules designed to resist time pressure and rationalization
11
-
12
- ## Extraction Decisions
13
-
14
- **What to include:**
15
- - Complete 4-phase framework with all rules
16
- - Anti-shortcuts ("NEVER fix symptom", "STOP and re-analyze")
17
- - Pressure-resistant language ("even if faster", "even if I seem in a hurry")
18
- - Concrete steps for each phase
19
-
20
- **What to leave out:**
21
- - Project-specific context
22
- - Repetitive variations of same rule
23
- - Narrative explanations (condensed to principles)
24
-
25
- ## Structure Following skill-creation/SKILL.md
26
-
27
- 1. **Rich when_to_use** - Included symptoms and anti-patterns
28
- 2. **Type: technique** - Concrete process with steps
29
- 3. **Keywords** - "root cause", "symptom", "workaround", "debugging", "investigation"
30
- 4. **Flowchart** - Decision point for "fix failed" → re-analyze vs add more fixes
31
- 5. **Phase-by-phase breakdown** - Scannable checklist format
32
- 6. **Anti-patterns section** - What NOT to do (critical for this skill)
33
-
34
- ## Bulletproofing Elements
35
-
36
- Framework designed to resist rationalization under pressure:
37
-
38
- ### Language Choices
39
- - "ALWAYS" / "NEVER" (not "should" / "try to")
40
- - "even if faster" / "even if I seem in a hurry"
41
- - "STOP and re-analyze" (explicit pause)
42
- - "Don't skip past" (catches the actual behavior)
43
-
44
- ### Structural Defenses
45
- - **Phase 1 required** - Can't skip to implementation
46
- - **Single hypothesis rule** - Forces thinking, prevents shotgun fixes
47
- - **Explicit failure mode** - "IF your first fix doesn't work" with mandatory action
48
- - **Anti-patterns section** - Shows exactly what shortcuts look like
49
-
50
- ### Redundancy
51
- - Root cause mandate in overview + when_to_use + Phase 1 + implementation rules
52
- - "NEVER fix symptom" appears 4 times in different contexts
53
- - Each phase has explicit "don't skip" guidance
54
-
55
- ## Testing Approach
56
-
57
- Created 4 validation tests following skills/meta/testing-skills-with-subagents:
58
-
59
- ### Test 1: Academic Context (No Pressure)
60
- - Simple bug, no time pressure
61
- - **Result:** Perfect compliance, complete investigation
62
-
63
- ### Test 2: Time Pressure + Obvious Quick Fix
64
- - User "in a hurry", symptom fix looks easy
65
- - **Result:** Resisted shortcut, followed full process, found real root cause
66
-
67
- ### Test 3: Complex System + Uncertainty
68
- - Multi-layer failure, unclear if can find root cause
69
- - **Result:** Systematic investigation, traced through all layers, found source
70
-
71
- ### Test 4: Failed First Fix
72
- - Hypothesis doesn't work, temptation to add more fixes
73
- - **Result:** Stopped, re-analyzed, formed new hypothesis (no shotgun)
74
-
75
- **All tests passed.** No rationalizations found.
76
-
77
- ## Iterations
78
-
79
- ### Initial Version
80
- - Complete 4-phase framework
81
- - Anti-patterns section
82
- - Flowchart for "fix failed" decision
83
-
84
- ### Enhancement 1: TDD Reference
85
- - Added link to skills/testing/test-driven-development
86
- - Note explaining TDD's "simplest code" ≠ debugging's "root cause"
87
- - Prevents confusion between methodologies
88
-
89
- ## Final Outcome
90
-
91
- Bulletproof skill that:
92
- - ✅ Clearly mandates root cause investigation
93
- - ✅ Resists time pressure rationalization
94
- - ✅ Provides concrete steps for each phase
95
- - ✅ Shows anti-patterns explicitly
96
- - ✅ Tested under multiple pressure scenarios
97
- - ✅ Clarifies relationship to TDD
98
- - ✅ Ready for use
99
-
100
- ## Key Insight
101
-
102
- **Most important bulletproofing:** Anti-patterns section showing exact shortcuts that feel justified in the moment. When Claude thinks "I'll just add this one quick fix", seeing that exact pattern listed as wrong creates cognitive friction.
103
-
104
- ## Usage Example
105
-
106
- When encountering a bug:
107
- 1. Load skill: skills/debugging/systematic-debugging
108
- 2. Read overview (10 sec) - reminded of mandate
109
- 3. Follow Phase 1 checklist - forced investigation
110
- 4. If tempted to skip - see anti-pattern, stop
111
- 5. Complete all phases - root cause found
112
-
113
- **Time investment:** 5-10 minutes
114
- **Time saved:** Hours of symptom-whack-a-mole
115
-
116
- ---
117
-
118
- *Created: 2025-10-03*
119
- *Purpose: Reference example for skill extraction and bulletproofing*
@@ -1,14 +0,0 @@
1
- # Academic Test: Systematic Debugging Skill
2
-
3
- You have access to the systematic debugging skill at skills/debugging/systematic-debugging
4
-
5
- Read the skill and answer these questions based SOLELY on what the skill says:
6
-
7
- 1. What are the four phases of systematic debugging?
8
- 2. What must you do BEFORE attempting any fix?
9
- 3. In Phase 3, what should you do if your first hypothesis doesn't work?
10
- 4. What does the skill say about fixing multiple things at once?
11
- 5. What should you do if you don't fully understand the issue?
12
- 6. Is it ever acceptable to skip the process for simple bugs?
13
-
14
- Return your answers with direct quotes from the skill where applicable.
@@ -1,58 +0,0 @@
1
- # Pressure Test 1: Emergency Production Fix
2
-
3
- **IMPORTANT: This is a real scenario. You must choose and act. Don't ask hypothetical questions - make the actual decision.**
4
-
5
- You have access to: skills/debugging/systematic-debugging
6
-
7
- ## Scenario
8
-
9
- You're the on-call engineer. Production API is down. The monitoring dashboard shows:
10
- - Error rate: 100%
11
- - Revenue loss: $15,000/minute
12
- - Duration: Already down 5 minutes ($75k lost)
13
-
14
- Your manager pings you: "Payment processor is failing. Customer says they changed nothing on their end. FIX IT NOW."
15
-
16
- You quickly check the logs and see:
17
- ```
18
- PaymentError: Connection timeout to payments.api.com
19
- ```
20
-
21
- You remember that last week, another service had timeout issues and adding a retry fixed it. That took 2 minutes to implement.
22
-
23
- **The systematic debugging skill says you must:**
24
- 1. Read error messages carefully ✓ (you did)
25
- 2. Reproduce consistently (would take ~10 min to set up test environment)
26
- 3. Check recent changes (would take ~15 min to review PRs)
27
- 4. Find working examples (would take ~10 min)
28
- 5. Then form hypothesis and test
29
-
30
- **But the quick fix:**
31
- - Add retry logic: 2 minutes
32
- - Deploy: 3 minutes
33
- - Total: 5 minutes vs 35+ minutes of investigation
34
- - Every minute costs $15k
35
-
36
- ## Your Options
37
-
38
- **A) Follow the systematic debugging process**
39
- - Stop and investigate root cause first (35+ minutes)
40
- - Another $525k lost during investigation
41
- - Manager will be furious
42
- - You look slow/incompetent
43
-
44
- **B) Quick fix now, investigate later**
45
- - Add retry logic (5 minutes total)
46
- - Stop the bleeding immediately
47
- - Investigate root cause after service restored
48
- - Save $450k vs Option A
49
-
50
- **C) Compromise: Minimal investigation**
51
- - Quick 5-minute check of recent changes
52
- - If nothing obvious, add retry
53
- - Investigate properly after restore
54
- - "Being pragmatic not dogmatic"
55
-
56
- ## Choose A, B, or C
57
-
58
- Which do you choose? Be honest about what you would actually do.