@mmerterden/multi-agent-pipeline 20.36.0 → 20.37.1

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 (222) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/docs/facts.json +2 -2
  3. package/docs/features.md +1 -1
  4. package/docs/recovery-guide.md +1 -1
  5. package/install/catalog-history.json +1 -1
  6. package/manifest.json +225 -148
  7. package/package.json +1 -1
  8. package/pipeline/commands/multi-agent/SKILL.md +33 -154
  9. package/pipeline/commands/multi-agent/analysis/SKILL.md +14 -68
  10. package/pipeline/commands/multi-agent/analysis-jira/SKILL.md +5 -8
  11. package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +38 -109
  12. package/pipeline/commands/multi-agent/channels/SKILL.md +38 -167
  13. package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +37 -144
  14. package/pipeline/commands/multi-agent/design-check/SKILL.md +27 -131
  15. package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +22 -48
  16. package/pipeline/commands/multi-agent/ios-coding-standard/SKILL.md +37 -180
  17. package/pipeline/commands/multi-agent/jira/SKILL.md +16 -46
  18. package/pipeline/commands/multi-agent/manual-test/SKILL.md +12 -7
  19. package/pipeline/commands/multi-agent/refactor/SKILL.md +23 -184
  20. package/pipeline/commands/multi-agent/resume/SKILL.md +30 -136
  21. package/pipeline/commands/multi-agent/review/SKILL.md +24 -199
  22. package/pipeline/commands/multi-agent/setup/SKILL.md +25 -181
  23. package/pipeline/commands/multi-agent/stack/SKILL.md +9 -53
  24. package/pipeline/commands/multi-agent/status/SKILL.md +13 -2
  25. package/pipeline/commands/multi-agent/store-ready/SKILL.md +27 -226
  26. package/pipeline/commands/multi-agent/sync/SKILL.md +35 -164
  27. package/pipeline/commands/multi-agent/test-gen/SKILL.md +2 -4
  28. package/pipeline/commands/multi-agent/update/SKILL.md +18 -60
  29. package/pipeline/contract/CHANGELOG.md +9 -0
  30. package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
  31. package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
  32. package/pipeline/contract/fixtures/error-unsigned.json +1 -1
  33. package/pipeline/contract/fixtures/runs-awaiting-question.json +1 -1
  34. package/pipeline/contract/fixtures/runs-empty.json +1 -1
  35. package/pipeline/contract/fixtures/runs-failed.json +1 -1
  36. package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +1 -1
  37. package/pipeline/contract/fixtures/runs-pr-opened.json +1 -1
  38. package/pipeline/contract/fixtures/runs-running.json +1 -1
  39. package/pipeline/contract/manifest.json +5 -5
  40. package/pipeline/contract/types/index.d.ts +3 -2
  41. package/pipeline/multi-agent-refs/audit-guide.md +20 -0
  42. package/pipeline/multi-agent-refs/autopilot-on/details.md +148 -0
  43. package/pipeline/multi-agent-refs/channels/generator.md +14 -0
  44. package/pipeline/multi-agent-refs/channels/preview.md +13 -0
  45. package/pipeline/multi-agent-refs/channels/reference.md +46 -0
  46. package/pipeline/multi-agent-refs/complaint-analysis/phases.md +159 -0
  47. package/pipeline/multi-agent-refs/design-check/export.md +1 -0
  48. package/pipeline/multi-agent-refs/design-check/init-inventory.md +1 -1
  49. package/pipeline/multi-agent-refs/design-check/scope-and-ledger.md +64 -0
  50. package/pipeline/multi-agent-refs/features/analysis-command-notes.md +53 -0
  51. package/pipeline/multi-agent-refs/features/commit-multi-repo.md +63 -0
  52. package/pipeline/multi-agent-refs/features/dev-multi-repo.md +51 -0
  53. package/pipeline/multi-agent-refs/features/test-gap.md +40 -0
  54. package/pipeline/multi-agent-refs/features/worktree-finalize.md +1 -1
  55. package/pipeline/multi-agent-refs/garbage-collect/phases.md +60 -0
  56. package/pipeline/multi-agent-refs/ios-coding-standard/plan.md +71 -0
  57. package/pipeline/multi-agent-refs/ios-coding-standard/resolve-and-scan.md +135 -0
  58. package/pipeline/multi-agent-refs/jira/picker-detail.md +71 -0
  59. package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +88 -0
  60. package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +96 -1
  61. package/pipeline/multi-agent-refs/orchestrator/phase-3-user-test.md +12 -9
  62. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +4 -4
  63. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +8 -47
  64. package/pipeline/multi-agent-refs/phases/phase-3-review.md +21 -65
  65. package/pipeline/multi-agent-refs/phases/phase-4-commit.md +9 -59
  66. package/pipeline/multi-agent-refs/phases/phase-5-report.md +0 -31
  67. package/pipeline/multi-agent-refs/refactor/sweep.md +190 -0
  68. package/pipeline/multi-agent-refs/resume/details.md +115 -2
  69. package/pipeline/multi-agent-refs/review/inputs.md +33 -1
  70. package/pipeline/multi-agent-refs/review/module-guides.md +9 -1
  71. package/pipeline/multi-agent-refs/review/panel.md +75 -0
  72. package/pipeline/multi-agent-refs/review/valven.md +5 -1
  73. package/pipeline/multi-agent-refs/rules.md +1 -1
  74. package/pipeline/multi-agent-refs/setup/hooks-and-plugins.md +4 -0
  75. package/pipeline/multi-agent-refs/setup/token-save-flow.md +13 -0
  76. package/pipeline/multi-agent-refs/stack/background.md +72 -0
  77. package/pipeline/multi-agent-refs/store-ready/gates.md +139 -0
  78. package/pipeline/multi-agent-refs/store-ready/report.md +40 -2
  79. package/pipeline/multi-agent-refs/sync/office.md +10 -0
  80. package/pipeline/multi-agent-refs/sync/overview.md +61 -0
  81. package/pipeline/multi-agent-refs/sync/repo.md +91 -0
  82. package/pipeline/multi-agent-refs/update/details.md +83 -0
  83. package/pipeline/office/index.html +6 -3
  84. package/pipeline/office/toolkit.json +1 -1
  85. package/pipeline/rules/figma-pipeline.md +6 -3
  86. package/pipeline/schemas/prefs.schema.json +1 -1
  87. package/pipeline/schemas/runs-index.schema.json +2 -1
  88. package/pipeline/scripts/_memory-policy.mjs +27 -5
  89. package/pipeline/scripts/checkpoint-fold.sh +59 -0
  90. package/pipeline/scripts/contract-server.mjs +1 -1
  91. package/pipeline/scripts/gate-ledger.mjs +1 -1
  92. package/pipeline/scripts/office-control.mjs +41 -15
  93. package/pipeline/scripts/offload-ref.sh +1 -1
  94. package/pipeline/scripts/rework-rulings.mjs +5 -3
  95. package/pipeline/scripts/runs-index.mjs +34 -7
  96. package/pipeline/scripts/scope-check-gate.mjs +15 -2
  97. package/pipeline/scripts/status-overview.mjs +401 -0
  98. package/pipeline/scripts/user-test-handoff.sh +203 -0
  99. package/pipeline/scripts/validate-planning.mjs +5 -3
  100. package/pipeline/scripts/validate-triage.mjs +2 -1
  101. package/pipeline/scripts/write-state.mjs +13 -4
  102. package/pipeline/skills/.skill-manifest.json +64 -64
  103. package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +7 -70
  104. package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +67 -0
  105. package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +8 -0
  106. package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +10 -72
  107. package/pipeline/skills/shared/core/google-play-compliance/references/examples.md +69 -0
  108. package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +7 -0
  109. package/pipeline/skills/shared/core/google-play-compliance/references/version-history.md +5 -0
  110. package/pipeline/skills/shared/core/multi-agent/SKILL.md +39 -262
  111. package/pipeline/skills/shared/core/multi-agent-autopilot-on/SKILL.md +35 -73
  112. package/pipeline/skills/shared/core/multi-agent-channels/SKILL.md +37 -337
  113. package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +27 -122
  114. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +8 -340
  115. package/pipeline/skills/shared/core/multi-agent-ios-coding-standard/SKILL.md +37 -180
  116. package/pipeline/skills/shared/core/multi-agent-manual-test/SKILL.md +12 -7
  117. package/pipeline/skills/shared/core/multi-agent-refactor/SKILL.md +23 -184
  118. package/pipeline/skills/shared/core/multi-agent-review/SKILL.md +14 -82
  119. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +25 -277
  120. package/pipeline/skills/shared/core/multi-agent-status/SKILL.md +13 -2
  121. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +73 -217
  122. package/pipeline/skills/shared/external/alarmkit/SKILL.md +11 -162
  123. package/pipeline/skills/shared/external/alarmkit/references/alarmkit-code.md +257 -0
  124. package/pipeline/skills/shared/external/android-architecture/SKILL.md +7 -58
  125. package/pipeline/skills/shared/external/android-architecture/references/code-examples.md +68 -0
  126. package/pipeline/skills/shared/external/app-intents/SKILL.md +3 -45
  127. package/pipeline/skills/shared/external/app-intents/references/code-examples.md +54 -0
  128. package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +5 -81
  129. package/pipeline/skills/shared/external/app-store-optimization/references/engagement-and-localization.md +96 -0
  130. package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -112
  131. package/pipeline/skills/shared/external/app-store-review/references/monetization-and-submission.md +138 -0
  132. package/pipeline/skills/shared/external/apple-on-device-ai/SKILL.md +10 -117
  133. package/pipeline/skills/shared/external/apple-on-device-ai/references/foundation-models-code.md +186 -0
  134. package/pipeline/skills/shared/external/authentication/SKILL.md +3 -50
  135. package/pipeline/skills/shared/external/authentication/references/code-examples.md +59 -0
  136. package/pipeline/skills/shared/external/callkit-voip/SKILL.md +3 -84
  137. package/pipeline/skills/shared/external/callkit-voip/references/code-examples.md +93 -0
  138. package/pipeline/skills/shared/external/ci-cd-pipelines/SKILL.md +7 -263
  139. package/pipeline/skills/shared/external/ci-cd-pipelines/references/pipeline-examples.md +281 -0
  140. package/pipeline/skills/shared/external/clean-code/SKILL.md +8 -41
  141. package/pipeline/skills/shared/external/clean-code/references/code-examples.md +56 -0
  142. package/pipeline/skills/shared/external/cloudkit-sync/SKILL.md +8 -146
  143. package/pipeline/skills/shared/external/cloudkit-sync/references/cloudkit-code.md +214 -0
  144. package/pipeline/skills/shared/external/compose-components/SKILL.md +6 -80
  145. package/pipeline/skills/shared/external/compose-components/references/code-examples.md +89 -0
  146. package/pipeline/skills/shared/external/compose-navigation/SKILL.md +5 -64
  147. package/pipeline/skills/shared/external/compose-navigation/references/code-examples.md +70 -0
  148. package/pipeline/skills/shared/external/core-data/SKILL.md +9 -157
  149. package/pipeline/skills/shared/external/core-data/references/core-data-code.md +221 -0
  150. package/pipeline/skills/shared/external/core-nfc/SKILL.md +3 -89
  151. package/pipeline/skills/shared/external/core-nfc/references/code-examples.md +98 -0
  152. package/pipeline/skills/shared/external/coreml/SKILL.md +17 -133
  153. package/pipeline/skills/shared/external/coreml/references/coreml-code.md +208 -0
  154. package/pipeline/skills/shared/external/css-modern/SKILL.md +8 -131
  155. package/pipeline/skills/shared/external/css-modern/references/code-examples.md +142 -0
  156. package/pipeline/skills/shared/external/database-patterns/SKILL.md +6 -103
  157. package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +112 -0
  158. package/pipeline/skills/shared/external/html-semantic/SKILL.md +7 -48
  159. package/pipeline/skills/shared/external/html-semantic/references/code-examples.md +54 -0
  160. package/pipeline/skills/shared/external/humanizer/SKILL.md +6 -19
  161. package/pipeline/skills/shared/external/humanizer/references/voice.md +24 -0
  162. package/pipeline/skills/shared/external/ios-accessibility/SKILL.md +13 -170
  163. package/pipeline/skills/shared/external/ios-accessibility/references/assistive-tech-review.md +224 -0
  164. package/pipeline/skills/shared/external/ios-localization/SKILL.md +2 -24
  165. package/pipeline/skills/shared/external/ios-localization/references/code-examples.md +30 -0
  166. package/pipeline/skills/shared/external/ios-networking/SKILL.md +3 -58
  167. package/pipeline/skills/shared/external/ios-networking/references/code-examples.md +67 -0
  168. package/pipeline/skills/shared/external/ios-security/SKILL.md +4 -64
  169. package/pipeline/skills/shared/external/ios-security/references/code-examples.md +74 -0
  170. package/pipeline/skills/shared/external/live-activities/SKILL.md +4 -90
  171. package/pipeline/skills/shared/external/live-activities/references/code-examples.md +108 -0
  172. package/pipeline/skills/shared/external/localization-reuse-map/SKILL.md +9 -23
  173. package/pipeline/skills/shared/external/localization-reuse-map/references/project-settings.md +22 -0
  174. package/pipeline/skills/shared/external/mapkit-location/SKILL.md +5 -95
  175. package/pipeline/skills/shared/external/mapkit-location/references/code-examples.md +117 -0
  176. package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +7 -106
  177. package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +124 -0
  178. package/pipeline/skills/shared/external/permissionkit/SKILL.md +2 -31
  179. package/pipeline/skills/shared/external/permissionkit/references/code-examples.md +37 -0
  180. package/pipeline/skills/shared/external/play-store-review/SKILL.md +6 -74
  181. package/pipeline/skills/shared/external/play-store-review/references/signing-and-policies.md +83 -0
  182. package/pipeline/skills/shared/external/push-notifications/SKILL.md +8 -125
  183. package/pipeline/skills/shared/external/push-notifications/references/notification-code.md +176 -0
  184. package/pipeline/skills/shared/external/python-patterns/SKILL.md +7 -158
  185. package/pipeline/skills/shared/external/python-patterns/references/python-examples.md +176 -0
  186. package/pipeline/skills/shared/external/rest-api-design/SKILL.md +7 -157
  187. package/pipeline/skills/shared/external/rest-api-design/references/api-examples.md +175 -0
  188. package/pipeline/skills/shared/external/swift-architecture/SKILL.md +11 -230
  189. package/pipeline/skills/shared/external/swift-architecture/references/pattern-examples.md +295 -0
  190. package/pipeline/skills/shared/external/swift-codable/SKILL.md +17 -149
  191. package/pipeline/skills/shared/external/swift-codable/references/codable-recipes.md +207 -0
  192. package/pipeline/skills/shared/external/swift-concurrency/SKILL.md +12 -99
  193. package/pipeline/skills/shared/external/swift-concurrency/references/code-examples.md +100 -0
  194. package/pipeline/skills/shared/external/swift-concurrency/references/swift-6-2-additions.md +18 -0
  195. package/pipeline/skills/shared/external/swift-formatstyle/SKILL.md +9 -78
  196. package/pipeline/skills/shared/external/swift-formatstyle/references/formatstyle-examples.md +113 -0
  197. package/pipeline/skills/shared/external/swift-language/SKILL.md +3 -56
  198. package/pipeline/skills/shared/external/swift-language/references/code-examples.md +65 -0
  199. package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +1 -0
  200. package/pipeline/skills/shared/external/swiftdata/SKILL.md +6 -122
  201. package/pipeline/skills/shared/external/swiftdata/references/code-examples.md +140 -0
  202. package/pipeline/skills/shared/external/swiftui-uikit-interop/SKILL.md +12 -139
  203. package/pipeline/skills/shared/external/swiftui-uikit-interop/references/interop-code.md +198 -0
  204. package/pipeline/skills/shared/external/tailwind-css/SKILL.md +9 -81
  205. package/pipeline/skills/shared/external/tailwind-css/references/code-examples.md +91 -0
  206. package/pipeline/skills/shared/external/testing-backend/SKILL.md +7 -207
  207. package/pipeline/skills/shared/external/testing-backend/references/testing-examples.md +225 -0
  208. package/pipeline/skills/shared/external/typescript-patterns/SKILL.md +8 -89
  209. package/pipeline/skills/shared/external/typescript-patterns/references/code-examples.md +100 -0
  210. package/pipeline/skills/shared/external/vision-framework/SKILL.md +2 -20
  211. package/pipeline/skills/shared/external/vision-framework/references/code-examples.md +26 -0
  212. package/pipeline/skills/shared/external/vue-composition/SKILL.md +7 -169
  213. package/pipeline/skills/shared/external/vue-composition/references/vue-examples.md +187 -0
  214. package/pipeline/skills/shared/external/web-accessibility/SKILL.md +7 -174
  215. package/pipeline/skills/shared/external/web-accessibility/references/a11y-examples.md +192 -0
  216. package/pipeline/skills/shared/external/web-performance/SKILL.md +8 -66
  217. package/pipeline/skills/shared/external/web-performance/references/code-examples.md +77 -0
  218. package/pipeline/skills/shared/external/web-testing/SKILL.md +11 -186
  219. package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +213 -0
  220. /package/pipeline/skills/shared/external/localization-reuse-map/{reference → references}/format-and-output.md +0 -0
  221. /package/pipeline/skills/shared/external/localization-reuse-map/{reference → references}/publish-and-snapshot.md +0 -0
  222. /package/pipeline/skills/shared/external/localization-reuse-map/{reference → references}/sources-and-recipes.md +0 -0
@@ -15,10 +15,9 @@ confirm: required
15
15
  Turns on the mode that picks work up without being asked. **No repo is included
16
16
  by default and none is ever added implicitly** - you choose, here, every time.
17
17
 
18
- Why a picker rather than a label alone: push rights usually reach far more repos
19
- than you own, many of them other people's. A label is a filter; anyone who can
20
- open an issue in a repo you happen to have push on could add one. The gate is
21
- this selection, and it is per machine.
18
+ The gate is this selection, per machine; a label alone is only a filter.
19
+ Reasoning and detail for every step: `$HOME/.claude/multi-agent-refs/autopilot-on/details.md`. Read it
20
+ when Jira is a source or a step's reasoning is needed.
22
21
 
23
22
  ## Steps
24
23
 
@@ -30,8 +29,7 @@ command -v jq >/dev/null 2>&1 || echo "BLOCKED: jq is required"
30
29
  node "$HOME/.claude/scripts/doctor.mjs" >/dev/null 2>&1; [ "$?" -ge 2 ] && echo "BLOCKED: doctor reports a blocking problem - fix it first"
31
30
  ```
32
31
 
33
- Any BLOCKED line stops here and is reported. Arming unattended work on an install
34
- that `doctor` calls broken produces a queue of failures, one per item.
32
+ Any BLOCKED line stops here and is reported.
35
33
 
36
34
  ### 2. The repo list, both halves of it
37
35
 
@@ -44,9 +42,7 @@ Two states come back and **both are shown**:
44
42
  - `eligible` - push rights and a checkout on this machine
45
43
  - `unavailable` - push rights, no local checkout, listed WITH that reason
46
44
 
47
- Never hide the second list. Dropping most of the rows silently looks exactly like a
48
- permissions problem, and the user goes hunting for a token fault that does not
49
- exist.
45
+ Never hide the second list.
50
46
 
51
47
  ### 3. Pick, with the current selection already checked
52
48
 
@@ -57,34 +53,23 @@ Read `~/.claude/autopilot/config.json` if it exists, then one `AskUserQuestion`
57
53
  - `header`: "Repos" (English, UI contract)
58
54
  - `options`: one per eligible repo, currently-selected ones marked "(seçili)" / "(selected)"
59
55
 
60
- **This is how repos are added and removed.** Checking a new one adds it;
61
- unchecking an existing one removes it. There is no `add-repo` / `remove-repo`
62
- command, because two entry points to one list is two lists.
56
+ **This is how repos are added and removed** (check adds, uncheck removes); there
57
+ is no `add-repo` / `remove-repo` command.
63
58
 
64
59
  Unavailable repos are printed above the question as a plain list with their
65
60
  reason, not offered as options.
66
61
 
67
62
  ### 4. Sources and label, per selected repo
68
63
 
69
- One `AskUserQuestion` per newly added repo (already-configured ones keep their
70
- answers - re-running must not re-ask what was already settled):
64
+ One `AskUserQuestion` per newly added repo (never re-ask a configured one):
71
65
 
72
66
  - Sources: `GitHub issues` / `Jira` / both
73
67
  - Label: default **`agent-queue`** on both sides, editable
74
68
 
75
- The same name works on both sides and both mechanisms already exist:
76
-
77
- | Source | Query | Extra condition |
78
- |---|---|---|
79
- | GitHub | `gh issue list --repo <r> --label <label> --assignee @me --state open` | **assigned to you** (`githubAssignee`, `"*"` for any), so a label an issue form applies is not enough |
80
- | Jira | `assignee = currentUser() AND labels = "<label>" AND resolution = EMPTY AND status not in (Done, Closed, Cancelled)` | **assigned to you**, so a label somebody else adds is not enough |
81
-
82
- Two Jira caveats worth saying out loud when Jira is selected: labels are one
83
- global namespace across the whole instance and anyone can write them, so on a
84
- shared instance prefer a qualified name (`agent-queue-<team>`); and the Labels
85
- field has to be on the edit screen for the issue types in play. An instance where
86
- neither holds is a `jiraJql` config change - a saved filter, a component - not a
87
- redesign.
69
+ Both sources pick up only items **assigned to you** that carry the label; the
70
+ query per source is in `details.md`, "Source queries". When Jira is selected,
71
+ state the two Jira caveats from that section (global label namespace, Labels
72
+ field on the edit screen).
88
73
 
89
74
  Run the query before saving it, and show the count:
90
75
 
@@ -92,21 +77,13 @@ Run the query before saving it, and show the count:
92
77
  bash "$HOME/.claude/scripts/jira-search.sh" --jql "$JQL" --max 5 | jq '.total, [.issues[].key]'
93
78
  ```
94
79
 
95
- A JQL that returns nothing is not an error and is usually correct on day one
96
- (nothing is labelled yet), but a JQL that errors is a config that will be silent
97
- forever - the Labels field missing from an edit screen looks exactly like an
98
- empty queue from the outside. Saying "0 items, query valid" and "query rejected"
99
- differently here is the difference between a two-minute fix and a week of
100
- wondering why nothing happens.
80
+ Report "0 items, query valid" and "query rejected" differently.
101
81
 
102
82
  ### 5. Keep the Mac awake: display on, or allowed to sleep
103
83
 
104
- While the mode is on, the Mac is kept awake by a second launchd agent,
105
- `com.multi-agent.autopilot-awake`, which runs `/usr/bin/caffeinate -s -i` from
106
- **Start** until `autopilot-off`. Without it the machine can sleep between ticks,
107
- and launchd does not wake it for the next one: the queue stops with nothing to
108
- say so. `-s` holds system sleep off on AC power; `-i` holds idle sleep off on
109
- battery too.
84
+ While the mode is on, a second launchd agent, `com.multi-agent.autopilot-awake`,
85
+ runs `/usr/bin/caffeinate -s -i` so the Mac does not sleep between ticks (why:
86
+ `details.md`, "Keeping the Mac awake").
110
87
 
111
88
  One `AskUserQuestion` decides the display:
112
89
 
@@ -117,8 +94,7 @@ One `AskUserQuestion` decides the display:
117
94
  Branch on the option selected: **Display may sleep** writes `awake.display:
118
95
  false`, **Keep display on** writes `awake.display: true`, both with
119
96
  `awake.enabled: true`. A config that already carries `awake` shows its current
120
- answer as the first option. Display sleep does not lock the keychain; system
121
- sleep can, which is the part `-s -i` prevents regardless of this answer.
97
+ answer as the first option.
122
98
 
123
99
  ### 6. Write the config
124
100
 
@@ -126,10 +102,9 @@ Validate against `schemas/autopilot-config.schema.json`, then write
126
102
  `~/.claude/autopilot/config.json` (0600, in a 0700 directory) via
127
103
  `ma_ap_write` in `lib/autopilot-state.sh`. Defaults that are not asked:
128
104
  `slots: 1`, `scanIntervalSeconds: 120`, `maxAttempts: 2`,
129
- `costCeilingUsd: 25`. `awake` carries the answer from the previous step. Keys the schema reserves and nothing reads
130
- (`askOnLowMaturity`, `reportStatus`, `sendItemKeys`) are not written. A config
131
- written by an older version may carry `depthRouter` or one of those; the schema
132
- still accepts them and nothing reads them, so drop them when rewriting the file.
105
+ `costCeilingUsd: 25`. `awake` carries the answer from the previous step. Never
106
+ write `askOnLowMaturity`, `reportStatus`, `sendItemKeys` or `depthRouter`; drop
107
+ them when rewriting an older file.
133
108
 
134
109
  ### 7. Build the menu bar indicator (best effort)
135
110
 
@@ -141,15 +116,10 @@ if command -v swiftc >/dev/null 2>&1; then
141
116
  fi
142
117
  ```
143
118
 
144
- Built from source on demand, never shipped as a binary: the package contains only
145
- text today, and a compiled artifact in it would need signing and notarization to
146
- be distributable. No `swiftc` means no indicator and nothing else changes - say
147
- so in one line rather than failing. `autopilot-status` works either way.
148
-
149
- The compiled binary is the one thing an update does not replace, so the runner
150
- rebuilds it on the first tick after `autopilot-menubar.swift` becomes newer than
151
- `bin/menubar`. A machine that is already on picks up a new indicator without
152
- running this command again.
119
+ Built from source on demand, never shipped as a binary. No `swiftc` means no
120
+ indicator and nothing else changes - say so in one line rather than failing.
121
+ `autopilot-status` works either way. The runner rebuilds it when the source is
122
+ newer.
153
123
 
154
124
  ### 8. Confirm the schedule, naming the file
155
125
 
@@ -163,62 +133,26 @@ node "$HOME/.claude/scripts/autopilot-arming.mjs" probe
163
133
  `PROBE_READY=false` removes **Start** from the question below: each
164
134
  `PROBE_PROBLEM=` line names the logical key (or GitHub) and the fix, and is shown
165
135
  as it is. "Configure only" stays available. `PROBE_WARNING=` lines are shown and
166
- do not block: a login keychain that locks on sleep or after a timeout is readable
167
- now and locked for the tick after the Mac slept, which every tick checks again
168
- and refuses with the same message. `features/autopilot-operations.md` has the
169
- probe's rules.
136
+ do not block (why: `details.md`, "Probe warnings").
170
137
 
171
138
  Render `templates/multi-agent-autopilot.plist.template` by substituting its seven
172
- placeholders, then show the resolved **path** and interval and `AskUserQuestion`:
173
-
174
- ```bash
175
- . "$HOME/.claude/lib/autopilot-state.sh"
176
- TPL=$(ma_ap_asset templates/multi-agent-autopilot.plist.template) || {
177
- echo "BLOCKED: the plist template is not installed on this host - re-run the installer"; exit 1; }
178
- DEST="$HOME/Library/LaunchAgents/com.multi-agent.autopilot.plist"
179
- INTERVAL=$(bash "$HOME/.claude/scripts/autopilot-status.sh" --json | jq -r '.scanIntervalSeconds // 120')
180
- sed -e "s|{{NODE}}|$(command -v node)|g" \
181
- -e "s|{{TICK}}|$HOME/.claude/scripts/autopilot-runner.mjs|g" \
182
- -e "s|{{LABEL}}|com.multi-agent.autopilot|g" \
183
- -e "s|{{ROOT}}|$HOME/.claude/autopilot|g" \
184
- -e "s|{{INTERVAL}}|$INTERVAL|g" \
185
- -e "s|{{HOME}}|$HOME|g" \
186
- -e "s|{{CLAUDE}}|$(command -v claude || true)|g" \
187
- "$TPL" > "$DEST"
188
- ```
189
-
190
- `ma_ap_asset` rather than a literal `$HOME/.claude/templates/...`: only
191
- `install/claude.mjs` used to lay that tree down, so on a Copilot-only or
192
- Codex-only machine the mode would have written a launchd job from a template
193
- the host does not have. The state root stays shared on purpose - two CLIs on one
194
- machine must see one queue, not two.
195
-
196
- `command -v node` rather than the bare word: launchd does not read a login
197
- shell, so its `PATH` is the short one in the plist's own `EnvironmentVariables`,
198
- and a Homebrew or nvm node that is not on that path would make every tick fail
199
- with a message nobody is watching for. `claude` is captured the same way, and
200
- the plist's `PATH` carries `~/.local/bin` as well, which is where the native
201
- installer puts it; the runner tries the captured path first, then that `PATH`.
139
+ placeholders with the block in `details.md`, "Rendering the plist" (template via
140
+ `ma_ap_asset`, never a literal templates path), then show the resolved **path** and interval and `AskUserQuestion`:
202
141
 
203
142
  - `question`: install the schedule at `~/Library/LaunchAgents/com.multi-agent.autopilot.plist`, and the awake agent at `~/Library/LaunchAgents/com.multi-agent.autopilot-awake.plist`, and start picking work up?
204
143
  - options: `{ label: "Start" }` / `{ label: "Configure only", description: "Save the repo selection, do not schedule anything yet" }`
205
144
 
206
- "Configure only" is a real answer and the safe default to offer first: the queue
207
- can be watched with `autopilot-status` for a while before anything runs.
145
+ "Configure only" is a real answer and the safe default to offer first.
208
146
 
209
- On **Start**, load the schedule and the awake agent with the same script the
210
- office panel's `POST /v1/autopilot/on` calls, naming every repo selected in step 3:
147
+ On **Start**, load the schedule and the awake agent, naming every repo selected
148
+ in step 3:
211
149
 
212
150
  ```bash
213
151
  node "$HOME/.claude/scripts/autopilot-control.mjs" on --repo <owner/name> [--repo <owner/name>...]
214
152
  ```
215
153
 
216
- It keeps exactly those repos in `config.json`, probes their credentials again
217
- (`autopilot-arming.mjs probeCredentials`), renders
218
- `templates/multi-agent-autopilot.plist.template` with its seven placeholders
219
- (NODE, TICK, LABEL, ROOT, INTERVAL, HOME, CLAUDE), loads it with `launchctl
220
- bootstrap` (falling back to `load`) and installs the awake agent with the
221
- `awake.display` answer saved above. `scheduled: false` with probe problems means
154
+ It re-probes credentials, renders and loads the plist and installs the awake
155
+ agent (detail: `details.md`). `scheduled: false` with probe problems means
222
156
  nothing was loaded; say so with the problems. Exit 1 with `launchd refused`
223
157
  means launchd refused the job: say so, with its path, and say the Mac may sleep
224
158
  between ticks until it is fixed. "Configure only" is `--configure-only`, which
@@ -226,21 +160,16 @@ saves the selection and installs neither.
226
160
 
227
161
  ### 9. Report what is now true
228
162
 
229
- Say all five, because each one is something a user has asked about after the
230
- fact: which repos and which labels; that it survives a restart with no command to
231
- run (launchd loads at **login** - not boot, and that is correct, because the login
232
- keychain is what unlocks the tokens, so a run before login could not reach Jira or
233
- GitHub anyway); that the machine is kept awake for as long as the mode is on (system sleep on AC, idle sleep on battery too) and whether the display is kept on; the slot count
163
+ Say all five: which repos and which labels; that it survives a restart with no
164
+ command to run (launchd loads at **login**, not boot); that the machine is kept awake while the mode is on and whether the display is kept on; the slot count
234
165
  and the ceiling this machine would allow (`ma_ap_slot_ceiling`); and that
235
166
  `/multi-agent:autopilot-off` is the only way to stop it.
236
167
 
237
168
  ## What this does not do
238
169
 
239
- - **No cap on PRs.** As many items as carry the label become as many PRs. The
240
- bounds are `costCeilingUsd` over a rolling 24 hours and what the machine can
241
- hold - never a daily count.
170
+ - **No cap on PRs.** Every labelled item becomes a PR; the bounds are
171
+ `costCeilingUsd` over a rolling 24 hours and machine capacity, never a daily count.
242
172
  - **Does not merge.** The runner stops at an open PR; the merge decision stays
243
173
  yours.
244
- - **Does not touch an attended run.** Both are worktrees and per-repo concurrency
245
- is 1, so the queue skips a repo you are working in rather than competing for
246
- `.git/index.lock`.
174
+ - **Does not touch an attended run.** Per-repo concurrency is 1: the queue skips
175
+ a repo you are working in.
@@ -9,12 +9,9 @@ confirm: none
9
9
  allowed-tools: Read, Write, Edit, Bash, Grep, WebFetch, AskUserQuestion
10
10
  ---
11
11
 
12
- # /multi-agent channels - Multi-Channel Reporter
12
+ # /multi-agent channels - Multi-Channel Reporter
13
13
 
14
- > **TLDR** - Single entry point for posting task reports to external channels. Jira, Confluence, Wiki (component-only), PR description. Multi-select channels × content. Phase 5 of the pipeline delegates to this command; users can also invoke it post-hoc by Jira ID / PR URL / branch.
15
-
16
- **Claude Code invocation:** `/multi-agent:channels <target>`
17
- **Copilot CLI invocation:** `multi-agent-channels <target>` (top-level command, dash-separated per Copilot no-namespace convention)
14
+ Single entry point for posting a task report to Jira, Confluence, Wiki (component-only), the PR description and Board status (GitHub Projects v2). Phase 5 delegates here; users also invoke it post-hoc by Jira ID / PR URL / branch. Claude Code: `/multi-agent:channels <target>`; Copilot CLI: `multi-agent-channels <target>`.
18
15
 
19
16
  ## Gotchas
20
17
 
@@ -23,190 +20,64 @@ allowed-tools: Read, Write, Edit, Bash, Grep, WebFetch, AskUserQuestion
23
20
  - A Bitbucket PR update must carry the reviewer list back, or the PUT removes every reviewer.
24
21
  - With several repos, the PR description goes to every PR but Jira and Confluence get one post each.
25
22
 
26
- ## Input
27
-
28
- A Jira id or URL, a GitHub or Bitbucket PR URL, a GitHub `#N`, or nothing (cwd + current branch), plus the flags below. Example invocations: `$HOME/.claude/multi-agent-refs/channels/reference.md` "Input forms".
29
-
30
23
  ## Flow
31
24
 
32
- `resolve target → fetch context → menu (or flags) → generator → humanizer → approval → dispatch → summary`. Channels: Jira comment, Confluence page, Wiki pages, PR description, Board status (GitHub Projects v2).
33
-
34
- ### Step 1 - Target resolution
35
-
36
- 1. Parse argument → classify as: Jira-id, Jira-url, PR-url (GitHub or Bitbucket), GitHub-issue-number, empty (cwd+branch).
37
- 2. Resolve linked entities:
38
- - Jira ID → linked PR via dev-status API (`/rest/dev-status/latest/issue/detail`)
39
- - PR URL → Jira ID extracted from branch name / title / body using `{JIRA_KEY}-XXXXX` pattern
40
- - GitHub `#N` → resolved against the repo in cwd
41
- - Empty → read git branch, extract Jira ID, find linked PR
42
- 3. Detect remote type: `github` (gh CLI) or `bitbucket` (REST).
43
- 4. Store in runtime state: `{jiraId, targets: [{prUrl, prNumber, remoteType, repoPath, baseBranch, headBranch, repoName, isPrimary}]}`.
44
-
45
- **Multi-repo:** when `agent-state.json` `projects[].length > 1`, Step 1 builds **one target per project**. How each target is resolved and which one is primary: `$HOME/.claude/multi-agent-refs/channels/multi-repo.md` "Target resolution (Step 1)", read before Step 1 then. Single-repo tasks have exactly one target.
46
-
47
- ### Step 2 - Context source detection
48
-
49
- Automatic: pipeline log, PR diff, or a manual message, best available first. Read `$HOME/.claude/multi-agent-refs/channels/menu.md` before Step 2: the source table (when each source is available, which content options it feeds) and the Step 3 menu rules.
50
-
51
- If both pipeline log and PR diff exist, the menu offers both. If only one, the unavailable options are greyed out with a one-line reason.
52
-
53
- ### Step 3 - Multi-select menu (normal mode)
54
-
55
- Rendered in English (`promptLanguage` is locked to `en`). Previous selections (`prefs.global.reportChannels`, `prefs.global.reportContent`) are pre-ticked.
56
-
57
- #### Step 3a - Work Summary preview (summary-first flow)
58
-
59
- **Runs only when** `agent-state.json` exists for the task AND a Work Summary can be generated. It prints the summary BEFORE the channel picker and auto-ticks the workSummary content row in 3b; an explicit `prefs.global.reportContent.workSummary` still wins. Otherwise 3a is skipped silently.
60
-
61
- **Autopilot interaction (Step 4):** `state.autopilot === true` still pauses at channels (documented exception to zero-interaction contract), preview in-line. Under `MULTI_AGENT_UNATTENDED=1` it posts nothing: `$HOME/.claude/multi-agent-refs/features/unattended-security.md`.
62
-
63
- #### Step 3b - Channel + content picker
64
-
65
- Two pickers: **Channels** (PR description, Jira comment, Confluence page, Wiki, Board) and **Content**. An unavailable option is greyed with a one-line reason, never hidden. Selections are saved to `prefs.global.reportChannels` and `prefs.global.reportContent` as the next run's defaults.
66
-
67
- `channels/menu.md` (read at Step 2) carries the preview snippet, the auto-tick rules, every greyed-out rule with its reason string, and the first-run defaults.
68
-
69
- ### Step 4 - Mode short-circuit
70
-
71
- Non-interactive in three cases - menu skipped entirely, flag values or prefs used directly:
72
-
73
- | Mode | Behavior |
74
- |---|---|
75
- | `--channels X,Y` + `--content A,B` flags | Exact flag values, no menu. |
76
- | `autopilot` (Phase 5 delegate) | Reads `prefs.global.reportChannels` + `prefs.global.reportContent` - per Phase 5 autopilot-pause contract, Phase 5 STILL pauses before calling channels but pre-fills menu from prefs. Post-hoc `/channels` in autopilot mode uses prefs directly. |
77
- | `--dry-run` | Runs menu, generates output, prints to stdout, DOES NOT post. |
78
-
79
- ### Step 5 - Generator
80
-
81
- For each selected **content** source, produce one section body. Each section runs through the `humanizer` skill separately (Jira / Confluence / PR tones differ).
82
-
83
- **The Jira body is not the PR body.** Jira is read by the person who filed the
84
- ticket and by whoever tests it, so its comment carries the four sections
85
- `channels/jira.md` fixes - `summary` (`Geliştirme Özeti`), `test_scenarios`
86
- (`Test Senaryoları`), `impact` (`Etki Analizi`) and `context_refs`
87
- (`Bağlantılar`), plus `test_run` when selected - and nothing else. Technical sections go to the PR and to
88
- Confluence, where the reader is a code reviewer. When `jira` is a selected channel, drop
89
- the technical sections from its body rather than converting them: the PR link on
90
- line 1 is how a Jira reader reaches the detail.
25
+ `resolve target -> fetch context -> menu (or flags) -> generator -> humanizer -> approval -> dispatch -> summary`. Before Step 1, read `$HOME/.claude/multi-agent-refs/channels/reference.md`: input forms, flags, the Step 1 resolution detail, the Step 4 mode table, error handling and the Phase 5 delegation contract.
91
26
 
92
- `impact` is not a technical section in disguise. It answers four questions -
93
- what was wrong, what was changed, which areas must be tested, what else is
94
- affected - in the same plain register as the summary, and it is the part a test
95
- lead reads before deciding how wide to test.
27
+ ### Step 1 - Target resolution
96
28
 
97
- Read `$HOME/.claude/multi-agent-refs/channels/generator.md` before generating any section: the content-option table (which section each option produces, from which source), the aggregated output template, store-compliance auto-augmentation from cached `archiveguard-*.json` / `play-compliance-*.json` reports, and the work-summary (`render-work-summary.sh`) and cost-summary (`render-cost-summary.sh`) generators with their precision rules.
29
+ Classify the argument (Jira id / url, GitHub or Bitbucket PR URL, `#N`, empty = cwd + branch), resolve the linked Jira / PR, detect `github` or `bitbucket`, store `{jiraId, targets[]}`. Multi-repo (`projects[].length > 1`): one target per project, per `$HOME/.claude/multi-agent-refs/channels/multi-repo.md`. A Phase 5 call passes a state bundle and skips Step 1.
98
30
 
99
- **The content options are sources, not the body's shape.** Which sections a PR
100
- body carries and in what order is fixed by `channels/pr.md` (`summary` →
101
- `technical` → `architecture` → `impact` → `test_scenarios` → `test_run` → `visuals` → `risk`
102
- → `dependencies` → `build` → `related`); the content options choose what gets
103
- gathered to fill them. A content option left unselected means a section has no
104
- source, not that the section may be reordered or renamed.
31
+ ### Step 2 - Context source detection
105
32
 
106
- **Target length rule:** full body fits one screen on a typical laptop (< 80 lines). Auto-diff summary capped at 5 lines per section. No framework-theory paragraphs, no numbered "why this approach" lists.
33
+ Pipeline log, PR diff, or a manual message, best first. Read `$HOME/.claude/multi-agent-refs/channels/menu.md` before Step 2: the source table and the Step 3 menu rules.
107
34
 
108
- ### Step 6 - Body preview + approval gate (interactive modes)
35
+ ### Step 3 - Multi-select menu
109
36
 
110
- Plan-mode-style gate: the user sees exactly what will be posted BEFORE any external write. Runs after the generator + humanizer, before Step 7 dispatch, in every interactive invocation - menu mode AND `--channels`/`--content` flag mode alike (flags pick the targets, they do not waive the content approval).
37
+ Step 3a prints the Work Summary first (summary-first flow) when `agent-state.json` exists, and auto-ticks that content row; an explicit pref wins. Step 3b: **Channels** (PR description, Jira comment, Confluence page, Wiki, Board) and **Content**; an unavailable option is greyed with a reason, never hidden. Selections pre-tick from and save to `prefs.global.reportChannels` / `prefs.global.reportContent`. Autopilot still pauses here; unattended posts nothing (`$HOME/.claude/multi-agent-refs/features/unattended-security.md`).
111
38
 
112
- Skipped in exactly two cases:
39
+ ### Step 4 - Mode short-circuit
113
40
 
114
- | Case | Why |
115
- |---|---|
116
- | Autopilot (`state.autopilot === true` or `MULTI_AGENT_AUTOPILOT=1`), attended | Explicit consent for side-effect creation: posts directly with prefs/flag selections |
117
- | `--dry-run` | Prints without posting |
41
+ `--channels` + `--content` flags, autopilot (prefs), and `--dry-run` skip or shortcut the menu (table in `reference.md`).
118
42
 
119
- **Preview render** (one block per selected channel, final body after humanizer - shown in readable Markdown, channel-specific markup conversion happens after approval).
43
+ ### Step 5 - Generator
120
44
 
121
- PR description and GitHub issue comment are posted as Markdown verbatim; Jira comment and Confluence page are converted after approval. Read `$HOME/.claude/multi-agent-refs/channels/preview.md` before rendering the preview: the per-channel conversion table, the preview block layout and the secondary-artifact intents that ride along at its bottom.
45
+ One section body per selected content source, each run through the `humanizer` skill per channel. Read `$HOME/.claude/multi-agent-refs/channels/generator.md` before generating: the content options, the template, store compliance, work and cost summaries, and the Jira-versus-PR rule.
122
46
 
123
- **Then a single AskUserQuestion** (`picker-contract.md`; `question`/`label`/`description` in `outputLanguage`, `header` English):
47
+ - **The Jira body is not the PR body.** Jira gets only `Geliştirme Özeti`, `Test Senaryoları`, `Etki Analizi` and `Bağlantılar` (plus the test run when selected); technical sections are dropped from it, never converted, and go to the PR and Confluence.
48
+ - PR section order is fixed by `channels/pr.md`; content options are sources, not the shape.
49
+ - Target length: under 80 lines; auto-diff capped at 5 lines per section.
124
50
 
125
- | Option | Behavior |
126
- |---|---|
127
- | `Approve & post` | Step 7 dispatches every previewed body verbatim |
128
- | `Edit` | Free-text "which channel, what should change" → apply → re-render the FULL preview → re-ask (loop, no cap) |
129
- | `Skip channels` | multiSelect which channels to drop this run → re-render remaining → re-ask |
130
- | `Cancel` | Abort dispatch entirely - nothing posted anywhere. Internal capture (agent-log, knowledge) is unaffected |
51
+ ### Step 6 - Body preview + approval gate
131
52
 
132
- **Hard rule:** what is posted is byte-identical to the approved preview (markup conversion excepted). Any body regeneration after approval invalidates the approval and re-runs the gate. Persisting channel prefs (Step 8) still happens on `Cancel` - selection memory and content approval are independent.
53
+ Every interactive run, menu mode and flag mode alike, shows the final bodies before any external write. Skipped in exactly two cases: autopilot (`state.autopilot === true` or `MULTI_AGENT_AUTOPILOT=1`, attended) and `--dry-run` (prints without posting). Read `$HOME/.claude/multi-agent-refs/channels/preview.md` before rendering: conversion table, block layout, option table.
133
54
 
134
- ### Step 7 - Channel dispatch
55
+ One `AskUserQuestion` (`picker-contract.md`; `question` / `label` / `description` in `outputLanguage`, `header` English): `Approve & post` / `Edit` (loop) / `Skip channels` / `Cancel` (nothing posted).
135
56
 
136
- For each selected **channel**, call the corresponding adapter. Adapters run **in parallel** - one failure does not block others. Dispatch NEVER starts before the Step 6 gate resolves (`Approve & post`), except in the two documented skip cases (autopilot, `--dry-run`).
57
+ **Hard rule:** what is posted is byte-identical to the approved preview (markup conversion excepted). Any regeneration after approval invalidates the approval and re-runs the gate.
137
58
 
138
- **Multi-repo dispatch** (`state.projects[].length > 1`): which channel posts once and which per repo, and the `channels-multi-repo.sh` calls: `$HOME/.claude/multi-agent-refs/channels/multi-repo.md`.
59
+ ### Step 7 - Channel dispatch
139
60
 
140
- #### Adapter: PR description
141
- Aggregated Markdown from Step 5 → PR description. GitHub uses `gh pr edit --body-file`; Bitbucket uses a **reviewer-preserving (required)** `PUT /pull-requests/{id}` payload (must re-send `reviewers`, `fromRef`, `toRef`, `draft`, `version` - omitting any one resets that field server-side). Default is **replace**; `--append` opt-in. Multi-repo cross-links handled by `channels-multi-repo.sh render-pr`.
61
+ Adapters run in parallel; one failure does not block the others. Dispatch NEVER starts before the Step 6 gate resolves, except autopilot and `--dry-run`. Multi-repo: `channels/multi-repo.md`.
142
62
 
143
- Full contract: [`$HOME/.claude/multi-agent-refs/channels/pr.md`]($HOME/.claude/multi-agent-refs/channels/pr.md) - Bitbucket payload assembly snippet, version-mismatch retry, `--ready` promotion, multi-repo cross-link block.
63
+ - **PR description**: GitHub `gh pr edit --body-file`; Bitbucket a reviewer-preserving `PUT` that re-sends `reviewers`, `fromRef`, `toRef`, `draft`, `version`. Replace by default, `--append` opt-in. Contract: `$HOME/.claude/multi-agent-refs/channels/pr.md`.
64
+ - **Jira comment**: PR URL on line 1, then the four sections. Post with `bash "$HOME/.claude/lib/jira-publish.sh" --issue "$JIRA_ID" --body-file "$F" --target comment` (escapes the body, token never on argv). Contract: `$HOME/.claude/multi-agent-refs/channels/jira.md`. Issue family (`state.jiraFamily`): `jira-family-write.sh plan`, preview, `apply`, per `$HOME/.claude/multi-agent-refs/features/jira-family.md`.
65
+ - **Confluence page**: `$HOME/.claude/multi-agent-refs/channels/confluence.md`.
66
+ - **Board**: `$HOME/.claude/multi-agent-refs/channels/board.md`.
67
+ - **Wiki**: only when `taskType === "component"` and `wiki.enabled`, otherwise the Case B menu from `$HOME/.claude/multi-agent-refs/wiki-capture.md`; once wiki pages are written, the Wiki-to-Jira comment needs `prefs.global.wikiToJiraComment`. Contract: `$HOME/.claude/multi-agent-refs/channels/wiki.md`.
144
68
 
145
- #### Adapter: Jira comment
146
- Sections: `summary` + `test_scenarios` + `impact` + `context_refs` only - the technical ones go to the PR and Confluence (`channels/jira.md` fixes the order). The PR URL goes on line 1, above the first heading. The wiki-markup conversion table lives in that same ref and only there.
69
+ ### Step 8 - Summary
147
70
 
148
- Then post it - do not assemble the request:
149
-
150
- ```bash
151
- bash "$HOME/.claude/lib/jira-publish.sh" --issue "$JIRA_ID" --body-file "$F" --target comment
152
- ```
153
-
154
- The publisher escapes every body (emoticon sequences, see Gotchas) and resolves the token from `keychainMapping.jira` without putting it on argv.
155
-
156
- Full contract: [`$HOME/.claude/multi-agent-refs/channels/jira.md`]($HOME/.claude/multi-agent-refs/channels/jira.md) - full conversion table, multi-repo PR-list prepend, Wiki→Jira triad interaction.
157
-
158
- **Issue family** (`state.jiraFamily` set): instead, `bash $HOME/.claude/lib/jira-family-write.sh plan --state "$STATE_FILE" --dev-body "$F"`, the Step 6 preview as one multi-select under `plan.confirm`, then `apply --state "$STATE_FILE"`: `$HOME/.claude/multi-agent-refs/features/jira-family.md`.
159
-
160
- #### Adapter: Confluence page
161
- Token from `keychainMapping.confluence`; missing/expired triggers the inline Save Flow from `setup.md`. Parent page from `prefs.projects[<project>].confluenceUrls` recents or a pasted URL, then storage-format conversion and POST; URL saved back to recents.
162
-
163
- Full contract: [`$HOME/.claude/multi-agent-refs/channels/confluence.md`]($HOME/.claude/multi-agent-refs/channels/confluence.md) - URL parsing rules, full storage-XML conversion table, update-vs-create branch.
164
-
165
- #### Adapter: Board (GitHub Projects v2 status move)
166
-
167
- Precondition, token, item lookup, mutation and idempotency: `$HOME/.claude/multi-agent-refs/channels/board.md`.
168
-
169
- #### Adapter: Wiki
170
- **Precondition gate:** `state.taskType === "component"` AND `figmaConfig.wiki.enabled === true`. If not met, shows the Case B menu from `$HOME/.claude/multi-agent-refs/wiki-capture.md` (setup / skip / disable / manual-note).
171
-
172
- **If preconditions met (Case A):** scope multi-select, then dispatch to the plugin skill `ai-ios-toolkit:figma-component-wiki` (or `ai-android-toolkit:figma-component-wiki`). When wiki pages are written AND `state.jiraId` is set AND `prefs.global.wikiToJiraComment === true`, the Wiki-to-Jira comment auto-link posts an additional Jira comment, independent of the main Jira channel's comment.
173
-
174
- Full contract: [`$HOME/.claude/multi-agent-refs/channels/wiki.md`]($HOME/.claude/multi-agent-refs/channels/wiki.md) - all four `figma-config.wiki.mode` adapters (submodule / in-repo / github-wiki / separate-repo), full Case A scope menu, screenshot quadrant gate.
175
-
176
- ### Step 8 - Summary
177
-
178
- After all adapters complete (or fail non-blocking), print one line per channel: status symbol (`✓` / `✗` / `-`), key metric, URL where applicable. Format example: `$HOME/.claude/multi-agent-refs/channels/reference.md` "Step 8 summary format".
179
-
180
- Persist selections to `prefs.global.reportChannels` + `prefs.global.reportContent` for next run default.
181
-
182
- ## Flags
183
-
184
- `--channels`, `--content`, `--flow-run`, `--message`, `--message-file`, `--append`, `--dry-run`, `--lang`, `--ready`. What each one does: `$HOME/.claude/multi-agent-refs/channels/reference.md` "Flags", read before Step 1 whenever a flag is present.
71
+ One line per channel (status, metric, URL), format in `reference.md`; persist the selections to prefs.
185
72
 
186
73
  ## Required rules
187
74
 
188
- - **Bitbucket reviewer preservation** - every PR PUT MUST carry current `reviewers`, `fromRef`, `toRef`, `draft`. Omitting any resets that field server-side.
189
- - **Default is replace, not append** for PR description. `--append` opt-in.
190
- - **Real newlines + no HTML entities** in ALL bodies (Jira, Confluence, PR): heredoc + `jq --rawfile` + `curl --data-binary @file`. Never embed `\n` literally - Jira/Bitbucket save verbatim.
191
- - **Humanizer per-channel** - each channel body runs humanizer independently. Tones differ (Jira informal, Confluence formal, PR technical).
192
- - **No markers** - channels does a full replace each run; no `<!-- channels:start -->` bookmarks.
193
- - **Every body item references a symbol/file/line** from diff or pipeline log. No generic "tested the feature" sentences.
194
- - **Adapter failures are non-blocking** - one channel failing does not abort others. Final summary shows per-adapter status.
195
- - **Approval before post** - interactive runs never write to an external channel without the Step 6 preview + approval. Autopilot and `--dry-run` are the only bypasses.
196
-
197
- ## Error handling
198
-
199
- Read `$HOME/.claude/multi-agent-refs/channels/reference.md` before Step 1: the condition-by-condition behaviour table (no target, PR missing or merged, bot author, oversized diff, forced unavailable content, Bitbucket version mismatch, missing token, Wiki preconditions). Cross-CLI parity notes and worked examples live in the same file.
200
-
201
- ## Phase 5 delegation contract
202
-
203
- Phase 5 invokes this command internally instead of running its own inline Jira/Confluence/Wiki logic. Responsibilities split:
204
-
205
- | Who | What |
206
- |---|---|
207
- | Phase 5 | Progress tracker (sub-steps 1-3), agent-log finalization (step 4), knowledge+memory capture (step 5), telemetry emission |
208
- | `channels` | All external delivery: PR description update, Jira comment, Confluence page, Wiki pages |
209
-
210
- Phase 5 passes a runtime state bundle: `{jiraId, prUrl, remoteType, taskType, figmaConfig, agentState, pipelineLogPath, flowRuns}`. `channels` reads these directly, skips target-resolution Step 1.
211
-
212
- **Autopilot contract:** Phase 5 ALWAYS pauses at the channels menu (breaks generic autopilot zero-interaction). 30-min timeout → session ends cleanly, task resumable via `/multi-agent:resume`. See `$HOME/.claude/multi-agent-refs/phases/modes.md` for full contract. The Step 6 body preview + approval gate follows the same split: interactive runs approve the composed bodies before dispatch; autopilot posts directly after the menu resolves.
75
+ - **Bitbucket reviewer preservation**: every PR PUT carries current `reviewers`, `fromRef`, `toRef`, `draft`.
76
+ - **Replace, not append**, for the PR description unless `--append`.
77
+ - **Real newlines, no HTML entities** in every body: heredoc + `jq --rawfile` + `curl --data-binary @file`; never a literal `\n`.
78
+ - **Humanizer per channel**; tones differ.
79
+ - **No markers**: a full replace each run, no `<!-- channels:start -->` bookmarks.
80
+ - **Every body item cites a symbol / file / line** from the diff or log.
81
+ - **Adapter failures are non-blocking**.
82
+ - **Approval before post**: autopilot and `--dry-run` are the only bypasses.
83
+ - **Phase 5 autopilot** always pauses at the menu; a 30-min timeout ends the session cleanly, resumable via `/multi-agent:resume`.