@mmerterden/multi-agent-pipeline 20.30.0 → 20.34.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 +123 -0
- package/README.md +47 -1
- package/README.tr.md +61 -1
- package/docs/adr/0018-cross-repo-links-not-a-global-graph.md +43 -0
- package/docs/adr/README.md +2 -1
- package/docs/facts.json +6 -5
- package/docs/features.md +1 -1
- package/install/_dev-only-files.mjs +1 -0
- package/install/_unattended-profile.mjs +61 -0
- package/install/catalog-history.json +1 -1
- package/install/claude.mjs +16 -2
- package/install/index.mjs +10 -1
- package/install/templates/claude-hooks.json +23 -1
- package/manifest.json +198 -134
- package/package.json +4 -1
- package/pipeline/agents/code-reviewer.md +9 -0
- package/pipeline/agents/explorer.md +4 -0
- package/pipeline/agents/plan-critic.md +4 -2
- package/pipeline/commands/multi-agent/SKILL.md +17 -136
- package/pipeline/commands/multi-agent/analysis/SKILL.md +4 -4
- package/pipeline/commands/multi-agent/channels/SKILL.md +15 -297
- package/pipeline/commands/multi-agent/graph/SKILL.md +5 -2
- package/pipeline/commands/multi-agent/language/SKILL.md +3 -3
- package/pipeline/commands/multi-agent/office-on/SKILL.md +8 -7
- package/pipeline/commands/multi-agent/office-status/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/prune-logs/SKILL.md +4 -1
- package/pipeline/commands/multi-agent/resume/SKILL.md +8 -22
- package/pipeline/commands/multi-agent/review/SKILL.md +11 -134
- package/pipeline/commands/multi-agent/scenario-audit/SKILL.md +4 -2
- package/pipeline/commands/multi-agent/setup/SKILL.md +19 -224
- package/pipeline/commands/multi-agent/sync/SKILL.md +12 -0
- package/pipeline/commands/multi-agent/test-gen/SKILL.md +29 -3
- package/pipeline/contract/CHANGELOG.md +46 -0
- package/pipeline/contract/README.md +27 -10
- package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
- package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
- package/pipeline/contract/fixtures/error-unsigned.json +1 -1
- package/pipeline/contract/fixtures/launch-plan.json +1 -1
- package/pipeline/contract/fixtures/runs-awaiting-question.json +6 -1
- package/pipeline/contract/fixtures/runs-empty.json +1 -1
- package/pipeline/contract/fixtures/runs-failed.json +6 -1
- package/pipeline/contract/fixtures/runs-old-schema.json +6 -1
- package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +5 -1
- package/pipeline/contract/fixtures/runs-pr-opened.json +6 -1
- package/pipeline/contract/fixtures/runs-running.json +6 -1
- package/pipeline/contract/manifest.json +153 -19
- package/pipeline/contract/types/index.d.ts +304 -6
- package/pipeline/lib/bg-launch.mjs +106 -0
- package/pipeline/lib/code-digest.mjs +49 -0
- package/pipeline/lib/credential-resolve.mjs +42 -2
- package/pipeline/multi-agent-refs/channels/generator.md +146 -0
- package/pipeline/multi-agent-refs/channels/menu.md +55 -0
- package/pipeline/multi-agent-refs/channels/multi-repo.md +6 -0
- package/pipeline/multi-agent-refs/channels/preview.md +25 -0
- package/pipeline/multi-agent-refs/channels/reference.md +98 -0
- package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +1 -1
- package/pipeline/multi-agent-refs/features/code-graph.md +27 -0
- package/pipeline/multi-agent-refs/features/office-threat-model.md +24 -6
- package/pipeline/multi-agent-refs/features/plan-critic.md +5 -2
- package/pipeline/multi-agent-refs/features/review-delta.md +4 -1
- package/pipeline/multi-agent-refs/features/scope-check.md +10 -1
- package/pipeline/multi-agent-refs/features/unattended-security.md +1 -1
- package/pipeline/multi-agent-refs/help/en.md +2 -2
- package/pipeline/multi-agent-refs/help/tr.md +2 -2
- package/pipeline/multi-agent-refs/knowledge.md +9 -0
- package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +163 -0
- package/pipeline/multi-agent-refs/phases/modes.md +7 -7
- package/pipeline/multi-agent-refs/phases/phase-1-plan.md +4 -4
- package/pipeline/multi-agent-refs/phases/phase-2-dev.md +9 -8
- package/pipeline/multi-agent-refs/phases/phase-3-review.md +12 -7
- package/pipeline/multi-agent-refs/phases/phase-4-commit.md +7 -3
- package/pipeline/multi-agent-refs/phases/phase-5-report.md +19 -10
- package/pipeline/multi-agent-refs/picker-contract.md +1 -1
- package/pipeline/multi-agent-refs/resume/details.md +35 -0
- package/pipeline/multi-agent-refs/review/inputs.md +87 -0
- package/pipeline/multi-agent-refs/review/module-guides.md +25 -0
- package/pipeline/multi-agent-refs/review/valven.md +42 -0
- package/pipeline/multi-agent-refs/review-standalone-tracker.md +37 -0
- package/pipeline/multi-agent-refs/setup/accounts.md +27 -0
- package/pipeline/multi-agent-refs/setup/app-store-connect.md +5 -0
- package/pipeline/multi-agent-refs/setup/firebase.md +5 -0
- package/pipeline/multi-agent-refs/setup/google-play.md +4 -0
- package/pipeline/multi-agent-refs/setup/hooks-and-plugins.md +21 -0
- package/pipeline/multi-agent-refs/setup/language.md +46 -0
- package/pipeline/multi-agent-refs/setup/multi-repo-group.md +51 -0
- package/pipeline/multi-agent-refs/setup/summaries.md +63 -0
- package/pipeline/multi-agent-refs/setup/token-save-flow.md +51 -0
- package/pipeline/multi-agent-refs/tracker-contract.md +8 -3
- package/pipeline/office/NOTICE.md +4 -1
- package/pipeline/office/assets/ARCHIVE_BOXES.png +0 -0
- package/pipeline/office/assets/COFFEE_MACHINE.png +0 -0
- package/pipeline/office/assets/COUNTER_SINK.png +0 -0
- package/pipeline/office/assets/DEVICE_STAND.png +0 -0
- package/pipeline/office/assets/FILING_CABINET.png +0 -0
- package/pipeline/office/assets/FRIDGE.png +0 -0
- package/pipeline/office/assets/MAILBOX.png +0 -0
- package/pipeline/office/assets/MOP_BUCKET.png +0 -0
- package/pipeline/office/assets/PRINTER.png +0 -0
- package/pipeline/office/assets/RECEPTION_DESK.png +0 -0
- package/pipeline/office/assets/SERVER_RACK.png +0 -0
- package/pipeline/office/assets/SERVER_RACK_2.png +0 -0
- package/pipeline/office/assets/TOILET_STALL.png +0 -0
- package/pipeline/office/assets/VENDING.png +0 -0
- package/pipeline/office/assets/WASHBASIN.png +0 -0
- package/pipeline/office/assets/WATER_COOLER.png +0 -0
- package/pipeline/office/index.html +3936 -819
- package/pipeline/office/toolkit.json +3 -0
- package/pipeline/rules/response-shape.md +6 -7
- package/pipeline/schemas/activity.schema.json +188 -4
- package/pipeline/schemas/agent-state.schema.json +511 -115
- package/pipeline/schemas/contract-error.schema.json +12 -1
- package/pipeline/schemas/job-change.schema.json +72 -0
- package/pipeline/schemas/job-request.schema.json +38 -0
- package/pipeline/schemas/launch.json +4 -4
- package/pipeline/schemas/office-credentials.schema.json +71 -0
- package/pipeline/schemas/office-jobs.json +253 -0
- package/pipeline/schemas/office-jobs.schema.json +62 -0
- package/pipeline/schemas/office-memory.schema.json +105 -0
- package/pipeline/schemas/office-settings-request.schema.json +30 -0
- package/pipeline/schemas/office-settings.schema.json +67 -0
- package/pipeline/schemas/phases.json +14 -6
- package/pipeline/schemas/phases.schema.json +86 -19
- package/pipeline/schemas/plan-critique.schema.json +9 -2
- package/pipeline/schemas/planning-output.schema.json +25 -2
- package/pipeline/schemas/prefs.schema.json +24 -1
- package/pipeline/schemas/prs.schema.json +5 -0
- package/pipeline/schemas/prune-logs-request.schema.json +26 -0
- package/pipeline/schemas/prune-logs.schema.json +52 -0
- package/pipeline/schemas/repo-change.schema.json +54 -0
- package/pipeline/schemas/repo-request.schema.json +29 -0
- package/pipeline/schemas/repos.schema.json +49 -1
- package/pipeline/schemas/reviewer-output.schema.json +20 -2
- package/pipeline/schemas/runs-index.schema.json +257 -46
- package/pipeline/schemas/system-status.schema.json +111 -0
- package/pipeline/schemas/token-budget.json +4 -4
- package/pipeline/schemas/tools.schema.json +5 -0
- package/pipeline/schemas/triage-output.schema.json +20 -2
- package/pipeline/schemas/unattended-profile.json +7 -2
- package/pipeline/scripts/_active-run.mjs +2 -1
- package/pipeline/scripts/_graph-analysis.mjs +270 -0
- package/pipeline/scripts/_memory-policy.mjs +165 -0
- package/pipeline/scripts/_secret-scan.mjs +105 -0
- package/pipeline/scripts/_spawn-async.mjs +9 -5
- package/pipeline/scripts/_unified-diff.mjs +2 -2
- package/pipeline/scripts/activity-snapshot.mjs +219 -23
- package/pipeline/scripts/autopilot-runner.mjs +7 -5
- package/pipeline/scripts/capture-flush.sh +12 -2
- package/pipeline/scripts/check-read-size.sh +9 -0
- package/pipeline/scripts/code-graph-rules/android.json +8 -3
- package/pipeline/scripts/contract-server.mjs +575 -28
- package/pipeline/scripts/debt-ledger.mjs +323 -0
- package/pipeline/scripts/file-context.mjs +261 -0
- package/pipeline/scripts/file-context.sh +20 -0
- package/pipeline/scripts/gen-mode-dispatch.mjs +3 -1
- package/pipeline/scripts/graph-links.mjs +230 -0
- package/pipeline/scripts/graph-query.mjs +133 -1
- package/pipeline/scripts/graph-report.mjs +65 -0
- package/pipeline/scripts/job-launch.mjs +477 -0
- package/pipeline/scripts/launch-request.mjs +94 -9
- package/pipeline/scripts/learn-from-transcripts.mjs +12 -48
- package/pipeline/scripts/learnings-ledger.mjs +143 -24
- package/pipeline/scripts/office-build.mjs +148 -11
- package/pipeline/scripts/office-control.mjs +34 -7
- package/pipeline/scripts/office-credentials.mjs +106 -0
- package/pipeline/scripts/office-memory.mjs +200 -0
- package/pipeline/scripts/office-prune.mjs +125 -0
- package/pipeline/scripts/office-settings.mjs +145 -0
- package/pipeline/scripts/phase-tracker.sh +12 -5
- package/pipeline/scripts/plan-critique-gate.mjs +11 -2
- package/pipeline/scripts/prune-logs.sh +53 -2
- package/pipeline/scripts/rework-rulings.mjs +106 -0
- package/pipeline/scripts/runs-index.mjs +62 -2
- package/pipeline/scripts/scope-check-gate.mjs +149 -2
- package/pipeline/scripts/system-status.mjs +196 -0
- package/pipeline/scripts/task-mirror.mjs +150 -0
- package/pipeline/scripts/task-mirror.sh +20 -0
- package/pipeline/scripts/toolkit-tools.mjs +33 -7
- package/pipeline/scripts/transcript-index.mjs +4 -1
- package/pipeline/scripts/triage-memory.mjs +64 -37
- package/pipeline/scripts/validate-planning.mjs +68 -4
- package/pipeline/scripts/validate-reviewer.mjs +20 -0
- package/pipeline/scripts/validate-triage.mjs +107 -2
- package/pipeline/scripts/work-items.mjs +191 -22
- package/pipeline/skills/.skill-manifest.json +9 -9
- package/pipeline/skills/.skills-index.json +1 -1
- package/pipeline/skills/shared/README.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +5 -2
- package/pipeline/skills/shared/core/multi-agent-language/SKILL.md +4 -4
- package/pipeline/skills/shared/core/multi-agent-office-on/SKILL.md +3 -4
- package/pipeline/skills/shared/core/multi-agent-prune-logs/SKILL.md +4 -1
- package/pipeline/skills/shared/core/multi-agent-review/SKILL.md +21 -0
- package/pipeline/skills/shared/core/multi-agent-scenario-audit/SKILL.md +4 -2
- package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +4 -4
- package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +26 -3
- package/pipeline/skills/skills-index.md +1 -1
|
@@ -41,10 +41,11 @@ Branch-mode runs print to chat only. PR-mode runs print to chat AND post the ver
|
|
|
41
41
|
: "${TASK_ID:=review-$(date +%s)-$$}"
|
|
42
42
|
export TASK_ID
|
|
43
43
|
|
|
44
|
-
# Clean up scratch files on exit so /tmp doesn't accumulate diffs and SHAs.
|
|
45
44
|
trap 'rm -f /tmp/multi-agent-review-${TASK_ID}-*' EXIT
|
|
46
45
|
```
|
|
47
46
|
|
|
47
|
+
Standalone only (a `review-` id): register a tracker record per `$HOME/.claude/multi-agent-refs/review-standalone-tracker.md`.
|
|
48
|
+
|
|
48
49
|
### 1. Parse the input - pick a resolution path
|
|
49
50
|
|
|
50
51
|
```bash
|
|
@@ -76,77 +77,11 @@ When `provider=github` and the diff is fetched in Step 2, also persist `agent-st
|
|
|
76
77
|
|
|
77
78
|
Reached when `kind=pick` (empty input). Skipped entirely in autopilot: autopilot with no ref goes straight to branch mode (`kind=branch; provider=local; ref=$(git rev-parse --abbrev-ref HEAD)`) so nothing prompts.
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
# GitHub: current repo's open PRs + the user's own/requested open PRs across repos.
|
|
83
|
-
gh pr list --state open --json number,title,url,headRefName,author,updatedAt 2>/dev/null # current repo
|
|
84
|
-
gh search prs --state open --review-requested=@me --json number,title,url,repository,updatedAt 2>/dev/null
|
|
85
|
-
gh search prs --state open --author=@me --json number,title,url,repository,updatedAt 2>/dev/null
|
|
86
|
-
|
|
87
|
-
# Bitbucket Server: for each configured bitbucket repo (prefs recentRepos / dev-context),
|
|
88
|
-
# resolve creds via credential-store (see Step 2 bitbucket block) then:
|
|
89
|
-
# GET https://$host/rest/api/1.0/projects/$KEY/repos/$slug/pull-requests?state=OPEN&role=REVIEWER
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Merge into one deduped list, each row labeled with its provider and PR URL; sort by `updatedAt` desc. If the merged list is EMPTY -> tell the user "no open PRs found", fall back to branch mode, and continue.
|
|
93
|
-
|
|
94
|
-
**Select** - follow `$HOME/.claude/multi-agent-refs/picker-contract.md` (breadcrumb narrator line before the prompt), then `AskUserQuestion` `multiSelect: true`:
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
question (outputLanguage): "Hangi PR('lar)ı review edeyim?"
|
|
98
|
-
header (English): "Review PRs"
|
|
99
|
-
options: one per open PR -> label "#<N> <short title>", description (outputLanguage): "<repo> · <provider> · <headRef>"
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Each selected option maps back to a full `agent-state.review.input` descriptor (provider + orgRepo / bb coordinates + prNumber + raw URL), exactly as Step 1 would have parsed an explicit URL. Then **loop Steps 2-7 once per selected PR** (independent review + post each). If the user selects none, fall back to branch mode.
|
|
80
|
+
List open PRs from both providers (a provider whose token or CLI is absent contributes nothing - never hard-fail on one provider), merge, dedupe and sort by `updatedAt` desc; an empty list falls back to branch mode. Ask with `AskUserQuestion` `multiSelect: true` per `$HOME/.claude/multi-agent-refs/picker-contract.md`, then **loop Steps 2-7 once per selected PR**; selecting none falls back to branch mode. Read `$HOME/.claude/multi-agent-refs/review/inputs.md` before Step 1a: the list commands, the picker fields and the descriptor mapping.
|
|
103
81
|
|
|
104
82
|
### 2. Fetch the diff - kind-aware
|
|
105
83
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
git diff origin/develop...{ref}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
**pr mode - github:**
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
gh pr diff "$pr_number" --repo "$org_repo" > /tmp/multi-agent-review-${TASK_ID}-diff.patch
|
|
116
|
-
# Also capture the head commit SHA for GitHub inline-comment anchors
|
|
117
|
-
# (POST .../pulls/{n}/comments requires commit_id):
|
|
118
|
-
HEAD_SHA=$(gh api "/repos/$org_repo/pulls/$pr_number" --jq .head.sha)
|
|
119
|
-
printf '%s\n' "$HEAD_SHA" > /tmp/multi-agent-review-${TASK_ID}-head.sha
|
|
120
|
-
# Persist into agent-state - post-pr-review.sh reads it from there.
|
|
121
|
-
tmp_state=$(mktemp)
|
|
122
|
-
jq --arg sha "$HEAD_SHA" '.review.headCommitSha = $sha' "$AGENT_STATE" > "$tmp_state" \
|
|
123
|
-
&& mv "$tmp_state" "$AGENT_STATE"
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**pr mode - bitbucket-server:**
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
# Resolve credentials via prefs.global.keychainMapping (never hardcode key names).
|
|
130
|
-
. "$HOME/.claude/lib/credential-store-resolver.sh" \
|
|
131
|
-
|| . "$HOME/.copilot/lib/credential-store-resolver.sh"
|
|
132
|
-
resolve_credential_store
|
|
133
|
-
USER_KEY=$(jq -r '.global.keychainMapping.bitbucket_user' "$HOME/.claude/multi-agent-preferences.json")
|
|
134
|
-
TOKEN_KEY=$(jq -r '.global.keychainMapping.bitbucket_token' "$HOME/.claude/multi-agent-preferences.json")
|
|
135
|
-
BB_USER=$("$CRED_STORE" get "$USER_KEY")
|
|
136
|
-
BB_TOKEN=$("$CRED_STORE" get "$TOKEN_KEY")
|
|
137
|
-
|
|
138
|
-
DIFF_FILE="/tmp/multi-agent-review-${TASK_ID}-diff.patch"
|
|
139
|
-
http=$(curl -sS -m 60 --config <(printf 'user = "%s:%s"\n' "$BB_USER" "$BB_TOKEN") -H "Accept: text/plain" \
|
|
140
|
-
"https://$bb_server_host/rest/api/1.0/projects/$bb_project_key/repos/$bb_repo_slug/pull-requests/$pr_number/diff?contextLines=10" \
|
|
141
|
-
-o "$DIFF_FILE" -w '%{http_code}')
|
|
142
|
-
if [ "$http" != "200" ]; then
|
|
143
|
-
echo "review: Bitbucket diff fetch failed (HTTP $http) - error body in $DIFF_FILE" >&2
|
|
144
|
-
rm -f "$DIFF_FILE"
|
|
145
|
-
exit 1
|
|
146
|
-
fi
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
The `credential-store.sh` wrapper reads the macOS Keychain (`security`).
|
|
84
|
+
Branch mode: `git diff origin/develop...{ref}`. PR mode fetches through the provider: `gh pr diff` for `github`, which also persists `agent-state.review.headCommitSha`; the Bitbucket Server REST diff endpoint for `bitbucket-server`, with credentials resolved through `prefs.global.keychainMapping` (never hardcoded key names) and any non-200 response a hard failure. Read `$HOME/.claude/multi-agent-refs/review/inputs.md` "Step 2" before fetching: the exact commands per provider.
|
|
150
85
|
|
|
151
86
|
Save the diff to `/tmp/multi-agent-review-${TASK_ID}-diff.patch` so reviewers can re-read it.
|
|
152
87
|
|
|
@@ -154,27 +89,7 @@ Save the diff to `/tmp/multi-agent-review-${TASK_ID}-diff.patch` so reviewers ca
|
|
|
154
89
|
|
|
155
90
|
A module in the repo may carry its own CLAUDE guide - a convention/checklist file living somewhere in the module's directory tree that the host CLI never auto-loads. When a changed file's module has such a guide, the review must consult it. Discovery is deterministic, from the diff's changed paths:
|
|
156
91
|
|
|
157
|
-
|
|
158
|
-
# Changed file paths from the patch:
|
|
159
|
-
grep -E '^\+\+\+ b/' "$DIFF_FILE" | sed 's|^+++ b/||' | sort -u > /tmp/multi-agent-review-${TASK_ID}-paths.txt
|
|
160
|
-
|
|
161
|
-
# For each changed path, walk its directory chain up to the repo root and
|
|
162
|
-
# collect guide files matching: CLAUDE.md, *-CLAUDE.md, AGENTS.md.
|
|
163
|
-
# Root-level CLAUDE.md/AGENTS.md are excluded - the host CLI already loads those.
|
|
164
|
-
guides=()
|
|
165
|
-
while IFS= read -r p; do
|
|
166
|
-
d=$(dirname "$p")
|
|
167
|
-
while [ "$d" != "." ] && [ "$d" != "/" ]; do
|
|
168
|
-
for g in "$d"/CLAUDE.md "$d"/*-CLAUDE.md "$d"/AGENTS.md; do
|
|
169
|
-
[ -e "$g" ] && guides+=("$g")
|
|
170
|
-
done
|
|
171
|
-
d=$(dirname "$d")
|
|
172
|
-
done
|
|
173
|
-
done < /tmp/multi-agent-review-${TASK_ID}-paths.txt
|
|
174
|
-
# dedupe, cap at 5 (log any dropped so truncation is never silent)
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Existence checks are resolved against the local checkout when the cwd is the target repo. In PR mode without a local checkout, probe the candidate paths via the provider API instead (`gh api /repos/{o}/{r}/contents/{path}?ref={headSha}` / Bitbucket `GET /projects/{KEY}/repos/{slug}/browse/{path}?at={headSha}`) and fetch the matching files' raw content the same way. No hit → step is a silent no-op.
|
|
92
|
+
Read `$HOME/.claude/multi-agent-refs/review/module-guides.md` before Step 2b: the discovery walk (guide file names, the root-level exclusion, the cap of 5 with dropped guides logged) and the provider-API probe for PR mode without a local checkout. No hit: the step is a silent no-op.
|
|
178
93
|
|
|
179
94
|
Persist `agent-state.review.moduleGuides = [<repo-relative paths>]` and inject into every reviewer prompt (Step 3):
|
|
180
95
|
|
|
@@ -186,44 +101,10 @@ Scope note: a guide governs only files under its own directory - a guide found
|
|
|
186
101
|
|
|
187
102
|
The `valven-rules` registry (`ai-common-toolkit`) is applied to every review, in `review` mode. Collect what the gate needs, then run it:
|
|
188
103
|
|
|
189
|
-
|
|
190
|
-
VG_FILE="/tmp/multi-agent-review-${TASK_ID}-valven.json"
|
|
191
|
-
VG_ARGS=(--mode review --out "$VG_FILE")
|
|
192
|
-
case "$kind/$provider" in
|
|
193
|
-
branch/local)
|
|
194
|
-
VG_ARGS+=(--repo . --base origin/develop --head "$ref") ;;
|
|
195
|
-
pr/github)
|
|
196
|
-
node "$HOME/.claude/scripts/pr-timeline.mjs" --repo "$org_repo" --pr "$pr_number" \
|
|
197
|
-
--out "/tmp/multi-agent-review-${TASK_ID}-pr.json" # gh pr view + ready time + bot-typed reviews
|
|
198
|
-
jq -r '.body // ""' "/tmp/multi-agent-review-${TASK_ID}-pr.json" > "/tmp/multi-agent-review-${TASK_ID}-body.md"
|
|
199
|
-
jq -r '.commits[] | "\(.authoredDate)\t\(.messageHeadline)"' "/tmp/multi-agent-review-${TASK_ID}-pr.json" > "/tmp/multi-agent-review-${TASK_ID}-commits.txt"
|
|
200
|
-
VG_ARGS+=(--branch "$(jq -r .headRefName "/tmp/multi-agent-review-${TASK_ID}-pr.json")"
|
|
201
|
-
--pr-body-file "/tmp/multi-agent-review-${TASK_ID}-body.md"
|
|
202
|
-
--commits-file "/tmp/multi-agent-review-${TASK_ID}-commits.txt"
|
|
203
|
-
--pr-meta-file "/tmp/multi-agent-review-${TASK_ID}-pr.json") ;;
|
|
204
|
-
pr/bitbucket-server)
|
|
205
|
-
# Same credentials as Step 2. PR: fromRef.displayId + description; commits: values[].message.
|
|
206
|
-
# Write the description to ...-body.md, one "<ISO authorTimestamp>\t<first message line>" per commit to ...-commits.txt,
|
|
207
|
-
# and the timeline to ...-meta.json (features/valven.md, "Development Behaviors"). Then:
|
|
208
|
-
VG_ARGS+=(--branch "$BB_FROM_REF" --pr-body-file "/tmp/multi-agent-review-${TASK_ID}-body.md"
|
|
209
|
-
--commits-file "/tmp/multi-agent-review-${TASK_ID}-commits.txt"
|
|
210
|
-
--pr-meta-file "/tmp/multi-agent-review-${TASK_ID}-meta.json") ;;
|
|
211
|
-
esac
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
For PR input: when the cwd is a checkout of the same repo, `git fetch origin "<headRef>"` (this moves no HEAD) and add `--repo . --base "origin/<baseRef>" --head FETCH_HEAD`, so sizes and the rework ratio come from history. Otherwise add `--diff-file "$DIFF_FILE"`; the rework rule then reports `not-measured`, which is stated in the summary rather than read as a pass.
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
node "$HOME/.claude/scripts/valven-gate.mjs" "${VG_ARGS[@]}" >/dev/null
|
|
218
|
-
VG_RC=$? # 0 clean, 1 findings, 2 could not run
|
|
219
|
-
```
|
|
104
|
+
Read `$HOME/.claude/multi-agent-refs/review/valven.md` before Step 2c: the per-input gate arguments, the checkout-vs-diff-file choice, and the handling of the split, old-work, judgement (`VLV-SCOPE-02`, `VLV-PRDESC-02`, injected into every Step 3 reviewer prompt), cycle and pickup rules. Two rules hold on every input:
|
|
220
105
|
|
|
221
106
|
- Exit 2: print the stderr line and continue the review with `Valven: not measured (<reason>)` in the Step 6 summary. Never print it as passed.
|
|
222
107
|
- The gate's `findings[]` join the reviewer findings at Step 5 with `tag: valven`. They are measurements, so triage accepts them unless the task is exempt; an accepted `important` or `blocking` one makes the Step 7 decision NEEDS WORK.
|
|
223
|
-
- When `splitRequired` is true, run `node "$HOME/.claude/scripts/valven-split.mjs" --repo . --base "origin/<baseRef>" --head <head>` (plan only, no `--apply`) where a checkout exists, and append the slice table (branch, lines, files) to the `VLV-SIZE-01` finding's `fix`.
|
|
224
|
-
- When `VLV-AGE-01`, `VLV-BEHIND-01` or `VLV-TRACE-03` fires and a checkout exists, put the `valven-port.mjs` plan (same base and head, no `--apply`) in the finding's `fix` as `$HOME/.claude/multi-agent-refs/features/valven.md`, "Old work", lists it.
|
|
225
|
-
- The registry's judgement rules (`rules:` block: `VLV-SCOPE-02`, `VLV-PRDESC-02`) go into every reviewer prompt in Step 3, with the PR body when one exists. Each reviewer returns a verdict per ID.
|
|
226
|
-
- `VLV-CYCLE-01..03` are `suggestion` findings with a Valven score and never set NEEDS WORK alone; `VLV-PICKUP-01` is `important` for no reviewer, a `suggestion` for an old draft. Branch input reports them `not-measured`.
|
|
227
108
|
|
|
228
109
|
Step 6 adds one line under the table: `Valven: <n> finding(s) · <changedLines> lines / <fileCount> files · split: <yes N slices|no>`, plus for a PR `Valven scores: churn · coding · pickup · review` from `scores` (`-` when absent).
|
|
229
110
|
|
|
@@ -312,6 +193,8 @@ Classify findings into:
|
|
|
312
193
|
|
|
313
194
|
Triage also marks each finding as `accepted` (real issue), `deferred` (real but out of scope), or `rejected` (false positive). Only `accepted` findings appear in the body of the PR comment; `deferred` items go in the Triage notes section.
|
|
314
195
|
|
|
196
|
+
Triage settles every reviewer `cannotVerify` row the way Phase 3 does (`phase-3-review.md` 3.2): `verified` with the file:line read, `finding` with the file:line of the accepted or deferred finding, or `out-of-scope`. Rows left unsettled are listed in the chat summary and in the Triage notes section.
|
|
197
|
+
|
|
315
198
|
### 6. Print the chat summary (always)
|
|
316
199
|
|
|
317
200
|
```
|
|
@@ -379,19 +262,13 @@ If the post fails (network, token, harness block), `post-pr-review.sh` exits non
|
|
|
379
262
|
Per the `$HOME/.claude/multi-agent-refs/tracker-contract.md` tokens contract, after each reviewer LLM call:
|
|
380
263
|
|
|
381
264
|
```bash
|
|
382
|
-
bash $HOME/.claude/scripts/phase-tracker.sh tokens
|
|
265
|
+
bash $HOME/.claude/scripts/phase-tracker.sh tokens <N> <input_count> <output_count>
|
|
383
266
|
```
|
|
384
267
|
|
|
385
|
-
|
|
268
|
+
`<N>`: the run's Review phase, or step 2 for a standalone review.
|
|
386
269
|
|
|
387
270
|
## Input matrix
|
|
388
271
|
|
|
389
|
-
|
|
390
|
-
|---|---|---|
|
|
391
|
-
| no args (interactive) | PR picker (open GitHub + Bitbucket PRs, multi-select) | inline comments + approve/needs-work, per selected PR |
|
|
392
|
-
| no args (autopilot / no PRs) | branch (current) | none - chat only |
|
|
393
|
-
| `feature/foo` | branch (named) | none - chat only |
|
|
394
|
-
| `#N`, `repo#N`, GitHub PR URL | pr (github) | inline comments + approve/needs-work |
|
|
395
|
-
| Bitbucket Server PR URL | pr (bitbucket-server) | inline comments + approve/needs-work |
|
|
272
|
+
The input table at the top, by mode and PR action: `$HOME/.claude/multi-agent-refs/review/inputs.md` "Input matrix".
|
|
396
273
|
|
|
397
274
|
PR-mode body language honors `prefs.global.outputLanguage`. The orchestrator entry point is `lib/post-pr-review.sh "$TASK_ID"` - it reads `agent-state.review` and handles diff fetch, finding render, comment posts, and review state end-to-end.
|
|
@@ -55,7 +55,9 @@ Read the candidate lines it returns. A term nothing matched is listed under
|
|
|
55
55
|
|
|
56
56
|
## Step 3 - Verdict
|
|
57
57
|
|
|
58
|
-
Write
|
|
58
|
+
Write the verdicts to a file in a folder of this run's own
|
|
59
|
+
(`VERDICTS="$(mktemp -d)/verdicts.json"`, never a fixed `/tmp` name another
|
|
60
|
+
user or a second audit could share): `[{id, status, citations, searched, note}]`.
|
|
59
61
|
|
|
60
62
|
| Status | When | Needs |
|
|
61
63
|
|---|---|---|
|
|
@@ -66,7 +68,7 @@ Write `/tmp/ma-verdicts.json`: `[{id, status, citations, searched, note}]`.
|
|
|
66
68
|
|
|
67
69
|
```bash
|
|
68
70
|
node "$HOME/.claude/scripts/scenario-audit.mjs" verify --csv "<scenarios.csv>" \
|
|
69
|
-
--verdicts
|
|
71
|
+
--verdicts "$VERDICTS" --repo "<repo>" --lang "<outputLanguage>"
|
|
70
72
|
```
|
|
71
73
|
|
|
72
74
|
## Step 4 - Report
|
|
@@ -34,51 +34,13 @@ Uses `$HOME/.claude/lib/credential-store.sh` to read/write secrets in the macOS
|
|
|
34
34
|
|
|
35
35
|
Run `~/.claude/lib/credential-store.sh doctor` first - it prints the platform and whether the backend is usable.
|
|
36
36
|
|
|
37
|
-
The shell driver
|
|
37
|
+
The shell driver delegates to the Python helper `$HOME/.claude/scripts/keychain.py`; what it writes and the `KEYCHAIN_DELEGATE=0` override: `$HOME/.claude/multi-agent-refs/setup/token-save-flow.md` "Inline Token Save Pattern".
|
|
38
38
|
|
|
39
39
|
### Step 0 - Language Selection
|
|
40
40
|
|
|
41
|
-
Ask BEFORE anything else,
|
|
41
|
+
Ask BEFORE anything else: one question, `outputLanguage` (`en` / `tr`). `promptLanguage` is fixed to `"en"` and never offered to the user. Commits, branch names and agent prompts stay English; PR, Jira and wiki bodies follow `outputLanguage`. Already set in prefs: skip silently. From this point forward `question`, `label` and `description` render in `outputLanguage`; `header` stays English.
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|---|---|---|
|
|
45
|
-
| `promptLanguage` | Picker chrome only: the `AskUserQuestion` `header` chip, host error UI, internal contract identifiers | **No - fixed to `en`.** The chip is capped at 12 chars, which most Turkish equivalents overflow. |
|
|
46
|
-
| `outputLanguage` | The assistant's non-interactive explanations, status updates, error messages, and pipeline-generated reports rendered to the user | Yes - set here and changeable later via `/multi-agent:language <en\|tr>` |
|
|
47
|
-
|
|
48
|
-
`promptLanguage` is seeded as `"en"` and never offered to the user. **External payloads always stay English** (commits, PR titles/bodies, Jira comments, wiki content, reviewer/triage prompts, agent-log.md).
|
|
49
|
-
|
|
50
|
-
#### Step 0 prompt - `outputLanguage`
|
|
51
|
-
|
|
52
|
-
The setup wizard asks one question (English UI per skill-prompt rules):
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
Which language should the assistant use for ITS OWN explanations,
|
|
56
|
-
status updates, and pipeline-generated reports?
|
|
57
|
-
|
|
58
|
-
1) English
|
|
59
|
-
2) Türkçe
|
|
60
|
-
|
|
61
|
-
Select (1-2):
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
**Rules:**
|
|
65
|
-
|
|
66
|
-
- **Already set in prefs** → skip silently. User can change later with `/multi-agent:language <en|tr>` or `/multi-agent:language output <en|tr>`.
|
|
67
|
-
- **New value** → validate against the schema enum (`en`, `tr`), write `prefs.global.outputLanguage` via atomic rename, force `prefs.global.promptLanguage = "en"`, then echo a confirmation in the just-chosen `outputLanguage`:
|
|
68
|
-
- `en`: `outputLanguage=<Y>. promptLanguage stays "en". External payloads (PR bodies, Jira comments, reviewer prompts) stay English regardless.`
|
|
69
|
-
- `tr`: `outputLanguage=<Y>. promptLanguage "en" sabit. Dış çıktılar (PR açıklamaları, Jira yorumları, review istemleri) her durumda İngilizce kalır.`
|
|
70
|
-
- **Unknown input** → re-ask once, then abort setup with a hint pointing to `/multi-agent:language`.
|
|
71
|
-
|
|
72
|
-
From this point forward, every prompt in Steps 1-6 below follows the canonical
|
|
73
|
-
per-field matrix in `$HOME/.claude/multi-agent-refs/rules.md` ("Language Application"):
|
|
74
|
-
`question`, `label` and `description` render in `outputLanguage`; `header` stays
|
|
75
|
-
English. Wizard status and the post-setup summary follow `outputLanguage`. External
|
|
76
|
-
payloads remain English.
|
|
77
|
-
|
|
78
|
-
> `promptLanguage` governs only the button and chip chrome, never the question a
|
|
79
|
-
> user reads. Rendering a whole prompt in English "per the fixed
|
|
80
|
-
> `promptLanguage`" contradicts the matrix above and produces half-English
|
|
81
|
-
> pickers on Turkish runs.
|
|
43
|
+
Read `$HOME/.claude/multi-agent-refs/setup/language.md` before Step 0: the two language axes, the exact prompt, validation, the confirmation lines and the unknown-input rule.
|
|
82
44
|
|
|
83
45
|
### Step 0.5 - Dependency check
|
|
84
46
|
|
|
@@ -104,22 +66,7 @@ Full procedure: `$HOME/.claude/multi-agent-refs/setup/discovery.md`. Read it for
|
|
|
104
66
|
|
|
105
67
|
### Step 2 - Show Discovery Summary + Save Mapping
|
|
106
68
|
|
|
107
|
-
Show results grouped by status:
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
Keychain Token Discovery (${USER}):
|
|
111
|
-
|
|
112
|
-
Jira -> ${USER}_Jira_Access_Token
|
|
113
|
-
GitHub -> ${USER}_Github
|
|
114
|
-
Figma -> ${USER}_Figma_Access_Token
|
|
115
|
-
Firebase -> ${USER}_Firebase_Access_Json
|
|
116
|
-
Confluence -> MISSING
|
|
117
|
-
Jenkins -> MISSING
|
|
118
|
-
---
|
|
119
|
-
Git identities: check preferences file (see Step 3)
|
|
120
|
-
|
|
121
|
-
Mapped: 8 | Missing: 4
|
|
122
|
-
```
|
|
69
|
+
Show results grouped by status: one line per service with its mapped key or `MISSING`, then the mapped / missing counts. Layout: `$HOME/.claude/multi-agent-refs/setup/summaries.md` "Step 2 discovery summary".
|
|
123
70
|
|
|
124
71
|
Non-standard key names are perfectly valid - the mapping handles resolution. No rename or migration is offered.
|
|
125
72
|
|
|
@@ -169,31 +116,11 @@ never runs update still reports. What is sent, what never is, and
|
|
|
169
116
|
|
|
170
117
|
### Auto-learned fields (no setup step needed)
|
|
171
118
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
**Git Identity**: auto-learned from token onboarding. Each token saved in Step 3 triggers an identity prompt (see Token Save Flow Step C). No separate identity setup step.
|
|
119
|
+
The Jira project key and the git identity are learned from use, never asked here. How each is captured: `$HOME/.claude/multi-agent-refs/setup/accounts.md` "Auto-learned fields".
|
|
175
120
|
|
|
176
121
|
### Step 3 - Interactive token onboarding (for missing tokens)
|
|
177
122
|
|
|
178
|
-
Git identities are NOT asked as a separate step. They are learned when tokens are added via the Token Save Flow
|
|
179
|
-
|
|
180
|
-
```
|
|
181
|
-
Token saved. Which git identity uses this token?
|
|
182
|
-
|
|
183
|
-
Existing identities:
|
|
184
|
-
1. Ada Lovelace <ada@example.com>
|
|
185
|
-
2. Ada Lovelace <ada@personal.com>
|
|
186
|
-
n. Create new identity
|
|
187
|
-
|
|
188
|
-
Select:
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
- First token ever → no existing identities → asks name + email → creates identity → maps token
|
|
192
|
-
- Subsequent tokens → pick existing or create new → maps token to that identity's `servicePatMap`
|
|
193
|
-
- Multiple accounts per platform supported (e.g. two GitHub tokens, each mapped to a different identity)
|
|
194
|
-
- Identity is stored in `prefs.global.identities[]`, token-to-identity binding in `identity.servicePatMap`
|
|
195
|
-
|
|
196
|
-
**Legacy compatibility**: If `prefs.global.gitIdentities` (deprecated) is present, `migrate-prefs.mjs` renames it to `identities` automatically.
|
|
123
|
+
Git identities are NOT asked as a separate step. They are learned when tokens are added via the Token Save Flow: each token save triggers an identity prompt (Step C), the identity is stored in `prefs.global.identities[]` and the token binding in `identity.servicePatMap`. Multiple accounts per platform are supported. The prompt, the binding rules and the legacy `gitIdentities` migration: `$HOME/.claude/multi-agent-refs/setup/token-save-flow.md` "Identity learning (Step 3)".
|
|
197
124
|
|
|
198
125
|
For each MISSING service, run the **Token Save Flow** below. When creating new tokens, use the **standard key name** from Step 1b table.
|
|
199
126
|
|
|
@@ -231,15 +158,15 @@ Full procedure: `$HOME/.claude/multi-agent-refs/setup/token-save-flow.md`. Read
|
|
|
231
158
|
|
|
232
159
|
### Step 3b - App Store Connect onboarding (iOS only, optional)
|
|
233
160
|
|
|
234
|
-
Runs inside Step 3. Every part of the API key
|
|
161
|
+
Runs inside Step 3, iOS target only. Every part of the API key, the `.p8` included, lives in the Keychain, and the key is validated BEFORE it is saved. Read `$HOME/.claude/multi-agent-refs/setup/app-store-connect.md` before Step 3b. On Skip, nothing is written.
|
|
235
162
|
|
|
236
163
|
### Step 3c - Firebase / Crashlytics onboarding (optional)
|
|
237
164
|
|
|
238
|
-
Runs inside Step 3. Measure first
|
|
165
|
+
Runs inside Step 3. Measure first with `bash "$HOME/.claude/lib/fetch-crashlytics.sh" --probe`, then ask by that answer, never blind; store the JSON as issued, never base64 it. Read `$HOME/.claude/multi-agent-refs/setup/firebase.md` before Step 3c. Skip writes nothing.
|
|
239
166
|
|
|
240
167
|
### Step 3d - Google Play onboarding (Android only, optional)
|
|
241
168
|
|
|
242
|
-
Runs inside Step 3, only when the target repo is Android
|
|
169
|
+
Runs inside Step 3, only when the target repo is Android: one entry, `google_play`, validated BEFORE saving. Read `$HOME/.claude/multi-agent-refs/setup/google-play.md` before Step 3d. Skip writes nothing.
|
|
243
170
|
|
|
244
171
|
### Step 3.5 - Host Prompt (embedded in Token Save Flow)
|
|
245
172
|
|
|
@@ -249,44 +176,13 @@ Full procedure: `$HOME/.claude/multi-agent-refs/setup/token-save-flow.md`. Read
|
|
|
249
176
|
|
|
250
177
|
**Runs only when** `~/.claude/lib/account-resolver.sh` returns **more than one** account AND at least one account has Jira or Bitbucket tokens.
|
|
251
178
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
For each non-default account, ask once:
|
|
255
|
-
|
|
256
|
-
```
|
|
257
|
-
Account {label} has Jira/Bitbucket tokens but no host override yet.
|
|
258
|
-
Use the global default ({hosts.jira}) or set a per-account host?
|
|
259
|
-
|
|
260
|
-
1) Use global default
|
|
261
|
-
2) Set per-account host
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
If `2`, prompt for `jiraHost` / `bitbucketHost` / `confluenceHost` (each optional). Save to `prefs.global.accounts[]` as `{ \"id\": \"client-x\", \"jiraHost\": \"client-x.atlassian.net\", \"bitbucketHost\": \"bitbucket.client-x.com\" }`.
|
|
265
|
-
|
|
266
|
-
`account-resolver.sh` reads this on every invocation; per-account override wins over `global.hosts.*`. Skip this step on autopilot - `accounts[]` stays empty until the user opts in via `/multi-agent:setup accounts`.
|
|
179
|
+
For each non-default account, ask once whether to keep the global default host or set per-account hosts; read `$HOME/.claude/multi-agent-refs/setup/accounts.md` "Per-account host overrides (Step 3.6)" before Step 3.6 for the prompt, the saved `prefs.global.accounts[]` shape and the precedence. Skip this step on autopilot - `accounts[]` stays empty until the user opts in via `/multi-agent:setup accounts`.
|
|
267
180
|
|
|
268
181
|
---
|
|
269
182
|
|
|
270
183
|
### Step 4 - Verify all
|
|
271
184
|
|
|
272
|
-
Re-run scan from Step 1.
|
|
273
|
-
```
|
|
274
|
-
All tokens present. Pipeline ready to use.
|
|
275
|
-
|
|
276
|
-
Optional per-project features (configured on first use, nothing to do now):
|
|
277
|
-
• Phase 5 Report Step 2 Wiki - auto-generates component wiki pages + Figma
|
|
278
|
-
screenshots. Activates when (a) task is a component AND (b) a Figma token
|
|
279
|
-
is in Keychain. Four adapters supported: submodule / in-repo / github-wiki
|
|
280
|
-
/ separate-repo. First run asks: use auto-detected path, use a custom
|
|
281
|
-
path, skip once, or disable for this project (persisted).
|
|
282
|
-
• channels - post-hoc multi-channel reporter (Jira/Confluence/Wiki/PR), works on any branch with an open PR.
|
|
283
|
-
• Default reviewers - auto-fetched from Bitbucket default-reviewers endpoint
|
|
284
|
-
or GitHub CODEOWNERS on first PR.
|
|
285
|
-
|
|
286
|
-
Next step:
|
|
287
|
-
/multi-agent "PROJ-12345" -> start your first task
|
|
288
|
-
/multi-agent help -> full usage guide
|
|
289
|
-
```
|
|
185
|
+
Re-run scan from Step 1 and show the final status: tokens present, the optional per-project features, the next-step commands. Layout: `$HOME/.claude/multi-agent-refs/setup/summaries.md` "Step 4 final status".
|
|
290
186
|
|
|
291
187
|
If still missing, show which ones and let user skip (pipeline will re-ask for any needed token at Phase 0).
|
|
292
188
|
|
|
@@ -294,66 +190,13 @@ If still missing, show which ones and let user skip (pipeline will re-ask for an
|
|
|
294
190
|
|
|
295
191
|
Pre-populates the Phase 0 project picker with repos the user is active in. Three independent sources merge into one flat list: local `$HOME` scan (depth 3, repo markers), Bitbucket (last 90 days, token-gated), GitHub (owner + collaborator, push in last 90 days, token-gated). Any source failing skips that source only, is reported (never swallowed), and discovery is never destructive and idempotent.
|
|
296
192
|
|
|
297
|
-
```
|
|
298
|
-
Step 5 - Repo Discovery (optional)
|
|
299
|
-
Scan for recent repos now to pre-populate the Phase 0 picker?
|
|
300
|
-
|
|
301
|
-
y - all three (local + Bitbucket + GitHub, ~10-30s)
|
|
302
|
-
l - local scan only (fastest, no network)
|
|
303
|
-
n - skip (Phase 0 will prompt for repo path manually)
|
|
304
|
-
```
|
|
305
|
-
|
|
306
193
|
The scan commands, merge-by-origin dedup, the multi-select picker, the `recentProjects` / `serviceStatus` prefs shapes and the skip / degrade rules live in `$HOME/.claude/multi-agent-refs/setup/repo-discovery.md` - read that file when the user opts in.
|
|
307
194
|
|
|
308
195
|
### Step 6 - Remember as Multi-Repo Group (optional)
|
|
309
196
|
|
|
310
|
-
After Step 5, if the user picked **2 or more** repos, offer to remember the combination as a named group. Phase 0's project picker surfaces
|
|
311
|
-
|
|
312
|
-
Auto-skipped if Step 5 was skipped or fewer than 2 repos were selected.
|
|
313
|
-
|
|
314
|
-
**Prompt:**
|
|
315
|
-
```
|
|
316
|
-
Step 6 - Remember as a multi-repo group (optional)
|
|
317
|
-
You picked 2 repos: Checkout, UIComponents.
|
|
318
|
-
|
|
319
|
-
Save this combo for one-tap selection in Phase 0?
|
|
320
|
-
Group name (Enter for auto): [Checkout + UIComponents]
|
|
321
|
-
Skip with 'n'.
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
**Auto-name heuristic** (suggested but editable):
|
|
325
|
-
- 2 repos → `"<repoA> + <repoB>"`
|
|
326
|
-
- 3-4 repos → `"<repoA>, <repoB>, <repoC>(+1)"`
|
|
327
|
-
- 5+ repos → `"<repoA> + <count-1> more"`
|
|
328
|
-
|
|
329
|
-
Repo identifiers in the label are the human label from `recentProjects` (basename of the path, not the full path), so groups stay readable.
|
|
330
|
-
|
|
331
|
-
**Save** (matches schema `global.recentGroups[]` shape - `repos` required, `label` / `count` / `lastUsed` optional):
|
|
332
|
-
|
|
333
|
-
```json
|
|
334
|
-
{
|
|
335
|
-
"global": {
|
|
336
|
-
"recentGroups": [
|
|
337
|
-
{
|
|
338
|
-
"label": "Checkout + UIComponents",
|
|
339
|
-
"repos": ["~/dev/Checkout", "~/dev/UIComponents"],
|
|
340
|
-
"count": 1,
|
|
341
|
-
"lastUsed": "2026-04-15T21:08:00Z"
|
|
342
|
-
}
|
|
343
|
-
]
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
**LRU + dedup rules:**
|
|
349
|
-
- New group → unshift to front of `recentGroups`.
|
|
350
|
-
- Same set of `repos` already exists (order-independent compare) → bump existing entry to front, increment its `count`, update `lastUsed`. Do NOT create a duplicate.
|
|
351
|
-
- Schema cap is 10 entries; oldest LRU entries past the cap are dropped.
|
|
197
|
+
After Step 5, if the user picked **2 or more** repos, offer to remember the combination as a named group in `global.recentGroups[]`, so Phase 0's project picker surfaces it at the top. Auto-skipped if Step 5 was skipped or fewer than 2 repos were selected.
|
|
352
198
|
|
|
353
|
-
|
|
354
|
-
- Single-repo selection → step is a no-op (no group needed for one repo).
|
|
355
|
-
- User answers `n` → not saved; the picker still works for one-time use, and a future Phase 0 selection of the same combo will re-prompt.
|
|
356
|
-
- Step 5 skipped → Step 6 is also skipped (no selection to remember).
|
|
199
|
+
Read `$HOME/.claude/multi-agent-refs/setup/multi-repo-group.md` before Step 6: the prompt, the auto-name heuristic, the saved shape, the LRU + dedup rules and the skip rules.
|
|
357
200
|
|
|
358
201
|
### Step 7 - Platform Identity Routing (optional)
|
|
359
202
|
|
|
@@ -369,28 +212,7 @@ Standard key names are a convention for NEW tokens; discovery may find existing
|
|
|
369
212
|
|
|
370
213
|
### Inline Token Save Pattern
|
|
371
214
|
|
|
372
|
-
All tokens go through `~/.claude/lib/credential-store.sh`
|
|
373
|
-
|
|
374
|
-
```bash
|
|
375
|
-
# PAT / API Key / JSON contents (from clipboard)
|
|
376
|
-
pbpaste | ~/.claude/lib/credential-store.sh set "<SERVICE_NAME>" -
|
|
377
|
-
pbcopy < /dev/null # clear clipboard
|
|
378
|
-
|
|
379
|
-
# Non-secret value typed inline (a secret on argv is visible to ps and lands in shell history)
|
|
380
|
-
~/.claude/lib/credential-store.sh set "<SERVICE_NAME>" "<VALUE>"
|
|
381
|
-
|
|
382
|
-
# Key file from disk (the .p8, the Google Play JSON; or when the clipboard is unavailable)
|
|
383
|
-
~/.claude/lib/credential-store.sh set "<SERVICE_NAME>" - < /path/to/file.json
|
|
384
|
-
|
|
385
|
-
# Read - a JSON value comes back exactly as it was stored, newlines included
|
|
386
|
-
~/.claude/lib/credential-store.sh get "<SERVICE_NAME>"
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
For maximum stdin hygiene (the secret never lands on argv / shell history), use the Python helper directly with the `-` sentinel:
|
|
390
|
-
|
|
391
|
-
```bash
|
|
392
|
-
pbpaste | ~/.claude/scripts/keychain.py set "<SERVICE_NAME>" -
|
|
393
|
-
```
|
|
215
|
+
All tokens go through `~/.claude/lib/credential-store.sh`: a secret from the clipboard via `pbpaste | ~/.claude/lib/credential-store.sh set "<SERVICE_NAME>" -` followed by `pbcopy < /dev/null`, a key file via `- < /path/to/file`, never a secret on argv. Every form, and the Python helper: `$HOME/.claude/multi-agent-refs/setup/token-save-flow.md` "Inline Token Save Pattern".
|
|
394
216
|
|
|
395
217
|
### Figma MCP Setup (Remote / Local question)
|
|
396
218
|
|
|
@@ -406,37 +228,15 @@ Full procedure: `$HOME/.claude/multi-agent-refs/setup/figma.md`. Read it for the
|
|
|
406
228
|
|
|
407
229
|
### Setup from Scratch Summary
|
|
408
230
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
```
|
|
412
|
-
1. Install the toolkit:
|
|
413
|
-
npx @{npm-scope}/multi-agent-pipeline install
|
|
414
|
-
|
|
415
|
-
2. Start setup:
|
|
416
|
-
/multi-agent setup
|
|
417
|
-
|
|
418
|
-
3. Interactive flow:
|
|
419
|
-
-> Token scan (shows what is missing)
|
|
420
|
-
-> Git Identity creation (name + email)
|
|
421
|
-
-> Inline commands for missing tokens
|
|
422
|
-
-> Final verification
|
|
423
|
-
|
|
424
|
-
4. Ready:
|
|
425
|
-
/multi-agent "PROJ-12345"
|
|
426
|
-
/multi-agent "https://github.com/.../issues/42"
|
|
427
|
-
/multi-agent "bug description"
|
|
428
|
-
```
|
|
231
|
+
Install the toolkit (`npx @{npm-scope}/multi-agent-pipeline install`), run `/multi-agent setup`, follow the interactive flow, then start a task. Walkthrough: `$HOME/.claude/multi-agent-refs/setup/summaries.md` "Setup from scratch".
|
|
429
232
|
|
|
430
233
|
All tokens are optional in the sense that every service can be answered with Skip - but the ASKING is not optional: the Step 3 sequential loop still walks every missing service one by one (token → author → host). Phase 0 re-asks at runtime only for tokens the user skipped here.
|
|
431
234
|
|
|
432
235
|
### Step 8 - Enforcement hooks (optional)
|
|
433
236
|
|
|
434
|
-
On Claude Code, offer to merge `$HOME/.claude/templates/claude-hooks.json`: three blocking `PreToolUse` gates (secret scan, agent-guard, read-size) plus
|
|
237
|
+
On Claude Code, offer to merge `$HOME/.claude/templates/claude-hooks.json`: three blocking `PreToolUse` gates (secret scan, agent-guard, read-size) plus non-blocking hooks on `PreCompact`, `SessionEnd`, `SessionStart` and `PostToolUse`, and a `Stop` hook (`run-stop-guard.sh`) that holds a session from stopping mid-run. What each does: `$HOME/.claude/multi-agent-refs/picker-contract.md`.
|
|
435
238
|
|
|
436
|
-
|
|
437
|
-
- On Yes, deep-merge EVERY event in the template's `hooks` object (merging `PreToolUse` alone drops the capture hooks); keep existing hooks, never duplicate a matcher calling the same script.
|
|
438
|
-
- Say only the three gates are hookable (no run-specific arguments); the rest are phase-enforced.
|
|
439
|
-
- Say the read-size gate stays inert until `prefs.global.bulkRead.mode` is set; recommend `observe` first (why, and the Phase 3 exemption: `picker-contract.md`).
|
|
239
|
+
Ask (picker) whether to install the hooks into `~/.claude/settings.json`, default Yes. On Yes, deep-merge EVERY event in the template's `hooks` object and never duplicate a matcher calling the same script. Read `$HOME/.claude/multi-agent-refs/setup/hooks-and-plugins.md` before Step 8: the merge rules and what to tell the user about the gates.
|
|
440
240
|
|
|
441
241
|
Codex: offer only the syntax gate, then run `node "$HOME/.codex/scripts/host-hooks.mjs" install --host codex`. Copilot CLI: offer no hook (it discards `postToolUse` output as of 1.0.45).
|
|
442
242
|
|
|
@@ -448,9 +248,7 @@ Stack skills ship as versioned plugins in the `{owner}/multi-agent-plugins` mark
|
|
|
448
248
|
```bash
|
|
449
249
|
bash "$HOME/.claude/scripts/plugin-refresh.sh" {owner} --add-only
|
|
450
250
|
```
|
|
451
|
-
2. Ask the detector, then derive
|
|
452
|
-
answer, and this one defaulted to `ai-ios-toolkit` when nothing matched - how
|
|
453
|
-
a Next.js site and several Node CLIs ended up with the iOS toolkit.
|
|
251
|
+
2. Ask the detector, then derive (no marker list in this file):
|
|
454
252
|
|
|
455
253
|
```bash
|
|
456
254
|
eval "$(bash $HOME/.claude/lib/stack-detect.sh "$PROJECT_ROOT")" # MA_STACKS, MA_STACK_WHY
|
|
@@ -459,10 +257,7 @@ Stack skills ship as versioned plugins in the `{owner}/multi-agent-plugins` mark
|
|
|
459
257
|
```
|
|
460
258
|
|
|
461
259
|
Report `MA_STACK_WHY` with the result. `ai-common-toolkit` and
|
|
462
|
-
`ai-analyst-toolkit` are in every answer, the empty one included:
|
|
463
|
-
stack-specific. **No marker matched is an answer** - those two, not a guess.
|
|
464
|
-
A name the marketplace does not carry is dropped with `dropped[]` naming it,
|
|
465
|
-
so a toolkit that was never shipped is caught before it fails to load.
|
|
260
|
+
`ai-analyst-toolkit` are in every answer, the empty one included. How the answer is read (empty answers, `dropped[]`): `$HOME/.claude/multi-agent-refs/setup/hooks-and-plugins.md` "Step 9".
|
|
466
261
|
3. Report the enabled set. To change later, run `/multi-agent:stack <ios|android|web|backend|...>` in the repo. Pipeline Phase 1 auto-detects the stack for its own routing regardless of enablement.
|
|
467
262
|
|
|
468
263
|
The marketplace repo name (`multi-agent-plugins`) is generic; a different org points `{owner}` at its own fork - nothing in the pipeline is coupled to a specific account.
|
|
@@ -79,6 +79,7 @@ Step 3: REPO Claude Code -> pipeline repo (genericized, personal data scr
|
|
|
79
79
|
Step 3c: PLUGINS pipeline shared/external -> multi-agent-plugins marketplace (rebuild knowledge/,
|
|
80
80
|
bump changed plugins' patch version, commit + push the plugins repo)
|
|
81
81
|
Step 3d: DEV-TOOLKIT companion MCP server -> detect movement, run the ship gates, commit + publish
|
|
82
|
+
Step 3e: OFFICE panel page is current, installed copies match it, toolkit version recorded
|
|
82
83
|
Step 4: WEBSITE Version + phase/model counts -> {website-host} (i18n + projects.ts)
|
|
83
84
|
Step 5: Commit Commit + push all changed repos
|
|
84
85
|
Step 6: Report Summary: synced targets, platform, changed files, deploy status, multi-agent-toolkit version
|
|
@@ -131,6 +132,7 @@ Step 0 gate rules and why: `features/doctor.md`.
|
|
|
131
132
|
- `~/.claude/CLAUDE.md`, `~/.claude/rules/`, `~/.claude/knowledge/`
|
|
132
133
|
- `~/.claude/scripts/` - EXCEPT `pre-commit-check.sh`, `agent-guard.sh`, `agent-guard.py`, and `build-stack-plugins.mjs` (generic, synced)
|
|
133
134
|
- `~/.claude/settings.json`
|
|
135
|
+
- `~/.claude/office/` - the office panel flows the other way: its source is the repo (`pipeline/office-src`, built by `office-build.mjs` into `pipeline/office`), and the installer copies it to each host. Never copy it from `~/.claude` into the repo; Step 3e checks it instead
|
|
134
136
|
- `~/.claude/multi-agent-refs/registries/` - the installer copies gate registries there from `pipeline/skills/shared/external`; the repo already holds the source
|
|
135
137
|
- **Any `~/.claude/commands/multi-agent/*/SKILL.md` whose frontmatter has `local-only: true`** - these are user/repo-specific alias wrappers that delegate to a private marketplace plugin's skills exposed as `multi-agent:<name>`. Syncing them would leak the private plugin/skill names into the public pipeline. Skip them at copy time; the backstop below proves none reached `pipeline/commands/`.
|
|
136
138
|
```bash
|
|
@@ -226,9 +228,19 @@ When invoked with the `release` argument:
|
|
|
226
228
|
8. WEBSITE Version + features -> {website-host} (maintainer identity, build verified Ready)
|
|
227
229
|
9. COPILOT Copilot CLI instructions + skills sync
|
|
228
230
|
9b. CODEX Codex CLI router skill + refs + agent TOML (node install.js --codex)
|
|
231
|
+
9c. OFFICE Step 3e: the installed panel matches the release
|
|
229
232
|
10. Report Summary: version, touched repos, deploy status
|
|
230
233
|
```
|
|
231
234
|
|
|
235
|
+
### Step 3e: OFFICE (every sync, and step 9c of a release)
|
|
236
|
+
|
|
237
|
+
The office panel ships with the pipeline, so a sync carries it by checking it, not by copying it:
|
|
238
|
+
|
|
239
|
+
1. `node ~/multi-agent-pipeline/pipeline/scripts/office-build.mjs --check`: the committed page is what `pipeline/office-src` builds to, and `office/toolkit.json` carries the toolkit version in `docs/facts.json`. Either stale fails the sync until it is rebuilt and committed; a release that regenerates facts rebuilds the office right after.
|
|
240
|
+
2. After the install steps, compare `pipeline/office/index.html` with the installed copies (`~/.claude/office/`, and the Copilot and Codex trees when installed), byte for byte, plus the asset list. A difference means the install is behind: run `node install.js --installed` and compare again.
|
|
241
|
+
3. Report the toolkit version the installed `office/toolkit.json` carries: it is what the office Tools window starts, and it moves forward with every release.
|
|
242
|
+
4. An office server that is already running picks the update up by itself: the open page shows a reload banner, and `/multi-agent:office-on` replaces a server whose code changed. Nothing to restart by hand.
|
|
243
|
+
|
|
232
244
|
---
|
|
233
245
|
|
|
234
246
|
## Sub-Command Sync (Claude Code <-> Copilot CLI Skills)
|