@mmerterden/multi-agent-pipeline 19.1.4 → 20.1.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 (137) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/README.md +19 -36
  3. package/README.tr.md +18 -35
  4. package/SECURITY.md +3 -3
  5. package/docs/adr/0002-instruction-driven-flag.md +6 -5
  6. package/docs/adr/0005-lazy-phase-docs.md +2 -2
  7. package/docs/adr/0008-installer-modularization-and-secret-leak-defense.md +1 -0
  8. package/docs/adr/0009-claude-stack-skills-plugin-only.md +1 -1
  9. package/docs/adr/0010-own-code-graph.md +5 -4
  10. package/docs/adr/0011-dormant-ci.md +10 -1
  11. package/docs/adr/0012-macos-only.md +2 -2
  12. package/docs/adr/0013-lsp-code-intelligence.md +2 -2
  13. package/docs/adr/0014-six-phase-consolidation.md +9 -9
  14. package/docs/adr/0015-one-pipeline-no-depth-answer.md +83 -0
  15. package/docs/adr/0016-the-run-shape-is-asked-not-typed.md +69 -0
  16. package/docs/adr/README.md +18 -16
  17. package/docs/architecture.md +2 -2
  18. package/docs/ecosystem.md +5 -5
  19. package/docs/facts.json +7 -9
  20. package/docs/features.md +4 -5
  21. package/docs/token-budget-history.md +1 -1
  22. package/install/_codex-agents.mjs +1 -1
  23. package/install/_common.mjs +9 -1
  24. package/install/templates/copilot-instructions.md +7 -16
  25. package/manifest.json +133 -129
  26. package/package.json +1 -1
  27. package/pipeline/agents/code-reviewer.md +2 -2
  28. package/pipeline/agents/dev-critic.md +5 -5
  29. package/pipeline/agents/security-auditor.md +80 -72
  30. package/pipeline/commands/figma-to-swiftui.md +1 -1
  31. package/pipeline/commands/multi-agent/SKILL.md +7 -9
  32. package/pipeline/commands/multi-agent/analysis/SKILL.md +2 -0
  33. package/pipeline/commands/multi-agent/analysis-jira/SKILL.md +2 -0
  34. package/pipeline/commands/multi-agent/analysis-resolve/SKILL.md +2 -0
  35. package/pipeline/commands/multi-agent/autopilot/SKILL.md +2 -0
  36. package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +2 -0
  37. package/pipeline/commands/multi-agent/autopilot-status/SKILL.md +1 -1
  38. package/pipeline/commands/multi-agent/build-optimize/SKILL.md +2 -0
  39. package/pipeline/commands/multi-agent/channels/SKILL.md +2 -2
  40. package/pipeline/commands/multi-agent/create-jira/SKILL.md +2 -0
  41. package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
  42. package/pipeline/commands/multi-agent/diff-explain/SKILL.md +1 -1
  43. package/pipeline/commands/multi-agent/forget/SKILL.md +2 -0
  44. package/pipeline/commands/multi-agent/garbage-collect/SKILL.md +4 -2
  45. package/pipeline/commands/multi-agent/help/SKILL.md +23 -27
  46. package/pipeline/commands/multi-agent/ios-coding-standard/SKILL.md +5 -4
  47. package/pipeline/commands/multi-agent/issue/SKILL.md +2 -0
  48. package/pipeline/commands/multi-agent/jira/SKILL.md +2 -0
  49. package/pipeline/commands/multi-agent/language/SKILL.md +2 -0
  50. package/pipeline/commands/multi-agent/prune-logs/SKILL.md +2 -0
  51. package/pipeline/commands/multi-agent/purge/SKILL.md +2 -0
  52. package/pipeline/commands/multi-agent/resume/SKILL.md +177 -48
  53. package/pipeline/commands/multi-agent/save/SKILL.md +2 -0
  54. package/pipeline/commands/multi-agent/scan/SKILL.md +2 -2
  55. package/pipeline/commands/multi-agent/security-review/SKILL.md +52 -0
  56. package/pipeline/commands/multi-agent/stack/SKILL.md +2 -0
  57. package/pipeline/commands/multi-agent/sync/SKILL.md +7 -8
  58. package/pipeline/commands/multi-agent/test-screenshots/SKILL.md +2 -0
  59. package/pipeline/commands/multi-agent/uninstall/SKILL.md +2 -0
  60. package/pipeline/lib/repo-hygiene.sh +1 -1
  61. package/pipeline/multi-agent-refs/analysis/render.md +1 -1
  62. package/pipeline/multi-agent-refs/analysis/resolve.md +1 -1
  63. package/pipeline/multi-agent-refs/analysis/synthesis.md +1 -1
  64. package/pipeline/multi-agent-refs/analysis-template.md +1 -1
  65. package/pipeline/multi-agent-refs/component-dispatch.md +5 -13
  66. package/pipeline/multi-agent-refs/cross-cli-contract.md +14 -15
  67. package/pipeline/multi-agent-refs/features/external-context-injection.md +2 -0
  68. package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
  69. package/pipeline/multi-agent-refs/features/review-multi-repo.md +3 -3
  70. package/pipeline/multi-agent-refs/features/security-audit.md +55 -0
  71. package/pipeline/multi-agent-refs/features/skill-conformance.md +1 -1
  72. package/pipeline/multi-agent-refs/features/visual-evidence.md +2 -1
  73. package/pipeline/multi-agent-refs/features/worktree-finalize.md +1 -1
  74. package/pipeline/multi-agent-refs/generate-issue.md +2 -0
  75. package/pipeline/multi-agent-refs/issue-jira-triad.md +2 -0
  76. package/pipeline/multi-agent-refs/keychain.md +2 -0
  77. package/pipeline/multi-agent-refs/knowledge.md +0 -7
  78. package/pipeline/multi-agent-refs/outside-the-pipeline.md +1 -1
  79. package/pipeline/multi-agent-refs/payload-contracts.md +1 -1
  80. package/pipeline/multi-agent-refs/phases/modes.md +33 -109
  81. package/pipeline/multi-agent-refs/phases/operations.md +2 -0
  82. package/pipeline/multi-agent-refs/phases/phase-0-init.md +23 -42
  83. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +7 -18
  84. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +13 -44
  85. package/pipeline/multi-agent-refs/phases/phase-3-review.md +28 -37
  86. package/pipeline/multi-agent-refs/phases/phase-4-commit.md +6 -6
  87. package/pipeline/multi-agent-refs/phases/phase-5-report.md +3 -3
  88. package/pipeline/multi-agent-refs/phases.md +9 -11
  89. package/pipeline/multi-agent-refs/progress-contract.md +1 -1
  90. package/pipeline/multi-agent-refs/readiness-review.md +2 -0
  91. package/pipeline/multi-agent-refs/rules.md +1 -1
  92. package/pipeline/multi-agent-refs/threat-model.md +39 -0
  93. package/pipeline/multi-agent-refs/tracker-contract.md +9 -40
  94. package/pipeline/multi-agent-refs/wiki-capture.md +3 -2
  95. package/pipeline/preferences-template.json +2 -2
  96. package/pipeline/rules/figma-pipeline.md +1 -1
  97. package/pipeline/schemas/agent-state.schema.json +28 -10
  98. package/pipeline/schemas/migrations/prefs-2.7.0-to-2.8.0.mjs +33 -0
  99. package/pipeline/schemas/phases.json +4 -26
  100. package/pipeline/schemas/prefs.schema.json +5 -9
  101. package/pipeline/schemas/reviewer-output.schema.json +99 -2
  102. package/pipeline/schemas/security-finding.schema.json +144 -0
  103. package/pipeline/scripts/_stack-routing.mjs +1 -0
  104. package/pipeline/scripts/cost-table.json +1 -1
  105. package/pipeline/scripts/gc-abandoned.sh +16 -9
  106. package/pipeline/scripts/gc-refs.sh +1 -1
  107. package/pipeline/scripts/gen-mode-dispatch.mjs +11 -41
  108. package/pipeline/scripts/migrate-prefs.mjs +18 -17
  109. package/pipeline/scripts/phase-tracker.sh +2 -2
  110. package/pipeline/scripts/phase0-exit-gate.mjs +1 -1
  111. package/pipeline/scripts/plan-coverage-gate.mjs +3 -3
  112. package/pipeline/scripts/render-work-summary.sh +7 -4
  113. package/pipeline/scripts/run-aggregator.mjs +1 -1
  114. package/pipeline/scripts/usage-report.mjs +0 -2
  115. package/pipeline/scripts/worktree-finalize.sh +2 -2
  116. package/pipeline/skills/.skill-manifest.json +17 -21
  117. package/pipeline/skills/.skills-index.json +6 -39
  118. package/pipeline/skills/shared/README.md +5 -8
  119. package/pipeline/skills/shared/core/multi-agent/SKILL.md +11 -15
  120. package/pipeline/skills/shared/core/multi-agent-autopilot-status/SKILL.md +1 -1
  121. package/pipeline/skills/shared/core/multi-agent-help/SKILL.md +13 -16
  122. package/pipeline/skills/shared/core/multi-agent-ios-coding-standard/SKILL.md +2 -3
  123. package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +51 -15
  124. package/pipeline/skills/shared/core/multi-agent-scan/SKILL.md +2 -2
  125. package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +29 -0
  126. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +7 -7
  127. package/pipeline/skills/shared/external/security-review/SKILL.md +64 -0
  128. package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md +53 -0
  129. package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md +56 -0
  130. package/pipeline/skills/skills-index.md +3 -6
  131. package/pipeline/commands/multi-agent/local/SKILL.md +0 -132
  132. package/pipeline/commands/multi-agent/local-autopilot/SKILL.md +0 -142
  133. package/pipeline/commands/multi-agent/resume-local/SKILL.md +0 -114
  134. package/pipeline/commands/security-review.md +0 -6
  135. package/pipeline/skills/shared/core/multi-agent-local/SKILL.md +0 -41
  136. package/pipeline/skills/shared/core/multi-agent-local-autopilot/SKILL.md +0 -55
  137. package/pipeline/skills/shared/core/multi-agent-resume-local/SKILL.md +0 -51
@@ -46,7 +46,7 @@ How It Works (Phase 0 - Interactive Flow):
46
46
  5. BRANCH NAME bugfix/{jiraId} or feature/{jiraId} -> confirm
47
47
  6. GIT ID Select identity from preferences (multiple supported)
48
48
  7. INSTRUCTION Auto-detect if .instructions/ exists (figma etc.)
49
- 8. WORKSPACE Create worktree (default) or local branch (--local)
49
+ 8. WORKSPACE Ask where the branch lives: worktree (default) or project root
50
50
 
51
51
  ------------------------------
52
52
 
@@ -55,7 +55,7 @@ Pipeline (after Phase 0) - shown as visual cards in terminal:
55
55
  Phase 0: Init -> The 8 steps above
56
56
  Phase 1: Plan -> Stack detection + codebase scan, task breakdown, architecture
57
57
  review, Plan Approval Gate (Opus; max 2 clarification rounds,
58
- Full + interactive only - a Short run has no plan)
58
+ interactive only - autopilot has nobody to ask)
59
59
  Phase 2: Dev -> TDD: test -> code -> build (Sonnet) + build queue, then the
60
60
  Verify exit gate: build, lint, tests, secrets. The build runs
61
61
  ONCE per run and its log carries into Review
@@ -68,11 +68,10 @@ Pipeline (after Phase 0) - shown as visual cards in terminal:
68
68
 
69
69
  Autopilot always pauses at the Phase 5 channels menu (30-min timeout → session ends cleanly).
70
70
 
71
- Pipeline depth is asked at Phase 0 Step 7.5, not passed as a flag:
72
- Full Plan -> Dev(Sonnet) -> Review -> Commit -> Report
73
- Short Dev(Opus, self-contained) -> Review -> Commit -> Report
74
- Short skips Phase 1 only; Review is NEVER skipped. Recommended from taskType:
75
- bugfix/chore -> Short, feature/refactor/component -> Full. Autopilot always runs Full.
71
+ One pipeline. Every mode runs its whole phase set:
72
+ Plan -> Dev(Sonnet) -> Review -> Commit -> Report
73
+ What a run costs follows the evidence the task carries, not an answer taken
74
+ before the evidence exists.
76
75
 
77
76
  Every step is logged. Error in any phase -> pause -> resume to continue.
78
77
 
@@ -82,17 +81,15 @@ Modes:
82
81
 
83
82
  Four pipeline entries:
84
83
 
85
- /multi-agent "task" Worktree, asks Full or Short
86
- /multi-agent:local "task" No worktree, asks Full or Short
84
+ /multi-agent "task" Worktree
87
85
  /multi-agent:autopilot "task" Worktree, no questions, always Full
88
- /multi-agent:local-autopilot "task" No worktree, no questions, always Full
89
86
 
90
- --local on the base command is the same as the :local entry.
91
- autopilot skips every confirmation INCLUDING the plan gate and the depth
87
+ Phase 0 Step 5b asks where the branch lives; there is no flag for it.
88
+ autopilot skips every confirmation INCLUDING the plan gate and the workspace
92
89
  question, and auto commit/PR - EXCEPT the Phase 5 channels menu, which
93
90
  always pauses.
94
91
 
95
- /multi-agent:resume-local [jira-id] [autopilot] Continue already-done LOCAL work: Review (build gate) → Commit/PR → Report (no dev)
92
+ /multi-agent:resume [#id|jira-id] [autopilot] Pick up unfinished work: a stopped run, or a branch with no run behind it (Review → Commit/PR → Report)
96
93
 
97
94
  ------------------------------
98
95
 
@@ -129,13 +126,14 @@ Post-Hoc & Side-Channel:
129
126
  /multi-agent:graph Build and query the repo code graph (symbols, imports, references), LLM-free
130
127
  /multi-agent:search Cross-task log search with smart ranking; --semantic queries triage corpus
131
128
  /multi-agent:scan Skill security scan against tiered pattern catalog
129
+ /multi-agent:security-review Standalone defensive static security review: threat model, OWASP + CWE + CVSS findings, dep inventory. No live target.
132
130
  /multi-agent:doctor Would a run work here? Layout, prefs, credentials, hooks; exit code is the verdict
133
131
  /multi-agent:refactor Best practices + bug hunt + upstream drift + toolkit MCP research -> one plan, approval, dev + sync
134
132
  /multi-agent:refactor backlog Decide the friction already recorded about the pipeline itself, nothing re-derived
135
133
  /multi-agent:store-ready [repo] [flags] Pre-submission store readiness, iOS + Android, local-only: three symmetric gates per platform plus the running-app sweep. A skipped gate is never a pass. Validates only, never uploads.
136
134
  /multi-agent:testflight-validation [repo] [--ipa=|--archive=] iOS-pinned alias of :store-ready. Same three gates, one implementation.
137
135
  /multi-agent:ios-coding-standard [module] Audit an iOS module against the 99-rule coding-standard registry -> remediation
138
- plan + one-page onboarding summary -> hand off to /multi-agent or :local. Read-only, never edits source.
136
+ plan + one-page onboarding summary -> hand off to /multi-agent. Read-only, never edits source.
139
137
 
140
138
  Setup & Maintenance:
141
139
 
@@ -182,9 +180,8 @@ Interactive Launchers:
182
180
 
183
181
  Both follow the same flow after selection:
184
182
  1. Branch selection (develop/release/main)
185
- 2. Depth: Full or Short
186
- 3. Autopilot: yes/no
187
- 4. Pipeline starts with the selected issue
183
+ 2. Autopilot: yes/no
184
+ 3. Pipeline starts with the selected issue
188
185
 
189
186
  ------------------------------
190
187
 
@@ -274,7 +271,6 @@ Examples:
274
271
  /multi-agent "MOBILE-12345"
275
272
 
276
273
  # GitHub issue, fast mode, local
277
- /multi-agent:local "#42" # then choose Short
278
274
 
279
275
  # Interactive launchers - browse and pick
280
276
  /multi-agent:jira # Pick from my Jira issues
@@ -284,7 +280,7 @@ Examples:
284
280
  /multi-agent:autopilot "LoginView dark mode fix" # iOS
285
281
  /multi-agent "Add pagination to /api/users endpoint" # Backend
286
282
  /multi-agent "Fix bottom nav recomposition in HomeScreen" # Android
287
- /multi-agent "Responsive layout broken on tablet" # Web, choose Short
283
+ /multi-agent "Responsive layout broken on tablet" # Web
288
284
 
289
285
  # Review current diff only
290
286
  /multi-agent:review
@@ -326,7 +322,7 @@ Nasıl Çalışır (Phase 0 - İnteraktif Akış):
326
322
  5. BRANCH NAME bugfix/{jiraId} veya feature/{jiraId} -> onayla
327
323
  6. GIT ID Kimlik seç (prefs'ten; birden fazla desteklenir)
328
324
  7. INSTRUCTION .instructions/ varsa otomatik algıla (figma vs.)
329
- 8. WORKSPACE Worktree yarat (default) ya da local branch (--local)
325
+ 8. WORKSPACE Branch nerede yaşayacak: worktree (default) ya da proje kökü
330
326
 
331
327
  ------------------------------
332
328
 
@@ -362,16 +358,14 @@ Modlar:
362
358
 
363
359
  Dört pipeline girişi:
364
360
 
365
- /multi-agent "task" Worktree var, Tam mı Kısa mı diye sorar
366
- /multi-agent:local "task" Worktree yok, Tam mı Kısa mı diye sorar
361
+ /multi-agent "task" Worktree var
367
362
  /multi-agent:autopilot "task" Worktree var, soru yok, her zaman Tam
368
- /multi-agent:local-autopilot "task" Worktree yok, soru yok, her zaman Tam
369
363
 
370
- Ana komuta --local eklemek :local girişiyle aynıdır.
364
+ Faz 0 Adım 5b branch'in nerede yaşayacağını sorar; bayrağı yok.
371
365
  autopilot plan kapısı ve derinlik sorusu dahil her onayı atlar, otomatik
372
366
  commit/PR açar - İSTİSNA: Faz 5 channels menüsü, o her zaman durur.
373
367
 
374
- /multi-agent:resume-local [jira-id] [autopilot] Lokalde biten işi sürdür: Review (build kapısı) → Commit/PR → Report (dev yok)
368
+ /multi-agent:resume [#id|jira-id] [autopilot] Yarım kalan işi sürdür: duran koşu ya da arkasında koşu olmayan branch (Review → Commit/PR → Report)
375
369
 
376
370
  ------------------------------
377
371
 
@@ -400,6 +394,7 @@ Post-Hoc & Side-Channel:
400
394
  /multi-agent:analysis ["analysis-name"] Feature-spec analizi (Figma + Swagger + Confluence + repolar). Önce standardı sorar: global (23 bölümlük geliştirme dokümanı) veya kurumsal (IG→UC→FG gereksinim dokümanı). Stack opsiyonel; Referanslar kanıt kaydından üretilir
401
395
  /multi-agent:analysis-resolve [doc] Analiz dokümanının Bölüm 20 açık sorularını kaynak etiketli adaylarla teker teker çözer
402
396
  /multi-agent:review-analysis [doc] Yazılmış analizi review eder; bulgular ihlal edilen kuralı gösterir
397
+ /multi-agent:analysis-jira [doc] Nihai analiz -> Jira story ağacı; kapsam iki yönlü kontrol edilir, var olan düğümler atlanır
403
398
  /multi-agent:complaint-analysis ["run-adı"] Müşteri şikayeti triyajı: trx/conv id ile Graylog kanıtı + salt-okunur repo eşleştirme → client/bff kök neden + fix planı + dev prompt'u, veya core'a yönlendirme önerisi
404
399
  /multi-agent:build-optimize iOS-only Xcode build performance wrapper → benchmark + analiz + recommend-first .build-benchmark/optimization-plan.md
405
400
  /multi-agent:create-jira ["açıklama"] [figma-url] [swagger-url] Takım standartlarına uygun Jira Task/Bug/Story oluştur (tip sorar + convention mining + aktif sprint + auto-sizing bölümler + önizleme & onay)
@@ -407,12 +402,14 @@ Post-Hoc & Side-Channel:
407
402
  /multi-agent:graph Repo kod grafiğini kur ve sorgula (semboller, import'lar, referanslar), LLM'siz
408
403
  /multi-agent:search Task log'larında akıllı arama; --semantic triage corpus'unu sorgular
409
404
  /multi-agent:scan Skill güvenlik taraması (tiered pattern catalog)
405
+ /multi-agent:security-review Bağımsız savunma amaçlı statik güvenlik incelemesi: tehdit modeli, OWASP + CWE + CVSS bulguları, bağımlılık envanteri. Canlı hedef yok.
406
+ /multi-agent:doctor Burada bir koşu çalışır mı? Yerleşim, prefs, kimlik bilgileri, hook'lar; çıkış kodu kararı verir
410
407
  /multi-agent:refactor Uyarlanmış best-practice + bug avı + upstream-drift + multi-agent-toolkit MCP araştırması -> tek plan, onay, dev + sync
411
408
  /multi-agent:refactor backlog Pipeline'ın kendisi hakkında kaydedilmiş sürtünmeyi karara bağlar, sıfırdan türetmez
412
409
  /multi-agent:store-ready [repo] [flags] Yükleme öncesi store hazırlığı, iOS + Android, yalnızca lokal: platform başına 3 simetrik kapı artı çalışan-app sweep'i. Atlanan kapı asla pass sayılmaz. Sadece doğrular, asla yüklemez.
413
410
  /multi-agent:testflight-validation [repo] [--ipa=|--archive=] :store-ready'nin iOS alias'ı. Aynı 3 kapı, tek implementasyon.
414
411
  /multi-agent:ios-coding-standard [modül] Bir iOS modülünü 99 kurallık kodlama-standardı registry'sine göre denetler -> düzeltme
415
- planı + tek sayfalık onboarding özeti -> /multi-agent veya :local'e devreder. Read-only, kaynağı hiç düzenlemez.
412
+ planı + tek sayfalık onboarding özeti -> /multi-agent'a devreder. Read-only, kaynağı hiç düzenlemez.
416
413
 
417
414
  Setup & Maintenance:
418
415
 
@@ -550,7 +547,6 @@ Quality & Telemetry (advisory, default açık - prefs.global.* ile kapatılabi
550
547
  /multi-agent "MOBILE-12345"
551
548
 
552
549
  # GitHub issue, hızlı mode, local
553
- /multi-agent:local "#42" # sonra Kısa seç
554
550
 
555
551
  # İnteraktif launcher'lar - göz at ve seç
556
552
  /multi-agent:jira # Jira issue'larımdan seç
@@ -1,12 +1,14 @@
1
1
  ---
2
- description: "Audit an iOS module against the shared coding-standard registry (99 stable-ID rules), produce a remediation plan, then hand off to /multi-agent or :local. Use for a standards pass on a module, or when a review needs rule IDs rather than opinions."
3
- description-tr: "Bir iOS modulunu paylasilan kodlama-standardi registry'sine (99 sabit-ID kural) gore denetler, duzeltme plani cikarir, sonra /multi-agent veya :local'e devreder. Bir modulde standart gecisi icin, ya da bir review'un gorus yerine kural ID'si istedigi durumda kullan."
2
+ description: "Audit an iOS module against the shared coding-standard registry (99 stable-ID rules), produce a remediation plan, then hand off to /multi-agent. Use for a standards pass on a module, or when a review needs rule IDs rather than opinions."
3
+ description-tr: "Bir iOS modulunu paylasilan kodlama-standardi registry'sine (99 sabit-ID kural) gore denetler, duzeltme plani cikarir, sonra /multi-agent'e devreder. Bir modulde standart gecisi icin, ya da bir review'un gorus yerine kural ID'si istedigi durumda kullan."
4
4
  argument-hint: "[module name or path]"
5
5
  allowed-tools: Skill, Bash, Read, Edit, Write, AskUserQuestion
6
6
  ---
7
7
 
8
8
  # multi-agent ios-coding-standard - Module audit → plan → dev handoff
9
9
 
10
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
11
+
10
12
  **Input**: $ARGUMENTS - optionally a module name or path. When absent, Phase 1 discovers and asks.
11
13
 
12
14
  This routine is the **procedure**. The rules live in the `ai-ios-toolkit:ios-coding-standard` skill, whose registry is
@@ -236,10 +238,9 @@ Show a concise version of the plan to the user too.
236
238
 
237
239
  | Option | What it does |
238
240
  |---|---|
239
- | `/multi-agent:local` | No worktree; branches from the main development branch, fixes on the current checkout |
240
241
  | `/multi-agent` | Opens a worktree; fixes on a fresh branch + PR |
241
242
 
242
- Both ask Full or Short at Phase 0 Step 7.5; a standards sweep is usually already scoped, so Short is the common answer.
243
+ Both run the whole pipeline; a standards sweep is usually already scoped, so Phase 1 has little to say and its document is short.
243
244
 
244
245
  Invoke the chosen command with the plan file as the task input, branching off the repo's main
245
246
  development branch (e.g. `chore/<module>-coding-standard`). The dev pipeline applies the fixes,
@@ -7,6 +7,8 @@ not-for: jira
7
7
 
8
8
  # multi-agent issue - 4-Step Picker (Account → Repos → Issue → Dev Context)
9
9
 
10
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
11
+
10
12
  **Input**: $ARGUMENTS
11
13
 
12
14
  Fully interactive. Only one optional flag: `autopilot`.
@@ -6,6 +6,8 @@ argument-hint: "[autopilot] - optional: run the pipeline without confirmations
6
6
 
7
7
  # multi-agent jira - 4-Step Picker (Account → Project → Issue → Dev Context)
8
8
 
9
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
10
+
9
11
  **Input**: $ARGUMENTS
10
12
 
11
13
  Fully interactive. Only one optional flag: `autopilot`.
@@ -6,6 +6,8 @@ argument-hint: "[en|tr] - sets outputLanguage; omit for interactive picker; us
6
6
 
7
7
  # multi-agent language - Language Preference Toggle
8
8
 
9
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
10
+
9
11
  **Input**: $ARGUMENTS
10
12
 
11
13
  Two-axis language preference for the pipeline:
@@ -6,6 +6,8 @@ argument-hint: "[--older-than=<days>] [--project=<name>] [--task=<id>] [--yes]"
6
6
 
7
7
  # multi-agent prune-logs - Clear Per-Task Project Logs
8
8
 
9
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
10
+
9
11
  Every run persists a task log dir at
10
12
  `~/.claude/logs/multi-agent/<project>/<task>/` (agent-state.json, agent-log.md,
11
13
  tracker-state.json, otel-spans.jsonl). These accumulate forever. This prunes
@@ -6,6 +6,8 @@ description-tr: "⚠️ Tüm worktree, branch, log ve state dosyalarını siler.
6
6
 
7
7
  # multi-agent purge - Full Reset
8
8
 
9
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
10
+
9
11
  Reset every multi-agent worktree, its local branch, and the project task
10
12
  counter. Nuclear option - requires double confirmation. Backed by
11
13
  `$HOME/.claude/scripts/purge.sh`, which is safe by default (dry-run, deletes
@@ -1,58 +1,187 @@
1
1
  ---
2
- description: "Resume a stopped or failed task from the phase where it left off. Use when a task stopped or failed and should carry on from where it left off."
3
- description-tr: "Durmuş veya hata almış bir görevi kaldığı fazdan devam ettirir."
4
- argument-hint: "[#id] - optional: task ID (e.g. #2). If omitted, the most recent paused task is used."
2
+ description: "Pick up unfinished work: a pipeline run that stopped mid-phase, or work already written on the current branch that never went through the pipeline. Use when a task stopped or failed, or when hand-written local work needs review, build, PR and reporting."
3
+ description-tr: "Yarım kalan işi sürdürür: ortada duran bir pipeline koşusu ya da mevcut branch'te elle yazılmış, pipeline'dan hiç geçmemiş iş."
4
+ argument-hint: "[#id | PROJ-12345] [--base <branch>] [autopilot] - no argument: pick from the list"
5
+ allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, WebFetch, WebSearch, Skill
5
6
  ---
6
7
 
7
- # multi-agent resume - Resume Paused Task
8
+ # multi-agent resume - Continue Unfinished Work
8
9
 
9
10
  **Input**: $ARGUMENTS
10
11
 
11
- Resume a paused or failed task from the last successful phase.
12
+ > **Language (read FIRST)**: Before any status output, read `prefs.global.outputLanguage` and render every conversational line in it. `AskUserQuestion` renders its `question`, option `label`s and option `description`s in `outputLanguage`; only `header` stays English (<=12-char chip); external payload bodies follow `outputLanguage` too (identifiers, commit messages, branch names stay English). Full contract: `$HOME/.claude/multi-agent-refs/rules.md` "Language Application".
12
13
 
13
- > **Not the same as `/multi-agent:resume-local`.** `resume` continues a **tracked pipeline task** (needs its `agent-state.json`/worktree) from where it stopped. `/multi-agent:resume-local` takes **ad-hoc local work** on the current branch (no prior task required) and runs the pipeline tail - Review → Build+Test → PR → Jira report - over it.
14
+ Unfinished work reaches this command from two directions, and which one you are in is a property of the repository, not of how you typed the command:
15
+
16
+ - **A tracked run stopped.** It has an `agent-state.json`, a phase it was inside, and possibly a worktree. It resumes from where it stopped.
17
+ - **Work exists on the current branch with no run behind it.** You wrote it by hand, or a run outside the pipeline produced it. There is nothing to resume, so the **pipeline tail** runs over the diff: Review (with its build gate) → Commit/PR → Report. Plan and Dev never run; the diff already on the branch is the Dev output.
18
+
19
+ Step 1 finds both and asks. A single command means you do not have to know which case you are in before you can ask the question.
20
+
21
+ ## Input
22
+
23
+ ```bash
24
+ /multi-agent:resume # list everything resumable, pick one
25
+ /multi-agent:resume #2 # a tracked run by task number
26
+ /multi-agent:resume PROJ-12345 # a tracked run by Jira id, or bind the tail to that id
27
+ /multi-agent:resume --base develop # tail path: override the base branch for the diff
28
+ /multi-agent:resume autopilot # no gate prompts: auto-fix, auto-PR, auto-comment
29
+ ```
30
+
31
+ ## When NOT to use it
32
+
33
+ - The change is not written yet - use `/multi-agent`.
34
+ - Only the review is wanted - `/multi-agent:review`. Only the report - `/multi-agent:channels`. Only device UI testing - `/multi-agent:test` / `/multi-agent:manual-test`.
35
+ - The run is abandoned rather than paused - `/multi-agent:kill #N`, or `/multi-agent:garbage-collect --abandoned` for the Phase 0 leftovers.
14
36
 
15
37
  ## Steps
16
38
 
17
- 1. **Find the task** - parse `#N` from the argument, or pick the most recent worktree with `status != "done"`.
18
-
19
- 2. **Read + validate state** - parse `agent-state.json`:
20
- - Validate first: `node $HOME/.claude/scripts/validate-state.mjs <state-file>` (resume-safety check, tolerant of legacy shapes). On non-zero exit, do NOT guess a phase - surface the errors and stop with `ERR: agent-state.json is unsafe to resume; inspect it or 'kill #N' and restart.`
21
- - Confirm the worktree (`worktreePath` / `projects[].worktreePath`) exists and is usable; if missing or locked, run the Phase 0 "Worktree stale-lock heal" before continuing.
22
- - **Unless `state.worktreeRemovedAt` is set.** Then the worktree was removed on purpose by Phase 4 once the PR opened, the branch is still local, and the artefacts live under `state.artifactsPath`. Do NOT heal or recreate it: read state from `artifactsPath`, and if the remaining work needs a checkout (a Phase 5 pause needs none), ask before moving the user's HEAD - they may be mid-work on another branch, which is exactly why the removal did not check the branch out.
23
- - `currentPhase` - last completed phase
24
- - `status` - `paused` | `failed` | `in_progress`
25
- - `haltReason` - if set, show it so the user knows why the run stopped; clear it on successful re-entry
26
- - `circuitBreaker` - if `tripped`, show `trigger` + `detail`, then set `tripped: false` and keep `counters`; if the same trigger fires again at the next checkpoint the breaker re-trips (no silent bypass)
27
- - `autopilot` - preserve the mode
28
-
29
- 3. **Load context** - rebuild working context from durable artifacts, never from conversation memory:
30
- - **Handoff first (v10.8.0)**: read the LATEST `## Handoff` block in `agent-log.md` - it carries done/remaining/decisions/open-findings and the exact re-entry point (phase + subStep). When present, it is the primary context source; cross-check its `Next:` line against `state.currentPhase` and trust state on mismatch (state is the machine truth, handoff is the narrative).
31
- - Fall back to per-phase findings for logs written before v10.8 (no handoff blocks):
32
- - Phase 1 analysis → use it from Phase 2+
33
- - Phase 1 plan → use it from Phase 2+
34
- - Phase 3 code → already in the worktree
35
- - Recent `git log --oneline -10` in the worktree grounds what was actually committed vs. claimed.
36
-
37
- 4. **Rebuild the phase tiles** - load `tracker-state.json` for the task (never re-init it; `$HOME/.claude/multi-agent-refs/tracker-contract.md` "Resume behaviour" + "Continuation runs"):
38
- - Claude Code: `TaskCreate` every phase from the state file in phase order, then `TaskUpdate` each to its stored status, and replace every `tasklist_id` meta with the new IDs.
39
- - Other CLIs: a single `bash $HOME/.claude/scripts/phase-tracker.sh render`.
40
-
41
- 5. **Continue the pipeline.** Read `state.waitingFor` FIRST: when it names a step, the
42
- run re-enters THAT step rather than the next phase. `currentPhase + 1` is the fallback,
43
- not the rule - a run that stopped mid-phase to ask a human has `currentPhase` pointing at
44
- the phase it is still inside, so resuming past it skips the question permanently. That
45
- was already true of Phase 5's channels pause, which documented itself as resumable
46
- through this field while this file never mentioned it.
47
-
48
- | `waitingFor` | Re-entry |
49
- |---|---|
50
- | `maturity` | Phase 0, the maturity step, with the item **re-fetched** and re-scored - an edit is a reason to look again, never proof the gap closed (`$HOME/.claude/multi-agent-refs/features/maturity-followup.md`) |
51
- | `user-channels-choice` | Phase 5, the channels multi-select, with the stored `channelsInput` |
52
- | absent | `currentPhase + 1`, as before (same pipeline as the main multi-agent command) |
53
-
54
- Clear `waitingFor` in the same write that records the answer, the moment the step is
55
- re-entered. A field that outlives the question it asked sends every later resume back
56
- to the step the user already answered.
57
-
58
- 6. **Log**: `🔄 Resumed {JIRA-KEY}-{id} from Phase {N}`
39
+ ### Step 1 - Build the resumable list, then ask
40
+
41
+ Collect both sources before rendering anything. An argument that names a run (`#N`, a Jira id, a GitHub issue number) selects it directly and skips the question; an argument that names nothing resumable is an error, never a silent fall-through to the tail.
42
+
43
+ **Source A - tracked runs.** Every `agent-state.json` under `$HOME/.claude/logs/multi-agent/{project}/` whose `status != "done"`. Each row carries what the choice actually turns on: task id, the phase it stopped inside, its workspace (the worktree path, or `local` when `worktreePath` is the project root), how long it has been sitting, and `haltReason` when set.
44
+
45
+ **Source B - untracked work on the current branch.** Resolve the base branch in order: `--base <arg>` → `figma-config.project.baseBranch` → `develop` → the branch's upstream/merge-base. The work is `git diff <base>...HEAD` plus uncommitted working-tree changes. The row appears only when that diff is non-empty **and** no Source A run already owns this branch - otherwise the same work would be offered twice under two different contracts.
46
+
47
+ **Ask.** Full rules: `$HOME/.claude/multi-agent-refs/picker-contract.md`. This is a one-step chain, so the breadcrumb is `Step 1/1: which unfinished work to pick up`, rendered in `outputLanguage` above the picker. `question`, every `label` and every `description` render in `outputLanguage`; `header` stays English (`Resume what`). Source A rows first (newest first), Source B last. Labels carry proper nouns verbatim - task id, branch name - and the run branches on which row was selected, never on the label text.
48
+
49
+ **One candidate is still a question.** A single row is asked with a genuine escape as its second option, because `AskUserQuestion` refuses a call with fewer than two declared options and discards every question batched with it:
50
+
51
+ | Only row | Second option |
52
+ |---|---|
53
+ | one stopped run | **Show every run** - re-opens with the `status != "done"` filter dropped, so a run that recorded itself finished but left work behind is still reachable |
54
+ | only the branch diff | **Pick a stopped run instead** - re-opens listing Source A unfiltered, and says so when it is empty |
55
+
56
+ Zero rows in both sources: do not ask. Stop with `ERR: nothing to resume - no stopped run for this project and no local changes on {branch} vs {base}`.
57
+
58
+ **The answer routes.** A Source A row runs Steps 2-5 and nothing else; a Source B row runs Steps 6-7 and nothing else. The two halves never both run in one invocation.
59
+
60
+ ### Step 2 - Tracked run: read and validate state
61
+
62
+ - Validate first: `node $HOME/.claude/scripts/validate-state.mjs <state-file>` (resume-safety check, tolerant of legacy shapes). On non-zero exit, do NOT guess a phase - surface the errors and stop with `ERR: agent-state.json is unsafe to resume; inspect it or 'kill #N' and restart.`
63
+ - Confirm the worktree (`worktreePath` / `projects[].worktreePath`) exists and is usable; if missing or locked, run the Phase 0 "Worktree stale-lock heal" before continuing.
64
+ - **Unless `state.worktreeRemovedAt` is set.** Then the worktree was removed on purpose by Phase 4 once the PR opened, the branch is still local, and the artefacts live under `state.artifactsPath`. Do NOT heal or recreate it: read state from `artifactsPath`, and if the remaining work needs a checkout (a Phase 5 pause needs none), ask before moving the user's HEAD - they may be mid-work on another branch, which is exactly why the removal did not check the branch out.
65
+ - `currentPhase` - last completed phase
66
+ - `status` - `paused` | `failed` | `in_progress`
67
+ - `haltReason` - if set, show it so the user knows why the run stopped; clear it on successful re-entry
68
+ - `circuitBreaker` - if `tripped`, show `trigger` + `detail`, then set `tripped: false` and keep `counters`; if the same trigger fires again at the next checkpoint the breaker re-trips (no silent bypass)
69
+ - `autopilot` - preserve the mode
70
+
71
+ ### Step 3 - Tracked run: load context
72
+
73
+ Rebuild working context from durable artifacts, never from conversation memory:
74
+
75
+ - **Handoff first**: read the LATEST `## Handoff` block in `agent-log.md` - it carries done/remaining/decisions/open-findings and the exact re-entry point (phase + subStep). When present, it is the primary context source; cross-check its `Next:` line against `state.currentPhase` and trust state on mismatch (state is the machine truth, handoff is the narrative).
76
+ - Fall back to per-phase findings for logs written before handoff blocks existed:
77
+ - Phase 1 analysis and plan → use them from Phase 2 on
78
+ - Phase 2 code → already in the worktree
79
+ - Recent `git log --oneline -10` in the worktree grounds what was actually committed vs. claimed.
80
+
81
+ ### Step 4 - Tracked run: rebuild the phase tiles
82
+
83
+ Load `tracker-state.json` for the task (never re-init it; `$HOME/.claude/multi-agent-refs/tracker-contract.md` "Resume behaviour" + "Continuation runs"):
84
+
85
+ - Claude Code: `TaskCreate` every phase from the state file in phase order, then `TaskUpdate` each to its stored status, and replace every `tasklist_id` meta with the new IDs.
86
+ - Other CLIs: a single `bash $HOME/.claude/scripts/phase-tracker.sh render`.
87
+
88
+ ### Step 5 - Tracked run: continue the pipeline
89
+
90
+ Read `state.waitingFor` FIRST: when it names a step, the run re-enters THAT step rather than the next phase. `currentPhase + 1` is the fallback, not the rule - a run that stopped mid-phase to ask a human has `currentPhase` pointing at the phase it is still inside, so resuming past it skips the question permanently.
91
+
92
+ | `waitingFor` | Re-entry |
93
+ |---|---|
94
+ | `maturity` | Phase 0, the maturity step, with the item **re-fetched** and re-scored - an edit is a reason to look again, never proof the gap closed (`$HOME/.claude/multi-agent-refs/features/maturity-followup.md`) |
95
+ | `user-channels-choice` | Phase 5, the channels multi-select, with the stored `channelsInput` |
96
+ | `local-test` | Phase 3, the user-test gate, with the checkout the gate was waiting on |
97
+ | absent | `currentPhase + 1`, as before (same pipeline as the main multi-agent command) |
98
+
99
+ Clear `waitingFor` in the same write that records the answer, the moment the step is re-entered. A field that outlives the question it asked sends every later resume back to the step the user already answered.
100
+
101
+ Log: `🔄 Resumed {JIRA-KEY}-{id} from Phase {N}`
102
+
103
+ ### Step 6 - Untracked branch work: context resolution
104
+
105
+ 1. **Project + branch:** detect project (cwd), current branch (`git branch --show-current`). No worktree is created; the work is already in this checkout.
106
+ 2. **Base + diff:** as resolved in Step 1. Abort with `ERR: no local work to resume on <branch> vs <base>` if the diff went empty between the question and the answer.
107
+ 3. **Task binding:** Jira id from the argument, else parsed from the branch name (`bugfix/PROJ-XXXX` / `feature/PROJ-XXXX`); `taskType` inferred from the diff (bugfix/feature/refactor/chore) for the report wording. GitHub issue `#N` from branch or argument when present.
108
+ 4. **Prior state (optional):** if a tracker state exists for this branch from an earlier run, load its analysis summary and Jira/issue binding to enrich the report. Never require a prior pipeline run.
109
+ 5. Persist state under `$HOME/.claude/logs/multi-agent/{project}/{taskId}/`, the same location every run uses.
110
+
111
+ ### Step 7 - Untracked branch work: run the tail
112
+
113
+ ```
114
+ Phase 0: Init → project/branch detect, base + diff, Jira id, state (no worktree)
115
+ Phase 3: Review → the Verify gate first (stack-aware build + existing tests; SUCCESS required), then
116
+ parallel review (Fable + Opus + Sonnet) + Fable triage
117
+ Phase 4: Commit → commit remaining local changes + push + open PR if none exists
118
+ Phase 5: Report → technical analysis + Jira comment with test scenarios (channels: Jira / PR / Confluence / Wiki)
119
+ ```
120
+
121
+ Phases 1 and 2 (Plan / Dev) do not run: the branch's diff is the Dev output, so the **Plan Approval Gate** has no plan to approve here. That is the only path where it is absent for a reason other than `autopilot` having nobody to ask.
122
+
123
+ **Why Review runs the build gate here.** Verify is Phase 2 Dev's exit gate, and this path has no Dev: the work arrived already written. The gate still has to run, so Review runs it before dispatching reviewers. Reviewing a branch whose build was never checked is the failure this ordering prevents.
124
+
125
+ - **Phase 3 Review** - per `$HOME/.claude/multi-agent-refs/phases/phase-3-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:
126
+ - interactive: present them and ask (`AskUserQuestion`) whether to fix now (loop back through a minimal Phase-2-style TDD fix) or proceed;
127
+ - `autopilot` (or `prefs.global.resume.autoFix == true`): auto-fix accepted blocking/important findings, then re-review the fix, before advancing.
128
+ - **Phase 3 Verify gate** - the **automated success gate** (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.**
129
+ - **Phase 4 Commit/PR** - per `$HOME/.claude/multi-agent-refs/phases/phase-4-commit.md`: stage + commit any remaining local changes with a conventional message (`{type}(scope): desc [{JIRA_KEY}-{id}]`), push, and open a PR **only if one does not already exist** for the branch. PR body per `$HOME/.claude/multi-agent-refs/rules.md` "External System Outputs" and `$HOME/.claude/rules/git-conventions.md` - `Ref: #N` / `Related: #N`, never `Closes/Fixes/Resolves`; NO AI/bot attribution anywhere.
130
+ - **Phase 5 Report** - per `$HOME/.claude/multi-agent-refs/phases/phase-5-report.md` + `channels.md`: produce the **technical analysis** and **test scenarios**, then post to the configured channels. Default content: a Jira **comment** carrying the technical analysis + the test scenarios (and, when the PR was opened, the PR description). Every body runs through the humanizer; bot/tool/AI signatures are FORBIDDEN in comments.
131
+
132
+ ## Modes
133
+
134
+ - **interactive** (default): stops at the Phase 4 gate when there are blocking/important findings; asks before committing/PR when appropriate.
135
+ - **`autopilot`**: no prompts - auto-fix accepted blocking/important findings, auto-commit/push/PR, auto-post the Jira comment.
136
+
137
+ ## Required: outward-facing payload contracts
138
+
139
+ Before writing anything outward-facing - PR body, Jira comment, Confluence page, closing report - load `$HOME/.claude/multi-agent-refs/payload-contracts.md`. It names the canonical section set for each payload, the markup dialect per surface (PR body is Markdown, Jira is wiki markup - mixing them is a defect), and the token/duration numbers the closing report must carry. Improvising a payload shape from memory is the most common failure of a run that starts in the middle.
140
+
141
+ ## Required: Phase Tracker Contract
142
+
143
+ **The phase tracker is required.** Full spec: [`$HOME/.claude/multi-agent-refs/tracker-contract.md`]($HOME/.claude/multi-agent-refs/tracker-contract.md).
144
+
145
+ A tracked run rebuilds its tiles from `tracker-state.json` (Step 4) and never re-declares a phase set. The untracked-branch path registers its own active set - `0:Init 3:Review 4:Commit 5:Report` - but NEVER resets a tracker an earlier run already built (load-or-continue; contract section "Continuation runs"):
146
+
147
+ ```bash
148
+ # Phase 0, first shell call (every CLI). init ONLY when no prior state exists -
149
+ # a task handed off from the user test inside Phase 3 ("awaiting local test")
150
+ # keeps its full phase 0-2 history (elapsed, tokens, USD).
151
+ STATE="$HOME/.claude/logs/multi-agent/${TASK_ID}/tracker-state.json"
152
+ if [ ! -f "$STATE" ]; then
153
+ bash $HOME/.claude/scripts/phase-tracker.sh init "$TASK_ID"
154
+ fi
155
+ for p in "0:Init" "3:Review" "4:Commit" "5:Report"; do
156
+ bash $HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}" # idempotent: existing phases keep their history
157
+ done
158
+ bash $HOME/.claude/scripts/phase-tracker.sh update 0 in_progress
159
+
160
+ # Every phase boundary (every CLI):
161
+ bash $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress|completed|failed|skipped
162
+ # After every LLM call (every CLI):
163
+ bash $HOME/.claude/scripts/phase-tracker.sh tokens <N> <in> <out> [cached]
164
+ ```
165
+
166
+ **Continuation path (prior state existed):** (1) if Phase 3 was left `in_progress` with `Now: awaiting local test (user)`, mark it `update 3 completed` + `meta 3 Result "local test done (user)"` before this run's own work (it re-opens Phase 3 with `update 3 in_progress` when the Verify gate runs; elapsed keeps the original `started_at`, which is expected); (2) print ONE line in `outputLanguage` summarizing the inherited history, e.g. `Continuing PROJ-12345: phases 0-3 finished earlier (12m, 38.4k tok, ~$0.74)` (USD via `phase-tracker.sh cost total`); (3) `render`.
167
+
168
+ ### Visual channel - Claude Code (native TaskList widget, required)
169
+
170
+ Fresh state: register one tile per phase in strict phase-number order (`0 → 3 → 4 → 5`) BEFORE any TaskUpdate, capture each `taskId`, persist via `phase-tracker.sh meta <N> tasklist_id "<taskId>"`, then flip status with `TaskUpdate` at each boundary. Out-of-order TaskCreate scrambles the tile stack. Full contract: `$HOME/.claude/multi-agent-refs/tracker-contract.md` "TaskCreate ordering (strict)".
171
+
172
+ Continuation: rebuild the FULL TaskList from the state file (completed tiles included) in phase order before any `TaskUpdate`, refreshing every `tasklist_id` meta - same as the contract's "Resume behaviour".
173
+
174
+ ### Visual channel - Copilot CLI / plain shell
175
+
176
+ No TaskList widget. After every state change call `bash $HOME/.claude/scripts/phase-tracker.sh render` (prints the bordered ANSI phase table as the last tool result). Do NOT call TaskCreate on these CLIs.
177
+
178
+ ## Examples
179
+
180
+ ```bash
181
+ /multi-agent "PROJ-12345" # a run that stops at the user-test gate
182
+ /multi-agent:resume # ... pick it back up from that gate
183
+
184
+ # ... or, with no run behind it at all:
185
+ # you write the change by hand on bugfix/PROJ-12345-flight-filter
186
+ /multi-agent:resume # review + build/test + PR + Jira analysis & test scenarios
187
+ ```
@@ -7,6 +7,8 @@ allowed-tools: Bash, Read, AskUserQuestion
7
7
 
8
8
  # multi-agent save - Save a Routine
9
9
 
10
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
11
+
10
12
  **Input**: $ARGUMENTS (optional routine name)
11
13
 
12
14
  Turn a recurring, project-specific procedure into a first-class `/multi-agent:<name>` command. The saved routine is a **local-only** command (`local-only: true`) plus a registry entry in `prefs.global.routines`; it is never synced to the public repo (the `/multi-agent:sync` backstops enforce this).
@@ -66,10 +66,10 @@ Known legitimate domains are embedded in the scanner (github, anthropic, figma,
66
66
 
67
67
  ## Smoke - self-verification
68
68
 
69
- `pipeline/scripts/smoke-skill-scan.sh` confirms the scanner triggers on positive fixtures for every severity and produces no false positives on the real tree. This is a maintainer-repo gate (smoke scripts are excluded from the npm package): it runs from a pipeline checkout and in CI, where it must be 13/13 green before a team rollout.
69
+ `pipeline/scripts/smoke-skill-scan.sh` confirms the scanner triggers on positive fixtures for every severity and produces no false positives on the real tree. This is a maintainer-repo gate (smoke scripts are excluded from the npm package): it runs from a pipeline checkout and in CI, where it must be green before a team rollout.
70
70
 
71
71
  ## Integration points
72
72
 
73
73
  - **install.js pre-deploy hook** - every `install.js --all` runs an automatic high-threshold warn-only scan
74
- - **CI** - `.github/workflows/smoke.yml` step (strict mode, critical findings block the PR)
74
+ - **Smoke suite** - `smoke-skill-scan.sh` runs the scanner in strict mode under `npm test`, so a critical pattern fails the suite
75
75
  - **Standalone** - `/multi-agent:scan` (this command)
@@ -0,0 +1,52 @@
1
+ ---
2
+ description: "Run a standalone defensive, static security review of a diff, a branch or a repo: build a run-scoped threat model, emit reviewer-shaped findings joined to OWASP + CWE with CVSS scoring, evidence and before/after fixes, and inventory dependencies offline. No live target, no payloads. Use when reviewing code for security outside a full pipeline run, auditing a dependency set, or preparing a branch for a security sign-off."
3
+ description-tr: "Bir diff, branch veya repo üzerinde bağımsız, savunma amaçlı statik güvenlik incelemesi koşar: çalışmaya özel tehdit modeli kurar, OWASP + CWE'ye bağlı, CVSS puanlı, kanıtlı ve önce/sonra düzeltmeli reviewer biçiminde bulgular üretir, bağımlılıkları çevrimdışı envanterler. Canlı hedef yok, payload yok."
4
+ argument-hint: "[#N | repo#N | PR-URL | branch | path] - optional: a PR, a local branch, or a path to scope the review. If omitted (interactive), reviews the current branch diff against its base."
5
+ ---
6
+
7
+ # multi-agent security-review - standalone defensive static review
8
+
9
+ **Input**: $ARGUMENTS
10
+
11
+ The same security audit Phase 3 runs at Step 2.7, invoked on its own. Defensive and static: it reads code, configuration and dependency manifests and reports vulnerabilities. It never runs the target, fires a payload, or reaches a live host.
12
+
13
+ ## Scope resolution
14
+
15
+ Resolve what to review from `$ARGUMENTS`, same input shapes as `/multi-agent:review`:
16
+
17
+ - `#N` / `repo#N` / a PR URL (GitHub or Bitbucket Server) → that PR's diff.
18
+ - a local branch name → its diff against the base branch.
19
+ - a path → the files under it.
20
+ - omitted (interactive) → the current branch diff against its base; autopilot uses the current branch.
21
+
22
+ Compute the diff once and cap it the way Phase 3 Step 1.9 does; write the capped diff to `.pipeline/security-diff.txt` when it exceeds the budget.
23
+
24
+ ## Steps
25
+
26
+ ### 1. Threat model
27
+
28
+ Produce `.pipeline/threat-model.md` if absent (four sections: attacker, trust boundaries, attack surface, severity calibration), or read the existing one. Contract: `$HOME/.claude/multi-agent-refs/threat-model.md`. Mirror to `state.threatModel`.
29
+
30
+ ### 2. Method (the plugin skill)
31
+
32
+ Load the always-on `ai-common-toolkit:security-review` skill for the method: walk the OWASP checklist (Web/API Top 10 2021 for services and sites, Mobile Top 10 2024 for apps) against the changed surface, join each finding to a CWE, and score it. This command orchestrates; it does not re-derive the method.
33
+
34
+ ### 3. Findings (the security-auditor)
35
+
36
+ Dispatch `Agent(subagent_type: "security-auditor")` on the capped diff plus the threat model. It returns one `reviewer-output.schema.json` object whose `findings[]` each carry the `security` envelope of `security-finding.schema.json`. Compute every `security.cvss.baseScore` + `band` with the toolkit `security_cvss_score` tool, so a score cannot drift from its vector. Validate the object with `$HOME/.claude/scripts/validate-reviewer.mjs`; on failure, one self-correction rework then halt.
37
+
38
+ ### 4. Dependencies (offline)
39
+
40
+ Run the toolkit `security_dep_inventory` tool on the lockfiles in scope to get a normalized `{ecosystem, name, version}` inventory. When the analyst toolkit is registered, hand that inventory to `ai-analyst-toolkit:evidence-registry` for a known-CVE lookup; a vulnerable dependency becomes an `A06:2021` finding with the advisory's CWE and CVE. This command contacts nothing itself.
41
+
42
+ ### 5. Report
43
+
44
+ Write the findings to `.pipeline/security-findings.json` (the reviewer-output object) and render a human summary: count by severity, each blocking and important finding with its OWASP id, CWE, CVSS band, evidence, and before/after fix. An empty findings list with `approved: true` is the correct result for a clean review; do not invent findings.
45
+
46
+ ## Relationship to the pipeline
47
+
48
+ - Inside a run, the same audit is Phase 3 Step 2.7 (`$HOME/.claude/multi-agent-refs/features/security-audit.md`), triggered by the `security_path` diff-risk signal. This command is the standalone entry point; both share the persona, the schemas and the toolkit tools.
49
+ - This is not the `store-ready` device pass under `/multi-agent:test`, and it is not a secret scanner: the pipeline's `pre-commit-check.sh` already covers secrets.
50
+ - No writes to Jira, GitHub or Confluence: routing findings to a ticket is a separate, approval-gated step.
51
+
52
+ **Autopilot**: reviews the current branch, writes the report, and never opens a PR or comments.
@@ -7,6 +7,8 @@ allowed-tools: Bash, Read, Edit, Write, AskUserQuestion
7
7
 
8
8
  # multi-agent stack - Select Stack(s) via Plugin Enablement
9
9
 
10
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
11
+
10
12
  Stack skills ship as plugins in the `{owner}/multi-agent-plugins` marketplace. Selecting a stack = **enabling the matching plugin(s)** in the current repo's `.claude/settings.json` `enabledPlugins`. Two toolkits are stack-independent and always enabled alongside the stack plugin(s): `ai-common-toolkit` (accessibility audit, humanizer, Firebase) and `ai-analyst-toolkit` (GitHub and package-registry evidence, community signal for analysis work).
11
13
 
12
14
  On Claude Code the marketplace plugins are the ONLY source of stack skills - nothing is copied into `~/.claude/skills` anymore. A stack that is not enabled here is simply absent from the session. Copilot CLI and Codex CLI have no plugin loader; they receive a local copy filtered to the enabled stacks at install time, which is why step 5 below offers to refresh those copies after a change.