@mmerterden/multi-agent-pipeline 16.11.0 → 16.12.0

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 (33) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +5 -3
  3. package/README.tr.md +5 -3
  4. package/docs/adr/0001-three-model-triage.md +5 -0
  5. package/docs/features.md +18 -2
  6. package/package.json +1 -1
  7. package/pipeline/claude-md-template.md +1 -1
  8. package/pipeline/commands/multi-agent/SKILL.md +1 -1
  9. package/pipeline/commands/multi-agent/analysis/SKILL.md +1 -1
  10. package/pipeline/commands/multi-agent/help/SKILL.md +2 -2
  11. package/pipeline/commands/multi-agent/resume-local/SKILL.md +2 -2
  12. package/pipeline/commands/multi-agent/review/SKILL.md +3 -3
  13. package/pipeline/commands/multi-agent/review-analysis/SKILL.md +1 -1
  14. package/pipeline/lib/figma-screenshot.sh +107 -7
  15. package/pipeline/lib/md2confluence-v3.py +133 -25
  16. package/pipeline/multi-agent-refs/analysis/locked.md +4 -3
  17. package/pipeline/multi-agent-refs/analysis/render.md +44 -9
  18. package/pipeline/multi-agent-refs/analysis/review.md +17 -1
  19. package/pipeline/multi-agent-refs/analysis-template-corporate.md +14 -3
  20. package/pipeline/multi-agent-refs/knowledge.md +1 -1
  21. package/pipeline/multi-agent-refs/phases/phase-4-review.md +8 -8
  22. package/pipeline/schemas/analysis-spec.schema.json +2 -0
  23. package/pipeline/schemas/reviewer-output.schema.json +1 -1
  24. package/pipeline/schemas/triage-output.schema.json +1 -1
  25. package/pipeline/scripts/anonymize-findings.mjs +1 -1
  26. package/pipeline/scripts/smoke-cross-cli-behavior.sh +9 -9
  27. package/pipeline/scripts/validate-analysis-doc.mjs +85 -23
  28. package/pipeline/skills/.skills-index.json +2 -2
  29. package/pipeline/skills/shared/README.md +1 -1
  30. package/pipeline/skills/shared/core/multi-agent/SKILL.md +3 -3
  31. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +2 -2
  32. package/pipeline/skills/shared/core/multi-agent-review/SKILL.md +2 -2
  33. package/pipeline/skills/skills-index.md +1 -1
package/CHANGELOG.md CHANGED
@@ -16,6 +16,35 @@ Internal file-layout changes that don't affect the slash-command surface are sti
16
16
 
17
17
  ## [Unreleased]
18
18
 
19
+ ## [16.12.0] - 2026-08-27
20
+
21
+ ### Added
22
+
23
+ - **`/multi-agent:analysis` reviews the document before publishing it.** It had no review phase: the only pre-dispatch gate was a structural validator, so nothing ever read what was about to reach Confluence, and one real run published a channel it never searched for, an open question about a frame it never opened, and twenty-three unowned `EKLENECEK` markers. Phase 3.2 runs `phase-4-review.md` Step 0 (the analysis branch that already existed and nothing called) on the draft, before the destination is chosen. Reviewers are subagents holding `analysis/review.md`, never the context that wrote the document, because a context cannot notice a search it never thought to run. A blocking finding returns to synthesis with dispatch closed and never becomes an open question. Locked 36.
24
+ - **Phase 3.3 closes gaps instead of writing them down.** Reachable evidence is searched and never asked about, decisions the user owns are asked, and only external gaps enter the document as `AS-NN` rows with an owner. A gap with neither a `searched, not found` nor an `asked, external` stamp fails the dispatch gate. Autopilot runs both phases; only the asking degrades.
25
+ - **A third reviewer on Claude Code.** Opus fills the slot GPT-5.4 occupies on Copilot and Codex, so every host now runs three: Fable + Opus + Sonnet here. A finding two independent readers both miss is one triage has no chance to catch.
26
+ - **`figma-screenshot.sh --discover-sections`.** One `GET ?depth=3` lists every section whose name matches the feature, with a frame count and a channel guess, folding diacritics so `Elite` and `Elit` are the same word. A channel may no longer be called missing until this returns nothing, and the record must cite the scan (Locked 12). Verified against the file that caused the defect: it returns both the Desktop section and the mobileWeb sibling the run had declared absent.
27
+ - **Four validator gates**: `AS-NN` matched in both directions, `EKLENECEK` without an id, JSON inside a service-table cell, and Turkish diagram labels flattened to ASCII inside a mermaid fence, which the punctuation gate skips.
28
+
29
+ ### Changed
30
+
31
+ - **"All variants drilled" now means read, not counted** (Locked 19). Visible `TEXT` layers inside each frame's own bounds are extracted, hidden layers and overflowing component boilerplate dropped. A frame can be called out of scope only by quoting its own text, and opening an open question about a frame nobody read fails the gate. One run logged a frame named `08 Payment` as ambiguous while its text spelled out the whole payment step.
32
+ - **Every frame-inventory row gets an embedded image** (Locked 18). The gallery is generated from the inventory rather than hand-picked; narrowing to a canonical subset for page weight is not a call the run makes alone. One run uploaded 34 attachments and embedded 14, and was reported as "frames not uploaded" - the files were there and invisible.
33
+ - **Embedded images carry a display width.** `md2confluence-v3.py --image-width` defaults to 720 with a per-image `![](f.png "width=320")` override; the attachment stays full resolution. A 2x phone export is 750x1624 and took two screen heights at natural size.
34
+ - **Service tables put payloads under the table, not in a cell.** `Request` and `Response` carry one of three states; JSON goes in a fenced block below, field notes in their own table. A whole-unknown contract is one line, not six `EKLENECEK` cells.
35
+
36
+ ### Fixed
37
+
38
+ - **`md2confluence` re-upload logged one warning per attachment and lost nothing.** The already-exists path was keyed off HTTP 400, and this Confluence Server answers 500 for a duplicate filename, so the update path was unreachable. It looks before creating now; 400, 409 and 500 remain handled as the race they should always have been. `attachments_updated` is counted apart from `attachments_uploaded`, because "0 uploaded, 12 warnings" reads as data loss when nothing was lost.
39
+ - **The mermaid fallback lost every edge in any diagram whose nodes carry labels.** The pattern required the node id to sit next to the arrow, so `A[Basla] --> B` matched nothing - not just labelled branches, the whole flow. Both label syntaxes are captured now and the label is kept (`Evet -> Odeme Yap`), and the source ships beside the list so the diagram is recoverable.
40
+
41
+ ### Internal
42
+
43
+ - **This release sets the `required` dist-tag.** An install older than 16.12.0 does not produce a worse analysis document, it produces one that has to be redone: no review before publishing, gaps recorded instead of closed, a channel called missing without the file ever being scanned, and frame filenames where the pictures belong. That is the criterion in the Supported Version Gate, so the tag is set rather than left off.
44
+ - The analysis ref ceiling moves 148000 -> 154000 across two raises in one session. Everything that could live outside the count already does: the scan in `figma-screenshot.sh`, the reviewer rubric in `analysis/review.md` which a subagent loads and the orchestrator does not, and all four new gates in `validate-analysis-doc.mjs`. The tree was measured for reclaimable duplication first and had none.
45
+ - `smoke-validate-analysis-doc.sh` replaces four section-number pairing assertions with the `AS-NN` contract in both directions.
46
+
47
+
19
48
  ## [16.11.0] - 2026-08-27
20
49
 
21
50
  ### Changed
package/README.md CHANGED
@@ -62,11 +62,13 @@ One command runs 8 phases, with a gate between the risky ones:
62
62
  - **1 · Analysis** - detect the stack, scan the codebase, map impact (Sonnet).
63
63
  - **2 · Plan** - write a task breakdown and **stop for your approval** before touching code.
64
64
  - **3 · Dev** - TDD: failing test → code → green, following the repo's style + the active stack skills.
65
- - **4 · Review** - deterministic gates (build / lint / test / secret-scan) must pass first, then a **CLI-aware parallel review** - Claude Code runs 2 models (Fable + Sonnet), Copilot CLI runs 3 (GPT-5.4 + Opus + Sonnet) - and a **Fable triage** keeps only actionable findings; blockers loop back to Phase 3.
65
+ - **4 · Review** - deterministic gates (build / lint / test / secret-scan) must pass first, then a **CLI-aware parallel review** - Claude Code runs 3 models (Fable + Opus + Sonnet), Copilot CLI runs 3 (GPT-5.4 + Opus + Sonnet) - and a **Fable triage** keeps only actionable findings; blockers loop back to Phase 3.
66
66
  - **5 · Test** - build + run the suite; success is required (no faked passes).
67
67
  - **6 · Commit/PR** - conventional commit, push (must succeed), open a PR (`Ref: #N`, never auto-close).
68
68
  - **7 · Report** - technical summary + a Jira comment with test scenarios, posted through the channels layer.
69
69
 
70
+ `/multi-agent:analysis` runs its own shorter chain and, since v16.12.0, reviews what it wrote before publishing it: the draft goes through the same three-reviewer set and triage as a code diff, a blocking finding returns it to synthesis with dispatch closed, and the gaps that survive are either searched, asked about, or recorded with an owner. It used to publish behind a structural validator alone.
71
+
70
72
  Under the hood: each task runs in its own **git worktree** (or the current branch with `:local`), commits use the **git identity routed from the repo's origin URL**, and **multi-repo** tasks get per-repo worktrees plus an integration build. Tokens stay in the OS keychain; nothing is committed or logged. `/multi-agent:review` can also review an existing GitHub/Bitbucket PR - per-finding inline comments anchored to `file:line` + an explicit Approve / Needs-Work state.
71
73
 
72
74
  The discipline behind all of this - bounded loops, evidence gates, token-budgeted phase docs, immutable tests, fresh-context handoffs - is catalogued in [docs/engineering.md](./docs/engineering.md). The full feature list lives in [docs/features.md](./docs/features.md). How this repo, the `multi-agent-plugins` marketplace, and the `multi-agent-toolkit-mcp` server compose at install time and at run time is diagrammed in [docs/ecosystem.md](./docs/ecosystem.md).
@@ -223,8 +225,8 @@ error. Measured on 0.145: installing one plugin that declares 142 skills surface
223
225
  `multi-agent` router and keeps the sub-command specs as reference files that cost
224
226
  nothing until read - same commands, same behaviour, a layout the host can actually hold.
225
227
 
226
- Reviewer sets differ because the available models do: Claude Code runs 2 reviewers
227
- (Fable + Sonnet), Copilot CLI 3 (Opus + GPT-5.4 + Sonnet), Codex CLI 3 (gpt-5.6 at
228
+ Reviewer sets differ because the available models do: Claude Code runs 3 reviewers
229
+ (Fable + Opus + Sonnet), Copilot CLI 3 (Opus + GPT-5.4 + Sonnet), Codex CLI 3 (gpt-5.6 at
228
230
  xhigh, gpt-5.4, gpt-5.6 at medium). Codex is single-vendor, so consensus among its three
229
231
  is weaker evidence than the same consensus on a two-vendor host, and the triage note
230
232
  says so.
package/README.tr.md CHANGED
@@ -62,11 +62,13 @@ Tek komut 8 fazı çalıştırır, riskli olanlar arasında bir kapı ile:
62
62
  - **1 · Analysis** - stack'i tespit et, codebase'i tara, etkiyi haritala (Sonnet).
63
63
  - **2 · Plan** - bir görev kırılımı yaz ve koda dokunmadan önce **onayın için dur**.
64
64
  - **3 · Dev** - TDD: başarısız test → kod → yeşil, repo'nun stiline + aktif stack skill'lerine uyarak.
65
- - **4 · Review** - önce deterministik kapılar (build / lint / test / secret-scan) geçmeli, sonra bir **CLI-farkında paralel review** - Claude Code 2 model çalıştırır (Fable + Sonnet), Copilot CLI 3 (GPT-5.4 + Opus + Sonnet) - ve bir **Fable triage** sadece aksiyon alınabilir bulguları tutar; blocker'lar Phase 3'e geri döner.
65
+ - **4 · Review** - önce deterministik kapılar (build / lint / test / secret-scan) geçmeli, sonra bir **CLI-farkında paralel review** - Claude Code 3 model çalıştırır (Fable + Opus + Sonnet), Copilot CLI 3 (GPT-5.4 + Opus + Sonnet) - ve bir **Fable triage** sadece aksiyon alınabilir bulguları tutar; blocker'lar Phase 3'e geri döner.
66
66
  - **5 · Test** - build + suite'i çalıştır; başarı zorunlu (sahte pass yok).
67
67
  - **6 · Commit/PR** - conventional commit, push (başarılı olmalı), bir PR aç (`Ref: #N`, asla otomatik kapatma).
68
68
  - **7 · Report** - teknik özet + test senaryolarıyla bir Jira yorumu, channels katmanından gönderilir.
69
69
 
70
+ `/multi-agent:analysis` kendi kısa zincirini koşar ve v16.12.0'dan beri yazdığını yayınlamadan önce review ediyor: taslak, bir kod diff'iyle aynı üç-reviewer setinden ve triyajdan geçiyor, bloklayıcı bulgu dokümanı sentez fazına geri gönderip dispatch'i kapatıyor, hayatta kalan boşluklar ya aranıyor ya sana soruluyor ya da sahibiyle birlikte kayda giriyor. Önceden yalnızca yapısal bir validator'ın arkasından yayınlıyordu.
71
+
70
72
  Perde arkasında: her görev kendi **git worktree**'sinde çalışır (ya da `:local` ile mevcut branch'te), commit'ler **repo'nun origin URL'inden yönlendirilen git kimliğini** kullanır, ve **çoklu-repo** görevleri repo başına worktree artı bir integration build alır. Tokenlar OS keychain'de kalır; hiçbir şey commit edilmez ya da loglanmaz. `/multi-agent:review` mevcut bir GitHub/Bitbucket PR'ını da review edebilir - `file:line`'a bağlı bulgu-başına inline yorumlar + açık bir Approve / Needs-Work durumu.
71
73
 
72
74
  Bunun arkasındaki disiplin - sınırlı loop'lar, kanıt kapıları, token-bütçeli faz dokümanları, değişmez testler, taze-context handoff'lar - [docs/engineering.md](./docs/engineering.md)'de kataloglanmıştır. Tam özellik listesi [docs/features.md](./docs/features.md)'te. Bu repo, `multi-agent-plugins` marketplace'i ve `multi-agent-toolkit-mcp` sunucusunun install zamanında ve run zamanında nasıl bir araya geldiği [docs/ecosystem.md](./docs/ecosystem.md)'de diyagramlanmıştır.
@@ -224,8 +226,8 @@ pipeline tek bir `multi-agent` router gönderir ve alt-komut spec'lerini, okunan
224
226
  hiçbir maliyeti olmayan referans dosyaları olarak tutar - aynı komutlar, aynı davranış,
225
227
  host'un gerçekten tutabildiği bir düzen.
226
228
 
227
- Reviewer setleri farklı çünkü mevcut modeller farklı: Claude Code 2 reviewer çalıştırır
228
- (Fable + Sonnet), Copilot CLI 3 (Opus + GPT-5.4 + Sonnet), Codex CLI 3 (xhigh'da
229
+ Reviewer setleri farklı çünkü mevcut modeller farklı: Claude Code 3 reviewer çalıştırır
230
+ (Fable + Opus + Sonnet), Copilot CLI 3 (Opus + GPT-5.4 + Sonnet), Codex CLI 3 (xhigh'da
229
231
  gpt-5.6, gpt-5.4, medium'da gpt-5.6). Codex tek-vendor olduğu için üçü arasındaki
230
232
  konsensüs, iki-vendor'lu bir host'taki aynı konsensüsten daha zayıf bir kanıttır ve
231
233
  triage notu bunu belirtir.
@@ -2,6 +2,11 @@
2
2
 
3
3
  **Status:** Accepted · 2025 · Amended 2026-04 (CLI-aware reviewer set) · Amended 2026-07 (v10.6.0: Fable 5 restored - Reviewer 1 and triage run on Fable on Claude Code; Copilot CLI pins Opus. "Opus" below reads as "the top tier of the day")
4
4
 
5
+ > **Superseded in part, v16.12.0.** The reviewer count is now 3 on every host: Opus
6
+ > fills the slot GPT-5.4 occupies on Copilot and Codex, so Claude Code runs
7
+ > Fable + Opus + Sonnet. The reasoning below about a 2-reviewer set on Claude Code
8
+ > is kept as the record of what was decided then, not as current behaviour.
9
+
5
10
  ## Context
6
11
 
7
12
  Code review is the phase where the pipeline most commonly ships wrong work. A
package/docs/features.md CHANGED
@@ -12,7 +12,7 @@ Phase 1: Analysis Stack detection, codebase exploration (parallel Explore agent
12
12
  Phase 2: Planning Task decomposition, architecture review, user approval
13
13
  Phase 3: Dev TDD cycle: test → code → build (Sonnet)
14
14
  Phase 4: Review Deterministic gates + parallel AI review + Fable triage
15
- (Claude Code: Fable + Sonnet · Copilot CLI: GPT-5.4 + Opus + Sonnet)
15
+ (Claude Code: Fable + Opus + Sonnet · Copilot CLI: GPT-5.4 + Opus + Sonnet)
16
16
  Phase 5: Test Optional manual testing + on-demand device audits
17
17
  Phase 6: Commit Git commit, push, PR with default reviewers + draft/ready prompt
18
18
  Phase 7: Report External: Jira comment · Wiki + Figma screenshots · Confluence
@@ -134,6 +134,22 @@ Cheap, objective checks run BEFORE any AI token is spent:
134
134
 
135
135
  If any gate fails, fix first. Don't waste AI tokens reviewing broken code.
136
136
 
137
+ ### Analysis Document Review (Phase 3.2 + 3.3)
138
+
139
+ `/multi-agent:analysis` published behind a structural validator alone until v16.12.0: nothing read the
140
+ document before it reached Confluence. Phase 3.2 now runs the same reviewer set and triage a code diff
141
+ gets, on the draft, before the destination is even chosen. Its first question is what the run skipped -
142
+ an input declared missing that nothing searched for, an open question about evidence nobody read, a gap
143
+ with no owner, a scope call made without asking. A blocking finding returns to synthesis with dispatch
144
+ closed; it never becomes an open question, because "the document is wrong" is not something to ask the
145
+ reader.
146
+
147
+ Phase 3.3 then sorts what is left: reachable evidence is searched (never asked about), decisions the
148
+ user owns are asked with `AskUserQuestion`, and only genuinely external gaps enter the document as
149
+ `AS-NN` rows with an owner. A gap carrying neither a `searched, not found` nor an `asked, external`
150
+ stamp fails the dispatch gate. Autopilot runs both phases; only the asking degrades, into rows stamped
151
+ `autopilot: could not ask`.
152
+
137
153
  ### CLI-Aware Parallel Review + Fable Triage (Phase 4 Steps 2-3)
138
154
 
139
155
  | Reviewer | Model | Focus | Where it runs |
@@ -142,7 +158,7 @@ If any gate fails, fix first. Don't waste AI tokens reviewing broken code.
142
158
  | Reviewer 2 | `gpt-5.4` | Edge cases, different perspective | **Copilot CLI only** |
143
159
  | Reviewer 3 | `claude-sonnet-4-6` | Quality + correctness + naming | Both CLIs |
144
160
 
145
- The reviewer set is **CLI-aware**: Claude Code dispatches 2 reviewers in parallel (Fable + Sonnet - GPT-5.4 is not available there); Copilot CLI dispatches all 3. Each returns structured JSON for deterministic aggregation. Cross-model diversity catches blind spots that any single model family would miss.
161
+ The reviewer set is **CLI-aware**: Claude Code dispatches 3 reviewers in parallel (Fable + Opus + Sonnet - Opus fills the slot GPT-5.4 takes elsewhere); Copilot CLI dispatches all 3. Each returns structured JSON for deterministic aggregation. Cross-model diversity catches blind spots that any single model family would miss.
146
162
 
147
163
  **Fable Triage** (Phase 4 Step 3, Opus on Copilot CLI): Evaluates merged raw findings against task scope. Classifies each as `accepted` (fix now), `deferred` (out of scope, log for later), or `rejected` (false positive / noise). Only triage-accepted blocking items loop back to Phase 3.
148
164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmerterden/multi-agent-pipeline",
3
- "version": "16.11.0",
3
+ "version": "16.12.0",
4
4
  "description": "8-phase AI development pipeline with full orchestration on Claude Code, Copilot CLI and Codex CLI. Analysis, planning, TDD, CLI-aware parallel review with consensus surfacing + Fable triage, default-FAIL evidence gates, secret + intent guards, per-phase cost ledger, persistent learnings memory, wiki generation, commit automation. Token-preserving uninstall.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -17,7 +17,7 @@
17
17
  2. Planning (Opus) -> spec, task breakdown
18
18
  3. Development (Sonnet) -> TDD, code, build
19
19
  4. Review -> deterministic gates + parallel review + Fable triage
20
- - Claude Code: Opus + Sonnet (2 paralel)
20
+ - Claude Code: Fable + Opus + Sonnet (3 paralel)
21
21
  - Copilot CLI: GPT-5.4 + Opus + Sonnet (3 paralel)
22
22
  - Codex CLI: gpt-5.6 (xhigh) + gpt-5.4 + gpt-5.6 (medium) (3 paralel)
23
23
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: "Task orchestrator - full pipeline via Jira ID + branch or GitHub Issue URL: analysis, plan, TDD development, parallel review + Fable triage (CLI-aware: 2-model on Claude Code, 3-model on Copilot CLI), commit, log. Use when given a Jira ID, a GitHub issue or a free-text task and the whole pipeline should run."
3
- description-tr: "Görev orkestratörü - Jira ID + branch veya GitHub Issue URL ile tam pipeline: analiz, plan, TDD geliştirme, paralel review + Fable triyajı (CLI'ya göre: Claude Code'da 2, Copilot CLI'da 3 model), commit, log"
3
+ description-tr: "Görev orkestratörü - Jira ID + branch veya GitHub Issue URL ile tam pipeline: analiz, plan, TDD geliştirme, paralel review + Fable triyajı (CLI'ya göre: Claude Code'da 3, Copilot CLI'da 3 model), commit, log"
4
4
  allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, WebFetch, WebSearch, NotebookEdit, Skill
5
5
  ---
6
6
 
@@ -61,7 +61,7 @@ Full contract: `$HOME/.claude/multi-agent-refs/analysis/evidence.md`. Fetches ev
61
61
 
62
62
  Full contract: `$HOME/.claude/multi-agent-refs/analysis/synthesis.md`. Pass A builds the platform-agnostic concept layer; Phase 2a previews the resolved conventions for approval (Locked 26); Pass B projects each concept onto the selected platform with a footnote per filled cell (Locked 24).
63
63
 
64
- ### Phases 3, 3.5, 4, 5 - Render, publish, report
64
+ ### Phases 3, 3.2, 3.3, 3.5, 4, 5 - Render, review, publish, report
65
65
 
66
66
  Full contract: `$HOME/.claude/multi-agent-refs/analysis/render.md`. Renders one markdown file per platform, runs the **required** `ai-common-toolkit:humanizer` pass, gates on `validate-analysis-doc.mjs` and on the `build-references.mjs --check` references coverage gate (Locked 34), asks for the output destination, dispatches to Local / Confluence / Jira (a Jira issue receives a comment unless the user explicitly asks for the description, which is never overwritten without a backup and a confirmation), then reports and stops. The humanizer pass and the validator are required in every mode; a document that skipped either is not shippable.
67
67
 
@@ -59,7 +59,7 @@ Pipeline (after Phase 0) - shown as visual cards in terminal:
59
59
  only; a Short run has no plan, autopilot may not ask)
60
60
  Phase 3: Dev -> TDD: test -> code -> build (Sonnet) + build queue
61
61
  Phase 4: Review -> Deterministic gates + parallel AI review + Fable triage
62
- (Claude Code: Fable + Sonnet · Copilot CLI: GPT-5.4 + Opus + Sonnet)
62
+ (Claude Code: Fable + Opus + Sonnet · Copilot CLI: GPT-5.4 + Opus + Sonnet)
63
63
  Phase 5: Test -> Optional: switch to branch, test in Xcode
64
64
  (only /multi-agent has it; every autopilot and local entry drops it)
65
65
  Phase 6: Commit -> Commit -> push -> PR + issue body update (never auto-closes)
@@ -334,7 +334,7 @@ Pipeline (Phase 0'dan sonra) - terminalde görsel kart olarak görünür:
334
334
  etkileşimli; Kısa'da plan yok, autopilot soru soramaz)
335
335
  Phase 3: Dev -> TDD: test -> kod -> build (Sonnet) + build queue
336
336
  Phase 4: Review -> Deterministik kapılar + paralel AI review + Fable triage
337
- (Claude Code: Fable + Sonnet · Copilot CLI: GPT-5.4 + Opus + Sonnet)
337
+ (Claude Code: Fable + Opus + Sonnet · Copilot CLI: GPT-5.4 + Opus + Sonnet)
338
338
  Phase 5: Test -> Opsiyonel: branch'e geç, Xcode'da test
339
339
  (yalnız /multi-agent'ta var; her autopilot ve local girişi düşürür)
340
340
  Phase 6: Commit -> Commit -> push -> PR + issue body güncelleme (hiç auto-close yok)
@@ -34,7 +34,7 @@ You already did the work locally - wrote code on the current branch and maybe
34
34
 
35
35
  ```
36
36
  Phase 0: Init → project/branch detect, resolve base + diff (work-already-done), Jira id, state (NO worktree)
37
- Phase 4: Review → deterministic gates + parallel review (Fable + Sonnet) + Fable triage
37
+ Phase 4: Review → deterministic gates + parallel review (Fable + Opus + Sonnet) + Fable triage
38
38
  Phase 5: Build+Test → stack-aware build gate + run existing tests; SUCCESS required (automated, not the interactive user-test)
39
39
  Phase 6: Commit → commit remaining local changes + push + open PR if none exists
40
40
  Phase 7: Report → technical analysis + Jira comment with test scenarios (channels: Jira / PR / Confluence / Wiki)
@@ -52,7 +52,7 @@ Phases 1-3 (Analysis / Planning / Dev) are skipped by design - `ship` treats t
52
52
 
53
53
  ## Phase execution (reuse the existing phase contracts)
54
54
 
55
- - **Phase 4 Review** - run per `$HOME/.claude/multi-agent-refs/phases/phase-4-review.md` against the resolved diff: deterministic gates (Step 1.x), stack-specific parallel reviewers (Fable + Sonnet on Claude Code; GPT + Opus + Sonnet on Copilot CLI), Fable triage → `triage.accepted`. Blocking/important accepted findings:
55
+ - **Phase 4 Review** - run per `$HOME/.claude/multi-agent-refs/phases/phase-4-review.md` against the resolved diff: deterministic gates (Step 1.x), stack-specific parallel reviewers (Fable + Opus + Sonnet on Claude Code; GPT + Opus + Sonnet on Copilot CLI), Fable triage → `triage.accepted`. Blocking/important accepted findings:
56
56
  - interactive: present them and ask (`AskUserQuestion`) whether to fix now (loop back through a minimal Phase-3-style TDD fix) or proceed;
57
57
  - `autopilot` (or `prefs.global.resumeLocal.autoFix == true`): auto-fix accepted blocking/important findings, then re-review the fix, before advancing.
58
58
  - **Phase 5 Build+Test** - the **automated success gate** (this is what "build+test success" means here; the interactive device user-test is `/multi-agent:manual-test`). Stack-aware: build via `figma-config.build` (iOS scheme / Android gradle / detected backend/web build) and run the existing test suite if present (`swift test` / `xcodebuild test` / `./gradlew test` / `pytest` / `npm test` / `vitest`). Require success to advance; on failure, surface logs and (interactive) stop or (autopilot) attempt a bounded fix loop. **If the repo has no tests, report "no tests present" - never fabricate test results.**
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: "Run parallel review on a branch's diff or a Pull Request: 2 models on Claude Code (Fable + Sonnet), 3 models on Copilot CLI (GPT + Opus + Sonnet). On PR input, posts per-finding inline comments and sets approve/needs-work review state. Use when a branch diff or a pull request needs reviewing before it merges."
3
- description-tr: "Bir branch diff'i veya Pull Request üzerinde paralel review koşar: Claude Code'da 2 model (Fable + Sonnet), Copilot CLI'da 3 model (GPT + Opus + Sonnet). PR girdisinde bulgu başına inline yorum atar ve approve/needs-work durumunu işaretler."
2
+ description: "Run parallel review on a branch's diff or a Pull Request: 3 models on Claude Code (Fable + Opus + Sonnet), 3 models on Copilot CLI (GPT + Opus + Sonnet). On PR input, posts per-finding inline comments and sets approve/needs-work review state. Use when a branch diff or a pull request needs reviewing before it merges."
3
+ description-tr: "Bir branch diff'i veya Pull Request üzerinde paralel review koşar: Claude Code'da 3 model (Fable + Opus + Sonnet), Copilot CLI'da 3 model (GPT + Opus + Sonnet). PR girdisinde bulgu başına inline yorum atar ve approve/needs-work durumunu işaretler."
4
4
  argument-hint: "[#N | repo#N | PR-URL | branch] - optional: PR by number/URL, repo+number, or local branch. Supports GitHub and Bitbucket Server URLs. If omitted (interactive), open GitHub + Bitbucket PRs are listed for multi-select; autopilot falls back to the current branch."
5
5
  ---
6
6
 
@@ -175,7 +175,7 @@ Scope note: a guide governs only files under its own directory - a guide found
175
175
 
176
176
  ### 3. Launch parallel reviewers - host-CLI dependent
177
177
 
178
- **Claude Code (2 in parallel):**
178
+ **Claude Code (3 in parallel):**
179
179
  - Agent 1: `claude-fable-5` → security + architecture
180
180
  - Agent 2: `claude-sonnet-5` → general quality
181
181
 
@@ -16,7 +16,7 @@ Read `$HOME/.claude/multi-agent-refs/analysis/review.md` and execute it:
16
16
 
17
17
  1. **Resolve** the document from a local path, a Confluence URL or `pageId`, or a Jira key. With no argument, offer the recent analyses from `~/Desktop/multiAgentAnalysis/` and from each selected repo's `analysis/`, newest first.
18
18
  2. **Deterministic gates first**: `validate-analysis-doc.mjs` on the document, and `build-references.mjs --check` when the run's state JSON is available (`--state`, or a fresh analysis). Their output is reported verbatim, before any model reads the document. A finding a script already proves does not need an opinion.
19
- 3. **Parallel model review** against the rubric (buildability, evidence, spine, altitude, admitted gaps, contradiction), CLI-aware: 2 models on Claude Code, 3 on Copilot CLI.
19
+ 3. **Parallel model review** against the rubric (buildability, evidence, spine, altitude, admitted gaps, contradiction), CLI-aware: 3 models on Claude Code, 3 on Copilot CLI.
20
20
  4. **Fable triage** into Blocker / Important / Suggestion, dropping duplicates and anything the document answers elsewhere.
21
21
  5. **Report**, naming the profile it judged against and, explicitly, what was NOT checked.
22
22
  6. **Output** on request only: chat (default), Confluence comment, Jira comment, or a `-review.md` beside the document.
@@ -88,6 +88,8 @@ MAX_IDS_PER_CALL=50
88
88
  FILE_KEY=""
89
89
  NODE_ID=""
90
90
  SECTION_URL=""
91
+ DISCOVER=0
92
+ FEATURE_SLUG=""
91
93
  OUTPUT_DIR=""
92
94
  SCALE="2"
93
95
  FORMAT="png"
@@ -118,6 +120,12 @@ Options:
118
120
  --file-key Figma file key (or branchKey for branch URLs).
119
121
  --node-id Node id; may use either "-" or ":" separator.
120
122
  --section Section URL; child FRAMEs are auto-discovered.
123
+ --discover-sections With --file-key and --feature-slug: list every SECTION or
124
+ FRAME in the file whose name matches the feature, with a
125
+ channel guess. One GET ?depth=2. Answers "does this file also
126
+ hold the other channel's design" before a run may write that a
127
+ channel has none. Emits JSON, downloads nothing.
128
+ --feature-slug Feature name to match against, for --discover-sections.
121
129
  --output-dir Output directory. Default: /tmp/figma-screenshots-<ts>.
122
130
  --scale Render scale (1-4). Default: 2.
123
131
  --format Image format. Default: png.
@@ -387,6 +395,8 @@ while [ "$#" -gt 0 ]; do
387
395
  --file-key) FILE_KEY="${2:-}"; shift 2 ;;
388
396
  --node-id) NODE_ID="${2:-}"; shift 2 ;;
389
397
  --section) SECTION_URL="${2:-}"; shift 2 ;;
398
+ --discover-sections) DISCOVER=1; shift ;;
399
+ --feature-slug) FEATURE_SLUG="${2:-}"; shift 2 ;;
390
400
  --output-dir) OUTPUT_DIR="${2:-}"; shift 2 ;;
391
401
  --scale) SCALE="${2:-2}"; shift 2 ;;
392
402
  --format) FORMAT="${2:-png}"; shift 2 ;;
@@ -394,12 +404,16 @@ while [ "$#" -gt 0 ]; do
394
404
  esac
395
405
  done
396
406
 
397
- if [ -n "$SECTION_URL" ] && { [ -n "$FILE_KEY" ] || [ -n "$NODE_ID" ]; }; then
398
- die 1 "--section is mutually exclusive with --file-key/--node-id"
399
- fi
400
-
401
- if [ -z "$SECTION_URL" ] && { [ -z "$FILE_KEY" ] || [ -z "$NODE_ID" ]; }; then
402
- die 1 "either --section <url> or both --file-key and --node-id are required"
407
+ if [ "$DISCOVER" -eq 1 ]; then
408
+ [ -n "$FILE_KEY" ] || die 1 "--discover-sections requires --file-key"
409
+ [ -n "$FEATURE_SLUG" ] || die 1 "--discover-sections requires --feature-slug"
410
+ else
411
+ if [ -n "$SECTION_URL" ] && { [ -n "$FILE_KEY" ] || [ -n "$NODE_ID" ]; }; then
412
+ die 1 "--section is mutually exclusive with --file-key/--node-id"
413
+ fi
414
+ if [ -z "$SECTION_URL" ] && { [ -z "$FILE_KEY" ] || [ -z "$NODE_ID" ]; }; then
415
+ die 1 "either --section <url> or both --file-key and --node-id are required"
416
+ fi
403
417
  fi
404
418
 
405
419
  require_cmd curl
@@ -421,6 +435,90 @@ if [ -z "$OUTPUT_DIR" ]; then
421
435
  fi
422
436
  mkdir -p "$OUTPUT_DIR"
423
437
 
438
+ # --- Discovery mode ---------------------------------------------------------
439
+ # One GET /v1/files/{key}?depth=3 lists every page, its sections and their frames,
440
+ # which is what makes frameCount real rather than always zero.
441
+ # That is enough to answer "does this file also hold the other channel's design",
442
+ # which a run has to ask before it may write that a channel has no design at all.
443
+ # Matching is diacritic- and case-insensitive because the same feature is spelled
444
+ # "Elite Kart" on one section and "Elit Kart" on its sibling.
445
+
446
+ run_discover_mode() {
447
+ local body
448
+ # Same as fetch_with_retry: the token goes through a curl config on a process
449
+ # substitution, never argv, because argv is readable from ps.
450
+ body=$(curl -sS --max-time "$HTTP_TIMEOUT" --connect-timeout 5 \
451
+ -K <(printf 'header = "X-Figma-Token: %s"\n' "$FIGMA_TOKEN") \
452
+ "https://api.figma.com/v1/files/${FILE_KEY}?depth=3") || die 3 "file tree fetch failed"
453
+
454
+ printf '%s' "$body" | FEATURE_SLUG="$FEATURE_SLUG" FILE_KEY="$FILE_KEY" python3 -c '
455
+ import json, os, re, sys, unicodedata
456
+
457
+ def fold(t):
458
+ t = unicodedata.normalize("NFKD", t)
459
+ t = "".join(c for c in t if not unicodedata.combining(c))
460
+ # Turkish dotless i and the rest survive NFKD, so map them explicitly.
461
+ t = t.translate(str.maketrans("ıİşŞğĞçÇöÖüÜ", "iIsSgGcCoOuU"))
462
+ return re.sub(r"[^a-z0-9]+", " ", t.lower()).strip()
463
+
464
+ CHANNELS = [
465
+ ("mobileweb", ["mobileweb", "mobile web", "mobil web", "responsive"]),
466
+ ("mobile", ["mobile app", "mobil uygulama", "app", "ios", "android", "mobil", "mobile"]),
467
+ ("desktop", ["desktop", "masaustu", "web"]),
468
+ ]
469
+
470
+ def channel_of(name):
471
+ f = fold(name)
472
+ for label, tokens in CHANNELS:
473
+ for tok in tokens:
474
+ if re.search(r"\b" + re.escape(fold(tok)) + r"\b", f):
475
+ return label
476
+ return None
477
+
478
+ raw = sys.stdin.read()
479
+ try:
480
+ doc = json.loads(raw).get("document", {})
481
+ except Exception:
482
+ print(json.dumps({"error": "unparseable file response"})); sys.exit(3)
483
+
484
+ slug_words = [w for w in fold(os.environ["FEATURE_SLUG"]).split() if len(w) > 2]
485
+ out, weak, pages = [], [], 0
486
+ for page in doc.get("children", []) or []:
487
+ pages += 1
488
+ for node in page.get("children", []) or []:
489
+ if node.get("type") not in ("SECTION", "FRAME"):
490
+ continue
491
+ name = node.get("name", "")
492
+ f = fold(name)
493
+ hits = [w for w in slug_words if w in f]
494
+ if not hits:
495
+ continue
496
+ # A single shared word is not a match: "Mil Hediye Et" shares "hediye" with
497
+ # "Elite Kart Hediye Et" and is a different feature. Require half the slug,
498
+ # at least two words. Weak hits are reported separately, never dropped in
499
+ # silence, because a run has to be able to say what it looked at.
500
+ need = max(2, (len(slug_words) + 1) // 2) if len(slug_words) > 1 else 1
501
+ row = {
502
+ "id": node.get("id"),
503
+ "name": name,
504
+ "type": node.get("type"),
505
+ "page": page.get("name"),
506
+ "frameCount": len(node.get("children", []) or []),
507
+ "channelGuess": channel_of(name),
508
+ "matchedWords": hits,
509
+ }
510
+ (out if len(hits) >= need else weak).append(row)
511
+ print(json.dumps({
512
+ "fileKey": os.environ["FILE_KEY"],
513
+ "featureSlug": os.environ["FEATURE_SLUG"],
514
+ "pagesScanned": pages,
515
+ "tokensTried": slug_words,
516
+ "candidates": sorted(out, key=lambda c: (c["channelGuess"] or "zz", c["id"])),
517
+ "weakMatches": sorted(weak, key=lambda c: c["id"]),
518
+ }, ensure_ascii=False, indent=2))
519
+ '
520
+ }
521
+
424
522
  # --- Section mode -----------------------------------------------------------
425
523
 
426
524
  run_section_mode() {
@@ -548,7 +646,9 @@ PY
548
646
 
549
647
  # --- Dispatch ---------------------------------------------------------------
550
648
 
551
- if [ -n "$SECTION_URL" ]; then
649
+ if [ "$DISCOVER" -eq 1 ]; then
650
+ run_discover_mode
651
+ elif [ -n "$SECTION_URL" ]; then
552
652
  run_section_mode
553
653
  else
554
654
  run_single_mode