github-router 0.3.324 → 0.3.326

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.
@@ -1,6 +1,6 @@
1
1
  import { Ln as BALANCED_PROFILE_NATIVE_AGENT_NAMES, Nn as oneMContextDisabled, Pn as withOneMSuffix, Rn as BALANCED_PROFILE_NATIVE_EFFORTS, Un as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, Wn as CHEAPEST_PROFILE_NATIVE_EFFORTS, Xn as CHEAP_PROFILE_NATIVE_EFFORTS, Yn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, a as buildAgentPrompt, fn as CONDENSED_OPERATING_SEQUENCE, l as maxPersonasFor, n as MCP_GROUPS, pn as DEFINITION_OF_GREATNESS, t as GROUP_META, u as personasFor } from "./peer-mcp-personas-DcAErb_d.js";
2
2
  import { a as isUnderClaudeConfigMirror, f as writeRuntimeFileSecure, t as PATHS } from "./paths-BnZwolac.js";
3
- import { C as CHEAP_REVIEWER_ALIAS_ID, S as CHEAP_PLAN_ALIAS_ID, _ as CHEAPEST_GENERAL_PURPOSE_ALIAS_ID, b as CHEAP_EXPLORE_ALIAS_ID, f as BALANCED_EXPLORE_ALIAS_ID, g as CHEAPEST_EXPLORE_ALIAS_ID, h as BALANCED_REVIEWER_ALIAS_ID, m as BALANCED_PLAN_ALIAS_ID, p as BALANCED_GENERAL_PURPOSE_ALIAS_ID, v as CHEAPEST_PLAN_ALIAS_ID, w as LUNA_SCOUT_ALIAS_ID, x as CHEAP_GENERAL_PURPOSE_ALIAS_ID, y as CHEAPEST_REVIEWER_ALIAS_ID } from "./server-setup-CZ3tEsgq.js";
3
+ import { C as CHEAP_REVIEWER_ALIAS_ID, S as CHEAP_PLAN_ALIAS_ID, _ as CHEAPEST_GENERAL_PURPOSE_ALIAS_ID, b as CHEAP_EXPLORE_ALIAS_ID, f as BALANCED_EXPLORE_ALIAS_ID, g as CHEAPEST_EXPLORE_ALIAS_ID, h as BALANCED_REVIEWER_ALIAS_ID, m as BALANCED_PLAN_ALIAS_ID, p as BALANCED_GENERAL_PURPOSE_ALIAS_ID, v as CHEAPEST_PLAN_ALIAS_ID, w as LUNA_SCOUT_ALIAS_ID, x as CHEAP_GENERAL_PURPOSE_ALIAS_ID, y as CHEAPEST_REVIEWER_ALIAS_ID } from "./server-setup-BfTjAZS2.js";
4
4
  import { c as FAST_PROFILE_MODELS, d as FAST_PROFILE_NATIVE_MODELS, l as FAST_PROFILE_NATIVE_AGENT_NAMES, u as FAST_PROFILE_NATIVE_EFFORTS } from "./fast-profile-contract-DmsyQQrw.js";
5
5
  import { C as MAX_PARALLELISM_RULE, S as MAX_COORDINATOR_PROMPT, T as maxNativePrompt, a as MAX_PROFILE_NATIVE_AGENT_NAMES, i as MAX_PROFILE_MODELS, o as MAX_PROFILE_NATIVE_EFFORTS, s as MAX_PROFILE_NATIVE_MODELS, w as maxNativeDescription, x as MAX_COORDINATOR_DESCRIPTION } from "./max-profile-contract-Bl7I_EOC.js";
6
6
  import "./self-invocation-opSXHEs0.js";
@@ -2074,23 +2074,33 @@ const GATHER_CONTEXT_SKILL = {
2074
2074
  name: "gh-gather-context",
2075
2075
  md: `---
2076
2076
  name: gh-gather-context
2077
- description: Bounded context gathering for non-trivial asks: decomposes the ask, runs lexical code searches to identify relevant files, dispatches bounded parallel explore workers to gather evidence, stitches results into a freshness-stamped context brief plus a compact version. Use when grounded context is needed before planning or changing code.
2077
+ description: Gather grounded codebase context before planning. Use when unfamiliar code must be understood, files located, or claims verified against source. Returns a freshness-stamped brief with file:line citations. Not for trivial reads or already-known code.
2078
2078
  user-invocable: true
2079
+ requires: []
2080
+ produces: [context.md, context.compact.md, .complete]
2081
+ consumes: []
2082
+ excludes: [trivial tasks, already-known code, implementation]
2079
2083
  ---
2080
2084
 
2081
2085
  # gh-gather-context: bounded context gathering
2082
2086
 
2083
2087
  Use this skill when a non-trivial ask needs grounded context before planning.
2084
- All reasoning runs at the 200K default window: the lead and every explore
2085
- worker use the Luna model at high effort with bare slugs (no 1M accounting).
2086
- Output is a durable full brief plus a compact downstream version.
2088
+ All reasoning runs at the 200K default window: the lead and every Explore
2089
+ subagent use the Luna model at high effort with bare slugs (no 1M accounting).
2090
+ Output is a durable full brief plus a compact downstream version. This skill
2091
+ dispatches ONLY native subagents present on the profile roster (Explore) via
2092
+ the Agent tool, never worker-* MCP dispatchers. No reviewer dispatch in this
2093
+ stage: Explore evidence plus targeted follow-up reads is the verification path.
2087
2094
 
2088
2095
  ## Hard bounds
2089
2096
 
2090
2097
  - Maximum rounds: 3.
2091
- - Maximum parallel explore workers per round: 6.
2098
+ - Maximum parallel Explore subagents per round: 6.
2092
2099
  - Maximum lexical searches per round: 10.
2093
2100
  - Maximum follow-up reads per round: 5.
2101
+ - Advisory budget: keep each Explore dispatch under ~3 minutes of wall-clock;
2102
+ the Task tool has no maxWallClockMs parameter, so count your own dispatches
2103
+ and stop at saturation rather than running to a clock.
2094
2104
  - Terminate at the first of saturation or a cap.
2095
2105
  - On cap-hit, return with open unknowns flagged as residual. Do not loop forever.
2096
2106
 
@@ -2100,7 +2110,6 @@ Use these exact tags on every finding and claim:
2100
2110
 
2101
2111
  - verified-executable: reproduced the symptom, ran the failing test, or ran a check that directly proves the claim. This is the only deterministic confidence tag.
2102
2112
  - verified-source: read the actual source, config, logs, docs, or primary artifact and cited the relevant locations. This is model-mediated and can still be wrong.
2103
- - cross-lab-agreed: a different-lab reviewer independently agreed with the claim. This reduces correlated blind spots but is advisory.
2104
2113
  - unverified: plausible but not confirmed; treat as residual risk.
2105
2114
 
2106
2115
  ## Procedure
@@ -2119,16 +2128,16 @@ Use these exact tags on every finding and claim:
2119
2128
  - Use git log and git blame when authorship, regression timing, or intent matters.
2120
2129
  - Use mcp__search__web for upstream APIs, package behavior, protocol docs, or public issues.
2121
2130
 
2122
- 4. Decompose into bounded explore workers.
2131
+ 4. Decompose into bounded Explore subagents.
2123
2132
  - Cluster search results into at most 6 coherent investigation areas.
2124
2133
  - For each area, write a narrow brief: the specific question, the expected artifact, and the files to focus on.
2125
- - Dispatch ALL explore workers in a single turn via the Agent tool (subagent_type worker-explore). Each runs read-only at the 200K default window and returns a summary with an evidence table and file:line citations. Pass maxWallClockMs 180000 on every worker call so a hung worker is reaped after 3 minutes instead of blocking its slot.
2126
- - Keep worker results summarized; do not paste every detail into the main context.
2134
+ - Dispatch ALL Explore subagents in a single turn via the Agent tool (subagent_type Explore). Each runs read-only at the 200K default window and returns a summary with an evidence table and file:line citations. Advisory: keep each dispatch under ~3 minutes; the Task tool enforces no wall-clock, so terminate at saturation.
2135
+ - Keep Explore results summarized; do not paste every detail into the main context.
2127
2136
 
2128
2137
  5. Stitch and verify.
2129
- - Collect all explore results and deduplicate file references.
2130
- - Run at most 5 targeted follow-up reads for gaps, in parallel.
2131
- - Dispatch the worker-review subagent (via the Agent tool, maxWallClockMs 300000) to confirm source-reading for load-bearing claims.
2138
+ - Collect all Explore results and deduplicate file references.
2139
+ - Run at most 5 targeted follow-up reads for gaps, in parallel, using Read, Grep, and Glob directly; dispatch one more narrow Explore round only for gaps direct reads cannot close.
2140
+ - Do NOT dispatch a reviewer in this stage. Verification here is Explore evidence plus your own follow-up reads: re-open the primary source for every load-bearing claim and confirm the citation is real before tagging it verified-source.
2132
2141
  - Form a root-cause hypothesis or integration map, and state what would falsify it.
2133
2142
 
2134
2143
  6. Run a completeness pass.
@@ -2137,29 +2146,46 @@ Use these exact tags on every finding and claim:
2137
2146
  - Ask: have we checked primary sources for every load-bearing claim?
2138
2147
  - If no material unknowns remain and the root cause is at least verified-source, stop for saturation.
2139
2148
 
2140
- 7. Persist two outputs under .github-router/context/<slug>/.
2141
- - context.md: full brief with the ask decomposition, searches run, worker reports, evidence table, hypothesis, freshness metadata (HEAD commit, working-tree diff hash, timestamp, repo path), residuals, and full citations.
2149
+ 7. Persist outputs under .github-router/context/<slug>/ and close the stage.
2150
+ - context.md: full brief with the ask decomposition, searches run, Explore reports, evidence table, hypothesis, freshness metadata (HEAD commit, working-tree diff hash, timestamp, repo path), residuals, and full citations.
2142
2151
  - context.compact.md: downstream consumable with a one-paragraph ask summary, key files with one-line purposes, critical constraints (APIs, types, patterns, forbidden changes), integration seams, and residual risks.
2152
+ - .complete: stage-completion marker written ONLY after every dispatched Explore subagent has returned or been recorded as superseded, and both briefs are on disk. No downstream stage (/gh-plan, /gh-implement, /gh-swe-pipeline stage 2+) may start until this marker exists.
2143
2153
  - Downstream phases read by pointer and check freshness instead of re-injecting the whole brief.
2144
2154
 
2155
+ ## Waterfall rule
2156
+
2157
+ This stage owns all Explore dispatches until it completes. Do NOT return while
2158
+ any Explore subagent is still running unless you explicitly record it as
2159
+ superseded (saturation reached or its area covered) with the reason. Native
2160
+ subagents cannot be killed mid-run: record superseded areas and let them
2161
+ finish, but do not wait on or use their output. If the brief already saturates
2162
+ the ask, record remaining dispatches as superseded first (no further
2163
+ follow-ups), then write the marker. A plan built on shifting evidence wastes
2164
+ more than an idle subagent costs.
2165
+
2145
2166
  ## Return format
2146
2167
 
2147
- Return a compact brief, not the whole dump:
2168
+ Return a compact brief, not the whole dump. Output cost dominates: Luna output
2169
+ tokens cost 6x input, so return only file:line citations with one-line
2170
+ summaries, never full file contents or pasted source blocks.
2148
2171
 
2149
2172
  - Context files: paths to context.md and context.compact.md.
2150
2173
  - Freshness: HEAD commit, diff hash, timestamp.
2151
2174
  - Termination: saturated or cap-hit; if cap-hit, name the cap.
2152
2175
  - Summary: 3-8 bullets with confidence tags.
2153
- - Evidence table: claim, tag, primary source or command, reviewer status.
2176
+ - Evidence table: claim, tag, primary source or command, verification status.
2154
2177
  - Residual unknowns: explicit list, or none.
2155
2178
  - Downstream guidance: recommended next action and what must be rechecked if the tree changes.
2156
2179
 
2157
2180
  ## Non-goals
2158
2181
 
2159
- - Do not present verified-source or cross-lab-agreed as deterministic.
2182
+ - Do not present verified-source as deterministic.
2160
2183
  - Do not hide open unknowns because the answer looks useful.
2161
2184
  - Do not keep searching after the cap.
2162
2185
  - Do not paste the entire persisted brief into later turns unless the user asks.
2186
+ - Do not dispatch a reviewer from this stage; Explore evidence plus targeted follow-up reads is the verification path.
2187
+ - Do not return full file contents in briefs, summaries, or evidence tables; cite file:line plus one line of purpose.
2188
+ - Do not finish without the .complete marker: a marker-less brief is not a completed stage.
2163
2189
  `
2164
2190
  };
2165
2191
  //#endregion
@@ -2168,51 +2194,85 @@ const IMPLEMENT_SKILL = {
2168
2194
  name: "gh-implement",
2169
2195
  md: `---
2170
2196
  name: gh-implement
2171
- description: Parallel implementation of an approved plan using bounded Luna workers with isolated worktrees: each worker implements its task, self-tests, self-reviews, and returns a patch; the lead aggregates into a unified diff, runs staged review, and returns the final diff with a report. Use when a user-approved plan is ready for execution.
2197
+ description: Execute an approved plan with parallel subagents and self-validation. Use when a user-approved plan.md is ready for execution. Reviewer only on low-confidence or risky changes. Not for unapproved plans or exploration.
2172
2198
  user-invocable: true
2199
+ requires: [approved plan.md with .complete marker]
2200
+ produces: [unified diff, implementation-report.md]
2201
+ consumes: [plan.md]
2202
+ excludes: [unapproved plans, exploration, trivial changes]
2173
2203
  ---
2174
2204
 
2175
2205
  # gh-implement: bounded parallel implementation with staged review
2176
2206
 
2177
2207
  Use this skill only after /gh-plan produced a user-approved plan.md. All
2178
- implementation runs at the 200K default window: the lead and every task worker
2179
- use the Luna model at max effort with bare slugs (no 1M accounting). Review is
2180
- staged: a Luna max pass first, then a Sol medium pass only for major issues.
2208
+ implementation runs at the 200K default window with bare slugs (no 1M
2209
+ accounting): the lead dispatches native subagents present on the profile
2210
+ roster. If an implementer subagent exists (max profile), use it first for
2211
+ implementation tasks, then General-Purpose for handoffs; otherwise use
2212
+ General-Purpose for all tasks. Review is conditional, never staged by default:
2213
+ each task subagent self-tests, self-reviews, and reports an explicit confidence
2214
+ verdict; the lead dispatches a reviewer only on low-confidence validation or
2215
+ complex and risky changes, then a General-Purpose fix pass only for major
2216
+ reviewer findings. This skill dispatches ONLY native subagents via the Agent
2217
+ tool, never worker-* MCP dispatchers.
2181
2218
 
2182
2219
  ## Hard bounds
2183
2220
 
2184
- - Maximum concurrent implement workers: 8.
2221
+ - Maximum concurrent implementation subagents: 8 (advisory; the Task tool
2222
+ enforces no concurrency cap, so count your own dispatches).
2185
2223
  - Maximum retries per task: 2.
2186
2224
  - Maximum review-fix cycles: 2.
2187
- - Worktrees are auto-removed on success and retained on failure for debugging.
2225
+ - Advisory budget: keep each task under ~10 minutes; the Task tool enforces
2226
+ no wall-clock, so terminate at acceptance, not at a clock.
2227
+ - Worktrees are opt-in, not default: pass worktree:true to
2228
+ General-Purpose when parallel tasks require isolation or git-history
2229
+ protection. In-place tasks must be sequentialized to avoid collisions;
2230
+ parallel in-place edits to the same files will conflict.
2231
+
2232
+ ## Stage gate 0 (do this BEFORE any implementation)
2233
+
2234
+ 1. Verify the plan stage is finished: .github-router/plans/<slug>/plan.md AND
2235
+ its .complete marker both exist, with an explicit user-approval record. If
2236
+ any is missing, STOP: do not implement an unapproved plan. Finish or
2237
+ re-invoke planning first.
2238
+ 2. Check freshness: if HEAD or the working-tree diff hash moved since the
2239
+ plan was approved, re-verify stale load-bearing assumptions before
2240
+ dispatching subagents.
2241
+ 3. Close the previous stage: send no further follow-ups to any lingering Plan
2242
+ dispatches (Explore follow-ups) and record them as superseded with the
2243
+ reason. Native subagents cannot be killed mid-run: let them finish but do
2244
+ not wait on or use their output. Implementing while planning still runs
2245
+ builds on a moving target and wastes both stages. Only advance once every
2246
+ Plan dispatch has returned or is recorded as superseded.
2188
2247
 
2189
2248
  ## Procedure
2190
2249
 
2191
2250
  1. Parse the approved plan.
2192
2251
  - Read plan.md fully.
2193
2252
  - Group tasks by parallelGroup; order groups by dependency.
2194
- - For each group, prepare an isolated git worktree per task plus a narrow task brief (task spec, relevant context excerpt, acceptance criteria, verification commands).
2253
+ - For each group, prepare a narrow task brief (task spec, relevant context excerpt, acceptance criteria, verification commands). Write every brief as plain directives, never reflective first-person prose: Gemini-run subagents may suppress tool calls when the prompt contains reflective text. If parallel tasks in the group require isolation, prepare one git worktree per task and pass worktree:true; otherwise tasks run in-place and must be sequentialized within shared files.
2195
2254
 
2196
- 2. Dispatch bounded implement workers, one parallel batch per group.
2197
- - Dispatch ALL tasks in the group in a single turn via the Agent tool (subagent_type worker-implement, with worktree isolation, maxWallClockMs 600000 per task so a hung worker is reaped after 10 minutes instead of blocking its slot).
2198
- - Each worker runs at the 200K default window and must self-contain its work:
2255
+ 2. Dispatch bounded implementation subagents, one parallel batch per group.
2256
+ - Dispatch ALL tasks in the group in a single turn via the Agent tool. Use subagent_type implementer first where the profile provides one (max), otherwise subagent_type General-Purpose for every task. Advisory: keep each task under ~10 minutes; the Task tool enforces no wall-clock.
2257
+ - Each subagent runs at the 200K default window and must self-contain its work:
2199
2258
  a. Implement the change.
2200
2259
  b. Run the task verification commands (tests, typecheck, lint).
2201
2260
  c. Self-review against the acceptance criteria.
2202
2261
  d. Fix any self-found issues (at most 2 internal fix cycles).
2203
- e. Return the patch plus test results and self-review notes.
2262
+ e. Return the patch plus test results, self-review notes, and an explicit confidence verdict (high or low) with reasons. Low confidence means the subagent itself doubts the result: flaky or incomplete verification, untested edge cases, or behavior it could not directly observe. Keep the return compact: patch plus results, no full-file echoes; output tokens cost several times input on every profile.
2204
2263
  - Do NOT dispatch the same task twice (no dedup exists); a retry is a new dispatch only after a recorded failure.
2205
- - For a big artifact, have the worker write it to a file and return the path.
2264
+ - For a big artifact, have the subagent write it to a file and return the path.
2206
2265
 
2207
2266
  3. Aggregate and validate.
2208
- - Collect all patches and apply them sequentially to the main worktree (or merge the worktrees).
2267
+ - Collect all patches and apply them sequentially to the main worktree (or merge the worktrees when worktree isolation was used).
2209
2268
  - Run the full relevant validation: test suite, typecheck, and lint.
2210
- - If any task fails validation, route it back to an implement worker (at most 2 retries per task). If it still fails, checkpoint with the failure as residual risk instead of pretending it is solved.
2269
+ - If any task fails validation, route it back to a General-Purpose subagent (at most 2 retries per task). If it still fails, checkpoint with the failure as residual risk instead of pretending it is solved.
2211
2270
 
2212
- 4. Run staged review.
2213
- - Pass 1 (always): dispatch the worker-review subagent (via the Agent tool, maxWallClockMs 300000) over the unified diff for correctness against acceptance criteria, code quality and consistency, security and performance regressions, and test coverage. Categorize findings as minor (style, nits) or major (logic, architecture).
2214
- - If pass 1 finds no major issues, finish here.
2215
- - Pass 2 (major issues only): dispatch a fix worker (via the Agent tool, maxWallClockMs 300000) at the 200K default window using the Sol model at medium effort with the flagged areas, the failing checks, and the pass-1 findings. It returns fixed patches or an explicit escalate-to-user with reasons.
2271
+ 4. Decide whether external review is warranted (default: skip it).
2272
+ - Skip the reviewer when every task reports high confidence AND full validation (tests, typecheck, lint) passes AND the change avoids high-risk areas (auth, user input, database queries, crypto, serialization, data migration, cross-boundary contracts) AND the lead judges the change non-complex. Record the skip with reasons in the implementation report; self-validation plus green checks is the default path, not a shortcut.
2273
+ - Dispatch the reviewer subagent (via the Agent tool, subagent_type reviewer) ONLY when a task reports low confidence, validation is incomplete or unconvincing, the change touches high-risk areas, or the lead explicitly requested review. Scope the brief to the uncertain areas, the acceptance criteria, and the failing or insufficient checks. Categorize findings as minor (style, nits) or major (logic, architecture). Advisory: keep the review under ~5 minutes.
2274
+ - If the reviewer finds no major issues (or review was skipped with recorded reasons), finish here.
2275
+ - Fix pass (major reviewer findings only): dispatch a General-Purpose subagent (via the Agent tool) at the 200K default window with the flagged areas, the failing checks, and the reviewer findings. It returns fixed patches or an explicit escalate-to-user with reasons. At most 2 review-fix cycles.
2216
2276
 
2217
2277
  5. Finalize.
2218
2278
  - Apply any review fixes and re-run full validation.
@@ -2227,14 +2287,16 @@ Return:
2227
2287
  - Implementation report path.
2228
2288
  - Task completion status per task id.
2229
2289
  - Test, typecheck, and lint results.
2230
- - Review summary (pass 1 findings; pass 2 findings and fixes if used).
2290
+ - Review summary (skipped with recorded reasons, or reviewer findings; fix-pass findings and fixes if used).
2231
2291
  - Final residual risks and next action.
2232
2292
 
2233
2293
  ## Non-goals
2234
2294
 
2235
- - Do not start without a user-approved plan.md.
2236
- - Do not serialize work that has no data dependency; independent tasks in a group run concurrently.
2237
- - Do not nest workflow invocations: workers are internal sessions and must not re-invoke /gh-implement.
2295
+ - Do not start without a user-approved plan.md plus its .complete approval record.
2296
+ - Do not start while Plan dispatches still run; record them superseded first.
2297
+ - Do not dispatch a reviewer by default; self-validation plus green checks is the default path.
2298
+ - Do not serialize work that has no data dependency; independent tasks in a group run concurrently (sequentialize only in-place edits to shared files).
2299
+ - Do not nest workflow invocations: subagents must not re-invoke /gh-implement (or any /gh-* pipeline skill).
2238
2300
  - Do not claim completeness when retries or review cycles are exhausted with open failures.
2239
2301
  `
2240
2302
  };
@@ -2382,59 +2444,108 @@ const PLAN_SKILL = {
2382
2444
  name: "gh-plan",
2383
2445
  md: `---
2384
2446
  name: gh-plan
2385
- description: Holistic planning from gathered context: ingests the context brief, creates a scoped modular ordered implementation plan with explicit tasks for cheap implementation workers, surfaces open questions for user approval, and persists plan.md. Use when a non-trivial change needs a reviewed plan before implementation.
2447
+ description: Create an implementation plan from gathered context. Use when a non-trivial change needs a reviewed, ordered task list with acceptance criteria before implementing. Requires user approval. Not for trivial changes or missing context.
2386
2448
  user-invocable: true
2449
+ requires: [fresh context.md with .complete marker]
2450
+ produces: [plan.md, .complete]
2451
+ consumes: [context.md, context.compact.md]
2452
+ excludes: [trivial changes, implementation, missing context]
2387
2453
  ---
2388
2454
 
2389
- # gh-plan: holistic planning for cheap implementation
2455
+ # gh-plan: native Plan-subagent planning
2390
2456
 
2391
2457
  Use this skill after /gh-gather-context (or when equivalent context is already
2392
- available) and before any implementation. The planner runs at the 200K default
2393
- window using the Sol model at medium effort. The plan must be scoped, modular,
2394
- non-overlapping, and ordered, with enough detail for Luna implementation
2395
- workers to execute each task in isolation. User approval is mandatory before
2396
- implementation.
2458
+ available) and before any implementation. For non-trivial work, dispatch the
2459
+ native Plan subagent (subagent_type Plan) present on every pipeline profile
2460
+ roster; profile frontmatter pins its model and effort (Sol at the 200K default
2461
+ window). The plan must be scoped, modular, non-overlapping, and ordered, with
2462
+ enough detail for a native General-Purpose (or implementer, where the profile
2463
+ provides one) subagent to execute each task in isolation. User approval is
2464
+ mandatory before implementation. This skill dispatches ONLY the native Plan
2465
+ subagent via the Agent tool, never worker-* MCP dispatchers. Plan self-serves
2466
+ Explore follow-ups per its delegation graph; the skill does not dispatch
2467
+ Explore directly.
2397
2468
 
2398
2469
  ## Prerequisites
2399
2470
 
2400
2471
  - A freshness-stamped context brief from /gh-gather-context, or equivalent context.
2401
2472
  - Read context.compact.md first; read context.md sections on demand (residual unknowns, evidence table).
2402
2473
 
2474
+ ## Stage gate 0 (do this BEFORE any planning)
2475
+
2476
+ 1. Verify the context stage is finished: .github-router/context/<slug>/.complete
2477
+ exists. If the marker is missing, STOP: do not plan on a partial brief.
2478
+ Finish or re-invoke gathering first.
2479
+ 2. Check freshness: if HEAD or the working-tree diff hash moved since the
2480
+ brief's stamp, re-verify stale load-bearing claims before using them.
2481
+ 3. Close the previous stage: send no further follow-ups to any lingering
2482
+ gather-context Explore dispatches and record them as superseded with the
2483
+ reason. Native subagents cannot be killed mid-run: let them finish but do
2484
+ not wait on or use their output. Planning while Explore subagents still run
2485
+ builds on shifting evidence and wastes both stages. Only advance once every
2486
+ Explore dispatch has returned or is recorded as superseded.
2487
+
2488
+ ## Triviality reassessment (do this AFTER gate 0, BEFORE dispatching Plan)
2489
+
2490
+ 1. Reassess with fresh context: if the ask is trivial (typo, one-line config
2491
+ read, obvious change of at most a few lines, pure explanation) or the
2492
+ context shows no multi-file, risky, uncertain, or high-impact work, STOP.
2493
+ Do NOT dispatch Plan. Do NOT write plan.md or .complete.
2494
+ 2. Return a trivial verdict: one-sentence reason, the recommended direct
2495
+ action, and an explicit statement that no downstream stage (/gh-implement,
2496
+ /gh-swe-pipeline stage 3) may run. A trivial ask must never pay planning
2497
+ cost as ritual.
2498
+
2403
2499
  ## Hard bounds
2404
2500
 
2405
2501
  - Maximum tasks: 20.
2406
2502
  - Maximum parallel groups: 5.
2407
2503
  - Keep planner input well under the 200K window (target at most around 150K tokens of context) so there is headroom for reasoning and output. This is self-discipline, not an enforced cap: prefer the compact brief and read full sections only on demand.
2504
+ - Advisory budget: keep the Plan dispatch under ~5 minutes; the Task tool enforces no wall-clock. At most 2 bounded follow-up rounds to the same Plan dispatch for gaps.
2408
2505
 
2409
- ## Procedure
2506
+ ## Procedure (non-trivial work only)
2410
2507
 
2411
2508
  1. Ingest context.
2412
2509
  - Read context.compact.md fully.
2413
2510
  - Read the evidence table and residual unknowns from context.md.
2414
2511
  - Identify acceptance criteria, constraints, integration seams, and forbidden changes.
2415
2512
 
2416
- 2. Build a blind-spot table before decomposing.
2417
- - Wrong-spec risk: judgment-only, mitigated only by user-blessed acceptance criteria.
2418
- - Root-cause risk: executable-checkable if reproduced or covered by a failing test; otherwise advisory.
2419
- - Integration risk: usually source-verified plus tests where possible.
2420
- - Regression risk: executable-checkable when tests, typecheck, or lint cover it.
2421
- - Review risk: advisory cross-lab review reduces correlated blind spots.
2422
- - Concurrency or merge risk: source-verified and sometimes executable-checkable.
2423
- - Missing-test risk: executable-checkable only after a test exists and runs.
2424
- - Tag every blind spot as executable-checkable or judgment-only.
2425
-
2426
- 3. Decompose into minimal safe increments.
2427
- - Each task touches a single file or a tightly coupled file group.
2428
- - Each task states input artifacts, output artifact, acceptance criteria, verification commands, and rollback concern.
2429
- - Order tasks by dependency (topological sort); tasks with no data dependency share a parallel group.
2430
- - Keep each task small enough for one Luna worker at the 200K window (target at most 50K context tokens of relevant files per task).
2431
- - If the ask needs discovery follow-ups, delegate them to worker-explore background subagents (via the Agent tool, maxWallClockMs 180000) rather than bloating the plan.
2432
-
2433
- 4. Surface open questions before finalizing.
2434
- - Ask about ambiguous acceptance criteria, design decisions with multiple valid approaches, risk tolerance, and test strategy.
2435
- - Present a short candidate list for confirmation where possible.
2436
-
2437
- 5. Persist the plan to .github-router/plans/<slug>/plan.md.
2513
+ 2. Compose the Plan dispatch brief. Include every item below; a vague brief
2514
+ produces a vague plan, and a vague plan fails downstream:
2515
+ - Ask summary and acceptance criteria (or candidates where ambiguous).
2516
+ - Constraints, integration seams, and forbidden changes.
2517
+ - Context pointers: context.compact.md path, the evidence table and
2518
+ residual sections of context.md, plus the freshness stamp.
2519
+ - Required output shape: objective; architectural invariants; interface
2520
+ contracts; execution steps with files touched plus a done condition per
2521
+ step; acceptance commands with the observable pass result; critical files
2522
+ as file:line; a blind-spot table tagging each risk executable-checkable
2523
+ or judgment-only (wrong-spec, root-cause, integration, regression,
2524
+ review, concurrency or merge, missing-test); open questions as options
2525
+ with a recommendation; cost estimate (task count, parallel groups,
2526
+ context tokens).
2527
+ - Plan-mode rule: plan and acceptance criteria only, no implementation
2528
+ file edits.
2529
+ - Permission to use Explore and reviewer per the delegation graph.
2530
+ - Write the brief as plain directives, never reflective first-person prose:
2531
+ Gemini-run subagents may suppress tool calls when the prompt contains
2532
+ reflective text.
2533
+ - Demand compact output: file:line plus one-line purposes, never pasted
2534
+ source blocks. Output tokens cost several times input on every profile.
2535
+ - Advisory ~5 minute budget.
2536
+
2537
+ 3. Dispatch ONE Plan subagent via the Agent tool (subagent_type Plan) with
2538
+ that brief, then WAIT for its full return. Do not plan inline in parallel
2539
+ and do not dispatch implementation subagents while it runs.
2540
+
2541
+ 4. Validate the returned plan. Every task must name files, state the change
2542
+ and its done condition, and carry runnable acceptance commands;
2543
+ trade-offs must appear as options with a recommendation. If gaps remain,
2544
+ send ONE bounded follow-up to the same Plan dispatch naming the exact gaps
2545
+ (at most 2 follow-up rounds total). If still underspecified, checkpoint
2546
+ with the gaps as residual risk instead of pretending the plan is complete.
2547
+
2548
+ 5. Persist the validated plan to .github-router/plans/<slug>/plan.md.
2438
2549
  - Ask summary and user-blessed acceptance criteria.
2439
2550
  - Blind-spot table with executable-checkable or judgment-only tags.
2440
2551
  - Ordered task list with ids, files, dependencies, parallel groups, acceptance criteria, verification commands, rollback concerns, and estimated context tokens.
@@ -2446,11 +2557,13 @@ implementation.
2446
2557
  - Present the goal, acceptance criteria, task-to-group map, per-task blind spot killed, residual risks, and cost estimate.
2447
2558
  - If the user rejects scope or cost, downshift to the smallest plan that kills the important blind spots.
2448
2559
  - Do not proceed to implementation without approval.
2560
+ - Write .github-router/plans/<slug>/.complete ONLY after explicit user approval, recording the approval in the marker. A plan without an approval record is NOT complete, and no downstream stage (/gh-implement, /gh-swe-pipeline stage 3) may start without it.
2449
2561
 
2450
2562
  ## Return format
2451
2563
 
2452
2564
  Return:
2453
2565
 
2566
+ - Trivial exit: yes with the recommended direct action and no plan file, or no with the plan below.
2454
2567
  - Plan file: path to the durable plan.md.
2455
2568
  - Task count and parallel groups.
2456
2569
  - Open questions and user answers.
@@ -2459,9 +2572,12 @@ Return:
2459
2572
 
2460
2573
  ## Non-goals
2461
2574
 
2575
+ - Do not dispatch Plan for a trivial ask; exit with a trivial verdict instead.
2462
2576
  - Do not edit implementation files while planning; in plan mode, produce the plan and acceptance criteria only.
2463
2577
  - Do not present judgment-only conclusions as executable guarantees.
2464
2578
  - Do not hide open unknowns because the plan looks complete.
2579
+ - Do not start planning while gather-context Explore subagents still run; record them superseded first.
2580
+ - Do not dispatch implementation subagents from planning: stages never overlap.
2465
2581
  `
2466
2582
  };
2467
2583
  //#endregion
@@ -2576,6 +2692,129 @@ Return a compact brief, not the whole research dump:
2576
2692
  `
2577
2693
  };
2578
2694
  //#endregion
2695
+ //#region src/lib/injected-skills/swe-pipeline-skill.ts
2696
+ const SWE_PIPELINE_SKILL = {
2697
+ name: "gh-swe-pipeline",
2698
+ md: `---
2699
+ name: gh-swe-pipeline
2700
+ description: Strict sequential SWE pipeline for non-trivial code changes: runs gather-context to completion, then plan with user approval, then implement with conditional review. Each stage waits for the previous to finish fully, superseding leftover subagents before advancing. Use when the user wants the full structured engineering workflow in one command.
2701
+ user-invocable: true
2702
+ ---
2703
+
2704
+ # gh-swe-pipeline: strict sequential SWE workflow
2705
+
2706
+ Use this skill when the user invokes /gh-swe-pipeline for a non-trivial code
2707
+ change. It coordinates the three pipeline stages in STRICT SEQUENCE. No two
2708
+ stages ever overlap: each stage runs to completion, its subagents are all
2709
+ finished or explicitly superseded, and its completion artifact exists before
2710
+ the next stage starts. Every stage dispatches ONLY native subagents present on
2711
+ the profile roster (Explore, Plan, General-Purpose, reviewer, implementer
2712
+ where provided) via the Agent tool, never worker-* MCP dispatchers.
2713
+
2714
+ All work runs at the 200K default window with bare slugs (no 1M accounting).
2715
+ Advisory budgets (the Task tool enforces no wall-clock): gather ~3 minutes
2716
+ per round, plan ~5 minutes total, implement ~10 minutes per task.
2717
+
2718
+ ## The one rule
2719
+
2720
+ WATERFALL ONLY. Never start a stage while the previous stage still has running
2721
+ subagents or an unwritten completion artifact. If a stage already has enough
2722
+ evidence to proceed, FIRST record every still-running subagent from the
2723
+ previous stage as superseded (native subagents cannot be killed mid-run: send
2724
+ no further follow-ups, let them finish, and do not use their output), record
2725
+ what was superseded and why, THEN advance. Overlapping stages waste money and
2726
+ produce plans built on shifting evidence. This is the failure the pipeline
2727
+ exists to prevent.
2728
+
2729
+ ## Stage 0: triage (no subagents)
2730
+
2731
+ 1. Restate the ask in one sentence.
2732
+ 2. Decide trivial versus non-trivial. Trivial (typo, one-line config read,
2733
+ obvious three-line fix, pure explanation) SKIPS the pipeline: say why and
2734
+ do the work directly. Do not pay orchestration cost as ritual.
2735
+ 3. For non-trivial work, derive a run slug and create
2736
+ .github-router/swe/<slug>/run.md with the ask, the triage verdict, and
2737
+ per-stage status (pending, running, complete, skipped).
2738
+
2739
+ ## Stage 1: gather context (to completion)
2740
+
2741
+ 1. Invoke the gh-gather-context skill and WAIT for its full return. Do not
2742
+ plan, sketch tasks, or dispatch Plan subagents while it runs.
2743
+ 2. Its completion artifact is
2744
+ .github-router/context/<slug>/context.md plus context.compact.md and a
2745
+ .complete marker. If the marker is missing, the stage is NOT complete:
2746
+ keep waiting or re-invoke; never advance on a partial brief.
2747
+ 3. Early-stop rule: if the returned brief already saturates the ask (root
2748
+ cause at least verified-source, no material unknowns), record any
2749
+ still-running Explore dispatches as superseded (no follow-ups), accept the
2750
+ brief, and advance. Do not keep searching after saturation.
2751
+ 4. Cap-hit rule: if the brief reports cap-hit with residuals, surface the
2752
+ residuals in run.md and ask the user whether to proceed to planning with
2753
+ the gap or to spend one more bounded round. Do not silently treat a
2754
+ cap-hit brief as complete.
2755
+
2756
+ ## Stage 2: plan (to user approval, or trivial exit)
2757
+
2758
+ 1. Precondition check BEFORE invoking gh-plan: the context .complete marker
2759
+ exists AND every gather-context Explore dispatch has returned or been
2760
+ recorded as superseded. If either is false, do not invoke planning. Fix
2761
+ stage 1 first.
2762
+ 2. Invoke the gh-plan skill and WAIT for its full return. For non-trivial
2763
+ work gh-plan dispatches the native Plan subagent with an
2764
+ implementation-ready brief; do not dispatch implementation subagents,
2765
+ sketch diffs, or edit implementation files while it runs. Plan mode means
2766
+ plan and acceptance criteria only.
2767
+ 3. Trivial exit: if gh-plan returns a trivial verdict (no plan.md, no
2768
+ .complete), STOP the pipeline here. Record the verdict and the recommended
2769
+ direct action in run.md and do NOT advance to implementation.
2770
+ 4. Its completion artifact is .github-router/plans/<slug>/plan.md with a
2771
+ user-approval record (.complete marker written only after explicit
2772
+ approval). A plan without explicit user approval is NOT complete.
2773
+ 5. Present the goal, acceptance criteria, task-to-group map, residual risks,
2774
+ and cost estimate. Wait for explicit approval. If the user rejects scope
2775
+ or cost, downshift to the smallest plan that kills the important blind
2776
+ spots and re-seek approval. NEVER advance to implementation without
2777
+ approval recorded in run.md.
2778
+
2779
+ ## Stage 3: implement (to validated diff, reviewed only when warranted)
2780
+
2781
+ 1. Precondition check BEFORE invoking gh-implement: plan.md exists, its
2782
+ .complete marker exists, and run.md records explicit user approval. If
2783
+ any is missing, do not invoke implementation. Fix stage 2 first.
2784
+ 2. Record any lingering Plan dispatches (Explore follow-ups) as superseded
2785
+ before the first implement dispatch.
2786
+ 3. Invoke the gh-implement skill and WAIT for its full return: unified diff,
2787
+ implementation report, test/typecheck/lint results, and review summary
2788
+ (or recorded skip when self-validation plus green checks sufficed).
2789
+ gh-implement dispatches a reviewer only on low-confidence validation or
2790
+ complex and risky changes; do not demand a review that the stage skipped
2791
+ with recorded reasons.
2792
+ 4. If retries or review cycles exhaust with open failures, checkpoint with
2793
+ the failure as residual risk instead of pretending it is solved.
2794
+
2795
+ ## Return format
2796
+
2797
+ Return:
2798
+
2799
+ - Run file: path to .github-router/swe/<slug>/run.md with per-stage status.
2800
+ - Context files: paths to context.md and context.compact.md, freshness
2801
+ (HEAD commit, diff hash, timestamp), termination (saturated or cap-hit).
2802
+ - Plan file: path to plan.md, task count, parallel groups, open questions
2803
+ and user answers, cost estimate, approval record.
2804
+ - Implement output: unified diff path, report path, per-task status, test
2805
+ results, review summary or recorded skip.
2806
+ - Residual risks and next action.
2807
+
2808
+ ## Non-goals
2809
+
2810
+ - Do not run stages in parallel or overlap subagents across stages.
2811
+ - Do not advance past a missing completion artifact or a missing approval.
2812
+ - Do not nest pipeline invocations: subagents must not re-invoke
2813
+ /gh-swe-pipeline or any /gh-* pipeline skill.
2814
+ - Do not present judgment-only conclusions as executable guarantees.
2815
+ `
2816
+ };
2817
+ //#endregion
2579
2818
  //#region src/lib/injected-skills/worker-skill.ts
2580
2819
  /**
2581
2820
  * The `/gh-worker` skill: the operating model for the NON-BLOCKING workers
@@ -2832,6 +3071,79 @@ You are running inside an ai-or-die tab, so the \`${toolPrefix}*\` tools drive a
2832
3071
  * dashes and does not mention any Claude / Anthropic attribution.
2833
3072
  */
2834
3073
  const STYLE_DIRECTIVE = "Write concisely without losing detail. Use a natural human voice. Avoid em dashes. Do not attribute work to Claude, AI, LLM, or Anthropic anywhere (commits, PRs, issues, code, comments, docs).";
3074
+ /**
3075
+ * Operating-defaults directive injected at the TOP of the mirrored CLAUDE.md.
3076
+ * The main agent's system prompt (`--append-system-prompt`) gets
3077
+ * OPERATING_DEFAULTS_DIGEST instead, with this full statement available through
3078
+ * CLAUDE.md. Three defaults, layered under the user's own
3079
+ * direction and the domain's standards as addons (on a direct conflict the
3080
+ * user's direction wins, then the domain standard, then the default below):
3081
+ *
3082
+ * 1. Orchestrate (strong default): delegate the heavy / parallel /
3083
+ * context-heavy work to the right subagent / worker / model, keeping the
3084
+ * main context free to reason and collaborate with the user, while still
3085
+ * doing trivial / surgical / last-mile work directly (delegating that
3086
+ * would only add relay-fidelity loss + latency).
3087
+ * 2. Adversarial review: WHEN a peer critic earns its keep and, equally
3088
+ * important, when reaching for one is ritual rather than review. Same
3089
+ * failure shape the delegation default had: "consult a critic for
3090
+ * non-trivial changes" is unfalsifiable in advance, so it collapses into
3091
+ * either never (four of four unprimed agents) or always (worse than
3092
+ * never). The discriminator is whether the conclusion still turns on
3093
+ * judgment once the direct evidence is in: a consequential recommendation
3094
+ * cannot be run, which is exactly where confabulation hides, while a
3095
+ * tracing question a search already proved gains nothing from a second
3096
+ * model re-deriving it. The roster, the lens-to-artifact match, the
3097
+ * advisor-complements-rather-than-substitutes distinction, and the
3098
+ * do-not-anchor-the-critic rule live here; the digest carries only the
3099
+ * trigger and the ritual exclusion.
3100
+ * 3. Excellence lens: the principles stated plainly and concretely (radical
3101
+ * simplicity + real-user focus; whole-system first-principles thinking that
3102
+ * anticipates scale; work back from the customer outcome). Named exemplars
3103
+ * were dropped per the injected-surface review: a named entity is a dense,
3104
+ * high-variance vector that pulls in persona mannerisms at top salience, and
3105
+ * the guidance favors specific functional framing over comparison, so
3106
+ * specificity carries the vividness instead.
3107
+ * 4. Engineering excellence: quality / robustness / maintainability over
3108
+ * development cost; reproduce a bug end-to-end (as a real user hits it)
3109
+ * before fixing so the fix targets the real cause; a pixel-perfect UI bar;
3110
+ * and fix any lint error / test failure / flake on sight, whoever caused it,
3111
+ * folded into the current work rather than derailing the user's task (the
3112
+ * scope guardrail keeps proactive quality from becoming yak-shaving). The
3113
+ * digest carries a one-line form; the full statement lives here so it does
3114
+ * not cost the context window every turn.
3115
+ *
3116
+ * Self-referentially compliant with the style directive: no em dashes, no
3117
+ * Claude / Anthropic attribution.
3118
+ *
3119
+ * Availability-aware: four of the natives (`scout`, `implementer-fast`,
3120
+ * `reviewer-fast`, and `general-purpose-fast`) are DROPPED rather than
3121
+ * downgraded when no model in
3122
+ * their chain resolves, so naming them unconditionally here would tell the lead to delegate
3123
+ * to an agent that has no `.md` file and is absent from the Task
3124
+ * `subagent_type` enum. Build the directive with
3125
+ * `buildOperatingDefaultsDirective` and the same availability booleans used for
3126
+ * the `.md` generation and the awareness snippet; the exported const below is
3127
+ * the all-available form, kept for callers and tests that do not model a thin
3128
+ * catalog.
3129
+ */
3130
+ /**
3131
+ * Pipeline skills (`/gh-gather-context`, `/gh-plan`, `/gh-implement`,
3132
+ * `/gh-swe-pipeline`) injected ONLY for `--swe` launches on pinned profiles
3133
+ * (fast, max, cheap, cheap1m, cheapest, balanced). Standard is intentionally
3134
+ * excluded. Without `--swe` the skill files are not written and this text is
3135
+ * not referenced. Stages dispatch ONLY native subagents present on the
3136
+ * profile roster (Explore, Plan, General-Purpose, reviewer, implementer
3137
+ * where provided), never worker-* MCP dispatchers. All roles run at the
3138
+ * 200K default window (bare slugs, no 1M accounting) with advisory budgets:
3139
+ * gather ~3 min per round (3 rounds max, 6 Explore per round); plan ~5 min
3140
+ * via the profile-pinned Plan subagent (trivial asks exit planless);
3141
+ * implement ~10 min per task (8 concurrent max, worktree:true only when
3142
+ * parallel tasks need isolation); reviewer only on low-confidence or complex
3143
+ * and risky changes, plus a General-Purpose fix pass for major reviewer
3144
+ * findings.
3145
+ */
3146
+ const PIPELINE_SKILLS_AWARENESS = "Pipeline skills (all 200K default context, native subagents only, never worker-*). Prefer `/gh-swe-pipeline`: strict sequence, each stage completing before the next starts, user approval before implementation. Stages in order: (1) `/gh-gather-context` BEFORE planning when grounded context is needed: lexical search plus bounded Explore subagents (~3 min each, 3 rounds max), writes context.md plus context.compact.md; (2) `/gh-plan` AFTER context and BEFORE implementation: native Plan subagent plans non-trivial asks (trivial exits planless), ordered plan.md (~5 min), open questions, waits for user approval; (3) `/gh-implement` AFTER plan approval: bounded parallel General-Purpose subagents (implementer first on max; worktree:true if parallel tasks need isolation), reviewer only on low-confidence or risky changes, plus fix pass for major findings. Skip for trivial work. Never implement without an approved plan. Never overlap stages.";
2835
3147
  /** Oxford-comma join: "a", "a and b", "a, b, and c". */
2836
3148
  function joinClauses(parts) {
2837
3149
  if (parts.length <= 1) return parts[0] ?? "";
@@ -2901,7 +3213,8 @@ function buildOperatingDefaultsDirective(opts = {}) {
2901
3213
  if (opts.profile === "max") {
2902
3214
  const peersKey = opts.peersKey ?? opts.groupKeys?.peers ?? "peers";
2903
3215
  const artifactClause = opts.artifactAvailable ? ` Live human review is available in the artifact panel via \`mcp__${peersKey}__artifact_*\`.` : "";
2904
- return "## Operating defaults (these layer with the user's explicit direction and the domain's own standards as addons, not replacements: follow all three together; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nMax launch profile. The lead owns the outcome. Start with direct repository or runtime evidence. Handle narrow, obvious, surgical, and single-command work directly; delegate a bounded workstream when it is broad, slow, context-heavy, or benefits from a genuinely independent perspective. " + MAX_PARALLELISM_RULE + " Brief each role with the desired outcome, relevant context, constraints, expected evidence, and verification. Use the roster as complementary capabilities, never as a required Explore → Plan → implement → review sequence. Avoid overlapping assignments and do not ask several models the same generic question. Synthesize results against the repository and executable checks: model agreement is not verification. Use one fresh-context peer only when a consequential judgment remains after direct checks; use the coordinator only when several distinct lenses could change the decision. Advisor is optional, non-binding counsel for one focused consequential uncertainty that evidence and the appropriate roles cannot settle; it has no approval or workflow authority, and a further consultation requires materially new or conflicting evidence." + artifactClause + "\n\nPipeline skills (all 200K default context). For non-trivial changes, run in order: (1) `/gh-gather-context` BEFORE planning when grounded context is needed: it decomposes the ask, runs lexical search, fans out to bounded Luna-high explore workers, and writes context.md plus context.compact.md; (2) `/gh-plan` AFTER context and BEFORE implementation: it ingests the context brief with Sol-medium, produces a scoped modular ordered plan.md with explicit tasks for Luna workers, surfaces open questions, and waits for user approval; (3) `/gh-implement` AFTER plan approval: it runs bounded parallel Luna-max task workers in isolated worktrees (each self-tests and self-reviews), aggregates a unified diff, and runs staged review (Luna max, then Sol medium for major issues only). Skip the pipeline for trivial surgical work. Never implement without an approved plan.";
3216
+ const pipelineClause = opts.sweEnabled === false ? "" : `\n\n${PIPELINE_SKILLS_AWARENESS}`;
3217
+ return "## Operating defaults (these layer with the user's explicit direction and the domain's own standards as addons, not replacements: follow all three together; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nMax launch profile. The lead owns the outcome. Start with direct repository or runtime evidence. Handle narrow, obvious, surgical, and single-command work directly; delegate a bounded workstream when it is broad, slow, context-heavy, or benefits from a genuinely independent perspective. " + MAX_PARALLELISM_RULE + " Brief each role with the desired outcome, relevant context, constraints, expected evidence, and verification. Use the roster as complementary capabilities, never as a required Explore → Plan → implement → review sequence. Avoid overlapping assignments and do not ask several models the same generic question. Synthesize results against the repository and executable checks: model agreement is not verification. Use one fresh-context peer only when a consequential judgment remains after direct checks; use the coordinator only when several distinct lenses could change the decision. Advisor is optional, non-binding counsel for one focused consequential uncertainty that evidence and the appropriate roles cannot settle; it has no approval or workflow authority, and a further consultation requires materially new or conflicting evidence." + artifactClause + pipelineClause;
2905
3218
  }
2906
3219
  if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest" || opts.profile === "balanced") {
2907
3220
  const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
@@ -2922,9 +3235,9 @@ ${profileLabel} profile runtime wiring is unavailable. Work directly, use only t
2922
3235
  const workerBrowseClause = opts.browseAvailable ? ` \`worker-browse\` runs delegated autonomous browsing tasks through \`mcp__${workersKey}__browse\`.` : "";
2923
3236
  const artifactClause = opts.artifactAvailable ? ` \`mcp__${peersKey}__artifact_*\` provides human review in the artifact panel with auto-open on plan completion.` : "";
2924
3237
  const astraClause = opts.astraAvailable && (opts.profile === "fast" || opts.profile === "cheap1m") ? ` \`mcp__${peersKey}__astra\` (GPT-6 Astra ${astraDescriptor}) is the terminal escalation consultant for the lead only, reserved strictly for the hardest dead ends when direct evidence, Advisor, and Oracle have all failed to produce a defensible path (consulted at most 1-2 times per decision with concise context and specific questions).` : "";
2925
- return "## Operating defaults (these layer with the user's explicit direction and the domain's own standards as addons, not replacements: follow all three together; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\n" + (isCheapest ? `${profileLabel} launch profile. The lead owns the outcome and handles straightforward work directly. ` + buildNativeReachClauses(opts) + ". Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. `Explore` may be used for discovery spanning more than a couple of files; `Plan` for sequencing with complex interfaces or acceptance criteria; `General-Purpose` for mixed multi-step execution; `reviewer` for behavior-changing or risk-sensitive changes. Delegation graph: the lead may invoke all four; `Plan` may invoke `Explore` and `reviewer`; `General-Purpose` may invoke `reviewer`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents.\n\n" : `${profileLabel} launch profile. The lead coordinates execution across specialized native roles: ` + buildNativeReachClauses(opts) + ". In plan mode or when designing changes with complex sequencing, interface contracts, or acceptance criteria, delegate architectural planning to `Plan` (in plan mode, produce the plan and acceptance criteria; do not edit files). Phase pipeline (budget gather, expensive plan, budget execution, expensive verification). GATHER: delegate to `Explore` instead of exploring yourself. For any question spanning more than a couple of files, launch one or more `Explore` subagents in parallel with scoped evidence questions and let them return file:line citations; read directly only the small subset you must touch to decide or edit. `Plan` follows the same rule when it needs repository facts. PLAN: `Plan` produces handoff-ready steps (ordered, file:line, done conditions, acceptance criteria) for a `General-Purpose` executor that cannot see its reasoning; `Plan` may consult Oracle on unresolved trade-offs and reports any remaining gap to the lead. EXECUTE: delegate mixed multi-step work and Plan handoffs to `General-Purpose` in a fresh context to preserve lead context; brief with outcome, constraints, files in scope, and verification. VERIFY: after behavior-changing, cross-boundary, or risk-sensitive implementation, run relevant build/tests then invoke `reviewer` before declaring done. Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. `Explore` is cheap and may be launched in parallel across independent discovery questions. Send independent subagent calls in parallel within a single turn. Delegation graph: the lead may invoke all four; `Plan` may invoke `Explore` and `reviewer`; `General-Purpose` may invoke `reviewer`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents.\n\n") + `Consultation guidance: Follow an evidence-first escalation ladder. Direct empirical evidence (search, code, tests, builds) settles factual questions first. Advisor is an optional, non-binding, lead-only transcript-aware sounding board for trajectory guidance or framing checks (direction, not dictation), and never use it for routine progress, waiting, directly verifiable facts, or completion ritual. \`mcp__${peersKey}__oracle\` is ${oracleDescriptor}, an expert consultant available to the lead and \`Plan\`, preferred over advisor for difficult conceptual, algorithmic, spec/protocol, or architectural tradeoffs evaluated in a self-contained brief; \`reviewer\` and other subagents cannot call Oracle. \`Plan\` may consult Oracle on unresolved trade-offs, and reports any remaining tie-breaking gap to the lead.${astraClause} ` + searchGuidance + `\`mcp__${searchKey}__web\` provides citable sources.${browserClause}${workerBrowseClause}${artifactClause}\n\nPipeline skills (all 200K default context). For non-trivial changes, run in order: (1) \`/gh-gather-context\` BEFORE planning when grounded context is needed: it decomposes the ask, runs lexical search, fans out to bounded Luna-high explore workers, and writes context.md plus context.compact.md; (2) \`/gh-plan\` AFTER context and BEFORE implementation: it ingests the context brief with Sol-medium, produces a scoped modular ordered plan.md with explicit tasks for Luna workers, surfaces open questions, and waits for user approval; (3) \`/gh-implement\` AFTER plan approval: it runs bounded parallel Luna-max task workers in isolated worktrees (each self-tests and self-reviews), aggregates a unified diff, and runs staged review (Luna max, then Sol medium for major issues only). Skip the pipeline for trivial surgical work. Never implement without an approved plan.
2926
-
2927
- Verify claims with concrete repository evidence and tests before declaring work done. User instructions outrank delegation triggers. Stop named teammates when finished.`;
3238
+ const pipeline = isCheapest ? `${profileLabel} launch profile. The lead owns the outcome and handles straightforward work directly. ` + buildNativeReachClauses(opts) + ". Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. `Explore` may be used for discovery spanning more than a couple of files; `Plan` for sequencing with complex interfaces or acceptance criteria; `General-Purpose` for mixed multi-step execution; `reviewer` for behavior-changing or risk-sensitive changes. Delegation graph: the lead may invoke all four; `Plan` may invoke `Explore` and `reviewer`; `General-Purpose` may invoke `reviewer`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents.\n\n" : `${profileLabel} launch profile. The lead coordinates execution across specialized native roles: ` + buildNativeReachClauses(opts) + ". In plan mode or when designing changes with complex sequencing, interface contracts, or acceptance criteria, delegate architectural planning to `Plan` (in plan mode, produce the plan and acceptance criteria; do not edit files). Phase pipeline (budget gather, expensive plan, budget execution, expensive verification). GATHER: delegate to `Explore` instead of exploring yourself. For any question spanning more than a couple of files, launch one or more `Explore` subagents in parallel with scoped evidence questions and let them return file:line citations; read directly only the small subset you must touch to decide or edit. `Plan` follows the same rule when it needs repository facts. PLAN: `Plan` produces handoff-ready steps (ordered, file:line, done conditions, acceptance criteria) for a `General-Purpose` executor that cannot see its reasoning; `Plan` may consult Oracle on unresolved trade-offs and reports any remaining gap to the lead. EXECUTE: delegate mixed multi-step work and Plan handoffs to `General-Purpose` in a fresh context to preserve lead context; brief with outcome, constraints, files in scope, and verification. VERIFY: after behavior-changing, cross-boundary, or risk-sensitive implementation, run relevant build/tests then invoke `reviewer` before declaring done. Handle trivial, surgical, single-file, or single-command tasks directly; you do not need to justify skipping delegation. `Explore` is cheap and may be launched in parallel across independent discovery questions. Send independent subagent calls in parallel within a single turn. Delegation graph: the lead may invoke all four; `Plan` may invoke `Explore` and `reviewer`; `General-Purpose` may invoke `reviewer`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents.\n\n";
3239
+ const swePipelineClause = opts.sweEnabled === false ? "" : `${PIPELINE_SKILLS_AWARENESS}\n\n`;
3240
+ return "## Operating defaults (these layer with the user's explicit direction and the domain's own standards as addons, not replacements: follow all three together; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\n" + pipeline + `Consultation guidance: Follow an evidence-first escalation ladder. Direct empirical evidence (search, code, tests, builds) settles factual questions first. Advisor is an optional, non-binding, lead-only transcript-aware sounding board for trajectory guidance or framing checks (direction, not dictation), and never use it for routine progress, waiting, directly verifiable facts, or completion ritual. \`mcp__${peersKey}__oracle\` is ${oracleDescriptor}, an expert consultant available to the lead and \`Plan\`, preferred over advisor for difficult conceptual, algorithmic, spec/protocol, or architectural tradeoffs evaluated in a self-contained brief; \`reviewer\` and other subagents cannot call Oracle. \`Plan\` may consult Oracle on unresolved trade-offs, and reports any remaining tie-breaking gap to the lead.${astraClause} ` + searchGuidance + `\`mcp__${searchKey}__web\` provides citable sources.${browserClause}${workerBrowseClause}${artifactClause}\n\n` + swePipelineClause + "Verify claims with concrete repository evidence and tests before declaring work done. User instructions outrank delegation triggers. Stop named teammates when finished.";
2928
3241
  }
2929
3242
  return "## Operating defaults (these layer with the user's explicit direction and the domain's own standards as addons, not replacements: follow all three together; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nOrchestrate. Delegate research, implementation, review, and large reads to the right subagent, worker, or model. Reach for " + buildNativeReachClauses(opts) + "; worker-* agents for background non-blocking runs; Task subagents for parallel work; peer critics for review. That keeps your own context free to reason and collaborate with the user. Launch independent agents concurrently in a single message rather than serially. Delegation pays when the work is WIDE (many files or sources to sweep) or SLOW, and you need only the conclusion: the main thread is where you think with and respond to the user, and its context window is a finite shared resource. It does NOT pay merely because a sub-question is separable. A narrow, deep question whose whole value is file:line fidelity loses exactly that through a summarization layer, and a sub-question you could answer in one command is cheaper done directly than paying a subagent's startup. Do trivial, surgical, and last-mile work yourself. A named teammate persists after it reports so you can send it follow-ups, and nothing reaps it for you: its idle notice means available, not finished. Stop it once you are done with it.\n\nAdversarial review. The peer critics (`codex_critic` and `codex_reviewer`, `gemini_critic` and `gemini_reviewer`, `opus_critic`, and the `peer-review-coordinator` that fans out to several of them) are fresh-context models, so what they add is a blind spot that whoever produced the work cannot reach by thinking harder about it; prefer a critic from a different lab than the producer, since blind spots correlate within a lab. The `advisor` is a complement and not a substitute: it sees your transcript, so it catches your own drift and momentum, but it inherits your framing, which is exactly what a fresh-context critic does not. They earn their keep on consequential design choices, recommendations, and hard-to-reverse decisions: the cases where plausible alternatives remain and the conclusion rests on judgment rather than on something you can verify directly. That is where confabulation hides, so budget the wait even under delivery pressure. Always consult one when the change touches auth, user input, database queries, crypto, or serialization. They do NOT pay for read-only tracing, ordinary repository lookup, or a conclusion that a focused test, a direct reproduction, or unambiguous code evidence already settles. Asking a critic to re-derive a proven fact returns a confident answer either way, which is ritual skepticism rather than review, and skipping them there is the right call and not a shortcut. Match the lens to the artifact: a strategic critic for plans and trade-offs, a code reviewer for a concrete diff, the coordinator only when the risk warrants several independent lenses. Give whichever you pick the artifact and the constraints and not your rationale, since justification anchors the review and dulls it.\n\nAim high. Default to radical simplicity and a relentless focus on the user's real experience: design for the person and the job to be done, not the demo. Reason about the whole system from first principles, anticipating scale and the long arc rather than patching the surface. Work backwards from the outcome the user actually needs. Question every assumption and prefer what you can derive, reproduce, or test.\n\nEngineering excellence. When making technical decisions, give little weight to development cost; prefer quality, simplicity, robustness, scalability, and long-term maintainability. Fix a bug by first reproducing it end to end, as close to how a real user hits it as you can, so you solve the real problem and not a symptom. When testing a product end to end, be picky about the UI and obsessed with pixel perfection: if something clearly looks off, even when it is unrelated to your task, get it fixed along the way. Hold that same bar for the codebase itself: a lint error, a failing test, or a flaky test is worth fixing the moment you see it, whoever introduced it. Fold it into your current work rather than letting it derail the task the user actually asked for.";
2930
3243
  }
@@ -2935,7 +3248,8 @@ Verify claims with concrete repository evidence and tests before declaring work
2935
3248
  const OPERATING_DEFAULTS_DIRECTIVE = buildOperatingDefaultsDirective();
2936
3249
  const STANDARD_OPERATING_DEFAULTS_DIGEST = "## Operating defaults (these layer with the user's direction and the domain's standards as addons: follow all three; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nDelegate when the work is WIDE (many files or sources to sweep) or SLOW and you need only the conclusion, to protect the main thread's finite context and keep it free for reasoning and interacting with the user; prefer parallel delegation for independent work. Do NOT delegate merely because a sub-question is separable: a narrow, deep question whose value is file:line fidelity loses exactly that through a summarization layer, and one answerable in a single command is cheaper done directly. Do trivial, surgical, and last-mile work yourself. Stop a named teammate once you are done with it: it persists for follow-ups, its idle notice means available rather than finished, and nothing reaps it for you.\n\nVerify, do not assert. Run the code, read the file, check the exit code. A claim in prose is worth nothing against state you did not check, and a check that cannot fail proves nothing. Reproduce a bug end to end, the way a real user hits it, before fixing it. Fix a lint error, failing test, or flake the moment you see it, whoever introduced it, without letting it derail the task at hand. Prefer quality and long-term maintainability over development cost.\n\nVerification has a blind spot: a consequential recommendation, a design or trade-off call, or a hard-to-reverse decision that still turns on judgment among plausible alternatives once the direct evidence is in. That is where confabulation hides, so put it past a peer critic before you ship it and budget the wait even under delivery pressure. When a test, a run, a reproduction, or a search would settle the claim, settle it that way instead; a critic asked to re-derive what you can already prove is ritual, not review.\n\nThe agent roster, the tool surface, and the reasoning behind these defaults are in your CLAUDE.md project instructions. Read them when choosing HOW to work; the rules above apply without a lookup.";
2937
3250
  function buildOperatingDefaultsDigest(opts = {}) {
2938
- if (opts.profile === "max") return "## Operating defaults (these layer with the user's direction and the domain's standards as addons: follow all three; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nMax launch profile. The lead owns the outcome. Start with direct repository or runtime evidence. Do narrow, obvious, surgical, and single-command work directly; delegate bounded work that is broad, slow, context-heavy, or independently valuable. " + MAX_PARALLELISM_RULE + " Give delegated workstreams non-overlapping scopes and state the outcome, constraints, evidence, and verification expected.\n\nPipeline skills (all 200K default): `/gh-gather-context` before planning when context is needed, `/gh-plan` before implementation (waits for user approval), `/gh-implement` after approval with bounded parallel workers and staged review. Skip for trivial work.\n\nSynthesize and verify: run the code, inspect outputs, and check tests. Agent count and agreement are not evidence. Use a fresh-context peer only for consequential judgment that remains after direct checks, and use the coordinator only when several distinct lenses could change the decision. Advisor is optional, non-binding, primary-lead-only counsel for one focused consequential uncertainty; it is not an approval or completion gate.";
3251
+ const digestPipelineSentence = opts.sweEnabled === false ? "" : "Pipeline skills (all 200K default, native subagents only): `/gh-gather-context` before planning when context is needed, `/gh-plan` before implementation (trivial exits planless, waits for user approval), `/gh-implement` after approval with parallel subagents and conditional reviewer. Skip for trivial work.\n\n";
3252
+ if (opts.profile === "max") return "## Operating defaults (these layer with the user's direction and the domain's standards as addons: follow all three; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\nMax launch profile. The lead owns the outcome. Start with direct repository or runtime evidence. Do narrow, obvious, surgical, and single-command work directly; delegate bounded work that is broad, slow, context-heavy, or independently valuable. " + MAX_PARALLELISM_RULE + " Give delegated workstreams non-overlapping scopes and state the outcome, constraints, evidence, and verification expected.\n\n" + digestPipelineSentence + "Synthesize and verify: run the code, inspect outputs, and check tests. Agent count and agreement are not evidence. Use a fresh-context peer only for consequential judgment that remains after direct checks, and use the coordinator only when several distinct lenses could change the decision. Advisor is optional, non-binding, primary-lead-only counsel for one focused consequential uncertainty; it is not an approval or completion gate.";
2939
3253
  if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest" || opts.profile === "balanced") {
2940
3254
  const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
2941
3255
  const isCheapest = opts.profile === "cheapest";
@@ -2944,7 +3258,7 @@ function buildOperatingDefaultsDigest(opts = {}) {
2944
3258
  const oracleDescriptor = isCheapest ? "(GPT-5.6 Sol 200K/high, lead and Plan)" : isCheap || isBalanced ? "(Grok 4.6 200K/medium, lead and Plan)" : "(Opus 5 1M/high, lead and Plan)";
2945
3259
  const advisorDescriptor = isCheapest ? "(Gemini/high, lead-only)" : "(Sol/high, lead-only)";
2946
3260
  const astraStep = opts.astraAvailable && (opts.profile === "fast" || opts.profile === "cheap1m") ? `; (4) \`astra\` (GPT-6 Astra 200K/${isCheap ? "medium" : "high"}, lead-only) only as a last resort when direct evidence, Advisor, and Oracle cannot produce a defensible path (at most 1-2 calls per decision).` : ".";
2947
- return "## Operating defaults (these layer with the user's direction and the domain's standards as addons: follow all three; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\n" + (isCheapest ? `${profileLabel} launch profile. The lead owns the outcome and handles straightforward work directly: use \`Explore\` for discovery spanning more than a couple of files, \`Plan\` in plan mode or for complex sequencing, \`General-Purpose\` for mixed multi-step execution, and \`reviewer\` for behavior-changing or risk-sensitive changes. Handle trivial and surgical edits directly. Stop named teammates when finished.\n\n` : `${profileLabel} launch profile. The lead coordinates execution across specialized roles: delegate broad discovery to \`Explore\` in parallel and do not sweep the repo yourself (read directly only files you will act on); delegate to \`Plan\` in plan mode or when structuring complex multi-step sequencing (\`Plan\` is an advisory planning capability, not an approval gate, and writes handoff-ready steps for \`General-Purpose\`); delegate mixed multi-step execution and Plan handoffs to \`General-Purpose\` in a fresh context; delegate to \`reviewer\` after behavior-changing or risk-sensitive implementation to verify correctness before declaring done; handle trivial and surgical edits directly. Send independent subagent calls in parallel within a single turn. Stop named teammates when finished.\n\n`) + "Pipeline skills (all 200K default): `/gh-gather-context` before planning when context is needed, `/gh-plan` before implementation (waits for user approval), `/gh-implement` after approval with bounded parallel workers and staged review. Skip for trivial work.\n\nVerify claims against real evidence: run relevant commands and tests. Follow a disciplined consultation ladder for unresolved decisions: (1) direct code inspection, search, builds, and tests settle factual questions; (2) `advisor` " + advisorDescriptor + " for transcript-aware framing checks or trajectory guidance; (3) `oracle` " + oracleDescriptor + " for self-contained technical/architectural trade-offs" + astraStep;
3261
+ return "## Operating defaults (these layer with the user's direction and the domain's standards as addons: follow all three; on a direct conflict the user's direction wins, then the domain standard, then the default below)\n\n" + (isCheapest ? `${profileLabel} launch profile. The lead owns the outcome and handles straightforward work directly: use \`Explore\` for discovery spanning more than a couple of files, \`Plan\` in plan mode or for complex sequencing, \`General-Purpose\` for mixed multi-step execution, and \`reviewer\` for behavior-changing or risk-sensitive changes. Handle trivial and surgical edits directly. Stop named teammates when finished.\n\n` : `${profileLabel} launch profile. The lead coordinates execution across specialized roles: delegate broad discovery to \`Explore\` in parallel and do not sweep the repo yourself (read directly only files you will act on); delegate to \`Plan\` in plan mode or when structuring complex multi-step sequencing (\`Plan\` is an advisory planning capability, not an approval gate, and writes handoff-ready steps for \`General-Purpose\`); delegate mixed multi-step execution and Plan handoffs to \`General-Purpose\` in a fresh context; delegate to \`reviewer\` after behavior-changing or risk-sensitive implementation to verify correctness before declaring done; handle trivial and surgical edits directly. Send independent subagent calls in parallel within a single turn. Stop named teammates when finished.\n\n`) + digestPipelineSentence + "Verify claims against real evidence: run relevant commands and tests. Follow a disciplined consultation ladder for unresolved decisions: (1) direct code inspection, search, builds, and tests settle factual questions; (2) `advisor` " + advisorDescriptor + " for transcript-aware framing checks or trajectory guidance; (3) `oracle` " + oracleDescriptor + " for self-contained technical/architectural trade-offs" + astraStep;
2948
3262
  }
2949
3263
  return STANDARD_OPERATING_DEFAULTS_DIGEST;
2950
3264
  }
@@ -3410,14 +3724,21 @@ async function writeInjectedSkill(name, md) {
3410
3724
  * Injected-skill registry: the floor-raising / controller skills the `claude`
3411
3725
  * launcher materializes into the per-launch `CLAUDE_CONFIG_DIR` mirror so the
3412
3726
  * spawned Claude Code session discovers them (`/gh-research`,
3413
- * `/gh-orchestrate`, `/gh-floor-keeper`, `/gh-first-mate`). See
3414
- * `docs/floor-raising-agent-surface.md`.
3727
+ * `/gh-orchestrate`, `/gh-floor-keeper`, `/gh-first-mate`, plus the `--swe`
3728
+ * pipeline skills `/gh-gather-context`, `/gh-plan`, `/gh-implement`,
3729
+ * `/gh-swe-pipeline`). See `docs/floor-raising-agent-surface.md`.
3730
+ */
3731
+ /**
3732
+ * Pipeline skills for `--swe` launches on pinned profiles (all 200K default
3733
+ * context). The orchestrator (`/gh-swe-pipeline`) runs the other three in
3734
+ * strict sequence; the three stages stay individually invokable for users who
3735
+ * only want one stage.
3415
3736
  */
3416
- /** Pipeline skills for pinned profiles (all 200K default context). */
3417
3737
  const PIPELINE_SKILLS = [
3418
3738
  GATHER_CONTEXT_SKILL,
3419
3739
  PLAN_SKILL,
3420
- IMPLEMENT_SKILL
3740
+ IMPLEMENT_SKILL,
3741
+ SWE_PIPELINE_SKILL
3421
3742
  ];
3422
3743
  /** All injected skills, in dependency order (research underpins the others). */
3423
3744
  const INJECTED_SKILLS = [
@@ -3435,6 +3756,10 @@ const INJECTED_SKILLS = [
3435
3756
  ];
3436
3757
  function injectedSkillsForLaunch(selection) {
3437
3758
  if (isPipelineSkillProfile(selection.profileId)) {
3759
+ if (!selection.sweEnabled) {
3760
+ if (selection.profileId === "max" && selection.firstMateEnabled) return INJECTED_SKILLS.filter((skill) => skill.name.startsWith("gh-first-mate"));
3761
+ return [];
3762
+ }
3438
3763
  if (selection.profileId === "max") {
3439
3764
  const pipeline = PIPELINE_SKILLS.slice();
3440
3765
  if (selection.firstMateEnabled) return [...pipeline, ...INJECTED_SKILLS.filter((skill) => skill.name.startsWith("gh-first-mate"))];
@@ -3512,4 +3837,4 @@ async function injectAttributionSuppressionIntoSettingsFile(settingsPath) {
3512
3837
  //#endregion
3513
3838
  export { writePeerMcpRuntimeFiles as C, workersKeyOf as S, sanitizeServeSettingsEnv as _, appendPeerAwarenessToMirroredClaudeMd as a, resolveCodexCliBackend as b, buildOperatingDefaultsDirective as c, prependStyleDirectiveToMirroredClaudeMd as d, buildArtifactReviewSkill as f, planModeAllowRules as g, injectAllowRules as h, writeInjectedSkill as i, prependArtifactPanelDirectiveToMirroredClaudeMd as l, configureServeDefaultPermissionMode as m, INJECTED_SKILLS as n, appendToolbeltAwarenessToMirroredClaudeMd as o, SEAMLESS_BUILTIN_TOOLS as p, injectedSkillsForLaunch as r, buildOperatingDefaultsDigest as s, injectAttributionSuppressionIntoSettingsFile as t, prependOperatingDefaultsToMirroredClaudeMd as u, BUILTIN_SUBAGENT_DEFINITIONS as v, resolveGroupKeysFromMirror as x, injectPeerMcpIntoMirror as y };
3514
3839
 
3515
- //# sourceMappingURL=attribution-settings-sTUXqFzx.js.map
3840
+ //# sourceMappingURL=attribution-settings-17Ug_BaA.js.map