---
description: "Multi-channel reporter  -  Jira/Confluence/Wiki/PR description/Board status. Multi-select channels + content, humanizer pass, reviewer-preserving Bitbucket PR PUT, GitHub Projects v2 board status move. Phase 5 delegates to this skill; users can invoke post-hoc by Jira ID / PR URL / branch."
description-tr: "Çok kanallı raporlayıcı - Jira/Confluence/Wiki/PR açıklaması/Board durumu. Çoklu kanal + içerik seçimi, humanizer geçişi, reviewer'ı koruyan Bitbucket PR PUT, GitHub Projects v2 board durum taşıma. Faz 5 bu skill'e delege eder; Jira ID / PR URL / branch ile sonradan da çağrılabilir."
argument-hint: '[Jira-id | PR-url | #N | Jira-url] [--channels pr,jira,confluence,wiki,board] [--content normal,technical,test,auto-diff,note] [--message "..."] [--message-file path] [--board-status <key>] [--dry-run] [--append] [--ready]'
parameters: [{"name":"target","kind":"text"},{"name":"--channels","kind":"enum","repeat":true,"enum":["pr","jira","confluence","wiki","board"]},{"name":"--content","kind":"enum","repeat":true,"enum":["normal","technical","test","auto-diff","note"]},{"name":"--message","kind":"text"},{"name":"--message-file","kind":"path"},{"name":"--board-status","kind":"text"},{"name":"--dry-run","kind":"flag"},{"name":"--append","kind":"flag"},{"name":"--ready","kind":"flag"}]
gui: form
destructive: false
confirm: none
allowed-tools: Read, Write, Edit, Bash, Grep, WebFetch, AskUserQuestion
---

# /multi-agent channels  -  Multi-Channel Reporter

> **TLDR**  -  Single entry point for posting task reports to external channels. Supports Jira, Confluence, Wiki (component-only), and PR description updates. Multi-select channels × multi-select content sources. Phase 5 of the pipeline delegates to this command; users can also invoke it post-hoc by Jira ID / PR URL / branch.

**Claude Code invocation:** `/multi-agent:channels <target>`
**Copilot CLI invocation:** `multi-agent-channels <target>` (top-level command, dash-separated per Copilot no-namespace convention)

## Gotchas

- Nothing is posted before the Step 6 approval gate resolves, in every interactive mode. Under `MULTI_AGENT_UNATTENDED=1` nothing is posted at all.
- Jira renders `:)` `(x)` `(!)` as emoticons, so a Swift selector like `login(source:input:)` breaks. Post through `jira-publish.sh`, which escapes the body; never assemble the request by hand.
- A Bitbucket PR update must carry the reviewer list back, or the PUT removes every reviewer.
- With several repos, the PR description goes to every PR but Jira and Confluence get one post each.

## Input

```
/multi-agent:channels                                         # cwd + current branch
/multi-agent:channels PROJ-12345                            # Jira ID
/multi-agent:channels #42                                     # GitHub issue/PR number
/multi-agent:channels https://github.com/<org>/<repo>/pull/N
/multi-agent:channels https://<bitbucket-host>/projects/.../pull-requests/N
/multi-agent:channels https://<jira-host>/browse/PROJ-12345

/multi-agent:channels PROJ-12345 --channels jira,confluence # non-interactive channel
/multi-agent:channels PROJ-12345 --content auto-diff        # non-interactive content
/multi-agent:channels PROJ-12345 --message "root: ..."      # manual source
/multi-agent:channels PROJ-12345 --message-file notes.md    # manual, long
/multi-agent:channels PROJ-12345 --dry-run                  # preview, no POST
```

## Flow

`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).

### Step 1  -  Target resolution

1. Parse argument → classify as: Jira-id, Jira-url, PR-url (GitHub or Bitbucket), GitHub-issue-number, empty (cwd+branch).
2. Resolve linked entities:
   - Jira ID → linked PR via dev-status API (`/rest/dev-status/latest/issue/detail`)
   - PR URL → Jira ID extracted from branch name / title / body using `{JIRA_KEY}-XXXXX` pattern
   - GitHub `#N` → resolved against the repo in cwd
   - Empty → read git branch, extract Jira ID, find linked PR
3. Detect remote type: `github` (gh CLI) or `bitbucket` (REST).
4. Store in runtime state: `{jiraId, targets: [{prUrl, prNumber, remoteType, repoPath, baseBranch, headBranch, repoName, isPrimary}]}`.

**Multi-repo:** when `agent-state.json` `projects[].length > 1`, Step 1 builds **one target per project**. Each project's PR is resolved via `pr` field in its projects[] entry; if missing, the Jira/Issue link query returns multiple PRs (one per repo)  -  all are added to `targets[]`. The project at `projects[0]` (or whose name matches `state.project`) is marked `isPrimary: true`; others are `isPrimary: false`.

For single-repo tasks, `targets` has exactly one entry. The rest of the flow is target-aware: Step 5 generates one body, Step 7 dispatches to each target, with cross-links (see below).

### Step 2  -  Context source detection

Automatic. The generator picks the best-available source:

| Source | Available when | Used for |
|---|---|---|
| **Pipeline log** | `$HOME/.claude/logs/multi-agent/<project>/<task-id>/agent-log.md` exists AND matches `jiraId` | "Normal analiz" + "Test senaryoları" content options  -  uses Phase 1/2/4 output verbatim |
| **PR diff** | PR exists, diff fetchable (`gh pr diff` or Bitbucket `/diff?contextLines=5`) | "Auto-diff summary" content option  -  old enrich behavior |
| **Manual message** | `--message` / `--message-file` provided | Replaces both sources  -  user text is canonical |

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.

### Step 3  -  Multi-select menu (normal mode)

Rendered in English (`promptLanguage` is locked to `en`). Previous selections (`prefs.global.reportChannels`, `prefs.global.reportContent`) are pre-ticked.

#### Step 3a  -  Work Summary preview (summary-first flow)

**Runs only when** (a) `agent-state.json` exists for the task AND (b) a Work Summary can be generated (same availability rule as the "Yapılan iş özeti" content row). Purpose: give the user an instant "what did this ship?" answer BEFORE they pick channels. They see the outcome first, then decide where to route it  -  instead of the reverse.

```bash
preview=$(bash $HOME/.claude/scripts/render-work-summary.sh "$TASK_ID" 2>/dev/null || true)
[ -n "$preview" ] && {
  printf '%s\n\n' "$preview"
  # Auto-tick workSummary content row when preview was shown.
  # Users can still untick it in 3b if they don't want to re-send the same
  # block to remote channels (useful when preview was enough for a look).
  content_defaults.workSummary=true
}
```

When the preview renders:
- **workSummary** row in 3b is **auto-ticked** (user can still uncheck).
- Previous `prefs.global.reportContent.workSummary` value is respected  -  if the user had explicitly unticked in a prior run, the auto-tick is **suppressed** and the ticked state matches the pref.

When the preview does NOT render (no state, or pref explicitly off at global level with no override):
- Skip 3a silently, go straight to the channels picker. The workSummary row in 3b stays at its pref default (`false`).

After the preview prints, 3b renders the two pickers: **Channels** (PR description, Jira comment, Confluence page, Wiki, Board; each unavailable one greyed with its reason) and **Content** (normal analysis, technical analysis, test scenarios, PR auto-diff, manual note, cost summary, work summary).

**Why auto-tick:** the user just saw the summary and is most likely sending it; the explicit pref still wins.

**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`.

#### Step 3b  -  Channel + content picker

**Greyed-out rules:**
- "Wiki" unselectable unless `state.taskType === "component"` AND `figmaConfig.wiki.enabled === true`. If greyed, show reason: `"(no figma-config or taskType != component)"`.
- "Board" unselectable unless `figmaConfig.board.enabled === true` AND `figmaConfig.board.provider === "github-projects-v2"` AND `figmaConfig.github.projectV2Id` set. If greyed, show reason: `"(no figma-config.board or projectV2Id missing)"`. Default target column: `inReview`.
- "Normal analiz" + "Test senaryoları" unselectable if no pipeline log found. Reason: `"(no pipeline log for PROJ-12345)"`.
- "Teknik analiz" unselectable if no Phase 1 planning log AND no PR diff available. Reason: `"(no technical source  -  need Phase 1 plan or PR diff)"`.
- "Auto-diff" unselectable if no PR found. Reason: `"(no PR linked to this target)"`.
- "Manuel not" always available.
- "Cost özeti" unselectable if `phase-tracker.sh cost total` prints `-` (no priced token tallies; there is no `status` action) AND no `otel-spans.jsonl` exists for the task. Reason: `"(no tracker data  -  set MULTI_AGENT_OTEL_SPANS=1 or enable token tracking)"`.
- "Yapılan iş özeti" unselectable if no `agent-state.json` exists for the task (post-hoc call with `--branch` + `--base-branch` flags restores partial availability). Reason: `"(no agent-state.json for {taskId})"`. **Auto-ticked** when Step 3a preview was shown  -  user can still uncheck before confirming the menu.

**Defaults (first run):** PR + Jira ticked, Confluence + Wiki unticked. Content: auto-diff if pipeline log missing; otherwise normal-analiz + test-senaryoları.

Saved to `prefs.global.reportChannels` and `prefs.global.reportContent`  -  next run uses these as defaults.

### Step 4  -  Mode short-circuit

Non-interactive in three cases  -  menu skipped entirely, flag values or prefs used directly:

| Mode | Behavior |
|---|---|
| `--channels X,Y` + `--content A,B` flags | Exact flag values, no menu. |
| `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. |
| `--dry-run` | Runs menu, generates output, prints to stdout, DOES NOT post. |

### Step 5  -  Generator

For each selected **content** source, produce one section body. Each section runs through the `humanizer` skill separately (Jira / Confluence / PR tones differ).

**The Jira body is not the PR body.** Jira is read by the person who filed the
ticket and by whoever tests it, so its comment carries the four sections
`channels/jira.md` fixes - `summary` (`Geliştirme Özeti`), `test_scenarios`
(`Test Senaryoları`), `impact` (`Etki Analizi`) and `context_refs`
(`Bağlantılar`) - and nothing else. Technical sections go to the PR and to
Confluence, where the reader is a code reviewer. A shipped Jira comment once
explained a hash-table mutation across three paragraphs of class names; it was
correct, and it was the wrong document. When `jira` is a selected channel, drop
the technical sections from its body rather than converting them: the PR link on
line 1 is how a Jira reader reaches the detail.

`impact` is not a technical section in disguise. It answers four questions -
what was wrong, what was changed, which areas must be tested, what else is
affected - in the same plain register as the summary, and it is the part a test
lead reads before deciding how wide to test.

| Content option | Generated section |
|---|---|
| Normal analiz | `### Analysis`  -  impact summary from Phase 1, risks from Phase 4 (pipeline-log source, high-level only) |
| Teknik analiz | `### Technical Details`  -  Changes (what/why per file group), Architecture (structural decisions, pattern changes), Dependencies (new imports/frameworks/packages). Source: Phase 1 planning + Phase 2 dev log + `git diff --stat`. **PR and Confluence only** - never rendered into a Jira comment. |
| Test senaryoları | `### Test Scenarios`  -  precondition / steps / expected table (4-8 rows), user perspective |
| Auto-diff | Old enrich Output Template verbatim  -  Root Cause / Solution / Changed Files / Test Scenarios |
| Manuel not | `### Notes`  -  user-provided paragraph, or LLM-split into subsections if `--message` is plain text and long |
| Cost özeti | `### Cost Summary`  -  per-phase token tally + est. USD table. Source: `phase-tracker.sh` phase status + optional OTel spans. See "Cost summary generation" below. |
| Yapılan iş özeti | `### Work Summary`  -  executive one-screen summary: task + branch + base + PR, scope delivered (done/[pending] per Phase 2 task), changed files with +/- counts (capped at 20 rows), review outcome (accepted/deferred/rejected + approved), phase tick strip. Source: `agent-state.json` + `phase-tracker.json` + `git diff --numstat base...HEAD`. See "Work summary generation" below. |

**The content options are sources, not the body's shape.** Which sections a PR
body carries and in what order is fixed by `channels/pr.md` (`summary` →
`technical` → `architecture` → `impact` → `test_scenarios` → `visuals` → `risk`
→ `dependencies` → `build` → `related`); the options below choose what gets
gathered to fill them. A content option left unselected means a section has no
source, not that the section may be reordered or renamed.

**Output template (aggregated across selected content options):**

```markdown
### Analysis                        ← if "Normal analiz" selected
{impact summary, risks  -  from pipeline log, high-level}

### Technical Details               ← if "Teknik analiz" selected
#### Changes
{Per changed-file-group, what changed + why  -  from Phase 2 dev log}
#### Architecture
{Structural decisions, pattern changes, new file layouts  -  from Phase 1 plan}
#### Dependencies
{New imports / frameworks / packages  -  from git diff --stat, or "None"}

### Root Cause                      ← if "Auto-diff" selected
{single paragraph  -  from diff}

- `path/to/File.ext → funcName`: {why it broke}

### Solution                        ← if "Auto-diff" selected
- `path/to/File.ext:LINE-LINE`  -  {change, one line}

### Changed Files                   ← if "Auto-diff" selected
| File | +/- |
|------|-----|
| `path/to/File.ext` | +N / -M |

### Test Scenarios                  ← if "Test senaryoları" OR "Auto-diff" selected
**1. {what this scenario exercises}**
1. {step the tester performs}
2. **Expected:** {what they should see}

**2. {regression scenario}**
1. {step}
2. **Expected:** {what should still behave as before}

### Notes                           ← if "Manuel not" selected
{user message}

### Work Summary                    ← if "Yapılan iş özeti" selected
{executive scope + files + review + phases block  -  see "Work summary generation" below}

### Cost Summary                    ← if "Cost özeti" selected
{per-phase token + USD table  -  see "Cost summary generation" below}

### Store compliance                ← auto-appended if cached compliance report exists
{summary line  -  see below}

Ref: {jiraId}
```

**Store compliance auto-augmentation:**

After the content-selected sections are generated, check for a recent compliance report cached from `/multi-agent:test "store-ready"`:

```bash
# Cache locations (newest wins; expire after 6h to avoid stale cross-branch reports)
find /tmp -maxdepth 1 -name 'archiveguard-*.json' -o -name 'play-compliance-*.json' \
  -newermt "-6 hours" -print 2>/dev/null | head -1
```

If a cached report exists AND any of the selected channels is PR / Jira / Confluence, append an auto-summary section:

| Blocker count | Appended line |
|---|---|
| `errors > 0` | `### Store compliance` + `{N} blocker(s), {M} warning(s)  -  run /multi-agent:test "store-ready" for the full report.`  -  per-blocker: `- \`{ruleID}\`  -  {Apple ITMS / Play ref}: {message}` (capped at 5 rows, rest collapsed to `+N more`) |
| `errors == 0, warnings > 0` | `### Store compliance` + `[done] No blockers. {M} warning(s)  -  see /multi-agent:test "store-ready" for detail.` |
| `errors == 0, warnings == 0` | Skip section entirely  -  don't pollute PR body |

The section references `ruleID` + policy ref from the compliance skill catalogs (`apple-archive-compliance` / `google-play-compliance`) verbatim. No translation  -  global identifiers stay as-is.

If no cached report exists, skip silently  -  this is augmentation, not a gate.

**Work summary generation:**

Emitted only when `reportContent.workSummary === true` and at least one of (`agent-state.json`, `--branch` flag) is available. The shell adapter is `$HOME/.claude/scripts/render-work-summary.sh <taskId>`, and that script's own header is the spec for what it emits - task header, scope delivered, changed files, review outcome, phase strip - including the caps and the hidden-when-empty rules. Re-stating those five steps here gave the pipeline two specifications of one script, and the prose one is the copy that rots. Exit 2 means the state was unreadable: skip the section, do not substitute a hand-written one.

**Output template:**

```markdown
### Work Summary
**Task**: `PROJ-1099`  |  **Branch**: `bugfix/PROJ-1099-dark-mode`  |  **Base**: `develop`  |  **PR**: #104

#### Scope delivered
- [done] T1 Add failing dark-mode snapshot test
- [done] T2 Replace Color.white with design token

#### Changed files (3 files · +48 / -12)
- `Sources/Auth/LoginView.swift` (+24 / -8)
- `Sources/Auth/LoginViewTests.swift` (+22 / -4)
- `Sources/DesignSystem/Color+Tokens.swift` (+2 / -0)

#### Review outcome
- 1 accepted · 0 deferred · 0 rejected · approved=true

#### Phases
- 0 Init [done] · 1 Plan [done] · 2 Dev [done] · 3 Review [done] · 4 Commit [done] · 5 Report active
```

**Post-hoc invocation** (task already finished, agent-state.json may be archived): pass `--branch` + `--base-branch` explicitly  -  the script still emits task header + changed-files + phases sections (scope + review outcome are state-dependent and will be absent if state is gone).

**Cost summary generation:**

Emitted only when `reportContent.costSummary === true` and tracker data is available. Source of truth is `phase-tracker.sh`:

1. **Token tallies per phase**  -  `render-cost-summary.sh <taskId>` resolves the tracker JSON itself: worktree candidates (`.worktrees/{taskPath}/phase-tracker.json`) first, then the standard location `$HOME/.claude/logs/multi-agent/{taskId}/tracker-state.json` that `phase-tracker.sh` actually writes. Each phase row carries `{tokens_in, tokens_out}`.
2. **Fallback to OTel spans**  -  if tracker JSON has no token columns but `otel-spans.jsonl` exists (set `MULTI_AGENT_OTEL_SPANS=1` beforehand), aggregate `phase.tokens` spans by phase ID.
3. **USD estimate**  -  uses a static price table in `$HOME/.claude/scripts/cost-table.json` (model → $/Mtok_in, $/Mtok_out). Missing model → show ` - ` for USD, never block.

**Output template:**

```markdown
### Cost Summary
| Phase | Model | Tokens in | Tokens out | Est. USD |
|-------|-------|-----------|------------|----------|
| 1. Analysis | opus   | 12,480 | 3,210 | $0.42 |
| 2. Planning | opus   | 18,904 | 5,120 | $0.66 |
| 3. Dev      | sonnet | 42,310 | 9,880 | $0.27 |
| 4. Review   | opus   | 21,050 | 4,720 | $0.66 |
| **Total**   |        | **94,744** | **22,930** | **$2.04** |
```

Generated by `$HOME/.claude/scripts/render-cost-summary.sh <task-id>` using prices from `$HOME/.claude/scripts/cost-table.json`. The channels adapter shells out to this renderer  -  doc table is illustrative only, runtime is authoritative.

**Precision rules:** tokens as thousand-separated integers. USD rounded to 2 dp (`printf '$%.2f'`). Rows with zero tokens dropped. If total USD is ` - ` (no price for any model), replace the total row USD cell with ` - ` and add a one-line footnote: `*USD unavailable  -  add model to cost-table.json*`.

**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.

### Step 6  -  Body preview + approval gate (interactive modes)

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).

Skipped in exactly two cases:

| Case | Why |
|---|---|
| Autopilot (`state.autopilot === true` or `MULTI_AGENT_AUTOPILOT=1`), attended | Explicit consent for side-effect creation: posts directly with prefs/flag selections |
| `--dry-run` | Already prints without posting; a question would be redundant |

**Preview render** (one block per selected channel, final body after humanizer  -  shown in readable Markdown, channel-specific markup conversion happens after approval).

Conversion is per-channel and two of the four channels have none. Do not reach for "the" conversion table  -  there is no single one:

| Channel | Conversion after approval | Table |
|---|---|---|
| PR description | **none**  -  posted as Markdown, verbatim | GitHub / Bitbucket / GitLab all render Markdown; see `channels/pr.md` "Markup dialect" |
| GitHub issue comment | **none**  -  posted as Markdown, verbatim |  -  |
| Jira comment | markdown → Jira wiki markup | `channels/jira.md` "Wiki markup conversion" |
| Confluence page | markdown → storage format | `channels/confluence.md` "Body conversion" |

Applying the Jira table to the PR body is the recurring failure of this step: it is the only *text* markup table in the doc set, so it reads as the default. It is not. A PR body containing `h2.`, `{{code}}`, or `#`-numbered lists shipped raw wiki markup to a Markdown surface.

```
── PR description  ({repoName} #{prNumber}, replace) ─────────
{body}
── Jira comment  ({jiraId}) ──────────────────────────────────
{body}
── Confluence page  ("{title}" under {parentUrl}) ────────────
{body}
```

Secondary artifacts ride along as one-line intents at the bottom of the preview: Wiki page list, wiki → Jira triad comment (when Wiki is selected and the triad is active per `$HOME/.claude/multi-agent-refs/issue-jira-triad.md`), Board status move (`{from} → {to}`), GitHub issue comment + Progress-flag sync (Phase 5 Step 1.5  -  same gate, see `$HOME/.claude/multi-agent-refs/phases/phase-5-report.md`).

**Then a single AskUserQuestion** (`picker-contract.md`; `question`/`label`/`description` in `outputLanguage`, `header` English):

| Option | Behavior |
|---|---|
| `Approve & post` | Step 7 dispatches every previewed body verbatim |
| `Edit` | Free-text "which channel, what should change" → apply → re-render the FULL preview → re-ask (loop, no cap) |
| `Skip channels` | multiSelect which channels to drop this run → re-render remaining → re-ask |
| `Cancel` | Abort dispatch entirely  -  nothing posted anywhere. Internal capture (agent-log, knowledge) is unaffected |

**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.

### Step 7  -  Channel dispatch

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`).

**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`.

#### Adapter: PR description
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`.

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.

#### Adapter: Jira comment
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: the four-row summary that used to sit here mapped `### ...` to `*...*`, which is italic, not a heading - a shrunken copy of a table is a second answer, and it was the wrong one.

Then post it - do not assemble the request:

```bash
bash "$HOME/.claude/lib/jira-publish.sh" --issue "$JIRA_ID" --body-file "$F" --target comment
```

The publisher escapes every body (Jira renders `:)` `(x)` `(!)` `(/)` as emoticon images, and a Swift selector like `login(source:input:)` ends in `:)`) and resolves the token from `keychainMapping.jira` without putting it on argv. The hand-rolled `jq`+`curl` this replaced kept the escape as a separate step, and a shipped comment turned `hash(into:)` into a smiley.

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.

#### Adapter: Confluence page
Token from `keychainMapping.confluence`; missing/expired triggers the inline Save Flow from `setup.md`. Parent page picked from `prefs.projects[<project>].confluenceUrls` recents (LRU, max 5) or paste new URL. Auto-suggest title `"{jiraId}  -  {taskTitle}"`. Body converted to Confluence storage format (`<h3>`, `<table>`, `<ac:structured-macro>` code blocks). POST `/rest/api/content`; URL saved back to recents.

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.

#### Adapter: Board (GitHub Projects v2 status move)

Precondition, token, item lookup, mutation and idempotency: `$HOME/.claude/multi-agent-refs/channels/board.md`.

#### Adapter: Wiki
**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).

**Wiki → Jira comment auto-link** (triad contract, preserved from v5.6): when the Wiki adapter writes pages AND `state.jiraId` is set AND `prefs.global.wikiToJiraComment === true`, also post a humanizer-passed summary of the wiki pages (component name + variant count + wiki URL) as an additional Jira comment on the same issue. Independent of the main Jira channel's comment  -  both can coexist. Full contract in `$HOME/.claude/multi-agent-refs/issue-jira-triad.md`.

**If preconditions met (Case A):** scope multi-select prompt (Main page / iOS sub-page / Screenshots / Index updates / Other); adapter dispatched to the plugin skill `ai-ios-toolkit:figma-component-wiki` (or `ai-android-toolkit:figma-component-wiki`).

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.

### Step 8  -  Summary

After all adapters complete (or fail non-blocking):

```
channels dispatch complete
  PR description  ✓   version 3→4, reviewers 23 preserved
  Jira comment    ✓   posted → <jira-url>?focusedCommentId=2484780
  Confluence      -   skipped: user declined
  Wiki            ✓   3 files via github-wiki adapter
  Board           ✓   In Develop → In Review (project #4)
```

Each line: status symbol (`✓` / `✗` / `-`), key metric, URL where applicable.

Persist selections to `prefs.global.reportChannels` + `prefs.global.reportContent` for next run default.

## Flags

| Flag | Effect |
|------|--------|
| `--channels pr,jira,confluence,wiki` | Non-interactive channel selection (comma list). Skips channel menu. |
| `--content normal,technical,test,auto-diff,note` | Non-interactive content selection. Skips content menu. |
| `--message "..."` | Manual mode  -  use user text as source, no diff read. Forces `content=note`. |
| `--message-file path` | Manual mode, long message from file. |
| `--append` | PR description: append instead of replace. |
| `--dry-run` | Generate, print to stdout, do not POST. |
| `--lang=tr\|en\|both` | Output language override (default: `en`; `promptLanguage` is locked to `en`). |
| `--ready` | If PR draft, promote to READY after channels dispatch. |

## Required rules

- **Bitbucket reviewer preservation**  -  every PR PUT MUST carry current `reviewers`, `fromRef`, `toRef`, `draft`. Omitting any resets that field server-side.
- **Default is replace, not append** for PR description. `--append` opt-in.
- **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.
- **Humanizer per-channel**  -  each channel body runs humanizer independently. Tones differ (Jira informal, Confluence formal, PR technical).
- **No markers**  -  channels does a full replace each run; no `<!-- channels:start -->` bookmarks.
- **Every body item references a symbol/file/line** from diff or pipeline log. No generic "tested the feature" sentences.
- **Adapter failures are non-blocking**  -  one channel failing does not abort others. Final summary shows per-adapter status.
- **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.

## Error handling

| Condition | Behavior |
|-----------|----------|
| No target resolvable | Error, exit 1 |
| PR not found + Jira selected | Proceed Jira-only, log reason |
| PR merged/closed | Warn, confirm continue |
| Author bot / dependabot | Skip entire run |
| Diff > 2 MB | Ask: skip / top-20-files / cancel |
| No pipeline log + "Normal analiz" selected | Greyed out at menu; if forced via `--content`, error |
| Bitbucket PR version mismatch | Refetch once, retry; fail on second mismatch |
| Jira token missing/expired | Token Save Flow inline; skip on user-skip |
| Wiki preconditions not met | Case B menu per `$HOME/.claude/multi-agent-refs/wiki-capture.md` |

## Phase 5 delegation contract

Phase 5 invokes this command internally instead of running its own inline Jira/Confluence/Wiki logic. Responsibilities split:

| Who | What |
|---|---|
| Phase 5 | Progress tracker (sub-steps 1-3), agent-log finalization (step 4), knowledge+memory capture (step 5), telemetry emission |
| `channels` | All external delivery: PR description update, Jira comment, Confluence page, Wiki pages |

Phase 5 passes a runtime state bundle: `{jiraId, prUrl, remoteType, taskType, figmaConfig, agentState, pipelineLogPath}`. `channels` reads these directly, skips target-resolution Step 1.

**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.

## Cross-CLI parity

| CLI | Command name | Invocation |
|---|---|---|
| Claude Code | `/multi-agent:channels` | Slash namespace (colon) |
| Copilot CLI | `multi-agent-channels` | Top-level command (dash-separated, no namespace support) |

Both installations read the same source file (`$HOME/.claude/commands/multi-agent/channels/SKILL.md`)  -  `install.js --all` copies to:
- `~/.claude/commands/multi-agent/channels/SKILL.md`
- `~/.copilot/commands/multi-agent-channels.md`

Prompts MUST be byte-identical. `smoke-cross-cli-behavior.sh` asserts this  -  spacing, brackets, numbering, log-line format.

Progress emission on Copilot (no native TaskCreate UI): `bash ~/.copilot/scripts/phase-tracker.sh sub 5 <N> "<step>" <status>`  -  same shape as Phase 5.

## Examples

```
/multi-agent:channels
  → resolves from cwd+branch → PROJ-12345 + PR #3433
  → menu: PR ✓ Jira ✓ / Normal analiz ✓ Test senaryoları ✓
  → PR description replaced (v3→4, 23 reviewers preserved)
  → Jira comment posted (id 2484780)
  → Confluence -  Wiki -

/multi-agent:channels PROJ-12345 --channels confluence --content note --message-file notes.md
  → non-interactive: only Confluence, content from notes.md
  → asks: parent page URL (or recent [1] / [2])
  → page created → https://<host>/pages/12345

/multi-agent:channels https://<bitbucket>/.../pull-requests/42 --dry-run
  → resolves → PROJ-67890
  → prints Jira + PR body preview to stdout, no POST

/multi-agent:channels --message "root: order id empty, UI silent. fix: length>0 guard in HomeVC.m"
  → auto-diff from cwd+branch PR + user note combined
  → posts to default channels (PR + Jira)
```
