@mmerterden/multi-agent-pipeline 10.3.0 → 10.5.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.
package/CHANGELOG.md CHANGED
@@ -14,6 +14,60 @@ Internal file-layout changes that don't affect the slash-command surface are sti
14
14
 
15
15
  ---
16
16
 
17
+ ## [10.5.0] - 2026-07-02
18
+
19
+ Stack skills move from the local `stack-swap` mechanic to versioned marketplace plugins.
20
+
21
+ ### Added
22
+
23
+ - **`build-stack-plugins.mjs`** — rebuilds each stack plugin's `knowledge/`
24
+ layer in the `{owner}/multi-agent-plugins` marketplace from the pipeline's
25
+ authoring source (`pipeline/skills/shared/external/`), regenerates each
26
+ `plugin.json` `skills[]`, and **bumps the patch version of any plugin whose
27
+ skill set changed**. Idempotent (`--dry-run` supported); a no-op run bumps
28
+ nothing. Cross-stack skills (accessibility audit, humanizer, Firebase) route
29
+ to `ai-common-engineering-toolkit`; Apple/Xcode-only skills stay in the iOS
30
+ plugin. This is the version-based-management backbone: the pipeline is the
31
+ single authoring source, the marketplace is a derived, versioned artifact.
32
+ - **`multi-agent:sync` Step 3c (PLUGINS)** — runs the generator, then commits +
33
+ pushes the plugins repo when a plugin version was bumped.
34
+
35
+ ### Changed
36
+
37
+ - **`/multi-agent:stack`** — selecting a stack no longer moves skill directories
38
+ via `stack-swap.sh`. It now enables the matching marketplace plugin(s) (stack
39
+ toolkit + `ai-common-engineering-toolkit`) in the current repo's
40
+ `.claude/settings.json` `enabledPlugins`, disabling the stack toolkits that
41
+ don't apply. Declarative, per-repo, versioned. No SessionStart hook.
42
+ - **`/multi-agent:update`** — added a step that refreshes the plugin marketplace
43
+ (`claude marketplace update multi-agent-plugins`) so the latest published
44
+ plugin versions are picked up alongside the pipeline update.
45
+
46
+ ### Deprecated
47
+
48
+ - **`stack-swap.sh`** — no longer wired to any SessionStart hook. Retained for
49
+ manual/offline use only; stack selection is now plugin enablement.
50
+
51
+ ## [10.4.0] - 2026-07-02
52
+
53
+ New `finish` command: run the pipeline tail over work you already did locally.
54
+
55
+ ### Added
56
+
57
+ - **`/multi-agent:finish`** (`multi-agent-finish` on Copilot CLI). Takes the
58
+ current branch's local work (diff vs base + working tree) and runs the
59
+ pipeline **tail** in one command — Phase 4 Review → Phase 5 Build+Test success
60
+ gate → Phase 6 Commit/push/PR → Phase 7 technical analysis + a Jira comment
61
+ with test scenarios — **without re-developing** (phases 1-3 skipped). Works
62
+ after `dev-local`/`local` (which skip Review + Test) or after hand-coding /
63
+ hand-testing. Interactive and `autopilot` modes. Reuses the existing
64
+ `phase-4-review` / `phase-5-test` / `phase-6-commit` / `phase-7-report` /
65
+ `channels` contracts; distinct from `resume` (tracked task) and `review`/
66
+ `channels` (single-step). If the repo has no tests it reports "no tests
67
+ present" — never fabricates results.
68
+ - Command inventory 34 → 35 (`cross-cli-contract` §1, README counts, `help.md`
69
+ EN+TR, `sync.md` synced-command list); cross-refs added in `dev-local`/`resume`.
70
+
17
71
  ## [10.3.0] - 2026-07-02
18
72
 
19
73
  Android (Jetpack Compose) parity for the interaction skills shipped in 10.2.0,
package/README.md CHANGED
@@ -11,8 +11,8 @@
11
11
 
12
12
  | Surface | Count |
13
13
  |---|---|
14
- | Slash commands (colon-form `/multi-agent:*`) | 34 |
15
- | Copilot skills (dash-form `multi-agent-*`) | 34 |
14
+ | Slash commands (colon-form `/multi-agent:*`) | 35 |
15
+ | Copilot skills (dash-form `multi-agent-*`) | 35 |
16
16
  | Platforms (native: Claude Code, Copilot CLI · adapter: Cursor, Antigravity, VS Code Copilot Chat, Codex CLI) | 6 |
17
17
  | Store-compliance skills (`apple-archive-compliance`, `google-play-compliance`) | 2 |
18
18
  | Figma skills (iOS + Android + Common) | 41 |
@@ -154,6 +154,7 @@ slows down the install.
154
154
 
155
155
  ## What's new
156
156
 
157
+ - **v10.4.0** (2026-07-02) - New `/multi-agent:finish` command: continue already-done LOCAL work through the pipeline tail in one shot — parallel review → build+test success gate → commit/push/PR → technical analysis + a Jira comment with test scenarios, without re-developing (phases 1-3 skipped). Pairs with `dev-local`/`local` (which skip Review + Test) or with hand-coded/hand-tested changes. Command inventory 34 → 35.
157
158
  - **v10.3.0** (2026-07-02) - Android (Jetpack Compose) parity for the 10.2.0 interaction skills: `figma-navigation` / `figma-overlays` / `figma-bottom-sheets` now carry both a SwiftUI and a Compose section (Navigation Compose; Snackbar/AlertDialog/Dialog + state-driven loading; `ModalBottomSheet`), same emit-intent rules and `ui.*` config hooks on both platforms. Plus a review pass: corrected the `animated-gradient-border` snippet (animate `AngularGradient(angle:)` on a static shape, not `rotationEffect`) and genericized the sheet corner-radius example token.
158
159
  - **v10.2.0** (2026-07-02) - Generic SwiftUI interaction coverage for figma-to-swiftui: three new cross-cutting integration skills (`figma-navigation`, `figma-overlays`, `figma-bottom-sheets`) + a reconcile-and-extend workflow (`figma-evolve-component`), all native-SwiftUI-first with an optional per-project `ui.*` config hook (so the same capabilities work on any SwiftUI codebase, no app-specific coupling). Phase 3D dev detection (§1.5.4) and Phase 4 review both consume them; `figma-to-swiftui` accessibility reference enriched with the VoiceOver-minimalism decision tree; new `animated-gradient-border` UI pattern. Figma-common skills 27 → 31, total figma skills 37 → 41.
159
160
  - **v10.1.0** (2026-06-20) - Fable 5 retired (no longer available): the five heavy agent personas plus Phase 1 / Phase 2 / Phase 4 reviewer-1 + triage and `--dev` fast mode now route to Opus (top available tier); fallback ladder is `opus -> sonnet`. Per-task cost guard (`costBudget`) now defaults on in warn mode. Token economy: Phase 4 shared cache prefix + single-repo diff cap, Phase 1 light Explore tier for small bugfixes, triage prior-art injection capped.
@@ -527,7 +528,7 @@ Stack is auto-detected. Build commands, test runners, lint tools, and review foc
527
528
  | Fastest | `/multi-agent:dev-autopilot "task"` | `multi-agent-dev-autopilot "task"` | Zero interaction |
528
529
  | Test | `/multi-agent:test` | `multi-agent-test` | UI Bug Hunter - visual + accessibility |
529
530
  | Channels | `/multi-agent:channels <target>` | `multi-agent-channels <target>` | Post report to Jira / Confluence / Wiki / PR (multi-select, humanizer pass, reviewer-preserving) |
530
- | Stack | `/multi-agent:stack ios` | `multi-agent-stack ios` | Manually swap skill set per platform |
531
+ | Stack | `/multi-agent:stack ios` | `multi-agent-stack ios` | Select stack by enabling the matching marketplace plugin(s) |
531
532
  | Language | `/multi-agent:language [prompt\|output] <en\|tr>` | `multi-agent-language [prompt\|output] <en\|tr>` | Toggle `promptLanguage` (interactive prompts) and/or `outputLanguage` (assistant explanations). External payloads stay English. |
532
533
 
533
534
  ## UI Bug Hunter + Audit Tools
@@ -562,22 +563,22 @@ All audits run via **direct Bash commands** - no MCP server dependency. Pipeline
562
563
 
563
564
  **No external dependencies** - only standard Xcode CLI tools (iOS) and Android SDK (Android). Platform guides include **compliance rules** that map 1:1 to audit checks - follow the guide, pass the audit.
564
565
 
565
- ## Stack Swap
566
+ ## Stack Selection (marketplace plugins)
566
567
 
567
- Stack is auto-detected at session start by `pipeline/scripts/stack-swap.sh` (SessionStart hook) based on project markers (`.xcodeproj`, `build.gradle`, `package.json`, etc.). To override manually:
568
+ Stack skills ship as versioned plugins in the `{owner}/multi-agent-plugins` marketplace. Selecting a stack **enables the matching plugin(s)** in the repo's `.claude/settings.json` `enabledPlugins` — the stack toolkit plus `ai-common-engineering-toolkit` (cross-stack skills). This replaced the old `stack-swap.sh` mechanic (which physically moved skill directories on a SessionStart hook); enablement is now declarative, per-repo, and versioned.
568
569
 
569
570
  ```bash
570
571
  # Claude Code # Copilot CLI
571
- /multi-agent:stack multi-agent-stack # show current
572
- /multi-agent:stack ios multi-agent-stack ios # SwiftUI + Xcode
573
- /multi-agent:stack android multi-agent-stack android # Compose + Gradle
574
- /multi-agent:stack backend multi-agent-stack backend # Python/Node/Go
575
- /multi-agent:stack frontend multi-agent-stack frontend # React/Vue/Next
576
- /multi-agent:stack mobile multi-agent-stack mobile # iOS + Android
577
- /multi-agent:stack all multi-agent-stack all # load everything
572
+ /multi-agent:stack multi-agent-stack # show enabled plugins
573
+ /multi-agent:stack ios multi-agent-stack ios # SwiftUI toolkit + common
574
+ /multi-agent:stack android multi-agent-stack android # Compose toolkit + common
575
+ /multi-agent:stack backend multi-agent-stack backend # Python/Node toolkit + common
576
+ /multi-agent:stack frontend multi-agent-stack frontend # React/TSX toolkit + common
577
+ /multi-agent:stack mobile multi-agent-stack mobile # iOS + Android + common
578
+ /multi-agent:stack all multi-agent-stack all # all four toolkits + common
578
579
  ```
579
580
 
580
- Re-runs `stack-swap.sh` with a forced mode and loads the matching guide (`swiftui-guide.md`, `android-guide.md`, `backend-guide.md`, `frontend-guide.md`).
581
+ Add the marketplace once with `claude marketplace add {owner}/multi-agent-plugins`. Newly published plugin versions are pulled by `/multi-agent:update`. The plugins are rebuilt from `pipeline/skills/shared/external/` via `pipeline/scripts/build-stack-plugins.mjs` (run by `multi-agent:sync` Step 3c), which bumps the patch version of any plugin whose skill set changed. `stack-swap.sh` is retained for manual/offline use but is no longer wired to any hook.
581
582
 
582
583
  ## Setup
583
584
 
@@ -637,7 +638,8 @@ Runs unit tests, smoke suites, eval fixtures, schema validation, and lint - the
637
638
  | Script | Purpose |
638
639
  | ---------------------- | ------------------------------------------------ |
639
640
  | `pre-commit-check.sh` | Secret detection before commits |
640
- | `stack-swap.sh` | Auto-detect project stack on session start |
641
+ | `build-stack-plugins.mjs` | Rebuild stack plugins from `shared/external`, bump changed plugin versions |
642
+ | `stack-swap.sh` | Legacy stack skill-dir swap (manual/offline; no longer hooked) |
641
643
  | `keychain-save.sh` | Save tokens/JSON to macOS Keychain (interactive) |
642
644
  | `keychain.py` | Deterministic Python Keychain helper (get/set/delete/list/doctor); shell driver auto-delegates on macOS/Linux |
643
645
  | `github-ssh-setup.sh` | GitHub SSH key generation + config |
@@ -782,7 +784,8 @@ pipeline/
782
784
  01-10/ 10 adversarial eval fixtures
783
785
  scripts/
784
786
  pre-commit-check.sh Secret detection hook
785
- stack-swap.sh Auto stack detection (SessionStart)
787
+ build-stack-plugins.mjs Rebuild stack plugins + version bump
788
+ stack-swap.sh Legacy stack swap (manual; no longer hooked)
786
789
  keychain-save.sh Save tokens/JSON to macOS Keychain
787
790
  github-ssh-setup.sh GitHub SSH key generation + setup
788
791
  ui-tree-dumper.swift iOS accessibility tree dumper
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmerterden/multi-agent-pipeline",
3
- "version": "10.3.0",
3
+ "version": "10.5.0",
4
4
  "description": "8-phase AI development pipeline with full orchestration on Claude Code, Copilot CLI, Cursor, Antigravity, and VS Code Copilot Chat. Analysis, planning, TDD, CLI-aware parallel review with consensus surfacing + Opus 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",
@@ -20,6 +20,8 @@ Phase 7: Report → Jira / Wiki + log + knowledge/memory
20
20
 
21
21
  `--dev local` skips Phase 1 (Analysis), Phase 2 (Planning + Approval Gate), Phase 4 (Review), and Phase 5 (User Test - local/autopilot variants skip the interactive test gate). It differs from `--dev` on two axes: no git worktree is created (development happens directly on the current branch in `$PROJECT_ROOT`), and the interactive User Test phase is skipped.
22
22
 
23
+ > **Want the quality tail afterwards?** Since this mode skips Review + Test, run [`/multi-agent:finish`](./finish.md) on the same branch when you're done to add parallel review, a build+test success gate, PR, and a Jira technical-analysis + test-scenario comment - without re-developing.
24
+
23
25
  ## When to use it
24
26
 
25
27
  - Quick bug fix or small feature - review overhead is unnecessary
@@ -0,0 +1,98 @@
1
+ ---
2
+ description: "Continue already-done LOCAL work through the pipeline tail: Review → Build+Test → Commit/PR → Report (technical analysis + Jira test-scenario comment). No dev phase."
3
+ allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, WebFetch, WebSearch, Skill
4
+ ---
5
+
6
+ # multi-agent finish - Ship Local Work Through the Pipeline Tail
7
+
8
+ > **Language (read FIRST)**: Before any status output, read `prefs.global.outputLanguage` and render every conversational line in it. `AskUserQuestion` and external payloads stay English. Full contract: `refs/rules.md` "Language Application".
9
+
10
+ You already did the work locally - wrote code on the current branch and maybe tested it by hand (or ran `/multi-agent:local` / `/multi-agent:dev-local`, which skip Review + Test). `/multi-agent:finish` picks up from there and runs the **pipeline tail** over that existing local work in one command: parallel review, a build + test success gate, commit/push + PR, then the technical analysis and a **Jira comment with test scenarios**. It does NOT re-develop - Analysis / Planning / Dev (phases 1-3) are intentionally skipped; the diff already on the branch IS the input.
11
+
12
+ ## When to use it
13
+
14
+ - You ran `dev-local` / `local` (which skip Review + Test) and now want the full quality tail on the same branch.
15
+ - You hand-coded or hand-tested a change and want review + build/test + PR + Jira write-up without re-running dev.
16
+ - You want the "reviewed, built, tested, PR'd, documented on Jira" finish with a single command.
17
+
18
+ ## When NOT to use it
19
+
20
+ - You haven't written the change yet - use `/multi-agent`, `/multi-agent:local`, or `/multi-agent:dev-local`.
21
+ - You only want the review, nothing else - use `/multi-agent:review`. Only the report/channels - `/multi-agent:channels`. Only device UI testing - `/multi-agent:test` / `/multi-agent:manual-test`.
22
+
23
+ ## Input
24
+
25
+ ```bash
26
+ /multi-agent:finish # current branch vs its base; resolve Jira id from branch name
27
+ /multi-agent:finish DIJITAL-12345 # bind to an explicit Jira id for the Phase 7 comment
28
+ /multi-agent:finish --base develop # override the base branch for the diff
29
+ /multi-agent:finish autopilot # no gate prompts: auto-fix blocking findings, auto-PR, auto-comment
30
+ ```
31
+
32
+ ## Pipeline
33
+
34
+ ```
35
+ Phase 0: Init → project/branch detect, resolve base + diff (work-already-done), Jira id, state (NO worktree)
36
+ Phase 4: Review → deterministic gates + parallel review (Opus + Sonnet) + Opus triage
37
+ Phase 5: Build+Test → stack-aware build gate + run existing tests; SUCCESS required (automated, not the interactive user-test)
38
+ Phase 6: Commit → commit remaining local changes + push + open PR if none exists
39
+ Phase 7: Report → technical analysis + Jira comment with test scenarios (channels: Jira / PR / Confluence / Wiki)
40
+ ```
41
+
42
+ Phases 1-3 (Analysis / Planning / Dev) are skipped by design - `finish` treats the current branch's local changes as the Phase 3 output.
43
+
44
+ ## Phase 0 - Context resolution (finish-specific)
45
+
46
+ 1. **Project + branch:** detect project (cwd), current branch (`git branch --show-current`). No worktree; work stays on the current branch.
47
+ 2. **Base + diff:** resolve base branch in order: `--base <arg>` → `figma-config.project.baseBranch` → `develop` → the branch's upstream/merge-base. The **work under review** is `git diff <base>...HEAD` PLUS uncommitted working-tree changes (`git status`). Abort with a clear message if the diff is empty (`ERR: no local work to finish on <branch> vs <base>`).
48
+ 3. **Task binding:** Jira id from the `--`/positional arg, else parse the branch name (`bugfix/DIJITAL-XXXX` / `feature/DIJITAL-XXXX`); `taskType` inferred from the diff (bugfix/feature/refactor/chore) for the report wording. GitHub issue `#N` from branch/arg when present.
49
+ 4. **Prior state (optional):** if an `agent-state.json` / tracker-state exists for this branch (left by a prior `dev-local`/`local` run), load its analysis summary + Jira/issue binding to enrich the report; otherwise synthesize a minimal state over the diff. Never require a prior full-pipeline run.
50
+ 5. Persist state under `.claude/logs/multi-agent/{project}/{taskId}/` (same as `--local`).
51
+
52
+ ## Phase execution (reuse the existing phase contracts)
53
+
54
+ - **Phase 4 Review** — run per `refs/phases/phase-4-review.md` against the resolved diff: deterministic gates (Step 1.x), stack-specific parallel reviewers (Opus + Sonnet on Claude Code; +GPT on Copilot CLI), Opus triage → `triage.accepted`. Blocking/important accepted findings:
55
+ - interactive: present them and ask (`AskUserQuestion`) whether to fix now (loop back through a minimal Phase-3-style TDD fix) or proceed;
56
+ - `autopilot` (or `prefs.global.finish.autoFix == true`): auto-fix accepted blocking/important findings, then re-review the fix, before advancing.
57
+ - **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/frontend 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.**
58
+ - **Phase 6 Commit/PR** — per `refs/phases/phase-6-commit.md`: stage + commit any remaining local changes with a conventional message (`{type}(scope): desc [DIJITAL-{id}]`), push, and open a PR **only if one does not already exist** for the branch. PR body per `refs/pipeline-output-formatting` and `rules/git-conventions` — `Ref: #N` / `Related: #N`, never `Closes/Fixes/Resolves`; NO AI/bot attribution anywhere.
59
+ - **Phase 7 Report** — per `refs/phases/phase-7-report.md` + `channels.md`: produce the **technical analysis** and **test scenarios**, then post to the configured channels. Default content for `finish`: 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.
60
+
61
+ ## Modes
62
+
63
+ - **interactive** (default): stops at the Phase 4 gate when there are blocking/important findings; asks before committing/PR when appropriate.
64
+ - **`autopilot`**: no prompts - auto-fix accepted blocking/important findings, auto-commit/push/PR, auto-post the Jira comment. Mirrors `local-autopilot`.
65
+
66
+ ## Required: Phase Tracker Contract
67
+
68
+ **The phase tracker is mandatory.** Full spec: [`refs/tracker-contract.md`](./refs/tracker-contract.md). `finish` registers only its active phase set - `0:Init 4:Review 5:Build+Test 6:Commit 7:Report` (phases 1-3 are not part of the finish set; do not register tiles for them).
69
+
70
+ ```bash
71
+ # Phase 0, first shell call (every CLI):
72
+ bash $HOME/.claude/scripts/phase-tracker.sh init "$TASK_ID"
73
+ for p in "0:Init" "4:Review" "5:Build+Test" "6:Commit" "7:Report"; do
74
+ bash $HOME/.claude/scripts/phase-tracker.sh add "${p%%:*}" "${p#*:}"
75
+ done
76
+ bash $HOME/.claude/scripts/phase-tracker.sh update 0 in_progress
77
+
78
+ # Every phase boundary (every CLI):
79
+ bash $HOME/.claude/scripts/phase-tracker.sh update <N> in_progress|completed|failed|skipped
80
+ # After every LLM call (every CLI):
81
+ bash $HOME/.claude/scripts/phase-tracker.sh tokens <N> <in> <out>
82
+ ```
83
+
84
+ ### Visual channel - Claude Code (native TaskList widget, required)
85
+
86
+ Register one tile per phase in **strict creation order** (`0 → 4 → 5 → 6 → 7`) 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: `refs/tracker-contract.md` "TaskCreate ordering (strict)".
87
+
88
+ ### Visual channel - Copilot CLI / plain shell
89
+
90
+ 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.
91
+
92
+ ## Examples
93
+
94
+ ```bash
95
+ /multi-agent:dev-local "DIJITAL-12345" # develop locally (Init→Dev→Commit→Report, no review/test)
96
+ # … you inspect / hand-test the change …
97
+ /multi-agent:finish # now: review + build/test + PR + Jira analysis & test scenarios
98
+ ```
@@ -90,6 +90,7 @@ Dedicated commands (same as flags above):
90
90
  /multi-agent:local-autopilot "task" = multi-agent "task" --local autopilot
91
91
  /multi-agent:dev-local "task" = multi-agent "task" --dev --local
92
92
  /multi-agent:dev-local-autopilot "task" = multi-agent "task" --dev --local autopilot
93
+ /multi-agent:finish [jira-id] [autopilot] Continue already-done LOCAL work: Review → Build+Test → PR → Jira analysis + test scenarios (no dev)
93
94
 
94
95
  ------------------------------------------------------------
95
96
 
@@ -119,7 +120,7 @@ Setup & Maintenance:
119
120
 
120
121
  /multi-agent:setup First-run wizard - Keychain tokens + Git identity + language
121
122
  /multi-agent:language [en|tr] Show or set outputLanguage (promptLanguage stays English)
122
- /multi-agent:stack <id> Manually switch active skill set (ios / android / backend / frontend / fullstack / all)
123
+ /multi-agent:stack <id> Select stack by enabling the matching marketplace plugin(s) (ios / android / backend / frontend / fullstack / all)
123
124
  /multi-agent:sync Sync ecosystem (Claude Code + Copilot CLI + pipeline + website + remote-control)
124
125
  /multi-agent:update Pull latest pipeline + reinstall + run migrations
125
126
  /multi-agent:delete Uninstall pipeline from every CLI (Keychain tokens left intact, double confirm)
@@ -176,7 +177,7 @@ Key Features:
176
177
 
177
178
  Multi-Platform iOS, Android, Backend, Frontend - auto-detected
178
179
  Build Queue xcodebuild/Gradle serialized with lock file - parallel safe
179
- Stack Aware Auto-detects iOS/Android/Python/Node/Go/Docker, loads matching skill set
180
+ Stack Aware Auto-detects iOS/Android/Python/Node/Go/Docker, uses the enabled stack plugin's skills
180
181
  Det. Gates Build + lint + test + secret scan BEFORE AI review
181
182
  Multi-Repo Per-repo worktrees, per-repo identity, integration build before commit
182
183
  Identity Routing Git identity auto-picked from repo origin URL (corporate vs personal)
@@ -296,6 +297,7 @@ Dedicated komutlar (yukarıdaki flag'lerin eşdeğeri):
296
297
  /multi-agent:local-autopilot "task" = multi-agent "task" --local autopilot
297
298
  /multi-agent:dev-local "task" = multi-agent "task" --dev --local
298
299
  /multi-agent:dev-local-autopilot "task" = multi-agent "task" --dev --local autopilot
300
+ /multi-agent:finish [jira-id] [autopilot] Lokalde biten işi sürdür: Review → Build+Test → PR → Jira teknik analiz + test senaryoları (dev yok)
299
301
 
300
302
  ------------------------------------------------------------
301
303
 
@@ -325,7 +327,7 @@ Setup & Maintenance:
325
327
 
326
328
  /multi-agent:setup İlk kurulum sihirbazı - Keychain token + Git kimliği + dil
327
329
  /multi-agent:language [en|tr] outputLanguage'ı göster veya ayarla (promptLanguage İngilizce kalır)
328
- /multi-agent:stack <id> Aktif skill set'i manuel değiştir (ios / android / backend / frontend / fullstack / all)
330
+ /multi-agent:stack <id> Stack'i eşleşen marketplace plugin'i etkinleştirerek seç (ios / android / backend / frontend / fullstack / all)
329
331
  /multi-agent:sync Ekosistemi senkronize et (Claude Code + Copilot CLI + pipeline + website + remote-control)
330
332
  /multi-agent:update En son pipeline'ı çek + reinstall + migration çalıştır
331
333
  /multi-agent:delete Pipeline'ı tüm CLI'lerden kaldır (Keychain token dokunulmaz, çift onay)
@@ -382,7 +384,7 @@ Temel Özellikler:
382
384
 
383
385
  Multi-Platform iOS, Android, Backend, Frontend - otomatik tespit
384
386
  Build Queue xcodebuild/Gradle lock file ile seri - parallel güvenli
385
- Stack Aware iOS/Android/Python/Node/Go/Docker algılanır, eşleşen skill set yüklenir
387
+ Stack Aware iOS/Android/Python/Node/Go/Docker algılanır, etkin stack plugin'inin skilleri kullanılır
386
388
  Det. Gates AI review'dan ÖNCE build + lint + test + secret scan
387
389
  Multi-Repo Repo başına worktree, repo başına identity, commit öncesi entegrasyon build'i
388
390
  Identity Routing Repo origin URL'sinden git kimliği seçimi (kurumsal vs kişisel)
@@ -6,11 +6,11 @@
6
6
 
7
7
  ---
8
8
 
9
- ## 1. Command Inventory (34 commands)
9
+ ## 1. Command Inventory (35 commands)
10
10
 
11
11
  ```
12
12
  analysis, analysis-resolve, autopilot, build-optimize, channels, delete, dev,
13
- dev-autopilot, dev-local, dev-local-autopilot, diff-explain, garbage-collect,
13
+ dev-autopilot, dev-local, dev-local-autopilot, diff-explain, finish, garbage-collect,
14
14
  help, issue, jira, kill, language, local, local-autopilot, log, manual-test,
15
15
  prune-logs, purge, refactor, resume, review, scan, search, setup, stack, status,
16
16
  sync, test, update
@@ -21,6 +21,7 @@ Categories:
21
21
  - **Interactive pickers** (single-purpose, not modes): `jira`, `issue`
22
22
  - **Full 8-phase modes**: `autopilot`, `local`, `local-autopilot`
23
23
  - **Fast modes** (Init -> Dev(Opus) -> Commit -> Report): `dev`, `dev-autopilot`, `dev-local`, `dev-local-autopilot`
24
+ - **Tail modes** (run the pipeline tail over already-done local work): `finish`
24
25
  - **Ops commands** (one-shot, no worktree): `status`, `log`, `kill`, `purge`, `delete`, `resume`, `review`, `analysis`, `analysis-resolve`, `build-optimize`, `channels`, `scan`, `search`, `diff-explain`, `garbage-collect`, `prune-logs`
25
26
  - **Meta-ops**: `setup`, `sync`, `update`, `help`, `refactor`, `test`, `stack`, `manual-test`, `language`
26
27
 
@@ -28,7 +29,7 @@ Categories:
28
29
 
29
30
  ### 1.1 Figma component subphase skills
30
31
 
31
- In addition to the 34 top-level multi-agent commands, the figma-to-component pipeline ships platform-specific skills that multi-agent dispatches from Phase 3 (see `refs/component-dispatch.md`). The structure is **platform-parallel iOS + Android with a shared common pool**:
32
+ In addition to the 35 top-level multi-agent commands, the figma-to-component pipeline ships platform-specific skills that multi-agent dispatches from Phase 3 (see `refs/component-dispatch.md`). The structure is **platform-parallel iOS + Android with a shared common pool**:
32
33
 
33
34
  | Location | Skill count | Purpose |
34
35
  |---|---|---|
@@ -310,7 +311,7 @@ For clipboard ops, callers still gate with `if command -v pbpaste >/dev/null; th
310
311
 
311
312
  This contract is validated by:
312
313
 
313
- - `smoke-cross-cli-behavior.sh` - asserts all 34 commands behave identically, pulls from Section 2 (placeholder vocab), Section 5 (argument parsing), Section 6 (output formats); also regression-locks the 6-persona agent deployment
314
+ - `smoke-cross-cli-behavior.sh` - asserts all 35 commands behave identically, pulls from Section 2 (placeholder vocab), Section 5 (argument parsing), Section 6 (output formats); also regression-locks the 6-persona agent deployment
314
315
  - `smoke-commands-skills-parity.sh` (50 assertions) - enforces colon-form command ↔ dash-form skill directory parity
315
316
  - `smoke-compliance-skills.sh` (45 assertions) - enforces store-compliance skill catalog + 4 consumer wiring
316
317
  - `smoke-personal-data.sh` - extended in 0.5.5 to treat deprecated placeholders (`{github-username}`, `{your-website}`, `{website-repo}`) as leaks; adds `mmerterden` to public-handle blocklist for generic docs
@@ -9,6 +9,8 @@ argument-hint: "[#id] - optional: task ID (e.g. #2). If omitted, the most rece
9
9
 
10
10
  Resume a paused or failed task from the last successful phase.
11
11
 
12
+ > **Not the same as `/multi-agent:finish`.** `resume` continues a **tracked pipeline task** (needs its `agent-state.json`/worktree) from where it stopped. `/multi-agent:finish` 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.
13
+
12
14
  ## Steps
13
15
 
14
16
  1. **Find the task** - parse `#N` from the argument, or pick the most recent worktree with `status != "done"`.
@@ -1,48 +1,94 @@
1
1
  ---
2
- description: "Manually switch the active skill set by platform (ios/android/mobile/backend/frontend/fullstack/all)."
3
- allowed-tools: Bash
2
+ description: "Select the active stack for this repo by enabling the matching marketplace plugin(s) in .claude/settings.json (ios/android/mobile/backend/frontend/fullstack/all)."
3
+ allowed-tools: Bash, Read, Edit, Write
4
4
  ---
5
5
 
6
- # multi-agent stack - Manual Stack Swap
6
+ # multi-agent stack - Select Stack via Plugin Enablement
7
7
 
8
- The `pipeline/scripts/stack-swap.sh` SessionStart hook auto-detects the stack from the project. This command manually overrides that decision - it switches the active skill set in `~/.claude/skills/` and moves the non-matching skills to `~/.claude/skills-inactive/`.
8
+ 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`. The `ai-common-engineering-toolkit` (accessibility audit, humanizer, Firebase) is always enabled alongside the stack plugin.
9
+
10
+ This replaces the old `stack-swap.sh` mechanic that physically moved skill directories in `~/.claude/skills/`. There is no SessionStart hook and no directory shuffling — enablement is declarative, per-repo, and versioned.
9
11
 
10
12
  ## Usage
11
13
 
12
14
  ```bash
13
- /multi-agent:stack # show current state
14
- /multi-agent:stack ios # SwiftUI + Xcode
15
- /multi-agent:stack android # Compose + Gradle
16
- /multi-agent:stack mobile # iOS + Android together
17
- /multi-agent:stack backend # Python / Node / Go
18
- /multi-agent:stack frontend # React / Vue / Next
19
- /multi-agent:stack fullstack # backend + frontend
20
- /multi-agent:stack all # activate everything
15
+ /multi-agent:stack # show which plugins are enabled here
16
+ /multi-agent:stack ios # SwiftUI toolkit + common
17
+ /multi-agent:stack android # Compose toolkit + common
18
+ /multi-agent:stack mobile # iOS + Android + common
19
+ /multi-agent:stack backend # Python / Node spec-driven toolkit + common
20
+ /multi-agent:stack frontend # React / TSX toolkit + common
21
+ /multi-agent:stack fullstack # frontend + backend + common
22
+ /multi-agent:stack all # all four stack toolkits + common
21
23
  ```
22
24
 
25
+ ## Stack → plugin map
26
+
27
+ | Stack | Plugins enabled (all `@multi-agent-plugins`) |
28
+ |---|---|
29
+ | `ios` | `ai-common-engineering-toolkit`, `ai-ios-engineering-toolkit` |
30
+ | `android` | `ai-common-engineering-toolkit`, `ai-android-engineering-toolkit` |
31
+ | `frontend` | `ai-common-engineering-toolkit`, `ai-frontend-engineering-toolkit` |
32
+ | `backend` | `ai-common-engineering-toolkit`, `ai-backend-toolkit` |
33
+ | `mobile` | common + `ai-ios-engineering-toolkit` + `ai-android-engineering-toolkit` |
34
+ | `fullstack` | common + `ai-frontend-engineering-toolkit` + `ai-backend-toolkit` |
35
+ | `all` | common + all four stack toolkits |
36
+
23
37
  ## Behaviour
24
38
 
25
- 1. No arg → status mode: print the active skill count, do **not** move any files.
26
- 2. Arg present → run `$HOME/.claude/scripts/stack-swap.sh <arg>`.
27
- 3. The script prints JSON on stdout (`{"systemMessage": "..."}`) - show the `systemMessage` value to the user.
28
- 4. Unknown arg → the script returns `exit 1` with an error message; do not re-prompt, show the list to the user.
39
+ 1. **No arg → status mode.** Read `.claude/settings.json` (repo) + `~/.claude/settings.json` (global) and print which `@multi-agent-plugins` plugins are currently enabled. Do not modify anything.
40
+ 2. **Arg present → enable mode.** Ensure the marketplace is known, then write the matching `enabledPlugins` entries into the **current repo's** `.claude/settings.json`, disabling the stack toolkits that don't belong to the selected stack. `ai-common-engineering-toolkit` is always set to `true`.
41
+ 3. **Unknown arg** show the list above; do not guess.
29
42
 
30
43
  ## Implementation
31
44
 
32
45
  ```bash
33
- SCRIPT="$HOME/.claude/scripts/stack-swap.sh"
46
+ REPO_SETTINGS=".claude/settings.json"
47
+ MP="multi-agent-plugins"
48
+ ARG="${1:-status}"
34
49
 
35
- if [ ! -x "$SCRIPT" ]; then
36
- echo "stack-swap.sh not found at $SCRIPT - run install.js --all to deploy pipeline scripts."
37
- exit 1
50
+ # --- ensure the marketplace is known (idempotent) -------------------------
51
+ if ! claude marketplace list 2>/dev/null | grep -q "$MP"; then
52
+ claude marketplace add {owner}/multi-agent-plugins 2>/dev/null \
53
+ || echo "note: add the marketplace once with: claude marketplace add {owner}/multi-agent-plugins"
38
54
  fi
39
55
 
40
- ARG="${1:-status}"
41
- "$SCRIPT" "$ARG"
56
+ COMMON="ai-common-engineering-toolkit@${MP}"
57
+ IOS="ai-ios-engineering-toolkit@${MP}"
58
+ ANDROID="ai-android-engineering-toolkit@${MP}"
59
+ FRONTEND="ai-frontend-engineering-toolkit@${MP}"
60
+ BACKEND="ai-backend-toolkit@${MP}"
61
+
62
+ if [ "$ARG" = "status" ]; then
63
+ echo "Enabled multi-agent plugins (repo + global):"
64
+ { [ -f "$REPO_SETTINGS" ] && cat "$REPO_SETTINGS"; cat "$HOME/.claude/settings.json"; } 2>/dev/null \
65
+ | grep -oE "ai-[a-z-]+@${MP}\"[[:space:]]*:[[:space:]]*(true|false)" | sort -u
66
+ exit 0
67
+ fi
68
+
69
+ # resolve the desired ON set
70
+ case "$ARG" in
71
+ ios) ON="$COMMON $IOS" ;;
72
+ android) ON="$COMMON $ANDROID" ;;
73
+ frontend) ON="$COMMON $FRONTEND" ;;
74
+ backend) ON="$COMMON $BACKEND" ;;
75
+ mobile) ON="$COMMON $IOS $ANDROID" ;;
76
+ fullstack) ON="$COMMON $FRONTEND $BACKEND" ;;
77
+ all) ON="$COMMON $IOS $ANDROID $FRONTEND $BACKEND" ;;
78
+ *) echo "Unknown stack '$ARG'. One of: ios android mobile backend frontend fullstack all"; exit 1 ;;
79
+ esac
42
80
  ```
43
81
 
82
+ After resolving `$ON`, edit `.claude/settings.json` (create `{ "enabledPlugins": {} }` if absent) so that:
83
+ - every plugin in `$ON` is set to `true`,
84
+ - every stack toolkit **not** in `$ON` is set to `false` (leave non-`@multi-agent-plugins` entries untouched),
85
+ - `ai-common-engineering-toolkit@multi-agent-plugins` is always `true`.
86
+
87
+ Use the Read + Edit/Write tools (JSON must stay valid). Then print the resulting `enabledPlugins` block.
88
+
44
89
  ## Notes
45
90
 
46
- - A manual swap takes effect immediately, but to refresh Claude Code's skill discovery completely, **restart the conversation**.
47
- - If you want auto-detect to take over again, the next SessionStart is enough - the hook re-evaluates `cwd`. Manual overrides are not persisted.
48
- - Pipeline Phase 1 stack detection is independent of this command (it reads project files). `stack` only affects which skill set is active.
91
+ - Enablement is per-repo and declarative commit `.claude/settings.json` so teammates get the same stack.
92
+ - Restart the conversation (or reload the window) for Claude Code to pick up newly enabled plugins.
93
+ - Pipeline Phase 1 stack detection is independent (it reads project files); `stack` only sets which plugin skill set is active.
94
+ - Legacy: `~/.claude/scripts/stack-swap.sh` is retained for manual/offline use but is no longer wired to any hook. Prefer plugin enablement.
@@ -70,6 +70,8 @@ Step 2b: ADAPTERS Cursor / Antigravity / Copilot Chat per-project rule files r
70
70
  - `--no-adapters` skips this step entirely
71
71
  - writes files + a LOCAL commit per project; push stays the user's call
72
72
  Step 3: REPO Claude Code -> pipeline repo (genericized, personal data scrub, bash -n on all sh)
73
+ Step 3c: PLUGINS pipeline shared/external -> multi-agent-plugins marketplace (rebuild knowledge/,
74
+ bump changed plugins' patch version, commit + push the plugins repo)
73
75
  Step 4: WEBSITE Version + phase/model counts -> {website-host} (i18n + projects.ts)
74
76
  Step 5: REMOTE Pipeline references -> remote-control README
75
77
  Step 6: Commit Commit + push all changed repos
@@ -215,7 +217,7 @@ Adapter sync orchestration goes through `pipeline/scripts/sync-adapters.mjs` -
215
217
  5. **Files NOT synced** (local-only, may contain personal data):
216
218
  - `~/.claude/multi-agent-preferences.json`
217
219
  - `~/.claude/CLAUDE.md`, `~/.claude/rules/`, `~/.claude/knowledge/`
218
- - `~/.claude/scripts/` - EXCEPT `pre-commit-check.sh` and `stack-swap.sh` (generic, synced)
220
+ - `~/.claude/scripts/` - EXCEPT `pre-commit-check.sh`, `stack-swap.sh` (legacy, retained for manual use), and `build-stack-plugins.mjs` (generic, synced)
219
221
  - `~/.claude/settings.json`
220
222
 
221
223
  6. **Cross-platform smoke gate** (final step of the REPO sync, before push):
@@ -234,6 +236,48 @@ Adapter sync orchestration goes through `pipeline/scripts/sync-adapters.mjs` -
234
236
 
235
237
  ---
236
238
 
239
+ ## Stack-Plugin Sync (Step 3c)
240
+
241
+ Stack skills are distributed as versioned plugins in the `{owner}/multi-agent-plugins` marketplace. The pipeline's `pipeline/skills/shared/external/` is the **single authoring source**; the marketplace is a derived, versioned publish artifact. This step rebuilds it and publishes only when something changed.
242
+
243
+ **Source of truth:** author/vendor knowledge skills in `pipeline/skills/shared/external/` (the pipeline's own phases also consume them). The plugins' authored lifecycle skills (`index` / `reference` / `workflow` / `tools`) live in the plugins repo and are never touched by sync.
244
+
245
+ **Flow:**
246
+
247
+ ```bash
248
+ PLUGINS_REPO="$HOME/multi-agent-plugins"
249
+ [ ! -d "$PLUGINS_REPO/.git" ] && gh repo clone {owner}/multi-agent-plugins "$PLUGINS_REPO"
250
+ cd "$PLUGINS_REPO" && git pull origin main
251
+
252
+ # 1. Preview what would change (routing + version bumps), no writes:
253
+ node "$HOME/multi-agent-pipeline/pipeline/scripts/build-stack-plugins.mjs" --dry-run
254
+
255
+ # 2. Apply: rebuild each stack plugin's knowledge/ from shared/external,
256
+ # regenerate plugin.json skills[], bump the patch version of any plugin
257
+ # whose skill set changed. Cross-stack skills -> ai-common-engineering-toolkit;
258
+ # Apple/Xcode-only skills -> iOS plugin only.
259
+ node "$HOME/multi-agent-pipeline/pipeline/scripts/build-stack-plugins.mjs"
260
+ ```
261
+
262
+ **Version-based management:** the generator bumps a plugin's `version` (patch) only when its skill set actually changed. Idempotent — a no-op run bumps nothing. Consumers pick up new versions via `/multi-agent:update` (which runs `claude marketplace update multi-agent-plugins`).
263
+
264
+ **Publish (only if the generator reported bumps):**
265
+
266
+ ```bash
267
+ cd "$PLUGINS_REPO"
268
+ if ! git diff --quiet; then
269
+ git config user.name "$(git config user.name)"; git config user.email "$(git config user.email)"
270
+ git add -A
271
+ git commit -m "chore: rebuild stack plugins from pipeline shared/external"
272
+ gh auth switch --user {owner} 2>/dev/null || true
273
+ git push origin main
274
+ fi
275
+ ```
276
+
277
+ Never author skills directly in the plugins repo's `knowledge/` — they will be overwritten on the next rebuild. Author in `shared/external`, then run this step.
278
+
279
+ ---
280
+
237
281
  ## Website Sync (Step 4)
238
282
 
239
283
  Propagate pipeline version, phase count, model count, and feature descriptions to the website.
@@ -17,7 +17,7 @@ Update the pipeline in one command. Existing preferences are preserved; only ski
17
17
  done
18
18
  if [ -z "$PIPE_DIR" ]; then
19
19
  echo "Pipeline repo not found. Clone it:"
20
- echo " git clone git@github.com:mmerterden/multi-agent-pipeline.git"
20
+ echo " git clone git@github.com:{owner}/multi-agent-pipeline.git"
21
21
  exit 1
22
22
  fi
23
23
  ```
@@ -38,6 +38,19 @@ Update the pipeline in one command. Existing preferences are preserved; only ski
38
38
  node "$PIPE_DIR/install.js" --all
39
39
  ```
40
40
 
41
+ 4b. **Update the stack-plugin marketplace** (pulls the latest plugin versions):
42
+ ```bash
43
+ # Stack skills ship as versioned plugins in {owner}/multi-agent-plugins.
44
+ # Refresh the marketplace so newly published plugin versions are picked up.
45
+ if claude marketplace list 2>/dev/null | grep -q "multi-agent-plugins"; then
46
+ claude marketplace update multi-agent-plugins 2>/dev/null \
47
+ || claude marketplace add {owner}/multi-agent-plugins 2>/dev/null
48
+ echo " -> marketplace multi-agent-plugins refreshed"
49
+ else
50
+ echo " -> marketplace not added yet; add with: claude marketplace add {owner}/multi-agent-plugins"
51
+ fi
52
+ ```
53
+
41
54
  5. **Migrate preferences** (if there is an old schema):
42
55
  ```bash
43
56
  if [ -f "$HOME/.claude/scripts/migrate-prefs.mjs" ]; then
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * build-stack-plugins.mjs
4
+ *
5
+ * Rebuild the per-stack plugin `knowledge/` trees in the multi-agent-plugins
6
+ * marketplace from the pipeline's authoring source (pipeline/skills/shared/external),
7
+ * regenerate each plugin.json `skills[]`, and bump the patch version of any plugin
8
+ * whose skill set changed. This is the version-based management backbone: the
9
+ * pipeline is the single authoring source; the marketplace is a derived, versioned
10
+ * publish artifact.
11
+ *
12
+ * The authored lifecycle skills (index / reference / workflow / tools) live in the
13
+ * plugin repo and are NEVER touched here — only the `knowledge/` layer + plugin.json
14
+ * knowledge entries are regenerated.
15
+ *
16
+ * Routing mirrors pipeline/scripts/stack-swap.sh patterns. Genuinely cross-stack
17
+ * skills go to ai-common-engineering-toolkit (not into each stack plugin). Apple/
18
+ * Xcode-only vendored skills that match no stack pattern belong to iOS only.
19
+ *
20
+ * Usage:
21
+ * node build-stack-plugins.mjs [--plugins-repo <path>] [--pipeline <path>] [--dry-run]
22
+ *
23
+ * Exit code 0 always (report-only); prints a JSON-ish summary + per-plugin diff.
24
+ */
25
+ import {
26
+ readdirSync, existsSync, rmSync, cpSync, readFileSync, writeFileSync, mkdirSync, statSync,
27
+ } from 'node:fs';
28
+ import { join } from 'node:path';
29
+
30
+ const args = process.argv.slice(2);
31
+ const getArg = (k, d) => { const i = args.indexOf(k); return i >= 0 ? args[i + 1] : d; };
32
+ const HOME = process.env.HOME;
33
+ const PLUGINS_REPO = getArg('--plugins-repo', join(HOME, 'multi-agent-plugins'));
34
+ const PIPE_ROOT = getArg('--pipeline', join(HOME, 'multi-agent-pipeline'));
35
+ const EXTERNAL = join(PIPE_ROOT, 'pipeline/skills/shared/external');
36
+ const DRY = args.includes('--dry-run');
37
+
38
+ const COMMON_PLUGIN = 'ai-common-engineering-toolkit';
39
+ const COMMON_SKILLS = ['accessibility-compliance-accessibility-audit', 'firebase', 'humanizer'];
40
+
41
+ // Apple/Xcode-only skills that match no stack pattern → iOS plugin only.
42
+ const APPLE_ONLY = [
43
+ 'avkit', 'cryptokit', 'metrickit-diagnostics', 'pdfkit', 'spm-build-analysis',
44
+ 'swiftlint', 'xcode-build-benchmark', 'xcode-build-fixer', 'xcode-build-orchestrator',
45
+ 'xcode-compilation-analyzer', 'xcode-project-analyzer',
46
+ ];
47
+
48
+ // stack → matching pattern (mirrors stack-swap.sh IOS/ANDROID/BACKEND/FRONTEND patterns)
49
+ const STACK_PATTERNS = {
50
+ 'ai-ios-engineering-toolkit': /(swiftui|swift-|ios-|hig-|apple-|storekit|widgetkit|healthkit|homekit|mapkit|musickit|passkit|pencilkit|realitykit|weatherkit|alarmkit|callkit|cloudkit|coreml|core-|eventkit|energykit|permissionkit|tipkit|shareplay|live-activities|background-processing|app-store|app-clips|app-intents|authentication|contacts-framework|device-integrity|macos-|natural-language|photos-camera|push-notifications|speech-recognition|swiftdata|vision-framework|debugging-instruments|help-skills)/i,
51
+ 'ai-android-engineering-toolkit': /(android|compose-|kotlin-|room-database|retrofit-|gradle-|play-store)/i,
52
+ 'ai-backend-toolkit': /(fastapi|nodejs|docker|api-pattern|api-security|github-actions|observability|architecture|monorepo|clean-code|debugging-strategies|agentflow|closed-loop|context-compression|python-patterns|database-patterns|rest-api-design|testing-backend|ci-cd-pipelines)/i,
53
+ 'ai-frontend-engineering-toolkit': /(react-|nextjs-|typescript-|tailwind-|vue-|web-accessibility|web-performance|css-modern|web-testing|html-semantic)/i,
54
+ };
55
+
56
+ const isDir = (p) => { try { return statSync(p).isDirectory(); } catch { return false; } };
57
+ const listDirs = (p) => (existsSync(p) ? readdirSync(p).filter((n) => isDir(join(p, n))) : []);
58
+
59
+ // --- 1. enumerate authoring source ---------------------------------------
60
+ if (!existsSync(EXTERNAL)) {
61
+ console.error(`source not found: ${EXTERNAL}`);
62
+ process.exit(0);
63
+ }
64
+ const allSkills = listDirs(EXTERNAL);
65
+
66
+ // --- 2. compute desired knowledge set per plugin -------------------------
67
+ const desired = { [COMMON_PLUGIN]: new Set() };
68
+ for (const p of Object.keys(STACK_PATTERNS)) desired[p] = new Set();
69
+
70
+ const unrouted = [];
71
+ for (const skill of allSkills) {
72
+ if (COMMON_SKILLS.includes(skill)) { desired[COMMON_PLUGIN].add(skill); continue; }
73
+ if (APPLE_ONLY.includes(skill)) { desired['ai-ios-engineering-toolkit'].add(skill); continue; }
74
+ let matched = false;
75
+ for (const [plugin, re] of Object.entries(STACK_PATTERNS)) {
76
+ if (re.test(skill)) { desired[plugin].add(skill); matched = true; }
77
+ }
78
+ if (!matched) unrouted.push(skill);
79
+ }
80
+
81
+ // --- 3. sync each plugin's knowledge/ + regenerate plugin.json -----------
82
+ const report = [];
83
+ for (const [plugin, want] of Object.entries(desired)) {
84
+ const pdir = join(PLUGINS_REPO, 'plugins', plugin);
85
+ const kdir = join(pdir, 'skills', 'knowledge');
86
+ const pjPath = join(pdir, '.claude-plugin', 'plugin.json');
87
+ if (!existsSync(pjPath)) { report.push({ plugin, error: 'plugin.json missing' }); continue; }
88
+
89
+ const have = new Set(listDirs(kdir));
90
+ const toAdd = [...want].filter((s) => !have.has(s)).sort();
91
+ const toRemove = [...have].filter((s) => !want.has(s)).sort();
92
+ const changed = toAdd.length > 0 || toRemove.length > 0;
93
+
94
+ if (!DRY && changed) {
95
+ if (!existsSync(kdir)) mkdirSync(kdir, { recursive: true });
96
+ for (const s of toAdd) cpSync(join(EXTERNAL, s), join(kdir, s), { recursive: true });
97
+ for (const s of toRemove) rmSync(join(kdir, s), { recursive: true, force: true });
98
+ }
99
+
100
+ // regenerate plugin.json skills[]: keep non-knowledge entries, rebuild knowledge set
101
+ const pj = JSON.parse(readFileSync(pjPath, 'utf8'));
102
+ const nonKnowledge = (pj.skills || []).filter((s) => !s.startsWith('./skills/knowledge/'));
103
+ const finalKnowledge = (DRY ? [...want] : listDirs(kdir)).map((s) => `./skills/knowledge/${s}`);
104
+ const newSkills = [...new Set([...nonKnowledge, ...finalKnowledge])].sort();
105
+ const skillsChanged = JSON.stringify(pj.skills) !== JSON.stringify(newSkills);
106
+
107
+ const oldV = pj.version || '0.1.0';
108
+ let newV = oldV;
109
+ if (changed || skillsChanged) {
110
+ const [maj, min, patch] = oldV.split('.').map((n) => parseInt(n, 10) || 0);
111
+ newV = `${maj}.${min}.${patch + 1}`;
112
+ }
113
+ if (!DRY && (changed || skillsChanged)) {
114
+ pj.skills = newSkills;
115
+ pj.version = newV;
116
+ writeFileSync(pjPath, `${JSON.stringify(pj, null, 2)}\n`);
117
+ }
118
+ report.push({ plugin, added: toAdd, removed: toRemove, skillCount: newSkills.length, version: oldV === newV ? oldV : `${oldV} → ${newV}`, bumped: oldV !== newV });
119
+ }
120
+
121
+ // --- 4. report ------------------------------------------------------------
122
+ console.log(`build-stack-plugins ${DRY ? '(dry-run)' : ''}`);
123
+ console.log(`source: ${EXTERNAL} (${allSkills.length} skills)`);
124
+ console.log(`target: ${PLUGINS_REPO}`);
125
+ for (const r of report) {
126
+ if (r.error) { console.log(` ✗ ${r.plugin}: ${r.error}`); continue; }
127
+ const flag = r.bumped ? 'BUMPED' : 'unchanged';
128
+ console.log(` ${r.plugin}: skills=${r.skillCount} version=${r.version} [${flag}]`);
129
+ if (r.added.length) console.log(` + ${r.added.join(', ')}`);
130
+ if (r.removed.length) console.log(` - ${r.removed.join(', ')}`);
131
+ }
132
+ if (unrouted.length) {
133
+ console.log(` ⚠ unrouted (matched no stack, not common/apple-only) — NOT copied anywhere:`);
134
+ console.log(` ${unrouted.join(', ')}`);
135
+ }
136
+ const anyBump = report.some((r) => r.bumped);
137
+ console.log(anyBump ? 'result: changes detected (versions bumped)' : 'result: all plugins up to date');
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: multi-agent-finish
3
+ language: en
4
+ description: "Continue already-done LOCAL work through the pipeline tail: Review → Build+Test → Commit/PR → Report (technical analysis + Jira test-scenario comment). No dev phase."
5
+ user-invocable: true
6
+ ---
7
+
8
+ # multi-agent finish - Ship Local Work Through the Pipeline Tail
9
+
10
+ You already wrote (and maybe hand-tested) the change on the current branch - or ran `dev-local` / `local`, which skip Review + Test. `finish` picks up from there and runs the **pipeline tail** over that existing local work in one command, without re-developing.
11
+
12
+ ## Pipeline
13
+
14
+ ```
15
+ Phase 0: Init → project/branch detect, resolve base + diff (work already done), Jira id, state (NO worktree)
16
+ Phase 4: Review → deterministic gates + parallel review + Opus triage
17
+ Phase 5: Build+Test → stack-aware build + run existing tests; SUCCESS required (automated gate, not the interactive user-test)
18
+ Phase 6: Commit → commit remaining changes + push + open PR if none exists
19
+ Phase 7: Report → technical analysis + Jira comment with test scenarios (channels: Jira / PR / Confluence / Wiki)
20
+ ```
21
+
22
+ Phases 1-3 (Analysis / Planning / Dev) are skipped by design - the branch's local diff IS the input.
23
+
24
+ ## When to use it
25
+
26
+ - After `dev-local` / `local` (which skip Review + Test) to run the full quality tail on the same branch.
27
+ - After hand-coding / hand-testing a change, to get review + build/test + PR + Jira write-up without re-running dev.
28
+
29
+ ## When NOT to use it
30
+
31
+ - Change not written yet → `multi-agent` / `multi-agent:local` / `multi-agent:dev-local`.
32
+ - Only the review → `multi-agent:review`; only report/channels → `multi-agent:channels`; only device UI test → `multi-agent:test` / `multi-agent:manual-test`.
33
+
34
+ ## Input
35
+
36
+ ```bash
37
+ multi-agent finish # current branch vs base; Jira id from branch name
38
+ multi-agent finish DIJITAL-12345 # explicit Jira id for the Phase 7 comment
39
+ multi-agent finish --base develop # override base branch for the diff
40
+ multi-agent finish autopilot # no gate prompts: auto-fix, auto-PR, auto-comment
41
+ ```
42
+
43
+ ## Notes
44
+
45
+ - Build+Test is the automated success gate (not the interactive device user-test - that is `multi-agent:manual-test`). If the repo has no tests, it reports "no tests present" - never fabricates results.
46
+ - Commit/PR follows house rules: conventional message, `Ref: #N` (never Closes/Fixes), NO AI/bot attribution. PR opened only if one does not already exist.
47
+ - Full phase contract lives in the Claude Code command `commands/multi-agent/finish.md`; this skill is the Copilot-CLI counterpart.
@@ -1,55 +1,50 @@
1
1
  ---
2
2
  name: multi-agent-stack
3
3
  language: en
4
- description: "Manually switch the active skill set by platform (ios/android/mobile/backend/frontend/fullstack/all)."
4
+ description: "Select the active stack for this repo by enabling the matching marketplace plugin(s) in .claude/settings.json (ios/android/mobile/backend/frontend/fullstack/all)."
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
- # multi-agent stack - Manual Stack Swap
8
+ # multi-agent stack - Select Stack via Plugin Enablement
9
9
 
10
- The `pipeline/scripts/stack-swap.sh` SessionStart hook auto-detects the stack from the project. This command manually overrides that decision - it changes the active skill set and moves non-matching skills to `skills-inactive/`.
10
+ 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`. The `ai-common-engineering-toolkit` (accessibility audit, humanizer, Firebase) is always enabled alongside the stack plugin.
11
+
12
+ This replaces the old `stack-swap.sh` mechanic that physically moved skill directories. No SessionStart hook, no directory shuffling — enablement is declarative, per-repo, and versioned.
11
13
 
12
14
  ## Usage
13
15
 
14
16
  ```bash
15
- multi-agent-stack # show the current state
16
- multi-agent-stack ios # SwiftUI + Xcode
17
- multi-agent-stack android # Compose + Gradle
18
- multi-agent-stack mobile # iOS + Android together
19
- multi-agent-stack backend # Python / Node / Go
20
- multi-agent-stack frontend # React / Vue / Next
21
- multi-agent-stack fullstack # backend + frontend
22
- multi-agent-stack all # activate everything
17
+ multi-agent-stack # show which plugins are enabled here
18
+ multi-agent-stack ios # SwiftUI toolkit + common
19
+ multi-agent-stack android # Compose toolkit + common
20
+ multi-agent-stack mobile # iOS + Android + common
21
+ multi-agent-stack backend # Python / Node spec-driven toolkit + common
22
+ multi-agent-stack frontend # React / TSX toolkit + common
23
+ multi-agent-stack fullstack # frontend + backend + common
24
+ multi-agent-stack all # all four stack toolkits + common
23
25
  ```
24
26
 
25
- ## Behaviour
27
+ ## Stack → plugin map
26
28
 
27
- 1. No arg status mode: show the active skill count, do **not** move any files.
28
- 2. With an arg → run `stack-swap.sh <arg>`.
29
- 3. The script's stdout is JSON (`{"systemMessage": "..."}`) - print the `systemMessage` value to the user.
30
- 4. Unknown arg → the script returns `exit 1` + an error message; do not ask for the value again, show the user the list.
29
+ | Stack | Plugins enabled (all `@multi-agent-plugins`) |
30
+ |---|---|
31
+ | `ios` | `ai-common-engineering-toolkit`, `ai-ios-engineering-toolkit` |
32
+ | `android` | `ai-common-engineering-toolkit`, `ai-android-engineering-toolkit` |
33
+ | `frontend` | `ai-common-engineering-toolkit`, `ai-frontend-engineering-toolkit` |
34
+ | `backend` | `ai-common-engineering-toolkit`, `ai-backend-toolkit` |
35
+ | `mobile` | common + `ai-ios-engineering-toolkit` + `ai-android-engineering-toolkit` |
36
+ | `fullstack` | common + `ai-frontend-engineering-toolkit` + `ai-backend-toolkit` |
37
+ | `all` | common + all four stack toolkits |
31
38
 
32
- ## Implementation
39
+ ## Behaviour
33
40
 
34
- ```bash
35
- # Both CLIs install pipeline scripts under their own home dir. Prefer Copilot's
36
- # own scripts if present; fall back to Claude Code's scripts when running under
37
- # --all install (shared machine, either CLI's copy is up-to-date).
38
- if [ -x "$HOME/.copilot/scripts/stack-swap.sh" ]; then
39
- SCRIPT="$HOME/.copilot/scripts/stack-swap.sh"
40
- elif [ -x "$HOME/.claude/scripts/stack-swap.sh" ]; then
41
- SCRIPT="$HOME/.claude/scripts/stack-swap.sh"
42
- else
43
- echo "stack-swap.sh not found - run install.js --copilot (or --all) to deploy pipeline scripts."
44
- exit 1
45
- fi
46
-
47
- ARG="${1:-status}"
48
- "$SCRIPT" "$ARG"
49
- ```
41
+ 1. **No arg → status mode.** Read `.claude/settings.json` (repo) + the global settings and print which `@multi-agent-plugins` plugins are enabled. Modify nothing.
42
+ 2. **Arg present enable mode.** Ensure the marketplace is known (`claude marketplace add {owner}/multi-agent-plugins`), then write the matching `enabledPlugins` entries into the current repo's `.claude/settings.json`, setting the stack toolkits that don't belong to `false`. `ai-common-engineering-toolkit` is always `true`.
43
+ 3. **Unknown arg** show the list above; do not guess.
50
44
 
51
45
  ## Notes
52
46
 
53
- - A manual swap takes effect immediately, but to fully refresh Copilot CLI's skill discovery, **restart the conversation**.
54
- - If you want auto-detect to take over again, the next SessionStart is enough - the hook looks at `cwd` and decides again. The manual override is not permanent.
55
- - Pipeline Phase 1 stack detection is independent of this command (it looks at project files). `stack` only affects which skill set is active.
47
+ - Enablement is per-repo and declarative commit `.claude/settings.json` so teammates get the same stack.
48
+ - Restart the conversation to pick up newly enabled plugins.
49
+ - Pipeline Phase 1 stack detection is independent (it reads project files); `stack` only sets which plugin skill set is active.
50
+ - Legacy: `stack-swap.sh` is retained for manual/offline use but is no longer wired to any hook.
@@ -90,7 +90,8 @@ If nothing is stale -> report "All targets up to date" and stop.
90
90
  5. **Files NOT synced** (local-only, may contain personal data):
91
91
  - `~/.claude/multi-agent-preferences.json`
92
92
  - `~/.claude/CLAUDE.md`, `~/.claude/rules/`, `~/.claude/knowledge/`
93
- - `~/.claude/scripts/` - EXCEPT `pre-commit-check.sh` and `stack-swap.sh` (generic, synced)
93
+ - `~/.claude/scripts/` - EXCEPT `pre-commit-check.sh`, `stack-swap.sh` (legacy, retained), and `build-stack-plugins.mjs` (generic, synced)
94
+ - Step 3c (PLUGINS): rebuild the `{owner}/multi-agent-plugins` marketplace from `shared/external` via `build-stack-plugins.mjs` (bumps changed plugins' patch version), then commit + push the plugins repo
94
95
  - `~/.claude/settings.json`
95
96
 
96
97
 
@@ -16,6 +16,8 @@ Update the pipeline with a single command. Preferences are preserved; only skill
16
16
  2. Record the current version
17
17
  3. `git pull origin main`
18
18
  4. `node install.js --all` (Claude + Copilot)
19
+ 4b. Refresh the stack-plugin marketplace so the latest plugin versions are picked up:
20
+ `claude marketplace update multi-agent-plugins` (or `claude marketplace add {owner}/multi-agent-plugins` if not yet added)
19
21
  5. `node migrate-prefs.mjs` (if there is a schema upgrade)
20
22
  6. Show the new version + changelog
21
23
  7. Smoke test (schema + cross-cli)