github-router 0.3.337 → 0.3.338

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/{attribution-settings-Bpa-YTZ5.js → attribution-settings-CeaG4eQa.js} +107 -142
  2. package/dist/attribution-settings-CeaG4eQa.js.map +1 -0
  3. package/dist/{balanced-profile-contract-DdmG6RRd.js → balanced-profile-contract-C6AgFJNp.js} +13 -16
  4. package/dist/balanced-profile-contract-C6AgFJNp.js.map +1 -0
  5. package/dist/browser-ext/manifest.json +1 -1
  6. package/dist/{claude-X8KYtT5_.js → claude-CjsxXwv2.js} +8 -12
  7. package/dist/claude-CjsxXwv2.js.map +1 -0
  8. package/dist/{codex-CbYioKum.js → codex-CjZXP_n6.js} +4 -4
  9. package/dist/{codex-CbYioKum.js.map → codex-CjZXP_n6.js.map} +1 -1
  10. package/dist/engine-cNHuW0j7.js +2 -0
  11. package/dist/{gate-discovery-C27g6aJn.js → gate-discovery-DGBZpoS7.js} +2 -2
  12. package/dist/{gate-discovery-C27g6aJn.js.map → gate-discovery-DGBZpoS7.js.map} +1 -1
  13. package/dist/hooks.mjs +1 -5
  14. package/dist/hooks.sha256 +1 -1
  15. package/dist/{internal-fast-dispatch-guard-0Or2xigH.js → internal-fast-dispatch-guard-7UiD_vM5.js} +5 -4
  16. package/dist/internal-fast-dispatch-guard-7UiD_vM5.js.map +1 -0
  17. package/dist/{internal-fast-dispatch-guard-UQSbkLqY.js → internal-fast-dispatch-guard-ByXUE5oO.js} +1 -1
  18. package/dist/{internal-stop-hook-YCK7DX-x.js → internal-stop-hook-BgtHofxp.js} +2 -2
  19. package/dist/{internal-stop-hook-YCK7DX-x.js.map → internal-stop-hook-BgtHofxp.js.map} +1 -1
  20. package/dist/main.js +6 -6
  21. package/dist/{peer-mcp-personas-DU2SO1RG.js → peer-mcp-personas-qQgzZDPP.js} +16 -20
  22. package/dist/peer-mcp-personas-qQgzZDPP.js.map +1 -0
  23. package/dist/{provision-Ck059J4j.js → provision-CjIatImk.js} +2 -2
  24. package/dist/{provision-Ck059J4j.js.map → provision-CjIatImk.js.map} +1 -1
  25. package/dist/{serve-QSuKiRrF.js → serve-BM6x_Cqs.js} +5 -5
  26. package/dist/{serve-QSuKiRrF.js.map → serve-BM6x_Cqs.js.map} +1 -1
  27. package/dist/{server-setup-BMd_WJqh.js → server-setup-M0PHRPjd.js} +26 -34
  28. package/dist/server-setup-M0PHRPjd.js.map +1 -0
  29. package/dist/{start-Ikh4r6Pa.js → start-BWEckTMU.js} +3 -3
  30. package/dist/{start-Ikh4r6Pa.js.map → start-BWEckTMU.js.map} +1 -1
  31. package/package.json +1 -1
  32. package/dist/attribution-settings-Bpa-YTZ5.js.map +0 -1
  33. package/dist/balanced-profile-contract-DdmG6RRd.js.map +0 -1
  34. package/dist/claude-X8KYtT5_.js.map +0 -1
  35. package/dist/engine-Di1OB28h.js +0 -2
  36. package/dist/internal-fast-dispatch-guard-0Or2xigH.js.map +0 -1
  37. package/dist/peer-mcp-personas-DU2SO1RG.js.map +0 -1
  38. package/dist/server-setup-BMd_WJqh.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import { a as isUnderClaudeConfigMirror, f as writeRuntimeFileSecure, t as PATHS } from "./paths-CpbTHKeP.js";
2
- 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-BMd_WJqh.js";
3
- import { _ as FAST_PROFILE_MODELS, a as BALANCED_PROFILE_NATIVE_EFFORTS, b as FAST_PROFILE_NATIVE_MODELS, i as BALANCED_PROFILE_NATIVE_AGENT_NAMES, v as FAST_PROFILE_NATIVE_AGENT_NAMES, y as FAST_PROFILE_NATIVE_EFFORTS } from "./balanced-profile-contract-DdmG6RRd.js";
4
- import { Bn as CHEAP_PROFILE_NATIVE_EFFORTS, Nn as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, On as oneMContextDisabled, Pn as CHEAPEST_PROFILE_NATIVE_EFFORTS, a as buildAgentPrompt, cn as DEFINITION_OF_GREATNESS, kn as withOneMSuffix, l as maxPersonasFor, n as MCP_GROUPS, sn as CONDENSED_OPERATING_SEQUENCE, t as GROUP_META, u as personasFor, zn as CHEAP_PROFILE_NATIVE_AGENT_NAMES } from "./peer-mcp-personas-DU2SO1RG.js";
2
+ import { S as LUNA_SCOUT_ALIAS_ID, _ as CHEAPEST_REVIEWER_ALIAS_ID, b as CHEAP_PLAN_ALIAS_ID, f as BALANCED_EXPLORE_ALIAS_ID, g as CHEAPEST_GENERAL_PURPOSE_ALIAS_ID, h as CHEAPEST_EXPLORE_ALIAS_ID, m as BALANCED_REVIEWER_ALIAS_ID, p as BALANCED_GENERAL_PURPOSE_ALIAS_ID, v as CHEAP_EXPLORE_ALIAS_ID, x as CHEAP_REVIEWER_ALIAS_ID, y as CHEAP_GENERAL_PURPOSE_ALIAS_ID } from "./server-setup-M0PHRPjd.js";
3
+ import { _ as FAST_PROFILE_MODELS, a as BALANCED_PROFILE_NATIVE_EFFORTS, b as FAST_PROFILE_NATIVE_MODELS, i as BALANCED_PROFILE_NATIVE_AGENT_NAMES, v as FAST_PROFILE_NATIVE_AGENT_NAMES, y as FAST_PROFILE_NATIVE_EFFORTS } from "./balanced-profile-contract-C6AgFJNp.js";
4
+ import { Bn as CHEAP_PROFILE_NATIVE_EFFORTS, Nn as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, On as oneMContextDisabled, Pn as CHEAPEST_PROFILE_NATIVE_EFFORTS, a as buildAgentPrompt, cn as DEFINITION_OF_GREATNESS, kn as withOneMSuffix, l as maxPersonasFor, n as MCP_GROUPS, sn as CONDENSED_OPERATING_SEQUENCE, t as GROUP_META, u as personasFor, zn as CHEAP_PROFILE_NATIVE_AGENT_NAMES } from "./peer-mcp-personas-qQgzZDPP.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-LTJstj1e.js";
6
6
  import "./self-invocation-DIUyoRgL.js";
7
- import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-Ck059J4j.js";
7
+ import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-CjIatImk.js";
8
8
  import { n as buildWorkspaceHeaderHelperCommand } from "./mcp-workspace-header-B77WqVFw.js";
9
9
  import { a as dispatcherAgentName, c as dispatcherTools, n as activeDispatchModes, o as dispatcherDescription, s as dispatcherPrompt } from "./worker-dispatch-lRhno09M.js";
10
10
  import consola from "consola";
@@ -443,12 +443,11 @@ Gaps and unknowns: what you could not confirm, and where you would look next.
443
443
  }
444
444
  const PLAN_DESC_HEAD = "Architecture and implementation planning specialist";
445
445
  const PLAN_DESC_TAIL = " Returns a decision-complete, ordered implementation plan with runnable acceptance criteria. Never edits files.";
446
- function pinnedPlanDescription(explicit, isBalanced = false, is200K = false) {
447
- return PLAN_DESC_HEAD + (explicit ? isBalanced ? ". Use proactively ONLY when sequencing, cross-boundary interfaces, invariants, migration risk, or acceptance criteria are genuinely complex and deserve a dedicated pass before any code is written. The lead owns planning by default. Delegates repository discovery to `Explore` rather than reading broadly itself." : ". Use proactively in plan mode, and whenever sequencing, cross-boundary interfaces, invariants, migration risk, or acceptance criteria deserve a dedicated pass before any code is written. Delegates repository discovery to `Explore` rather than reading broadly itself." : " for sequencing, cross-boundary interfaces, invariants, migration risk, and acceptance criteria before any code is written.") + PLAN_DESC_TAIL + (is200K ? DESC_200K_NOTE : "");
446
+ function pinnedPlanDescription(explicit, is200K = false) {
447
+ return PLAN_DESC_HEAD + (explicit ? ". Use proactively in plan mode, and whenever sequencing, cross-boundary interfaces, invariants, migration risk, or acceptance criteria deserve a dedicated pass before any code is written. Delegates repository discovery to `Explore` rather than reading broadly itself." : " for sequencing, cross-boundary interfaces, invariants, migration risk, and acceptance criteria before any code is written.") + PLAN_DESC_TAIL + (is200K ? DESC_200K_NOTE : "");
448
448
  }
449
449
  function pinnedPlanPrompt(opts) {
450
- const oracleRef = opts.oracleTool ? `\`${opts.oracleTool}\`` : "Oracle";
451
- return `You are a software architect and planning specialist. Your mission is to turn a request into a decision-complete implementation plan: an ordered sequence of changes, the invariants that must hold throughout, and acceptance criteria a reviewer can actually run. This is read-only work. Do not modify repository files. Produce the architecture, sequencing, and acceptance criteria for the lead to synthesize and execute. Plan is an advisory planning capability, not an approval gate. Separate discoverable facts from genuine choices. ${opts.explicit ? "Do not sweep the repository yourself: delegate discovery to `Explore`, launching one or more `Explore` subagents in parallel with scoped evidence questions, then read directly only the files needed to resolve trade-offs and write executable steps. " : "Do not sweep the repository broadly yourself: keep discovery narrow, read directly only the files needed to resolve trade-offs and write executable steps, and record any repository fact you could not confirm as an explicit gap. "}Escalate only genuine product or architectural trade-offs, and escalate them as explicit options with consequences and a recommendation, never as an open question. For low-risk details, choose the reading most consistent with the codebase, proceed, and record it as an assumption. When a design trade-off has more than one viable answer and repository evidence cannot settle it, consult ${oracleRef} with one self-contained brief that states the constraints, the candidate designs, and the evidence you already gathered plus one precise question. If Oracle does not settle it, carry the options and the remaining gap into the plan rather than silently picking one. Delegation: you may invoke Explore and \`reviewer\` for discovery and verification; do not invoke any other subagent. Behavior and code verification belongs to post-implementation review. Write the plan for its consumer — a General-Purpose execution agent or the lead implementing directly — who cannot see your reasoning. Every step must be executable without rediscovering what you already found: name the files, name the interfaces, and state the condition that means the step is done. Prefer the smallest design that satisfies the requirement and fits the conventions already in the codebase. Mark steps that are independent of each other and can run concurrently.
450
+ return `You are a software architect and planning specialist. Your mission is to turn a request into a decision-complete implementation plan: an ordered sequence of changes, the invariants that must hold throughout, and acceptance criteria a reviewer can actually run. This is read-only work. Do not modify repository files. Produce the architecture, sequencing, and acceptance criteria for the lead to synthesize and execute. Plan is an advisory planning capability, not an approval gate. Separate discoverable facts from genuine choices. Do not sweep the repository yourself: delegate discovery to \`Explore\`, launching one or more \`Explore\` subagents in parallel with scoped evidence questions, then read directly only the files needed to resolve trade-offs and write executable steps. Escalate only genuine product or architectural trade-offs, and escalate them as explicit options with consequences and a recommendation, never as an open question. For low-risk details, choose the reading most consistent with the codebase, proceed, and record it as an assumption. When a design trade-off has more than one viable answer and repository evidence cannot settle it, consult ${opts.oracleTool ? `\`${opts.oracleTool}\`` : "Oracle"} with one self-contained brief that states the constraints, the candidate designs, and the evidence you already gathered plus one precise question. If Oracle does not settle it, carry the options and the remaining gap into the plan rather than silently picking one. Delegation: you may invoke Explore and \`reviewer\` for discovery and verification; do not invoke any other subagent. Behavior and code verification belongs to post-implementation review. Write the plan for its consumer — a General-Purpose execution agent or the lead implementing directly — who cannot see your reasoning. Every step must be executable without rediscovering what you already found: name the files, name the interfaces, and state the condition that means the step is done. Prefer the smallest design that satisfies the requirement and fits the conventions already in the codebase. Mark steps that are independent of each other and can run concurrently.
452
451
 
453
452
  Return format:
454
453
  Objective: what will be true when this is complete.
@@ -521,7 +520,6 @@ function buildFastProfileAgentDefinitions(opts) {
521
520
  Plan: {
522
521
  description: pinnedPlanDescription(true),
523
522
  prompt: pinnedPlanPrompt({
524
- explicit: true,
525
523
  semanticAvailable,
526
524
  oracleTool
527
525
  }),
@@ -615,9 +613,8 @@ function buildCheapProfileAgentDefinitions(opts) {
615
613
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
616
614
  },
617
615
  Plan: {
618
- description: pinnedPlanDescription(true, false, true),
616
+ description: pinnedPlanDescription(true, true),
619
617
  prompt: pinnedPlanPrompt({
620
- explicit: true,
621
618
  semanticAvailable,
622
619
  oracleTool,
623
620
  is200K: true
@@ -661,27 +658,26 @@ function buildCheapProfileAgentDefinitions(opts) {
661
658
  for (const name of Object.keys(out)) if (name !== "worker-browse" && !roster.has(name)) delete out[name];
662
659
  return out;
663
660
  }
664
- /** Build the literal `-m cheapest` native roster. Same fixed four-agent
665
- * surface and roles as `-m cheap`, but Luna-led with a Sol reviewer —
666
- * every SUBAGENT model is a BARE router-owned alias
667
- * (`gh-router-cheapest-*`, no `[1m]`) rather than a real catalog id, for the
668
- * same client catalog-resolution reason as the cheap builder above: a bare
669
- * real id is upgraded to `[1m]` accounting by Claude Code whenever the entry
670
- * advertises >=1M. Caller-supplied `opts.cheapest*Model` values are
671
- * deliberately ignored. Cheapest is tuned for straightforward tasks: role
672
- * descriptions carry no proactive fan-out push, so the lead handles simple
673
- * work inline instead of paying handoff overhead. */
661
+ /** Build the literal `-m cheapest` native roster. Three-agent surface
662
+ * (`Explore`, `General-Purpose`, `reviewer` — no `Plan`: the lead plans
663
+ * directly and reviews the final plan with the Advisor before presenting
664
+ * it), Luna-led with a Sol reviewer — every SUBAGENT model is a BARE
665
+ * router-owned alias (`gh-router-cheapest-*`, no `[1m]`) rather than a real
666
+ * catalog id, for the same client catalog-resolution reason as the cheap
667
+ * builder above: a bare real id is upgraded to `[1m]` accounting by Claude
668
+ * Code whenever the entry advertises >=1M. Caller-supplied
669
+ * `opts.cheapest*Model` values are deliberately ignored. Cheapest is tuned
670
+ * for straightforward tasks: role descriptions carry no proactive fan-out
671
+ * push, so the lead handles simple work inline instead of paying handoff
672
+ * overhead. Oracle is lead-only: no emitted native receives the peers
673
+ * server. */
674
674
  function buildCheapestProfileAgentDefinitions(opts) {
675
675
  const exploreModel = CHEAPEST_EXPLORE_ALIAS_ID;
676
- const planModel = CHEAPEST_PLAN_ALIAS_ID;
677
676
  const generalModel = CHEAPEST_GENERAL_PURPOSE_ALIAS_ID;
678
677
  const reviewerModel = CHEAPEST_REVIEWER_ALIAS_ID;
679
678
  const semanticAvailable = opts.semanticSearchAvailable === true;
680
679
  const searchKey = opts.groupKeys.search ?? GROUP_META.search.preferredKey;
681
- const peersKey = peersKeyOf(opts.groupKeys);
682
680
  const searchMcpServers = opts.serverUrl ? { [searchKey]: httpEntryFor(opts.serverUrl, "search", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
683
- const peersMcpServers = opts.serverUrl && opts.groupKeys.peers ? { [peersKey]: httpEntryFor(opts.serverUrl, "peers", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
684
- const oracleTool = opts.groupKeys.peers ? `mcp__${peersKey}__oracle` : void 0;
685
681
  const readSearchTools = [
686
682
  "Read",
687
683
  "Grep",
@@ -691,11 +687,6 @@ function buildCheapestProfileAgentDefinitions(opts) {
691
687
  "WebSearch",
692
688
  `mcp__${searchKey}__*`
693
689
  ];
694
- const planTools = [
695
- ...readSearchTools,
696
- ...oracleTool ? [oracleTool] : [],
697
- "Agent"
698
- ];
699
690
  const effort = (name) => CHEAPEST_PROFILE_NATIVE_EFFORTS[name];
700
691
  const out = {
701
692
  Explore: {
@@ -711,22 +702,6 @@ function buildCheapestProfileAgentDefinitions(opts) {
711
702
  effort: effort("Explore"),
712
703
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
713
704
  },
714
- Plan: {
715
- description: pinnedPlanDescription(false, false, true),
716
- prompt: pinnedPlanPrompt({
717
- explicit: false,
718
- semanticAvailable,
719
- oracleTool,
720
- is200K: true
721
- }),
722
- tools: planTools,
723
- model: planModel,
724
- effort: effort("Plan"),
725
- mcpServers: {
726
- ...searchMcpServers ?? {},
727
- ...peersMcpServers ?? {}
728
- }
729
- },
730
705
  "General-Purpose": {
731
706
  description: pinnedGeneralPurposeDescription(false, false, true),
732
707
  prompt: pinnedGeneralPurposePrompt({ is200K: true }),
@@ -758,31 +733,27 @@ function buildCheapestProfileAgentDefinitions(opts) {
758
733
  for (const name of Object.keys(out)) if (name !== "worker-browse" && !roster.has(name)) delete out[name];
759
734
  return out;
760
735
  }
761
- /** Build the literal `-m balanced` native roster. Same fixed four-agent
762
- * surface and roles as `-m cheap`, but Sol-led at the 200K default window
763
- * for the most complex tasks — every SUBAGENT model is a BARE router-owned
764
- * alias (`gh-router-balanced-*`, no `[1m]`) rather than a real catalog id,
765
- * for the same client catalog-resolution reason as the cheap builder above.
736
+ /** Build the literal `-m balanced` native roster. Three-agent surface
737
+ * (`Explore`, `General-Purpose`, `reviewer` — no `Plan`: the lead owns
738
+ * planning directly), Sol-led at the 200K default window for the most
739
+ * complex tasks — every SUBAGENT model is a BARE router-owned alias
740
+ * (`gh-router-balanced-*`, no `[1m]`) rather than a real catalog id, for the
741
+ * same client catalog-resolution reason as the cheap builder above.
766
742
  * Caller-supplied `opts.balanced*Model` values are deliberately ignored.
767
743
  * Explicit delegation tuning is search-first and lead-owns-by-default
768
744
  * (unlike cheap): `code_search` + `web` search narrow scope before any
769
- * `Explore` fan-out; `Plan` ONLY when genuinely complex (lead owns planning)
770
- * with an explicitly named Oracle tool; `General-Purpose` mixed execution
771
- * delegates FREELY; `reviewer` ONLY when genuinely behavior-changing (lead
772
- * owns verification) where the reviewer
773
- * narrows scope with search and may invoke `Explore` for targeted
774
- * discovery. */
745
+ * `Explore` fan-out; `General-Purpose` mixed execution delegates FREELY;
746
+ * `reviewer` ONLY when genuinely behavior-changing (lead owns verification)
747
+ * where the reviewer narrows scope with search and may invoke `Explore` for
748
+ * targeted discovery. Oracle is lead-only: no emitted native receives the
749
+ * peers server. */
775
750
  function buildBalancedProfileAgentDefinitions(opts) {
776
751
  const exploreModel = BALANCED_EXPLORE_ALIAS_ID;
777
- const planModel = BALANCED_PLAN_ALIAS_ID;
778
752
  const generalModel = BALANCED_GENERAL_PURPOSE_ALIAS_ID;
779
753
  const reviewerModel = BALANCED_REVIEWER_ALIAS_ID;
780
754
  const semanticAvailable = opts.semanticSearchAvailable === true;
781
755
  const searchKey = opts.groupKeys.search ?? GROUP_META.search.preferredKey;
782
- const peersKey = peersKeyOf(opts.groupKeys);
783
756
  const searchMcpServers = opts.serverUrl ? { [searchKey]: httpEntryFor(opts.serverUrl, "search", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
784
- const peersMcpServers = opts.serverUrl && opts.groupKeys.peers ? { [peersKey]: httpEntryFor(opts.serverUrl, "peers", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
785
- const oracleTool = opts.groupKeys.peers ? `mcp__${peersKey}__oracle` : void 0;
786
757
  const readSearchTools = [
787
758
  "Read",
788
759
  "Grep",
@@ -792,11 +763,6 @@ function buildBalancedProfileAgentDefinitions(opts) {
792
763
  "WebSearch",
793
764
  `mcp__${searchKey}__*`
794
765
  ];
795
- const planTools = [
796
- ...readSearchTools,
797
- ...oracleTool ? [oracleTool] : [],
798
- "Agent"
799
- ];
800
766
  const effort = (name) => BALANCED_PROFILE_NATIVE_EFFORTS[name];
801
767
  const out = {
802
768
  Explore: {
@@ -812,22 +778,6 @@ function buildBalancedProfileAgentDefinitions(opts) {
812
778
  effort: effort("Explore"),
813
779
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
814
780
  },
815
- Plan: {
816
- description: pinnedPlanDescription(true, true, true),
817
- prompt: pinnedPlanPrompt({
818
- explicit: true,
819
- semanticAvailable,
820
- oracleTool,
821
- is200K: true
822
- }),
823
- tools: planTools,
824
- model: planModel,
825
- effort: effort("Plan"),
826
- mcpServers: {
827
- ...searchMcpServers ?? {},
828
- ...peersMcpServers ?? {}
829
- }
830
- },
831
781
  "General-Purpose": {
832
782
  description: pinnedGeneralPurposeDescription(true, true, true),
833
783
  prompt: pinnedGeneralPurposePrompt({ is200K: true }),
@@ -1327,12 +1277,10 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
1327
1277
  cheapImplementerModel: opts.cheapImplementerModel,
1328
1278
  cheapReviewerModel: opts.cheapReviewerModel,
1329
1279
  cheapestExploreModel: opts.cheapestExploreModel,
1330
- cheapestPlanModel: opts.cheapestPlanModel,
1331
1280
  cheapestGeneralPurposeModel: opts.cheapestGeneralPurposeModel,
1332
1281
  cheapestImplementerModel: opts.cheapestImplementerModel,
1333
1282
  cheapestReviewerModel: opts.cheapestReviewerModel,
1334
1283
  balancedExploreModel: opts.balancedExploreModel,
1335
- balancedPlanModel: opts.balancedPlanModel,
1336
1284
  balancedGeneralPurposeModel: opts.balancedGeneralPurposeModel,
1337
1285
  balancedReviewerModel: opts.balancedReviewerModel,
1338
1286
  semanticSearchAvailable: opts.semanticSearchAvailable,
@@ -2240,7 +2188,8 @@ summaries, never full file contents or pasted source blocks.
2240
2188
  }
2241
2189
  //#endregion
2242
2190
  //#region src/lib/injected-skills/implement-skill.ts
2243
- function buildImplementSkill(_searchEnabled) {
2191
+ function buildImplementSkill(_searchEnabled, profile) {
2192
+ const planDispatches = profile === "cheapest" || profile === "balanced" ? "planning work" : "Plan dispatches";
2244
2193
  return {
2245
2194
  name: "gh-implement",
2246
2195
  md: `---
@@ -2289,12 +2238,12 @@ tool, never worker-* MCP dispatchers.
2289
2238
  2. Check freshness: if HEAD or the working-tree diff hash moved since the
2290
2239
  plan was approved, re-verify stale load-bearing assumptions before
2291
2240
  dispatching subagents.
2292
- 3. Close the previous stage: send no further follow-ups to any lingering Plan
2293
- dispatches (Explore follow-ups) and record them as superseded with the
2241
+ 3. Close the previous stage: send no further follow-ups to any lingering ${planDispatches}
2242
+ (Explore follow-ups) and record them as superseded with the
2294
2243
  reason. Native subagents cannot be killed mid-run: let them finish but do
2295
2244
  not wait on or use their output. Implementing while planning still runs
2296
2245
  builds on a moving target and wastes both stages. Only advance once every
2297
- Plan dispatch has returned or is recorded as superseded.
2246
+ ${planDispatches === "planning work" ? "planning pass has returned" : "Plan dispatch has returned"} or is recorded as superseded.
2298
2247
 
2299
2248
  ## Procedure
2300
2249
 
@@ -2344,7 +2293,7 @@ Return:
2344
2293
  ## Non-goals
2345
2294
 
2346
2295
  - Do not start without a user-approved plan.md plus its .complete approval record.
2347
- - Do not start while Plan dispatches still run; record them superseded first.
2296
+ - ${planDispatches === "planning work" ? "Do not start while planning still runs; record it superseded first." : "Do not start while Plan dispatches still run; record them superseded first."}
2348
2297
  - Do not dispatch a reviewer by default; self-validation plus green checks is the default path.
2349
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).
2350
2299
  - Do not nest workflow invocations: subagents must not re-invoke /gh-implement (or any /gh-* pipeline skill).
@@ -2352,6 +2301,7 @@ Return:
2352
2301
  `
2353
2302
  };
2354
2303
  }
2304
+ buildImplementSkill(true);
2355
2305
  //#endregion
2356
2306
  //#region src/lib/injected-skills/orchestrate-skill.ts
2357
2307
  function buildOrchestrateSkill(searchEnabled, bluebirdEnabled = false) {
@@ -2494,7 +2444,8 @@ Return:
2494
2444
  }
2495
2445
  //#endregion
2496
2446
  //#region src/lib/injected-skills/plan-skill.ts
2497
- function buildPlanSkill(_searchEnabled) {
2447
+ function buildPlanSkill(_searchEnabled, profile) {
2448
+ const leadPlansDirectly = profile === "cheapest" || profile === "balanced";
2498
2449
  return {
2499
2450
  name: "gh-plan",
2500
2451
  md: `---
@@ -2507,19 +2458,14 @@ consumes: [context.md, context.compact.md]
2507
2458
  excludes: [trivial changes, implementation, missing context]
2508
2459
  ---
2509
2460
 
2510
- # gh-plan: native Plan-subagent planning
2461
+ # gh-plan: ${leadPlansDirectly ? "lead-direct planning" : "native Plan-subagent planning"}
2511
2462
 
2512
2463
  Use this skill after /gh-gather-context (or when equivalent context is already
2513
- available) and before any implementation. For non-trivial work, dispatch the
2514
- native Plan subagent (subagent_type Plan) present on every pipeline profile
2515
- roster; profile frontmatter pins its model and effort (Sol at the 200K default
2516
- window). The plan must be scoped, modular, non-overlapping, and ordered, with
2464
+ available) and before any implementation. For non-trivial work, ${leadPlansDirectly ? "the lead plans directly (no Plan subagent exists on the cheapest/balanced rosters)" : "dispatch the native Plan subagent (subagent_type Plan) present on the profile roster where provided; profile frontmatter pins its model and effort (Sol at the 200K default window)"}.
2465
+ The plan must be scoped, modular, non-overlapping, and ordered, with
2517
2466
  enough detail for a native General-Purpose (or implementer, where the profile
2518
2467
  provides one) subagent to execute each task in isolation. User approval is
2519
- mandatory before implementation. This skill dispatches ONLY the native Plan
2520
- subagent via the Agent tool, never worker-* MCP dispatchers. Plan self-serves
2521
- Explore follow-ups per its delegation graph; the skill does not dispatch
2522
- Explore directly.
2468
+ mandatory before implementation. ${leadPlansDirectly ? "This skill plans directly (plus scoped Explore discovery where the delegation graph permits), never via worker-* MCP dispatchers." : "This skill dispatches ONLY the native Plan subagent via the Agent tool, never worker-* MCP dispatchers."} ${leadPlansDirectly ? "The lead self-serves Explore follow-ups per its delegation graph; the skill does not dispatch Explore directly." : "Plan self-serves Explore follow-ups per its delegation graph; the skill does not dispatch Explore directly."}
2523
2469
 
2524
2470
  ## Prerequisites
2525
2471
 
@@ -2540,12 +2486,12 @@ Explore directly.
2540
2486
  builds on shifting evidence and wastes both stages. Only advance once every
2541
2487
  Explore dispatch has returned or is recorded as superseded.
2542
2488
 
2543
- ## Triviality reassessment (do this AFTER gate 0, BEFORE dispatching Plan)
2489
+ ## Triviality reassessment (do this AFTER gate 0, BEFORE ${leadPlansDirectly ? "planning" : "dispatching Plan"})
2544
2490
 
2545
2491
  1. Reassess with fresh context: if the ask is trivial (typo, one-line config
2546
2492
  read, obvious change of at most a few lines, pure explanation) or the
2547
2493
  context shows no multi-file, risky, uncertain, or high-impact work, STOP.
2548
- Do NOT dispatch Plan. Do NOT write plan.md or .complete.
2494
+ Do NOT ${leadPlansDirectly ? "plan" : "dispatch Plan"}. Do NOT write plan.md or .complete.
2549
2495
  2. Return a trivial verdict: one-sentence reason, the recommended direct
2550
2496
  action, and an explicit statement that no downstream stage (/gh-implement,
2551
2497
  /gh-swe-pipeline stage 3) may run. A trivial ask must never pay planning
@@ -2556,7 +2502,7 @@ Explore directly.
2556
2502
  - Maximum tasks: 20.
2557
2503
  - Maximum parallel groups: 5.
2558
2504
  - 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.
2559
- - 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.
2505
+ - Advisory budget: keep ${leadPlansDirectly ? "planning" : "the Plan dispatch"} under ~5 minutes; the Task tool enforces no wall-clock. At most 2 bounded ${leadPlansDirectly ? "self-review passes" : "follow-up rounds to the same Plan dispatch"} for gaps.
2560
2506
 
2561
2507
  ## Procedure (non-trivial work only)
2562
2508
 
@@ -2565,7 +2511,7 @@ Explore directly.
2565
2511
  - Read the evidence table and residual unknowns from context.md.
2566
2512
  - Identify acceptance criteria, constraints, integration seams, and forbidden changes.
2567
2513
 
2568
- 2. Compose the Plan dispatch brief. Include every item below; a vague brief
2514
+ 2. Compose the ${leadPlansDirectly ? "plan" : "Plan dispatch brief"}. Include every item below; a vague brief
2569
2515
  produces a vague plan, and a vague plan fails downstream:
2570
2516
  - Ask summary and acceptance criteria (or candidates where ambiguous).
2571
2517
  - Constraints, integration seams, and forbidden changes.
@@ -2581,7 +2527,7 @@ Explore directly.
2581
2527
  context tokens).
2582
2528
  - Plan-mode rule: plan and acceptance criteria only, no implementation
2583
2529
  file edits.
2584
- - Permission to use Explore and reviewer per the delegation graph.
2530
+ - Permission to use Explore ${leadPlansDirectly ? "per the lead delegation graph" : "and reviewer per the delegation graph"}.
2585
2531
  - Write the brief as plain directives, never reflective first-person prose:
2586
2532
  Gemini-run subagents may suppress tool calls when the prompt contains
2587
2533
  reflective text.
@@ -2589,26 +2535,38 @@ Explore directly.
2589
2535
  source blocks. Output tokens cost several times input on every profile.
2590
2536
  - Advisory ~5 minute budget.
2591
2537
 
2592
- 3. Dispatch ONE Plan subagent via the Agent tool (subagent_type Plan) with
2538
+ ${leadPlansDirectly ? `3. Compose the plan directly with that brief, then validate it against
2539
+ the same bar: every task names files, states the change and its done
2540
+ condition, and carries runnable acceptance commands; trade-offs appear as
2541
+ options with a recommendation. If gaps remain, run ONE bounded self-review
2542
+ pass naming the exact gaps (at most 2 review passes total). If still
2543
+ underspecified, checkpoint with the gaps as residual risk instead of
2544
+ pretending the plan is complete.` : `3. Dispatch ONE Plan subagent via the Agent tool (subagent_type Plan) with
2593
2545
  that brief, then WAIT for its full return. Do not plan inline in parallel
2594
- and do not dispatch implementation subagents while it runs.
2546
+ and do not dispatch implementation subagents while it runs.`}
2595
2547
 
2596
- 4. Validate the returned plan. Every task must name files, state the change
2597
- and its done condition, and carry runnable acceptance commands;
2548
+ ${leadPlansDirectly ? `4. Validate the composed plan. Every task must name files, state the
2549
+ change and its done condition, and carry runnable acceptance commands;
2550
+ trade-offs must appear as options with a recommendation.` : `4. Validate the returned plan. Every task must name files, state the
2551
+ change and its done condition, and carry runnable acceptance commands;
2598
2552
  trade-offs must appear as options with a recommendation. If gaps remain,
2599
2553
  send ONE bounded follow-up to the same Plan dispatch naming the exact gaps
2600
2554
  (at most 2 follow-up rounds total). If still underspecified, checkpoint
2601
- with the gaps as residual risk instead of pretending the plan is complete.
2555
+ with the gaps as residual risk instead of pretending the plan is complete.`}
2602
2556
 
2603
- 5. Persist the validated plan to .github-router/plans/<slug>/plan.md.
2557
+ ${leadPlansDirectly ? profile === "cheapest" ? 7 : 6 : 5}. Persist the validated plan to .github-router/plans/<slug>/plan.md.
2604
2558
  - Ask summary and user-blessed acceptance criteria.
2605
2559
  - Blind-spot table with executable-checkable or judgment-only tags.
2606
2560
  - Ordered task list with ids, files, dependencies, parallel groups, acceptance criteria, verification commands, rollback concerns, and estimated context tokens.
2607
2561
  - Open questions and user answers.
2608
2562
  - Cost estimate: task count, parallel groups, and context tokens.
2609
2563
  - Residual risks.
2564
+ ${profile === "cheapest" ? `
2565
+ 6. Review the final plan with the Advisor before presenting it to the user:
2566
+ consult \`advisor\` once for a framing check. It is non-binding counsel;
2567
+ you retain decision ownership.
2610
2568
 
2611
- 6. Checkpoint with the user and wait for explicit approval.
2569
+ ` : ""}${leadPlansDirectly ? profile === "cheapest" ? 8 : 7 : 6}. Checkpoint with the user and wait for explicit approval.
2612
2570
  - Present the goal, acceptance criteria, task-to-group map, per-task blind spot killed, residual risks, and cost estimate.
2613
2571
  - If the user rejects scope or cost, downshift to the smallest plan that kills the important blind spots.
2614
2572
  - Do not proceed to implementation without approval.
@@ -2627,7 +2585,7 @@ Return:
2627
2585
 
2628
2586
  ## Non-goals
2629
2587
 
2630
- - Do not dispatch Plan for a trivial ask; exit with a trivial verdict instead.
2588
+ - Do not ${leadPlansDirectly ? "plan a trivial ask" : "dispatch Plan for a trivial ask"}; exit with a trivial verdict instead.
2631
2589
  - Do not edit implementation files while planning; in plan mode, produce the plan and acceptance criteria only.
2632
2590
  - Do not present judgment-only conclusions as executable guarantees.
2633
2591
  - Do not hide open unknowns because the plan looks complete.
@@ -2757,7 +2715,8 @@ Return a compact brief, not the whole research dump:
2757
2715
  }
2758
2716
  //#endregion
2759
2717
  //#region src/lib/injected-skills/swe-pipeline-skill.ts
2760
- function buildSwePipelineSkill(_searchEnabled) {
2718
+ function buildSwePipelineSkill(_searchEnabled, profile) {
2719
+ const leadPlansDirectly = profile === "cheapest" || profile === "balanced";
2761
2720
  return {
2762
2721
  name: "gh-swe-pipeline",
2763
2722
  md: `---
@@ -2773,8 +2732,7 @@ change. It coordinates the three pipeline stages in STRICT SEQUENCE. No two
2773
2732
  stages ever overlap: each stage runs to completion, its subagents are all
2774
2733
  finished or explicitly superseded, and its completion artifact exists before
2775
2734
  the next stage starts. Every stage dispatches ONLY native subagents present on
2776
- the profile roster (Explore, Plan, General-Purpose, reviewer, implementer
2777
- where provided) via the Agent tool, never worker-* MCP dispatchers.
2735
+ the profile roster (${leadPlansDirectly ? "Explore, General-Purpose, reviewer" : "Explore, Plan, General-Purpose, reviewer, implementer where provided"}) via the Agent tool, never worker-* MCP dispatchers.
2778
2736
 
2779
2737
  All work runs at the 200K default window with bare slugs (no 1M accounting).
2780
2738
  Advisory budgets (the Task tool enforces no wall-clock): gather ~3 minutes
@@ -2804,7 +2762,7 @@ exists to prevent.
2804
2762
  ## Stage 1: gather context (to completion)
2805
2763
 
2806
2764
  1. Invoke the gh-gather-context skill and WAIT for its full return. Do not
2807
- plan, sketch tasks, or dispatch Plan subagents while it runs.
2765
+ plan, sketch tasks, or dispatch ${leadPlansDirectly ? "lead planning" : "Plan subagents"} while it runs.
2808
2766
  2. Its completion artifact is
2809
2767
  .github-router/context/<slug>/context.md plus context.compact.md and a
2810
2768
  .complete marker. If the marker is missing, the stage is NOT complete:
@@ -2825,8 +2783,7 @@ exists to prevent.
2825
2783
  recorded as superseded. If either is false, do not invoke planning. Fix
2826
2784
  stage 1 first.
2827
2785
  2. Invoke the gh-plan skill and WAIT for its full return. For non-trivial
2828
- work gh-plan dispatches the native Plan subagent with an
2829
- implementation-ready brief; do not dispatch implementation subagents,
2786
+ work gh-plan ${leadPlansDirectly ? "has the lead produce an implementation-ready plan" : "dispatches the native Plan subagent with an implementation-ready brief"}; do not dispatch implementation subagents,
2830
2787
  sketch diffs, or edit implementation files while it runs. Plan mode means
2831
2788
  plan and acceptance criteria only.
2832
2789
  3. Trivial exit: if gh-plan returns a trivial verdict (no plan.md, no
@@ -2846,7 +2803,7 @@ exists to prevent.
2846
2803
  1. Precondition check BEFORE invoking gh-implement: plan.md exists, its
2847
2804
  .complete marker exists, and run.md records explicit user approval. If
2848
2805
  any is missing, do not invoke implementation. Fix stage 2 first.
2849
- 2. Record any lingering Plan dispatches (Explore follow-ups) as superseded
2806
+ 2. Record any lingering ${leadPlansDirectly ? "planning work" : "Plan dispatches"} (Explore follow-ups) as superseded
2850
2807
  before the first implement dispatch.
2851
2808
  3. Invoke the gh-implement skill and WAIT for its full return: unified diff,
2852
2809
  implementation report, test/typecheck/lint results, and review summary
@@ -3201,17 +3158,26 @@ const STYLE_DIRECTIVE = "Write concisely without losing detail. Use a natural hu
3201
3158
  * (fast, max, cheap, cheap1m, cheapest, balanced). Standard is intentionally
3202
3159
  * excluded. Without `--swe` the skill files are not written and this text is
3203
3160
  * not referenced. Stages dispatch ONLY native subagents present on the
3204
- * profile roster (Explore, Plan, General-Purpose, reviewer, implementer
3205
- * where provided), never worker-* MCP dispatchers. All roles run at the
3161
+ * profile roster (Explore, Plan where the profile provides one,
3162
+ * General-Purpose, reviewer, implementer where provided), never worker-*
3163
+ * MCP dispatchers. All roles run at the
3206
3164
  * 200K default window (bare slugs, no 1M accounting) with advisory budgets:
3207
3165
  * gather ~3 min per round (3 rounds max, 6 Explore per round); plan ~5 min
3208
- * via the profile-pinned Plan subagent (trivial asks exit planless);
3166
+ * via the profile-pinned Plan subagent where the profile provides one
3167
+ * (the lead plans directly on cheapest/balanced; trivial asks exit
3168
+ * planless);
3209
3169
  * implement ~10 min per task (8 concurrent max, worktree:true only when
3210
3170
  * parallel tasks need isolation); reviewer only on low-confidence or complex
3211
3171
  * and risky changes, plus a General-Purpose fix pass for major reviewer
3212
3172
  * findings.
3213
3173
  */
3214
3174
  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.";
3175
+ /**
3176
+ * Pipeline-skills awareness for the profiles without a `Plan` role
3177
+ * (cheapest, balanced): the lead plans directly, so `/gh-plan` names the
3178
+ * lead instead of a Plan dispatch. Every other stage is identical.
3179
+ */
3180
+ const PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT = "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: the lead plans directly (no Plan subagent on this profile; 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 (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.";
3215
3181
  /** Oxford-comma join: "a", "a and b", "a, b, and c". */
3216
3182
  function joinClauses(parts) {
3217
3183
  if (parts.length <= 1) return parts[0] ?? "";
@@ -3239,13 +3205,11 @@ function buildNativeReachClauses(opts) {
3239
3205
  if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest" || opts.profile === "balanced") {
3240
3206
  if (opts.profile === "cheapest") return joinClauses([
3241
3207
  "`Explore` for broad repository discovery, dependency mapping, and convention tracking",
3242
- "`Plan` for architectural sequencing, interface contracts, migration risk, and runnable acceptance criteria",
3243
3208
  "`General-Purpose` for mixed, iterative, or multi-step execution tasks",
3244
3209
  "`reviewer` for independent adversarial verification, reproduction, and root-causing"
3245
3210
  ]) + ". All roles run at a 200K context window — prefer targeted reads (search, Grep, Read specific files) over full file reads";
3246
3211
  if (opts.profile === "balanced") return joinClauses([
3247
3212
  "`Explore` for broad repository discovery, dependency mapping, and convention tracking (launch in parallel)",
3248
- "`Plan` for architectural sequencing, interface contracts, migration risk, and runnable acceptance criteria ONLY when genuinely complex (lead owns planning by default)",
3249
3213
  "`General-Purpose` for mixed, iterative, or multi-step execution tasks (delegate freely)",
3250
3214
  "`reviewer` for independent adversarial verification, reproduction, and root-causing ONLY when genuinely behavior-changing (lead owns verification by default)"
3251
3215
  ]) + ". All roles run at a 200K context window — prefer targeted reads (search, Grep, Read specific files) over full file reads";
@@ -3300,7 +3264,8 @@ function buildOperatingDefaultsDirective(opts = {}) {
3300
3264
  const profileLabel = isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
3301
3265
  const oracleDescriptor = isCheapest ? "GPT-6 Sol (200K/high)" : isCheap || isBalanced ? "Grok 4.6 (200K/medium)" : "exact Opus 5.5 (1M/high)";
3302
3266
  const astraDescriptor = isCheap && !isCheapest ? "200K/medium" : "200K/high";
3303
- const searchGuidance = opts.bluebirdEnabled === true ? "Search strategy: use Bluebird `code` search in `lexical` mode for indexed keyword queries and `semantic` mode for intent/concept questions. Bluebird failures remain visible and never fall back locally; `exact`, `regex`, and `ast` stay on the local live tree. `Explore` subagents read the narrowed files and return file:line conclusions; expensive models (Plan, reviewer, Oracle) see only the synthesized subset, never raw search output. " : opts.semanticSearchAvailable === true ? "Search strategy (cheapest first): (1) LOCAL LEXICAL `code` search (mode:\"lexical\"/\"exact\", plus Grep/Glob) for symbols, filenames, errors, routes, flags, and config keys; (2) local ColBERT SEMANTIC `code` search for intent/concept questions where literal keywords may not appear, with lexical fallback while its index is unavailable; (3) `Explore` subagents read the narrowed files and return file:line conclusions — expensive models (Plan, reviewer, Oracle) see only the synthesized subset, never raw search output. " : "Search strategy (cheapest first): LOCAL LEXICAL `code` search (mode:\"lexical\"/\"exact\", plus Grep/Glob) for symbols, filenames, errors, routes, flags, and config keys. `Explore` subagents read the narrowed files and return file:line conclusions — expensive models (Plan, reviewer, Oracle) see only the synthesized subset, never raw search output. ";
3267
+ const expensiveModels = isCheapest || isBalanced ? "(reviewer, Oracle)" : "(Plan, reviewer, Oracle)";
3268
+ const searchGuidance = opts.bluebirdEnabled === true ? "Search strategy: use Bluebird `code` search in `lexical` mode for indexed keyword queries and `semantic` mode for intent/concept questions. Bluebird failures remain visible and never fall back locally; `exact`, `regex`, and `ast` stay on the local live tree. `Explore` subagents read the narrowed files and return file:line conclusions; expensive models " + expensiveModels + " see only the synthesized subset, never raw search output. " : opts.semanticSearchAvailable === true ? "Search strategy (cheapest first): (1) LOCAL LEXICAL `code` search (mode:\"lexical\"/\"exact\", plus Grep/Glob) for symbols, filenames, errors, routes, flags, and config keys; (2) local ColBERT SEMANTIC `code` search for intent/concept questions where literal keywords may not appear, with lexical fallback while its index is unavailable; (3) `Explore` subagents read the narrowed files and return file:line conclusions — expensive models " + expensiveModels + " see only the synthesized subset, never raw search output. " : "Search strategy (cheapest first): LOCAL LEXICAL `code` search (mode:\"lexical\"/\"exact\", plus Grep/Glob) for symbols, filenames, errors, routes, flags, and config keys. `Explore` subagents read the narrowed files and return file:line conclusions — expensive models " + expensiveModels + " see only the synthesized subset, never raw search output. ";
3304
3269
  if (opts.fastRuntimeAvailable === false) 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)
3305
3270
 
3306
3271
  ${profileLabel} profile runtime wiring is unavailable. Work directly, use only tools actually listed in this session, verify with the repository's relevant build/tests before declaring done, report uncertainty, and do not invent unavailable capabilities.`;
@@ -3312,12 +3277,10 @@ ${profileLabel} profile runtime wiring is unavailable. Work directly, use only t
3312
3277
  const workerBrowseClause = opts.browseAvailable ? ` \`worker-browse\` runs delegated autonomous browsing tasks through \`mcp__${workersKey}__browse\`.` : "";
3313
3278
  const artifactClause = opts.artifactAvailable ? ` \`mcp__${peersKey}__artifact_*\` provides human review in the artifact panel with auto-open on plan completion.` : "";
3314
3279
  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).` : "";
3315
- 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" : isBalanced ? `${profileLabel} launch profile. The lead coordinates execution across specialized native roles: ` + buildNativeReachClauses(opts) + `. Lead owns planning, implementation, and verification by default: in plan mode, produce the plan and acceptance criteria directly and do not edit files; delegate architectural planning to \`Plan\` ONLY when sequencing or cross-boundary interfaces are genuinely complex. Phase pipeline (budget gather, expensive plan, budget execution, expensive verification). GATHER: narrow scope first with \`code_search\` (lexical, then semantic when available) and \`web\` search to rule out hypotheses — cheapest, always first. Delegate to \`Explore\` only when search is insufficient: 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: lead owns planning: sequence interfaces, invariants, and acceptance criteria directly. Delegate to \`Plan\` ONLY when sequencing or cross-boundary interfaces are genuinely complex and deserve a dedicated pass; \`Plan\` produces handoff-ready steps (ordered, file:line, done conditions, acceptance criteria) and may consult \`mcp__${peersKey}__oracle\` on unresolved trade-offs and reports any remaining gap to the lead. EXECUTE: lead implements directly by default. Delegate to \`General-Purpose\` FREELY for multi-step work combining investigation, tool workflows, and code changes; brief with outcome, constraints, files in scope, and verification. VERIFY: lead owns verification: run relevant build/tests, read the code, and reproduce before declaring done. Invoke \`reviewer\` ONLY when the change is genuinely behavior-changing, cross-boundary, or risk-sensitive; \`reviewer\` narrows scope with search first and may invoke \`Explore\` for targeted discovery. 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\`; \`reviewer\` may invoke \`Explore\` for targeted discovery; \`Explore\` and \`worker-browse\` cannot invoke native subagents.
3316
-
3317
- ` : `${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";
3280
+ 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; `General-Purpose` for mixed multi-step execution; `reviewer` for behavior-changing or risk-sensitive changes. In plan mode, produce the plan and acceptance criteria directly and do not edit files; before presenting the final plan to the user, consult `advisor` once for a framing check — it is non-binding counsel and you retain decision ownership. Delegation graph: the lead may invoke all three; `General-Purpose` may invoke `reviewer`; `Explore`, `reviewer`, and `worker-browse` cannot invoke native subagents.\n\n" : isBalanced ? `${profileLabel} launch profile. The lead coordinates execution across specialized native roles: ` + buildNativeReachClauses(opts) + ". Lead owns planning, implementation, and verification by default: in plan mode, produce the plan and acceptance criteria directly and do not edit files. Phase pipeline (budget gather, budget execution, expensive verification). GATHER: narrow scope first with `code_search` (lexical, then semantic when available) and `web` search to rule out hypotheses — cheapest, always first. Delegate to `Explore` only when search is insufficient: 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: lead owns planning: sequence interfaces, invariants, and acceptance criteria directly. EXECUTE: lead implements directly by default. Delegate to `General-Purpose` FREELY for multi-step work combining investigation, tool workflows, and code changes; brief with outcome, constraints, files in scope, and verification. VERIFY: lead owns verification: run relevant build/tests, read the code, and reproduce before declaring done. Invoke `reviewer` ONLY when the change is genuinely behavior-changing, cross-boundary, or risk-sensitive; `reviewer` narrows scope with search first and may invoke `Explore` for targeted discovery. 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 three; `General-Purpose` may invoke `reviewer`; `reviewer` may invoke `Explore` for targeted discovery; `Explore` 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";
3318
3281
  const windowNote = isCheapest || isBalanced ? "All roles run at a 200K context window — use targeted reads (search, Grep, Read specific files) over full file reads.\n\n" : isCheap ? "The lead runs at a 200K context window on `-m cheap` (1M on `-m cheap1m`) and every subagent runs at 200K — use targeted reads (search, Grep, Read specific files) over full file reads.\n\n" : "";
3319
- const swePipelineClause = opts.sweEnabled === false ? "" : `${PIPELINE_SKILLS_AWARENESS}\n\n`;
3320
- const consultation = isBalanced ? `Consultation guidance: funnel unknowns cheapest-first. (1) \`code_search\` and \`web\` search narrow scope and rule out hypotheses — always first. (2) \`Explore\` subagents for targeted breadth only when search is insufficient. (3) \`Plan\` ONLY when sequencing or cross-boundary interfaces are genuinely complex. \`mcp__${peersKey}__oracle\` is ${oracleDescriptor}, a second opinion for precise, self-contained architectural/spec trade-offs that search and \`Explore\` (and \`Plan\`, where consulted) cannot settle; available to the lead and \`Plan\`; \`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. Optimize for accuracy, intelligence, and correctness at the lowest cost — prefer direct evidence over delegation when the question is narrow. ` : `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} `;
3282
+ const swePipelineClause = opts.sweEnabled === false ? "" : `${isCheapest || isBalanced ? PIPELINE_SKILLS_AWARENESS_NO_PLAN_AGENT : PIPELINE_SKILLS_AWARENESS}\n\n`;
3283
+ const consultation = isBalanced ? `Consultation guidance: funnel unknowns cheapest-first. (1) \`code_search\` and \`web\` search narrow scope and rule out hypotheses — always first. (2) \`Explore\` subagents for targeted breadth only when search is insufficient. \`mcp__${peersKey}__oracle\` is ${oracleDescriptor}, a second opinion for precise, self-contained architectural/spec trade-offs that search and \`Explore\` cannot settle; available to the lead; \`reviewer\` and other subagents cannot call Oracle. Optimize for accuracy, intelligence, and correctness at the lowest cost — prefer direct evidence over delegation when the question is narrow. ` : `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 ${isCheapest || isBalanced ? "available to the lead" : "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.${isCheapest ? "" : " `Plan` may consult Oracle on unresolved trade-offs, and reports any remaining tie-breaking gap to the lead."}${astraClause} `;
3321
3284
  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 + windowNote + consultation + 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.";
3322
3285
  }
3323
3286
  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.";
@@ -3329,18 +3292,18 @@ ${profileLabel} profile runtime wiring is unavailable. Work directly, use only t
3329
3292
  const OPERATING_DEFAULTS_DIRECTIVE = buildOperatingDefaultsDirective();
3330
3293
  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.";
3331
3294
  function buildOperatingDefaultsDigest(opts = {}) {
3332
- 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";
3295
+ const digestPipelineSentence = opts.sweEnabled === false ? "" : opts.profile === "cheapest" || opts.profile === "balanced" ? "Pipeline skills (all 200K default, native subagents only): `/gh-gather-context` before planning when context is needed, `/gh-plan` before implementation (the lead plans directly on this profile; trivial exits planless, waits for user approval), `/gh-implement` after approval with parallel subagents and conditional reviewer. Skip for trivial work.\n\n" : "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";
3333
3296
  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.";
3334
3297
  if (opts.profile === "fast" || opts.profile === "cheap" || opts.profile === "cheap1m" || opts.profile === "cheapest" || opts.profile === "balanced") {
3335
3298
  const isCheap = opts.profile === "cheap" || opts.profile === "cheap1m";
3336
3299
  const isCheapest = opts.profile === "cheapest";
3337
3300
  const isBalanced = opts.profile === "balanced";
3338
3301
  const profileLabel = isCheapest ? "Cheapest" : isCheap ? "Cheap" : isBalanced ? "Balanced" : "Fast";
3339
- const oracleDescriptor = isCheapest ? "(GPT-6 Sol 200K/high, lead and Plan)" : isCheap || isBalanced ? "(Grok 4.6 200K/medium, lead and Plan)" : "(Opus 5 1M/high, lead and Plan)";
3340
- const advisorDescriptor = isCheapest ? "(Gemini/high, lead-only)" : "(Sol/high, lead-only)";
3302
+ const oracleDescriptor = isCheapest ? "(GPT-6 Sol 200K/high, lead-only)" : isBalanced ? "(Grok 4.6 200K/medium, lead-only)" : isCheap ? "(Grok 4.6 200K/medium, lead and Plan)" : "(Opus 5 1M/high, lead and Plan)";
3303
+ const advisorDescriptor = isCheapest ? "(Sol/medium, lead-only)" : "(Sol/high, lead-only)";
3341
3304
  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).` : ".";
3342
- const delegation = 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` : isBalanced ? `${profileLabel} launch profile. The lead owns planning, implementation, and verification by default: narrow scope first with \`code_search\` and \`web\` search to rule out hypotheses (cheapest, always first); delegate to \`Explore\` in parallel only when search is insufficient (read directly only files you will act on); delegate to \`Plan\` ONLY when sequencing or cross-boundary interfaces are genuinely complex; delegate to \`General-Purpose\` FREELY for multi-step work combining investigation, tool workflows, and code changes; invoke \`reviewer\` ONLY when the change is genuinely behavior-changing, cross-boundary, or risk-sensitive (\`reviewer\` narrows scope with search first and may invoke \`Explore\` for targeted discovery); handle trivial and surgical edits directly. Send independent subagent calls in parallel within a single turn. 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`;
3343
- const consultationLadder = isBalanced ? "Verify claims against real evidence: run relevant commands and tests. Funnel unknowns cheapest-first: (1) `code_search` + `web` search narrow scope and rule out hypotheses first; (2) `Explore` for targeted breadth when search is insufficient; (3) `Plan` only when sequencing or cross-boundary interfaces are genuinely complex; (4) `oracle` " + oracleDescriptor + " as a second opinion for precise, self-contained technical/architectural trade-offs that search, `Explore`, and (where consulted) `Plan` cannot settle. Optimize for accuracy, intelligence, and correctness at the lowest cost." : "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;
3305
+ const delegation = 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, \`General-Purpose\` for mixed multi-step execution, and \`reviewer\` for behavior-changing or risk-sensitive changes. In plan mode, produce the plan and acceptance criteria directly; before presenting the final plan to the user, consult \`advisor\` once for a framing check — non-binding counsel, you retain decision ownership. Handle trivial and surgical edits directly. Stop named teammates when finished.\n\n` : isBalanced ? `${profileLabel} launch profile. The lead owns planning, implementation, and verification by default: narrow scope first with \`code_search\` and \`web\` search to rule out hypotheses (cheapest, always first); delegate to \`Explore\` in parallel only when search is insufficient (read directly only files you will act on); delegate to \`General-Purpose\` FREELY for multi-step work combining investigation, tool workflows, and code changes; invoke \`reviewer\` ONLY when the change is genuinely behavior-changing, cross-boundary, or risk-sensitive (\`reviewer\` narrows scope with search first and may invoke \`Explore\` for targeted discovery); handle trivial and surgical edits directly. Send independent subagent calls in parallel within a single turn. 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`;
3306
+ const consultationLadder = isBalanced ? "Verify claims against real evidence: run relevant commands and tests. Funnel unknowns cheapest-first: (1) `code_search` + `web` search narrow scope and rule out hypotheses first; (2) `Explore` for targeted breadth when search is insufficient; (3) `oracle` " + oracleDescriptor + " as a second opinion for precise, self-contained technical/architectural trade-offs that search and `Explore` cannot settle. Optimize for accuracy, intelligence, and correctness at the lowest cost." : "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;
3344
3307
  const digestWindowNote = isCheapest || isBalanced ? "All roles run at a 200K context window — use targeted reads over full file reads.\n\n" : isCheap ? "The lead runs at 200K on `-m cheap` (1M on `-m cheap1m`) and every subagent runs at 200K — use targeted reads over full file reads.\n\n" : "";
3345
3308
  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" + delegation + digestPipelineSentence + digestWindowNote + consultationLadder;
3346
3309
  }
@@ -3816,14 +3779,16 @@ async function writeInjectedSkill(name, md) {
3816
3779
  * Build the pipeline skills for `--swe` launches on pinned profiles (all
3817
3780
  * 200K default context). The orchestrator (`/gh-swe-pipeline`) runs the
3818
3781
  * other three in strict sequence; the three stages stay individually
3819
- * invokable for users who only want one stage.
3782
+ * invokable for users who only want one stage. Profiles without a `Plan`
3783
+ * role (`cheapest`, `balanced`) get the lead-plans-directly `/gh-plan`
3784
+ * variant.
3820
3785
  */
3821
- function getPipelineSkills(searchEnabled, bluebirdEnabled = false) {
3786
+ function getPipelineSkills(searchEnabled, bluebirdEnabled = false, profile) {
3822
3787
  return [
3823
3788
  buildGatherContextSkill(searchEnabled, bluebirdEnabled),
3824
- buildPlanSkill(searchEnabled || bluebirdEnabled),
3825
- buildImplementSkill(searchEnabled || bluebirdEnabled),
3826
- buildSwePipelineSkill(searchEnabled || bluebirdEnabled)
3789
+ buildPlanSkill(searchEnabled || bluebirdEnabled, profile),
3790
+ buildImplementSkill(searchEnabled || bluebirdEnabled, profile),
3791
+ buildSwePipelineSkill(searchEnabled || bluebirdEnabled, profile)
3827
3792
  ];
3828
3793
  }
3829
3794
  /**
@@ -3850,7 +3815,7 @@ function injectedSkillsForLaunch(selection) {
3850
3815
  const searchEnabled = selection.searchEnabled === true;
3851
3816
  const bluebirdEnabled = selection.bluebirdEnabled === true;
3852
3817
  const allSkills = getInjectedSkills(searchEnabled, bluebirdEnabled);
3853
- const pipelineSkills = getPipelineSkills(searchEnabled, bluebirdEnabled);
3818
+ const pipelineSkills = getPipelineSkills(searchEnabled, bluebirdEnabled, selection.profileId === "cheapest" || selection.profileId === "balanced" ? selection.profileId : void 0);
3854
3819
  if (isPipelineSkillProfile(selection.profileId)) {
3855
3820
  if (!selection.sweEnabled) {
3856
3821
  if (selection.profileId === "max" && selection.firstMateEnabled) return allSkills.filter((skill) => skill.name.startsWith("gh-first-mate"));
@@ -3933,4 +3898,4 @@ async function injectAttributionSuppressionIntoSettingsFile(settingsPath) {
3933
3898
  //#endregion
3934
3899
  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, getInjectedSkills 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 };
3935
3900
 
3936
- //# sourceMappingURL=attribution-settings-Bpa-YTZ5.js.map
3901
+ //# sourceMappingURL=attribution-settings-CeaG4eQa.js.map