github-router 0.3.357 → 0.3.369

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 (124) hide show
  1. package/dist/ado-tools-C0sY_rX1.js +1 -0
  2. package/dist/{aic-ledger-BuFrsGur.js → aic-ledger-_mvGW2Ev.js} +42 -7
  3. package/dist/aic-ledger-_mvGW2Ev.js.map +1 -0
  4. package/dist/{aic-statusline-settings-DBS9sEGC.js → aic-statusline-settings-B5EMMSFC.js} +2 -2
  5. package/dist/{aic-statusline-settings-DBS9sEGC.js.map → aic-statusline-settings-B5EMMSFC.js.map} +1 -1
  6. package/dist/{attribution-settings-D9PxJxkL.js → attribution-settings-zoBxw08y.js} +374 -218
  7. package/dist/attribution-settings-zoBxw08y.js.map +1 -0
  8. package/dist/{auth-DFawaLJU.js → auth-B3UvYB2r.js} +3 -3
  9. package/dist/{auth-DFawaLJU.js.map → auth-B3UvYB2r.js.map} +1 -1
  10. package/dist/{balanced-profile-contract-DtnTIBjL.js → balanced-profile-contract-Dm_usmw7.js} +7 -1
  11. package/dist/{balanced-profile-contract-DtnTIBjL.js.map → balanced-profile-contract-Dm_usmw7.js.map} +1 -1
  12. package/dist/browser-ext/manifest.json +1 -1
  13. package/dist/{check-usage-BkVEl-Su.js → check-usage-45vyaLfl.js} +4 -4
  14. package/dist/{check-usage-BkVEl-Su.js.map → check-usage-45vyaLfl.js.map} +1 -1
  15. package/dist/{claude-BTYQjK-K.js → claude-BbIfnWbm.js} +92 -42
  16. package/dist/claude-BbIfnWbm.js.map +1 -0
  17. package/dist/{claude-md-injection-Cpzolxin.js → claude-md-injection-BtBG1RBZ.js} +153 -37
  18. package/dist/claude-md-injection-BtBG1RBZ.js.map +1 -0
  19. package/dist/{codex-TdsG6C9K.js → codex-CZVlP2tB.js} +7 -7
  20. package/dist/{codex-TdsG6C9K.js.map → codex-CZVlP2tB.js.map} +1 -1
  21. package/dist/{copilot-discount-Bsmv_3OX.js → copilot-discount-BuDbQOHq.js} +2 -2
  22. package/dist/{copilot-discount-Bsmv_3OX.js.map → copilot-discount-BuDbQOHq.js.map} +1 -1
  23. package/dist/{debug-DkNTuErv.js → debug-DL2JsRqY.js} +2 -2
  24. package/dist/{debug-DkNTuErv.js.map → debug-DL2JsRqY.js.map} +1 -1
  25. package/dist/engine-DeIo-VIR.js +1 -0
  26. package/dist/{gate-discovery-NNQg0t0H.js → gate-discovery-BYyYeUnn.js} +5 -5
  27. package/dist/{gate-discovery-NNQg0t0H.js.map → gate-discovery-BYyYeUnn.js.map} +1 -1
  28. package/dist/{get-copilot-usage-P9chc-X2.js → get-copilot-usage-BbGmK03C.js} +2 -2
  29. package/dist/{get-copilot-usage-P9chc-X2.js.map → get-copilot-usage-BbGmK03C.js.map} +1 -1
  30. package/dist/hooks.mjs +262 -117
  31. package/dist/hooks.sha256 +1 -1
  32. package/dist/{index-cmd-BkfYr9FH.js → index-cmd-CjRcmYk3.js} +4 -4
  33. package/dist/{index-cmd-BkfYr9FH.js.map → index-cmd-CjRcmYk3.js.map} +1 -1
  34. package/dist/{internal-aic-status-C6L4-ncP.js → internal-aic-status-BAVomi5A.js} +4 -4
  35. package/dist/{internal-aic-status-C6L4-ncP.js.map → internal-aic-status-BAVomi5A.js.map} +1 -1
  36. package/dist/{internal-artifact-open-DgJ3PCtt.js → internal-artifact-open-NAGn9Mgt.js} +2 -2
  37. package/dist/{internal-artifact-open-DgJ3PCtt.js.map → internal-artifact-open-NAGn9Mgt.js.map} +1 -1
  38. package/dist/{internal-fast-dispatch-guard-CicGz6oM.js → internal-fast-dispatch-guard-De_DJOyZ.js} +1 -1
  39. package/dist/{internal-fast-dispatch-guard-CgBtUsQI.js → internal-fast-dispatch-guard-_n-A8hgo.js} +3 -3
  40. package/dist/{internal-fast-dispatch-guard-CgBtUsQI.js.map → internal-fast-dispatch-guard-_n-A8hgo.js.map} +1 -1
  41. package/dist/{internal-first-mate-guard-DTXPT7JW.js → internal-first-mate-guard-C8GwLbaX.js} +1 -1
  42. package/dist/{internal-first-mate-guard-BfWYN6Jb.js → internal-first-mate-guard-GufCUMl3.js} +3 -3
  43. package/dist/{internal-first-mate-guard-BfWYN6Jb.js.map → internal-first-mate-guard-GufCUMl3.js.map} +1 -1
  44. package/dist/{internal-max-dispatch-guard-mNl9CCir.js → internal-max-dispatch-guard-BB0vwiPx.js} +1 -1
  45. package/dist/{internal-max-dispatch-guard-CY8l9SDw.js → internal-max-dispatch-guard-BodVFHRC.js} +2 -2
  46. package/dist/{internal-max-dispatch-guard-CY8l9SDw.js.map → internal-max-dispatch-guard-BodVFHRC.js.map} +1 -1
  47. package/dist/{internal-plan-review-2OHTs8Nk.js → internal-plan-review-ChFx8wTX.js} +3 -3
  48. package/dist/{internal-plan-review-2OHTs8Nk.js.map → internal-plan-review-ChFx8wTX.js.map} +1 -1
  49. package/dist/{internal-prompt-submit-DZ_-2A6a.js → internal-prompt-submit-B-kKTl-8.js} +2 -2
  50. package/dist/{internal-prompt-submit-CkfUcu34.js → internal-prompt-submit-bi7F7pKk.js} +4 -4
  51. package/dist/{internal-prompt-submit-CkfUcu34.js.map → internal-prompt-submit-bi7F7pKk.js.map} +1 -1
  52. package/dist/{internal-rebrief-EhBHAHsz.js → internal-rebrief-B6ZJS6Mp.js} +4 -4
  53. package/dist/{internal-rebrief-EhBHAHsz.js.map → internal-rebrief-B6ZJS6Mp.js.map} +1 -1
  54. package/dist/{internal-session-bind-Bv50ju2n.js → internal-session-bind-dsUOcKxU.js} +2 -2
  55. package/dist/{internal-session-bind-Bv50ju2n.js.map → internal-session-bind-dsUOcKxU.js.map} +1 -1
  56. package/dist/{internal-stop-hook-Iz8XXE07.js → internal-stop-hook-BbyobGUU.js} +5 -5
  57. package/dist/{internal-stop-hook-Iz8XXE07.js.map → internal-stop-hook-BbyobGUU.js.map} +1 -1
  58. package/dist/{internal-stop-review-K6f8xsCh.js → internal-stop-review-D_KEV_04.js} +2 -2
  59. package/dist/{internal-stop-review-K6f8xsCh.js.map → internal-stop-review-D_KEV_04.js.map} +1 -1
  60. package/dist/{internal-worker-guard-GVhTjVlR.js → internal-worker-guard-DB6shBIn.js} +2 -2
  61. package/dist/{internal-worker-guard-GVhTjVlR.js.map → internal-worker-guard-DB6shBIn.js.map} +1 -1
  62. package/dist/{internal-workspace-header-d2hFf9Jy.js → internal-workspace-header-DBg5Y7oN.js} +2 -2
  63. package/dist/{internal-workspace-header-d2hFf9Jy.js.map → internal-workspace-header-DBg5Y7oN.js.map} +1 -1
  64. package/dist/{lifecycle-C6cxM_Nk.js → lifecycle-9nX09dBl.js} +2 -2
  65. package/dist/{lifecycle-C6cxM_Nk.js.map → lifecycle-9nX09dBl.js.map} +1 -1
  66. package/dist/lifecycle-C_CT13c9.js +1 -0
  67. package/dist/lifecycle-DibiH857.js +1 -0
  68. package/dist/{lifecycle-pl9QpvqD.js → lifecycle-Gge2Dadd.js} +2 -2
  69. package/dist/{lifecycle-pl9QpvqD.js.map → lifecycle-Gge2Dadd.js.map} +1 -1
  70. package/dist/main.js +23 -23
  71. package/dist/{mcp-workspace-header-Su8uUxJg.js → mcp-workspace-header-Xw9B1W6T.js} +2 -2
  72. package/dist/{mcp-workspace-header-Su8uUxJg.js.map → mcp-workspace-header-Xw9B1W6T.js.map} +1 -1
  73. package/dist/{models-D8v8OTbN.js → models-BR6i348u.js} +3 -3
  74. package/dist/{models-D8v8OTbN.js.map → models-BR6i348u.js.map} +1 -1
  75. package/dist/{orchestration-Bov4rZEi.js → orchestration-D3-2ulhX.js} +2 -2
  76. package/dist/{orchestration-Bov4rZEi.js.map → orchestration-D3-2ulhX.js.map} +1 -1
  77. package/dist/{paths-BSI_EtDT.js → paths-C5477RGC.js} +48 -4
  78. package/dist/paths-C5477RGC.js.map +1 -0
  79. package/dist/paths-CEswtFj5.js +1 -0
  80. package/dist/{peer-mcp-personas-GANlrtNR.js → peer-mcp-personas-DNtWI2C1.js} +1139 -398
  81. package/dist/peer-mcp-personas-DNtWI2C1.js.map +1 -0
  82. package/dist/{pi-TKFwPyLA.js → pi-Bc-MVgAo.js} +397 -603
  83. package/dist/pi-Bc-MVgAo.js.map +1 -0
  84. package/dist/{plan-review-hook-CHK1wL3-.js → plan-review-hook-C9K-em4D.js} +3 -3
  85. package/dist/{plan-review-hook-CHK1wL3-.js.map → plan-review-hook-C9K-em4D.js.map} +1 -1
  86. package/dist/{provision-BNN6yRk8.js → provision-DUWdcY_a.js} +5 -5
  87. package/dist/{provision-BNN6yRk8.js.map → provision-DUWdcY_a.js.map} +1 -1
  88. package/dist/{self-invocation-Dk_UHD_v.js → self-invocation-BtcGj-lY.js} +2 -2
  89. package/dist/{self-invocation-Dk_UHD_v.js.map → self-invocation-BtcGj-lY.js.map} +1 -1
  90. package/dist/{serve-BaeLm9Um.js → serve-CmWOTR7m.js} +14 -14
  91. package/dist/{serve-BaeLm9Um.js.map → serve-CmWOTR7m.js.map} +1 -1
  92. package/dist/{server-setup-BcUQv5ac.js → server-setup-CIzmDJzT.js} +848 -103
  93. package/dist/server-setup-CIzmDJzT.js.map +1 -0
  94. package/dist/{service-backend-DHyd9vjW.js → service-backend-B6D_DY1Z.js} +3 -3
  95. package/dist/{service-backend-DHyd9vjW.js.map → service-backend-B6D_DY1Z.js.map} +1 -1
  96. package/dist/{start-BdoGJc36.js → start-rlpaeAtx.js} +4 -4
  97. package/dist/{start-BdoGJc36.js.map → start-rlpaeAtx.js.map} +1 -1
  98. package/dist/state-CiwCLVDZ.js.map +1 -1
  99. package/dist/{static-context-pack-dKrzbfIN.js → static-context-pack-DvwLWlbe.js} +371 -64
  100. package/dist/static-context-pack-DvwLWlbe.js.map +1 -0
  101. package/dist/{stop-gate-hook-CC7VWkZM.js → stop-gate-hook-DnLC09Lg.js} +3 -3
  102. package/dist/{stop-gate-hook-CC7VWkZM.js.map → stop-gate-hook-DnLC09Lg.js.map} +1 -1
  103. package/dist/{stop-gate-policy-CoR8xKNQ.js → stop-gate-policy-Dx9c98_d.js} +2 -2
  104. package/dist/{stop-gate-policy-CoR8xKNQ.js.map → stop-gate-policy-Dx9c98_d.js.map} +1 -1
  105. package/dist/{token-CA2s70qj.js → token-OTb61rOC.js} +2 -2
  106. package/dist/{token-CA2s70qj.js.map → token-OTb61rOC.js.map} +1 -1
  107. package/dist/{worker-dispatch-B_rriT7z.js → worker-dispatch-B1w2qfjX.js} +2 -2
  108. package/dist/{worker-dispatch-B_rriT7z.js.map → worker-dispatch-B1w2qfjX.js.map} +1 -1
  109. package/docs/azure-mcp.md +29 -31
  110. package/package.json +1 -1
  111. package/dist/ado-tools-DqLJ-u19.js +0 -1
  112. package/dist/aic-ledger-BuFrsGur.js.map +0 -1
  113. package/dist/attribution-settings-D9PxJxkL.js.map +0 -1
  114. package/dist/claude-BTYQjK-K.js.map +0 -1
  115. package/dist/claude-md-injection-Cpzolxin.js.map +0 -1
  116. package/dist/engine-CmhUwYI5.js +0 -1
  117. package/dist/lifecycle-BU_d2QMs.js +0 -1
  118. package/dist/lifecycle-ByFyew_w.js +0 -1
  119. package/dist/paths-BSI_EtDT.js.map +0 -1
  120. package/dist/paths-BYxX9DfA.js +0 -1
  121. package/dist/peer-mcp-personas-GANlrtNR.js.map +0 -1
  122. package/dist/pi-TKFwPyLA.js.map +0 -1
  123. package/dist/server-setup-BcUQv5ac.js.map +0 -1
  124. package/dist/static-context-pack-dKrzbfIN.js.map +0 -1
@@ -1,15 +1,15 @@
1
- import { f as writeRuntimeFileSecure, t as PATHS } from "./paths-BSI_EtDT.js";
2
- import { C as CHEAP_REVIEWER_ALIAS_ID, S as CHEAP_PLAN_ALIAS_ID, T as MAX_BROWSE_LOW_ALIAS_ID, _ as CHEAPEST_EXPLORE_ALIAS_ID, b as CHEAP_EXPLORE_ALIAS_ID, g as BROWSE_LOW_ALIAS_ID, h as BALANCED_REVIEWER_ALIAS_ID, m as BALANCED_GENERAL_PURPOSE_ALIAS_ID, p as BALANCED_EXPLORE_ALIAS_ID, v as CHEAPEST_GENERAL_PURPOSE_ALIAS_ID, w as LUNA_SCOUT_ALIAS_ID, x as CHEAP_GENERAL_PURPOSE_ALIAS_ID, y as CHEAPEST_REVIEWER_ALIAS_ID } from "./server-setup-BcUQv5ac.js";
1
+ import { p as writeRuntimeFileSecure, t as PATHS } from "./paths-C5477RGC.js";
2
+ import { A as CHEAP_EXPLORE_ALIAS_ID, C as BALANCED_EXPLORE_ALIAS_ID, D as CHEAPEST_EXPLORE_ALIAS_ID, E as BROWSE_LOW_ALIAS_ID, F as MAX_BROWSE_LOW_ALIAS_ID, M as CHEAP_PLAN_ALIAS_ID, N as CHEAP_REVIEWER_ALIAS_ID, O as CHEAPEST_GENERAL_PURPOSE_ALIAS_ID, P as LUNA_SCOUT_ALIAS_ID, T as BALANCED_REVIEWER_ALIAS_ID, j as CHEAP_GENERAL_PURPOSE_ALIAS_ID, k as CHEAPEST_REVIEWER_ALIAS_ID, w as BALANCED_GENERAL_PURPOSE_ALIAS_ID } from "./server-setup-CIzmDJzT.js";
3
3
  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-JOnZBgFB.js";
4
- import { Hn as withOneMSuffix, Kn as CHEAP_PROFILE_NATIVE_AGENT_NAMES, Vn as oneMContextDisabled, _n as CONDENSED_OPERATING_SEQUENCE, a as buildAgentPrompt, l as maxPersonasFor, n as MCP_GROUPS, qn as CHEAP_PROFILE_NATIVE_EFFORTS, t as GROUP_META, u as personasFor, vn as DEFINITION_OF_GREATNESS } from "./peer-mcp-personas-GANlrtNR.js";
5
- import { O as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, _ as isBalancedFamily, k as CHEAPEST_PROFILE_NATIVE_EFFORTS, v as isCheapestFamily } from "./static-context-pack-dKrzbfIN.js";
6
- import { a as BALANCED_PROFILE_NATIVE_EFFORTS, i as BALANCED_PROFILE_NATIVE_AGENT_NAMES } from "./balanced-profile-contract-DtnTIBjL.js";
4
+ import { An as DEFINITION_OF_GREATNESS, Fn as LOCAL_CONSULT_REDACTION_LINE, a as buildAgentPrompt, ar as CHEAP_PROFILE_NATIVE_AGENT_NAMES, er as oneMContextDisabled, kn as CONDENSED_OPERATING_SEQUENCE, l as maxPersonasFor, n as MCP_GROUPS, or as CHEAP_PROFILE_NATIVE_EFFORTS, t as GROUP_META, tr as withOneMSuffix, u as personasFor } from "./peer-mcp-personas-DNtWI2C1.js";
5
+ import { E as LOCAL_PROFILE_NATIVE_MODELS, F as CHEAPEST_PROFILE_NATIVE_AGENT_NAMES, I as CHEAPEST_PROFILE_NATIVE_EFFORTS, T as LOCAL_PROFILE_NATIVE_AGENT_NAMES, _ as isCheapestFamily, g as isBalancedFamily, y as isLocalFamily } from "./static-context-pack-DvwLWlbe.js";
6
+ import { a as BALANCED_PROFILE_NATIVE_EFFORTS, i as BALANCED_PROFILE_NATIVE_AGENT_NAMES } from "./balanced-profile-contract-Dm_usmw7.js";
7
7
  import { 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-Cx5_Z1Y7.js";
8
- import "./self-invocation-Dk_UHD_v.js";
9
- import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-BNN6yRk8.js";
10
- import { n as buildWorkspaceHeaderHelperCommand } from "./mcp-workspace-header-Su8uUxJg.js";
11
- import { a as dispatcherAgentName, c as dispatcherTools, n as activeDispatchModes, o as dispatcherDescription, s as dispatcherPrompt } from "./worker-dispatch-B_rriT7z.js";
12
- import { o as isUnderClaudeConfigMirrorRealpath, u as renameWithRetry } from "./claude-md-injection-Cpzolxin.js";
8
+ import "./self-invocation-BtcGj-lY.js";
9
+ import { a as STRIPPED_AUTH_ROUTING_ENV_KEYS, n as buildCodexProviderConfigFlags } from "./provision-DUWdcY_a.js";
10
+ import { n as buildWorkspaceHeaderHelperCommand } from "./mcp-workspace-header-Xw9B1W6T.js";
11
+ import { a as dispatcherAgentName, c as dispatcherTools, n as activeDispatchModes, o as dispatcherDescription, s as dispatcherPrompt } from "./worker-dispatch-B1w2qfjX.js";
12
+ import { o as isUnderClaudeConfigMirrorRealpath, u as renameWithRetry } from "./claude-md-injection-BtBG1RBZ.js";
13
13
  import consola from "consola";
14
14
  import path from "node:path";
15
15
  import { randomBytes } from "node:crypto";
@@ -464,23 +464,56 @@ Open questions: any unresolved trade-off, as options with a recommendation. Omit
464
464
  ` + (opts.is200K ? PROMPT_200K_NOTE : "") + readOnlyToolSteer(opts.semanticAvailable);
465
465
  }
466
466
  const GENERAL_PURPOSE_DESC_TAIL = "Drives to a verified end state with changed files and evidence. Do not use for pure discovery (use Explore) or verification-only (use reviewer).";
467
- function pinnedGeneralPurposeDescription(explicit, isBalanced = false, is200K = false) {
468
- return (explicit ? isBalanced ? "Autonomous multi-step execution agent. Use proactively and FREELY for open-ended or mixed tasks combining investigation, tool workflows, and code changes where the approach emerges during work. Follows a Plan handoff when one exists and otherwise investigates before acting. " : "Autonomous multi-step execution agent. Use proactively for open-ended or mixed tasks combining investigation, tool workflows, and code changes where the approach emerges during work. Follows a Plan handoff when one exists and otherwise investigates before acting. " : "Autonomous multi-step execution agent for open-ended or mixed tasks combining investigation, tool workflows, and code changes where the approach emerges during work. ") + GENERAL_PURPOSE_DESC_TAIL + (is200K ? DESC_200K_NOTE : "");
467
+ function pinnedGeneralPurposeDescription(explicit, isBalanced = false, is200K = false, planAgent = true) {
468
+ const planClause = planAgent ? " Follows a Plan handoff when one exists and otherwise investigates before acting." : " Investigates before acting when the lead has not already supplied a plan.";
469
+ return (explicit ? isBalanced ? "Autonomous multi-step execution agent. Use proactively and FREELY for open-ended or mixed tasks combining investigation, tool workflows, and code changes where the approach emerges during work." + planClause + " " : "Autonomous multi-step execution agent. Use proactively for open-ended or mixed tasks combining investigation, tool workflows, and code changes where the approach emerges during work." + planClause + " " : "Autonomous multi-step execution agent for open-ended or mixed tasks combining investigation, tool workflows, and code changes where the approach emerges during work. ") + GENERAL_PURPOSE_DESC_TAIL + (is200K ? DESC_200K_NOTE : "");
469
470
  }
470
471
  function pinnedGeneralPurposePrompt(opts) {
471
- return "You are an autonomous execution specialist for mixed, multi-step work. Your mission is to take an open-ended task from investigation through implementation to a verified end state within this turn. Keep going until the task is genuinely done. Do not stop at a diagnosis, a partial fix, or a plan when the request asked for a change. Ground discovery in repository truth. For low-risk ambiguities, choose the interpretation most consistent with the repository, proceed, and record it as an assumption in your report. For material intent gaps that would alter product behavior or security, surface concrete options and a recommendation to the lead. When a Plan handoff exists, follow its ordered steps and acceptance criteria; do not rediscover what the plan already settled — read the critical files it names, execute each step's done condition, and report any step whose premise proves wrong instead of silently replanning. Investigate before you act. Confirm your assumptions against the actual code rather than against the request's description of it. After every command, read the real output and let it decide the next step. When something fails, diagnose the specific cause before trying again. If repeated attempts fail for the same reason and no new information has emerged, stop retrying: re-examine the underlying assumption and take a different path. Escalate rather than expand. If the task turns out to require a change the lead did not sanction, complete the sanctioned part and report the rest as a recommendation. If the task collapses to pure discovery or a single settled edit, do that slice and report the remainder as a recommendation. Do not expand scope. Match the conventions, structure, and test style already present in the files you touch. The lead owns final integration. Verify before you report. Run the builds, linters, or test commands relevant to what you changed. Quote the command run, exit status, and concise decisive output verbatim; if output is long, summarize the middle and quote the pass/fail lines. Report your changes and test output directly to the caller. Post-integration review is owned by the lead. Return a self-contained result the lead can act on immediately.\n\nReturn format:\nOutcome: what is now true, and whether the task is complete.\nActions taken: what you did, in order.\nChanged files: each as file:line, with a one-line description of the change.\nVerification: the commands you ran, exit status, and decisive output.\nAssumptions: every interpretation you had to choose.\nRemaining items: anything deliberately not done, and why.\n\n" + (opts?.is200K ? PROMPT_200K_NOTE : "") + fileToolSteer("builds");
472
+ return "You are an autonomous execution specialist for mixed, multi-step work. Your mission is to take an open-ended task from investigation through implementation to a verified end state within this turn. Keep going until the task is genuinely done. Do not stop at a diagnosis, a partial fix, or a plan when the request asked for a change. Ground discovery in repository truth. For low-risk ambiguities, choose the interpretation most consistent with the repository, proceed, and record it as an assumption in your report. For material intent gaps that would alter product behavior or security, surface concrete options and a recommendation to the lead. " + (opts?.planAgent === false ? "When the lead hands you a plan, follow its ordered steps and acceptance criteria; do not rediscover what the plan already settled — read the critical files it names, execute each step's done condition, and report any step whose premise proves wrong instead of silently replanning. " : "When a Plan handoff exists, follow its ordered steps and acceptance criteria; do not rediscover what the plan already settled — read the critical files it names, execute each step's done condition, and report any step whose premise proves wrong instead of silently replanning. ") + "Investigate before you act. Confirm your assumptions against the actual code rather than against the request's description of it. After every command, read the real output and let it decide the next step. When something fails, diagnose the specific cause before trying again. If repeated attempts fail for the same reason and no new information has emerged, stop retrying: re-examine the underlying assumption and take a different path. Escalate rather than expand. If the task turns out to require a change the lead did not sanction, complete the sanctioned part and report the rest as a recommendation. If the task collapses to pure discovery or a single settled edit, do that slice and report the remainder as a recommendation. Do not expand scope. Match the conventions, structure, and test style already present in the files you touch. The lead owns final integration. Verify before you report. Run the builds, linters, or test commands relevant to what you changed. Quote the command run, exit status, and concise decisive output verbatim; if output is long, summarize the middle and quote the pass/fail lines. Report your changes and test output directly to the caller. Post-integration review is owned by the lead. Return a self-contained result the lead can act on immediately.\n\nReturn format:\nOutcome: what is now true, and whether the task is complete.\nActions taken: what you did, in order.\nChanged files: each as file:line, with a one-line description of the change.\nVerification: the commands you ran, exit status, and decisive output.\nAssumptions: every interpretation you had to choose.\nRemaining items: anything deliberately not done, and why.\n\n" + (opts?.is200K ? PROMPT_200K_NOTE : "") + fileToolSteer("builds");
472
473
  }
473
474
  const REVIEWER_DESC_TAIL = "Runs builds/tests itself rather than assuming them. Returns SHIP / FIX / BLOCK with reproducible evidence. Never edits source.";
474
- function pinnedReviewerDescription(explicit, isBalanced = false, is200K = false, protegeAdvisor = false) {
475
- return (explicit ? isBalanced ? "Adversarial evidence-based reviewer. Use proactively ONLY when the change is genuinely behavior-changing, cross-boundary, or risk-sensitive, before done. The lead owns verification by default. " : "Adversarial evidence-based reviewer. Use proactively post-integration after behavior-changing, cross-boundary, or risk-sensitive changes, before done. " : "Adversarial evidence-based reviewer for behavior-changing, cross-boundary, or risk-sensitive changes. ") + REVIEWER_DESC_TAIL + (is200K ? DESC_200K_NOTE : "") + (protegeAdvisor ? " May consult its Sol advisor (at most 5 advisor rounds per review) on consequential uncertainty it cannot settle by evidence." : "");
475
+ function pinnedReviewerDescription(explicit, isBalanced = false, is200K = false, advisorKind) {
476
+ const head = explicit ? isBalanced ? "Adversarial evidence-based reviewer. Use proactively ONLY when the change is genuinely behavior-changing, cross-boundary, or risk-sensitive, before done. The lead owns verification by default. " : "Adversarial evidence-based reviewer. Use proactively post-integration after behavior-changing, cross-boundary, or risk-sensitive changes, before done. " : "Adversarial evidence-based reviewer for behavior-changing, cross-boundary, or risk-sensitive changes. ";
477
+ const consultant = advisorKind === "local-endpoint" ? "advisor" : "Sol advisor";
478
+ return head + REVIEWER_DESC_TAIL + (is200K ? DESC_200K_NOTE : "") + (advisorKind ? ` May consult its ${consultant} (at most 5 advisor rounds per review) on consequential uncertainty it cannot settle by evidence.` : "");
476
479
  }
477
- /** Protege appendix for the cheapest Luna/max reviewer: the capped Sol-advisor
480
+ /** Protege appendix for the cheapest reviewer: the capped Sol-advisor
478
481
  * protocol. Appended after the delegation paragraph so the adversarial core
479
- * above stays byte-identical across profiles. */
480
- const PROTEGE_ADVISOR_APPENDIX = "You have an `advisor` tool backed by Sol, a stronger cross-lab model that sees your full transcript. You own the verdict; the advisor is counsel, never authority — it never approves, vetoes, or decides for you. Budget: at most 5 advisor rounds per review (code-enforced; one round is one back-and-forth exchange). Spend them only on consequential uncertainty that repository evidence, builds, or tests cannot settle: a changed assumption, conflicting evidence, an approach that will not converge, or a severity call with merge-blocking consequences. Every consult must state the precise question, your evidence so far with file:line citations, the credible alternatives, and what evidence would change your verdict. Never consult for routine verification, progress narration, reassurance, or completion ritual — run the check yourself. If the advisor disagrees with you, evaluate on the merits: adopt what is right with a one-line reason, defend what is verified with evidence, and record the disagreement in your result. ";
482
+ * above stays byte-identical across profiles.
483
+ *
484
+ * `framing` is the complete noun phrase describing the consultant, from its
485
+ * identity (or the absence of one) through what it sees. One parameter rather
486
+ * than a model name plus a predicate, because the variants differ in both: a
487
+ * Copilot-served lead can be told the consultant is Sol and stronger
488
+ * cross-lab, a `local` launch bills an endpoint whose model the proxy knows
489
+ * nothing about so the only claim it can make is who serves it, and
490
+ * `cheaplocal` names no model at all. Same builder, so the behavioural
491
+ * contract cannot drift between them.
492
+ *
493
+ * All framings describe the curated transport, not a full transcript: the
494
+ * reviewer's consult is rendered by the curated path (24K transcript budget,
495
+ * tool-aware, layered under `<operator_focus>` / `<caller_context>`), so
496
+ * promising the whole transcript would overstate what the advisor sees.
497
+ *
498
+ * `redact` carries the caller half of the redaction contract to the one
499
+ * framing whose brief leaves Copilot for an endpoint the operator runs. It is
500
+ * a boolean rather than part of `framing` because it describes the transport,
501
+ * not the consultant: the same endpoint-backed reviewer would need it whether
502
+ * or not the profile names a model. */
503
+ function buildProtegeAdvisorAppendix(framing, redact = false) {
504
+ return "You have an `advisor` tool backed by " + framing + ". You own the verdict; the advisor is counsel, never authority — it never approves, vetoes, or decides for you. Budget: at most 5 advisor rounds per review (code-enforced; one round is one back-and-forth exchange). Spend them only on consequential uncertainty that repository evidence, builds, or tests cannot settle: a changed assumption, conflicting evidence, an approach that will not converge, or a severity call with merge-blocking consequences. Every consult must state the precise question, your evidence so far with file:line citations, the credible alternatives, and what evidence would change your verdict. " + (redact ? LOCAL_CONSULT_REDACTION_LINE + " " : "") + "Never consult for routine verification, progress narration, reassurance, or completion ritual — run the check yourself. If the advisor disagrees with you, evaluate on the merits: adopt what is right with a one-line reason, defend what is verified with evidence, and record the disagreement in your result. ";
505
+ }
506
+ /** The appendix per consultant kind. Indexed rather than branched at the two
507
+ * call sites so a new kind cannot be reachable from `pinnedReviewerPrompt`
508
+ * without its prose existing. */
509
+ const PROTEGE_APPENDICES = {
510
+ sol: buildProtegeAdvisorAppendix("Sol, a stronger cross-lab model that sees the ask, the brief you write, and a bounded transcript"),
511
+ "copilot-served": buildProtegeAdvisorAppendix("a Copilot-served model that sees the ask, the brief you write, and a bounded transcript"),
512
+ "local-endpoint": buildProtegeAdvisorAppendix("a model on your local endpoint that sees the ask, the brief you write, and a bounded transcript", true)
513
+ };
481
514
  function pinnedReviewerPrompt(semanticAvailable = true, opts) {
482
515
  const delegation = opts?.allowExploreDelegation === true ? "Do not modify source code. Scope first with search, then delegate: use code search (lexical, then semantic when available) and web search to narrow scope and rule out hypotheses before delegating — cheapest, always first. When search is insufficient, delegate targeted discovery to `Explore`: launch one or more `Explore` subagents in parallel with scoped evidence questions (call chains, config patterns, test conventions, boundary conditions) and let them return file:line conclusions; do not sweep the repository yourself. You may invoke only `Explore`; do not invoke any other subagent. You may run build, test, and read-only inspection commands; do not run commands that alter tracked source files or touch remote infrastructure (transient build cache or test runner side effects are expected). " : "Do not modify source code and do not delegate to other agents. You may run build, test, and read-only inspection commands; do not run commands that alter tracked source files or touch remote infrastructure (transient build cache or test runner side effects are expected). ";
483
- const protege = opts?.protegeAdvisor === true ? PROTEGE_ADVISOR_APPENDIX : "";
516
+ const protege = opts?.advisorKind ? PROTEGE_APPENDICES[opts.advisorKind] : "";
484
517
  return "You are an adversarial code reviewer. Your job is not to confirm that the change works. Your job is to find the conditions under which it does not. Think carefully about the plausible failure modes of this change before you start running commands, so that what you run is chosen to expose them. Read before you judge. Inspect the changed files and relevant surrounding context, callers of affected call sites, and tests that claim to cover the change, sized to the identified risks of the change. Then verify by execution. Run the builds, linters, or test suites relevant to what changed, and any command that would surface the specific failure you suspect. Verification means output you observed. Never state that something passes, compiles, or is covered unless you ran it and read the result; where you could not run something, say so explicitly rather than inferring the outcome. Probe deliberately: boundary and empty inputs, error and early-return paths, concurrency and ordering, resource acquisition and cleanup on the failure path, partial failure and retry, backward compatibility of any changed interface, handling of untrusted input, and whether the new tests would actually fail if the change were reverted. Judge against the bar the repository already holds itself to, not an abstract ideal. Do not soften a real finding, and do not manufacture findings to appear thorough. If the change is correct and verified, say so. " + delegation + protege + "Return a self-contained result the lead can act on immediately.\n\nReturn format. Line one must be exactly one of:\nVERDICT: SHIP\nVERDICT: FIX\nVERDICT: BLOCK\n\nSHIP means you found no blocking defect and your verification ran clean. FIX means the approach is sound but specific defects must be corrected. BLOCK means the approach itself is wrong, or verification could not be run at all.\n\nThen, using the repository's severity taxonomy:\nCritical: blocking defects (correctness, security, data loss). Each with file:line, the concrete scenario in which it fails, and how you confirmed it.\nImportant: non-blocking issues that should be fixed before shipping. Each with file:line and impact.\nSuggestion: non-blocking improvements or stylistic suggestions.\nEvidence: the commands you ran, exit status, and decisive output.\nUnverified surface: what you could not exercise, and why.\n\n" + (opts?.is200K ? PROMPT_200K_NOTE : "") + reviewerToolSteer(semanticAvailable);
485
518
  }
486
519
  /** Build the literal `-m fast` native roster. This is intentionally separate
@@ -686,6 +719,7 @@ function buildCheapestProfileAgentDefinitions(opts) {
686
719
  const generalModel = CHEAPEST_GENERAL_PURPOSE_ALIAS_ID;
687
720
  const reviewerModel = CHEAPEST_REVIEWER_ALIAS_ID;
688
721
  const semanticAvailable = opts.semanticSearchAvailable === true;
722
+ const advisorKind = opts.cheaplocalProfile ? "local-endpoint" : "sol";
689
723
  const searchKey = opts.groupKeys.search ?? GROUP_META.search.preferredKey;
690
724
  const searchMcpServers = opts.serverUrl ? { [searchKey]: httpEntryFor(opts.serverUrl, "search", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
691
725
  const readSearchTools = [
@@ -713,17 +747,20 @@ function buildCheapestProfileAgentDefinitions(opts) {
713
747
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
714
748
  },
715
749
  "General-Purpose": {
716
- description: pinnedGeneralPurposeDescription(false, false, true),
717
- prompt: pinnedGeneralPurposePrompt({ is200K: true }),
750
+ description: pinnedGeneralPurposeDescription(false, false, true, false),
751
+ prompt: pinnedGeneralPurposePrompt({
752
+ is200K: true,
753
+ planAgent: false
754
+ }),
718
755
  model: generalModel,
719
756
  effort: effort("General-Purpose"),
720
757
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
721
758
  },
722
759
  reviewer: {
723
- description: pinnedReviewerDescription(false, false, true, true),
760
+ description: pinnedReviewerDescription(false, false, true, advisorKind),
724
761
  prompt: pinnedReviewerPrompt(semanticAvailable, {
725
762
  is200K: true,
726
- protegeAdvisor: true
763
+ advisorKind
727
764
  }),
728
765
  model: reviewerModel,
729
766
  effort: effort("reviewer"),
@@ -746,6 +783,90 @@ function buildCheapestProfileAgentDefinitions(opts) {
746
783
  for (const name of Object.keys(out)) if (name !== "worker-browse" && !roster.has(name)) delete out[name];
747
784
  return out;
748
785
  }
786
+ /**
787
+ * Build the literal `-m local` / `-m local2` native roster.
788
+ *
789
+ * The cheapest surface with the cheapest prompts, differing in exactly one
790
+ * dimension: every role's `model:` is the LOCAL endpoint's own tier id
791
+ * (`haiku` / `sonnet` / `opus`) instead of a router-owned alias. Those ids
792
+ * resolve back to themselves through the `ANTHROPIC_DEFAULT_*_MODEL` tier rows
793
+ * the launcher seeds, so Claude Code neither catalog-resolves them nor
794
+ * upgrades their accounting, and the local server receives the id it
795
+ * advertises.
796
+ *
797
+ * Deliberately NOT run through `MODEL_ALIAS_TABLE`: that table exists so
798
+ * Claude Code will not `[1m]`-upgrade a REAL catalog id, and a local tier id is
799
+ * not a catalog id at all.
800
+ *
801
+ * The one prompt deviation from cheapest is the reviewer's optional protege
802
+ * appendix, which names an `advisor` tool. It is emitted only when the launch
803
+ * actually has an Advisor (`local2`): naming a tool that does not exist is the
804
+ * failure mode the droppable-agent rule exists to prevent.
805
+ *
806
+ * Unlike cheapest, this roster never includes `worker-browse`, even when browse
807
+ * is enabled. `worker-browse` is a Pi worker and a worker answers on a Copilot
808
+ * model, which is the one thing these profiles forbid a subagent to do. The
809
+ * browser CAPABILITY does not depend on it: the `browser` group's own
810
+ * `browser_*` tools are model-free and are published on both profiles.
811
+ */
812
+ function buildLocalProfileAgentDefinitions(opts) {
813
+ const exploreModel = opts.localExploreModel ?? LOCAL_PROFILE_NATIVE_MODELS.Explore;
814
+ const generalModel = opts.localGeneralPurposeModel ?? LOCAL_PROFILE_NATIVE_MODELS["General-Purpose"];
815
+ const reviewerModel = opts.localReviewerModel ?? LOCAL_PROFILE_NATIVE_MODELS.reviewer;
816
+ const semanticAvailable = opts.semanticSearchAvailable === true;
817
+ const protegeAdvisor = opts.advisorAvailable === true;
818
+ const searchKey = opts.groupKeys.search ?? GROUP_META.search.preferredKey;
819
+ const searchMcpServers = opts.serverUrl ? { [searchKey]: httpEntryFor(opts.serverUrl, "search", opts.nonce, opts.workspaceHeaderCmd) } : void 0;
820
+ const readSearchTools = [
821
+ "Read",
822
+ "Grep",
823
+ "Glob",
824
+ "Bash",
825
+ "WebFetch",
826
+ "WebSearch",
827
+ `mcp__${searchKey}__*`
828
+ ];
829
+ const effort = (name) => CHEAPEST_PROFILE_NATIVE_EFFORTS[name];
830
+ const out = {
831
+ Explore: {
832
+ description: pinnedExploreDescription(false, true),
833
+ prompt: pinnedExplorePrompt({
834
+ explicit: false,
835
+ semanticAvailable,
836
+ is200K: true,
837
+ bluebirdEnabled: opts.bluebirdEnabled
838
+ }),
839
+ tools: readSearchTools,
840
+ model: exploreModel,
841
+ effort: effort("Explore"),
842
+ ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
843
+ },
844
+ "General-Purpose": {
845
+ description: pinnedGeneralPurposeDescription(false, false, true, false),
846
+ prompt: pinnedGeneralPurposePrompt({
847
+ is200K: true,
848
+ planAgent: false
849
+ }),
850
+ model: generalModel,
851
+ effort: effort("General-Purpose"),
852
+ ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
853
+ },
854
+ reviewer: {
855
+ description: pinnedReviewerDescription(false, false, true, protegeAdvisor ? "copilot-served" : void 0),
856
+ prompt: pinnedReviewerPrompt(semanticAvailable, {
857
+ is200K: true,
858
+ advisorKind: protegeAdvisor ? "copilot-served" : void 0
859
+ }),
860
+ model: reviewerModel,
861
+ effort: effort("reviewer"),
862
+ tools: readSearchTools,
863
+ ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
864
+ }
865
+ };
866
+ const roster = opts.nativeRoster == null ? new Set(LOCAL_PROFILE_NATIVE_AGENT_NAMES) : opts.nativeRoster instanceof Set ? opts.nativeRoster : new Set(opts.nativeRoster);
867
+ for (const name of Object.keys(out)) if (!roster.has(name)) delete out[name];
868
+ return out;
869
+ }
749
870
  /** Build the literal `-m balanced` native roster. Three-agent surface
750
871
  * (`Explore`, `General-Purpose`, `reviewer` — no `Plan`: the lead owns
751
872
  * planning directly), Sol-led at the 200K default window for the most
@@ -792,8 +913,11 @@ function buildBalancedProfileAgentDefinitions(opts) {
792
913
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
793
914
  },
794
915
  "General-Purpose": {
795
- description: pinnedGeneralPurposeDescription(true, true, true),
796
- prompt: pinnedGeneralPurposePrompt({ is200K: true }),
916
+ description: pinnedGeneralPurposeDescription(true, true, true, false),
917
+ prompt: pinnedGeneralPurposePrompt({
918
+ is200K: true,
919
+ planAgent: false
920
+ }),
797
921
  model: generalModel,
798
922
  effort: effort("General-Purpose"),
799
923
  ...searchMcpServers ? { mcpServers: searchMcpServers } : {}
@@ -840,6 +964,7 @@ function buildPeerAgentDefinitions(opts) {
840
964
  if (opts.cheapProfile) return buildCheapProfileAgentDefinitions(opts);
841
965
  if (opts.cheapestProfile) return buildCheapestProfileAgentDefinitions(opts);
842
966
  if (opts.balancedProfile) return buildBalancedProfileAgentDefinitions(opts);
967
+ if (opts.localProfile) return buildLocalProfileAgentDefinitions(opts);
843
968
  const out = {};
844
969
  const personas = personasFor({
845
970
  codexCli: opts.codexCli,
@@ -1296,6 +1421,11 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
1296
1421
  balancedExploreModel: opts.balancedExploreModel,
1297
1422
  balancedGeneralPurposeModel: opts.balancedGeneralPurposeModel,
1298
1423
  balancedReviewerModel: opts.balancedReviewerModel,
1424
+ localExploreModel: opts.localExploreModel,
1425
+ localGeneralPurposeModel: opts.localGeneralPurposeModel,
1426
+ localReviewerModel: opts.localReviewerModel,
1427
+ localProfile: opts.localProfile,
1428
+ advisorAvailable: opts.advisorAvailable,
1299
1429
  semanticSearchAvailable: opts.semanticSearchAvailable,
1300
1430
  bluebirdEnabled: opts.bluebirdEnabled,
1301
1431
  nativeRoster: opts.nativeRoster,
@@ -1307,6 +1437,7 @@ async function writePeerMcpRuntimeFiles(serverUrl, opts) {
1307
1437
  fastProfile: opts.fastProfile,
1308
1438
  cheapProfile: opts.cheapProfile,
1309
1439
  cheapestProfile: opts.cheapestProfile,
1440
+ cheaplocalProfile: opts.cheaplocalProfile,
1310
1441
  balancedProfile: opts.balancedProfile,
1311
1442
  implementerEffort: opts.implementerEffort,
1312
1443
  reviewerEffort: opts.reviewerEffort,
@@ -2074,9 +2205,195 @@ Return a compact final checkpoint:
2074
2205
  };
2075
2206
  }
2076
2207
  //#endregion
2208
+ //#region src/lib/injected-skills/plan-skill.ts
2209
+ /**
2210
+ * Whether the profile roster includes an `implementer` native.
2211
+ *
2212
+ * Only the standard, fast and max rosters emit one, and none of those profiles
2213
+ * receives the pipeline skills. Every member of `PlanSkillProfile` is a
2214
+ * cheap/balanced/local family launch whose roster is Explore,
2215
+ * General-Purpose and reviewer, so naming `implementer` there would point the
2216
+ * model at an agent the launch does not have. A profile-less call is the
2217
+ * legacy standalone builder, where the max-conditional wording still applies.
2218
+ */
2219
+ function rosterEmitsImplementer(profile) {
2220
+ return profile === void 0;
2221
+ }
2222
+ function buildPlanSkill(_searchEnabled, profile) {
2223
+ const leadPlansDirectly = isCheapestFamily(profile) || isBalancedFamily(profile) || isLocalFamily(profile);
2224
+ const planningMeans = leadPlansDirectly ? "the lead plans directly (no separate planning subagent exists on this roster)" : "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)";
2225
+ const downstreamAgent = rosterEmitsImplementer(profile) ? "a native General-Purpose (or implementer, where the profile provides one) subagent" : "a native General-Purpose subagent";
2226
+ const briefProseNote = isLocalFamily(profile) ? "Write the brief as plain directives, never reflective first-person prose." : "Write the brief as plain directives, never reflective first-person prose: Gemini-run subagents may suppress tool calls when the prompt contains reflective text.";
2227
+ const compactionNote = isLocalFamily(profile) ? "Output volume dominates." : "Output tokens cost several times input on every profile.";
2228
+ const dispatchBoundary = isLocalFamily(profile) ? "" : ", never via worker-* MCP dispatchers";
2229
+ const planDispatchBoundary = isLocalFamily(profile) ? "" : ", never worker-* MCP dispatchers";
2230
+ const dispatchStep = leadPlansDirectly ? `3. Compose the plan directly with that brief, then validate it against
2231
+ the same bar: every task names files, states the change and its done
2232
+ condition, and carries runnable acceptance commands; trade-offs appear as
2233
+ options with a recommendation. If gaps remain, run ONE bounded self-review
2234
+ pass naming the exact gaps (at most 2 review passes total). If still
2235
+ underspecified, checkpoint with the gaps as residual risk instead of
2236
+ pretending the plan is complete.` : `3. Dispatch ONE Plan subagent via the Agent tool (subagent_type Plan) with
2237
+ that brief, then WAIT for its full return. Do not plan inline in parallel
2238
+ and do not dispatch implementation subagents while it runs.`;
2239
+ const validateStep = leadPlansDirectly ? `4. Validate the composed plan. Every task must name files, state the
2240
+ change and its done condition, and carry runnable acceptance commands;
2241
+ trade-offs must appear as options with a recommendation.` : `4. Validate the returned plan. Every task must name files, state the
2242
+ change and its done condition, and carry runnable acceptance commands;
2243
+ trade-offs must appear as options with a recommendation. If gaps remain,
2244
+ send ONE bounded follow-up to the same Plan dispatch naming the exact gaps
2245
+ (at most 2 follow-up rounds total). If still underspecified, checkpoint
2246
+ with the gaps as residual risk instead of pretending the plan is complete.`;
2247
+ const advisorStep = isCheapestFamily(profile) || profile === "local2" ? `
2248
+ 6. Review the final plan with the Advisor before presenting it to the user:
2249
+ consult \`advisor\` once for a framing check. It is non-binding counsel;
2250
+ you retain decision ownership.
2251
+
2252
+ ` : "";
2253
+ const persistStepNumber = 5 + (leadPlansDirectly ? 1 : 0) + (advisorStep ? 1 : 0);
2254
+ const checkpointStepNumber = persistStepNumber + 1;
2255
+ return {
2256
+ name: "gh-plan",
2257
+ md: `---
2258
+ name: gh-plan
2259
+ 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.
2260
+ user-invocable: true
2261
+ requires: [fresh context.md with .complete marker]
2262
+ produces: [plan.md, .complete]
2263
+ consumes: [context.md, context.compact.md]
2264
+ excludes: [trivial changes, implementation, missing context]
2265
+ ---
2266
+
2267
+ # gh-plan: ${leadPlansDirectly ? "lead-direct planning" : "native Plan-subagent planning"}
2268
+
2269
+ Use this skill after /gh-gather-context (or when equivalent context is already
2270
+ available) and before any implementation. For non-trivial work, ${planningMeans}.
2271
+ The plan must be scoped, modular, non-overlapping, and ordered, with
2272
+ enough detail for ${downstreamAgent} to execute each task in isolation. User approval is
2273
+ mandatory before implementation. ${leadPlansDirectly ? `This skill plans directly (plus scoped Explore discovery where the delegation graph permits)${dispatchBoundary}.` : `This skill dispatches ONLY the native Plan subagent via the Agent tool${planDispatchBoundary}.`} ${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."}
2274
+
2275
+ ## Prerequisites
2276
+
2277
+ - A freshness-stamped context brief from /gh-gather-context, or equivalent context.
2278
+ - Read context.compact.md first; read context.md sections on demand (residual unknowns, evidence table).
2279
+
2280
+ ## Stage gate 0 (do this BEFORE any planning)
2281
+
2282
+ 1. Verify the context stage is finished: .github-router/context/<slug>/.complete
2283
+ exists. If the marker is missing, STOP: do not plan on a partial brief.
2284
+ Finish or re-invoke gathering first.
2285
+ 2. Check freshness: if HEAD or the working-tree diff hash moved since the
2286
+ brief's stamp, re-verify stale load-bearing claims before using them.
2287
+ 3. Close the previous stage: send no further follow-ups to any lingering
2288
+ gather-context Explore dispatches and record them as superseded with the
2289
+ reason. Native subagents cannot be killed mid-run: let them finish but do
2290
+ not wait on or use their output. Planning while Explore subagents still run
2291
+ builds on shifting evidence and wastes both stages. Only advance once every
2292
+ Explore dispatch has returned or is recorded as superseded.
2293
+
2294
+ ## Triviality reassessment (do this AFTER gate 0, BEFORE ${leadPlansDirectly ? "planning" : "dispatching Plan"})
2295
+
2296
+ 1. Reassess with fresh context: if the ask is trivial (typo, one-line config
2297
+ read, obvious change of at most a few lines, pure explanation) or the
2298
+ context shows no multi-file, risky, uncertain, or high-impact work, STOP.
2299
+ Do NOT ${leadPlansDirectly ? "plan" : "dispatch Plan"}. Do NOT write plan.md or .complete.
2300
+ 2. Return a trivial verdict: one-sentence reason, the recommended direct
2301
+ action, and an explicit statement that no downstream stage (/gh-implement,
2302
+ /gh-swe-pipeline stage 3) may run. A trivial ask must never pay planning
2303
+ cost as ritual.
2304
+
2305
+ ## Hard bounds
2306
+
2307
+ - Maximum tasks: 20.
2308
+ - Maximum parallel groups: 5.
2309
+ - 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.
2310
+ - 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.
2311
+
2312
+ ## Procedure (non-trivial work only)
2313
+
2314
+ 1. Ingest context.
2315
+ - Read context.compact.md fully.
2316
+ - Read the evidence table and residual unknowns from context.md.
2317
+ - Identify acceptance criteria, constraints, integration seams, and forbidden changes.
2318
+
2319
+ 2. Compose the ${leadPlansDirectly ? "plan" : "Plan dispatch brief"}. Include every item below; a vague brief
2320
+ produces a vague plan, and a vague plan fails downstream:
2321
+ - Ask summary and acceptance criteria (or candidates where ambiguous).
2322
+ - Constraints, integration seams, and forbidden changes.
2323
+ - Context pointers: context.compact.md path, the evidence table and
2324
+ residual sections of context.md, plus the freshness stamp.
2325
+ - Required output shape: objective; architectural invariants; interface
2326
+ contracts; execution steps with files touched plus a done condition per
2327
+ step; acceptance commands with the observable pass result; critical files
2328
+ as file:line; a blind-spot table tagging each risk executable-checkable
2329
+ or judgment-only (wrong-spec, root-cause, integration, regression,
2330
+ review, concurrency or merge, missing-test); open questions as options
2331
+ with a recommendation; cost estimate (task count, parallel groups,
2332
+ context tokens).
2333
+ - Plan-mode rule: plan and acceptance criteria only, no implementation
2334
+ file edits.
2335
+ - Permission to use Explore ${leadPlansDirectly ? "per the lead delegation graph" : "and reviewer per the delegation graph"}.
2336
+ - ${briefProseNote}
2337
+ - Demand compact output: file:line plus one-line purposes, never pasted
2338
+ source blocks. ${compactionNote}
2339
+ - Advisory ~5 minute budget.
2340
+
2341
+ ${dispatchStep}
2342
+
2343
+ ${validateStep}
2344
+
2345
+ ${persistStepNumber}. Persist the validated plan to .github-router/plans/<slug>/plan.md.
2346
+ - Ask summary and user-blessed acceptance criteria.
2347
+ - Blind-spot table with executable-checkable or judgment-only tags.
2348
+ - Ordered task list with ids, files, dependencies, parallel groups, acceptance criteria, verification commands, rollback concerns, and estimated context tokens.
2349
+ - Open questions and user answers.
2350
+ - Cost estimate: task count, parallel groups, and context tokens.
2351
+ - Residual risks.
2352
+ ${advisorStep}${checkpointStepNumber}. Checkpoint with the user and wait for explicit approval.
2353
+ - Present the goal, acceptance criteria, task-to-group map, per-task blind spot killed, residual risks, and cost estimate.
2354
+ - If the user rejects scope or cost, downshift to the smallest plan that kills the important blind spots.
2355
+ - Do not proceed to implementation without approval.
2356
+ - 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.
2357
+
2358
+ ## Return format
2359
+
2360
+ Return:
2361
+
2362
+ - Trivial exit: yes with the recommended direct action and no plan file, or no with the plan below.
2363
+ - Plan file: path to the durable plan.md.
2364
+ - Task count and parallel groups.
2365
+ - Open questions and user answers.
2366
+ - Cost estimate.
2367
+ - Residual risks and next action (implementation only after approval).
2368
+
2369
+ ## Non-goals
2370
+
2371
+ - Do not ${leadPlansDirectly ? "plan a trivial ask" : "dispatch Plan for a trivial ask"}; exit with a trivial verdict instead.
2372
+ - Do not edit implementation files while planning; in plan mode, produce the plan and acceptance criteria only.
2373
+ - Do not present judgment-only conclusions as executable guarantees.
2374
+ - Do not hide open unknowns because the plan looks complete.
2375
+ - Do not start planning while gather-context Explore subagents still run; record them superseded first.
2376
+ - Do not dispatch implementation subagents from planning: stages never overlap.
2377
+ `
2378
+ };
2379
+ }
2380
+ buildPlanSkill(true);
2381
+ //#endregion
2077
2382
  //#region src/lib/injected-skills/gather-context-skill.ts
2078
- function buildGatherContextSkill(searchEnabled, bluebirdEnabled = false) {
2383
+ function buildGatherContextSkill(searchEnabled, bluebirdEnabled = false, profile) {
2079
2384
  const semanticAvailable = searchEnabled || bluebirdEnabled;
2385
+ const modelNote = isLocalFamily(profile) ? "All reasoning runs at the 200K default window: the lead and every Explore\nsubagent run with bare slugs (no 1M accounting)." : "All reasoning runs at the 200K default window: the lead and every Explore\nsubagent use the Luna model at high effort with bare slugs (no 1M accounting).";
2386
+ const downstreamConsumer = rosterEmitsImplementer(profile) ? "planner, implementer, or user" : "planner, General-Purpose, or user";
2387
+ const outputNote = isLocalFamily(profile) ? "Return a compact brief, not the whole dump. Output volume dominates: return\nonly file:line citations with one-line summaries, never full file contents or\npasted source blocks." : "Return a compact brief, not the whole dump. Output cost dominates: Luna output\ntokens cost 6x input, so return only file:line citations with one-line\nsummaries, never full file contents or pasted source blocks.";
2388
+ const searchStep = semanticAvailable ? `3. Run semantic search first for concepts, then lexical for symbols, in parallel, in a single turn.
2389
+ - Use mcp__search__code semantically first to find concepts and likely files via ${bluebirdEnabled ? "Bluebird's Azure DevOps index; failures stay visible with no local fallback" : "the local ColBERT index, with transparent lexical fallback while unavailable"}.
2390
+ - Then use mcp__search__code lexically for exact symbols, filenames, errors, routes, flags, and config keys.
2391
+ - Use git log and git blame when authorship, regression timing, or intent matters.
2392
+ - Use mcp__search__web for upstream APIs, package behavior, protocol docs, or public issues.` : `3. Run lexical search first, in parallel, in a single turn.
2393
+ - Use mcp__search__code lexically for exact symbols, filenames, errors, routes, flags, and config keys.
2394
+ - Use git log and git blame when authorship, regression timing, or intent matters.
2395
+ - Use mcp__search__web for upstream APIs, package behavior, protocol docs, or public issues.`;
2396
+ const searchCap = semanticAvailable ? "Maximum searches per round: 10." : "Maximum lexical searches per round: 10.";
2080
2397
  return {
2081
2398
  name: "gh-gather-context",
2082
2399
  md: `---
@@ -2092,18 +2409,17 @@ excludes: [trivial tasks, already-known code, implementation]
2092
2409
  # gh-gather-context: bounded context gathering
2093
2410
 
2094
2411
  Use this skill when a non-trivial ask needs grounded context before planning.
2095
- All reasoning runs at the 200K default window: the lead and every Explore
2096
- subagent use the Luna model at high effort with bare slugs (no 1M accounting).
2412
+ ${modelNote}
2097
2413
  Output is a durable full brief plus a compact downstream version. This skill
2098
2414
  dispatches ONLY native subagents present on the profile roster (Explore) via
2099
- the Agent tool, never worker-* MCP dispatchers. No reviewer dispatch in this
2415
+ the Agent tool${isLocalFamily(profile) ? "" : ", never worker-* MCP dispatchers"}. No reviewer dispatch in this
2100
2416
  stage: Explore evidence plus targeted follow-up reads is the verification path.
2101
2417
 
2102
2418
  ## Hard bounds
2103
2419
 
2104
2420
  - Maximum rounds: 3.
2105
2421
  - Maximum parallel Explore subagents per round: 6.
2106
- - ${semanticAvailable ? "Maximum searches per round: 10." : "Maximum lexical searches per round: 10."}
2422
+ - ${searchCap}
2107
2423
  - Maximum follow-up reads per round: 5.
2108
2424
  - Advisory budget: keep each Explore dispatch under ~3 minutes of wall-clock;
2109
2425
  the Task tool has no maxWallClockMs parameter, so count your own dispatches
@@ -2123,20 +2439,13 @@ Use these exact tags on every finding and claim:
2123
2439
 
2124
2440
  1. Restate the ask and define the research target.
2125
2441
  - Identify whether this is a bug, feature, refactor, incident, or design question.
2126
- - Name the expected downstream consumer: planner, implementer, or user.
2442
+ - Name the expected downstream consumer: ${downstreamConsumer}.
2127
2443
 
2128
2444
  2. Decompose the ask into searchable entities.
2129
2445
  - Extract symbols, filenames, error strings, routes, flags, config keys, and types.
2130
2446
  - Define what must be true for a correct implementation.
2131
2447
 
2132
- ${semanticAvailable ? `3. Run semantic search first for concepts, then lexical for symbols, in parallel, in a single turn.
2133
- - Use mcp__search__code semantically first to find concepts and likely files via ${bluebirdEnabled ? "Bluebird's Azure DevOps index; failures stay visible with no local fallback" : "the local ColBERT index, with transparent lexical fallback while unavailable"}.
2134
- - Then use mcp__search__code lexically for exact symbols, filenames, errors, routes, flags, and config keys.
2135
- - Use git log and git blame when authorship, regression timing, or intent matters.
2136
- - Use mcp__search__web for upstream APIs, package behavior, protocol docs, or public issues.` : `3. Run lexical search first, in parallel, in a single turn.
2137
- - Use mcp__search__code lexically for exact symbols, filenames, errors, routes, flags, and config keys.
2138
- - Use git log and git blame when authorship, regression timing, or intent matters.
2139
- - Use mcp__search__web for upstream APIs, package behavior, protocol docs, or public issues.`}
2448
+ ${searchStep}
2140
2449
 
2141
2450
  4. Decompose into bounded Explore subagents.
2142
2451
  - Cluster search results into at most 6 coherent investigation areas.
@@ -2175,9 +2484,7 @@ more than an idle subagent costs.
2175
2484
 
2176
2485
  ## Return format
2177
2486
 
2178
- Return a compact brief, not the whole dump. Output cost dominates: Luna output
2179
- tokens cost 6x input, so return only file:line citations with one-line
2180
- summaries, never full file contents or pasted source blocks.
2487
+ ${outputNote}
2181
2488
 
2182
2489
  - Context files: paths to context.md and context.compact.md.
2183
2490
  - Freshness: HEAD commit, diff hash, timestamp.
@@ -2199,10 +2506,15 @@ summaries, never full file contents or pasted source blocks.
2199
2506
  `
2200
2507
  };
2201
2508
  }
2509
+ buildGatherContextSkill(true);
2202
2510
  //#endregion
2203
2511
  //#region src/lib/injected-skills/implement-skill.ts
2204
2512
  function buildImplementSkill(_searchEnabled, profile) {
2205
- const planDispatches = isCheapestFamily(profile) || isBalancedFamily(profile) ? "planning work" : "Plan dispatches";
2513
+ const planDispatches = isCheapestFamily(profile) || isBalancedFamily(profile) || isLocalFamily(profile) ? "planning work" : "Plan dispatches";
2514
+ const implementerFirst = rosterEmitsImplementer(profile) ? "If an implementer subagent exists (max profile), use it first for implementation tasks, then General-Purpose for handoffs; otherwise use General-Purpose for all tasks" : "Use General-Purpose for every implementation task and handoff";
2515
+ const implementerDispatch = rosterEmitsImplementer(profile) ? "Use subagent_type implementer first where the profile provides one (max), otherwise subagent_type General-Purpose for every task" : "Use subagent_type General-Purpose for every task";
2516
+ const geminiNote = isLocalFamily(profile) ? "" : ": Gemini-run subagents may suppress tool calls when the prompt contains reflective text";
2517
+ const compactionNote = isLocalFamily(profile) ? "Output volume dominates." : "Output tokens cost several times input on every profile.";
2206
2518
  return {
2207
2519
  name: "gh-implement",
2208
2520
  md: `---
@@ -2220,14 +2532,12 @@ excludes: [unapproved plans, exploration, trivial changes]
2220
2532
  Use this skill only after /gh-plan produced a user-approved plan.md. All
2221
2533
  implementation runs at the 200K default window with bare slugs (no 1M
2222
2534
  accounting): the lead dispatches native subagents present on the profile
2223
- roster. If an implementer subagent exists (max profile), use it first for
2224
- implementation tasks, then General-Purpose for handoffs; otherwise use
2225
- General-Purpose for all tasks. Review is conditional, never staged by default:
2535
+ roster. ${implementerFirst}. Review is conditional, never staged by default:
2226
2536
  each task subagent self-tests, self-reviews, and reports an explicit confidence
2227
2537
  verdict; the lead dispatches a reviewer only on low-confidence validation or
2228
2538
  complex and risky changes, then a General-Purpose fix pass only for major
2229
2539
  reviewer findings. This skill dispatches ONLY native subagents via the Agent
2230
- tool, never worker-* MCP dispatchers.
2540
+ tool${isLocalFamily(profile) ? "" : ", never worker-* MCP dispatchers"}.
2231
2541
 
2232
2542
  ## Hard bounds
2233
2543
 
@@ -2263,16 +2573,16 @@ tool, never worker-* MCP dispatchers.
2263
2573
  1. Parse the approved plan.
2264
2574
  - Read plan.md fully.
2265
2575
  - Group tasks by parallelGroup; order groups by dependency.
2266
- - 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.
2576
+ - 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${geminiNote}. 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.
2267
2577
 
2268
2578
  2. Dispatch bounded implementation subagents, one parallel batch per group.
2269
- - 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.
2579
+ - Dispatch ALL tasks in the group in a single turn via the Agent tool. ${implementerDispatch}. Advisory: keep each task under ~10 minutes; the Task tool enforces no wall-clock.
2270
2580
  - Each subagent runs at the 200K default window and must self-contain its work:
2271
2581
  a. Implement the change.
2272
2582
  b. Run the task verification commands (tests, typecheck, lint).
2273
2583
  c. Self-review against the acceptance criteria.
2274
2584
  d. Fix any self-found issues (at most 2 internal fix cycles).
2275
- 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.
2585
+ 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. ${compactionNote}
2276
2586
  - Do NOT dispatch the same task twice (no dedup exists); a retry is a new dispatch only after a recorded failure.
2277
2587
  - For a big artifact, have the subagent write it to a file and return the path.
2278
2588
 
@@ -2456,165 +2766,6 @@ Return:
2456
2766
  };
2457
2767
  }
2458
2768
  //#endregion
2459
- //#region src/lib/injected-skills/plan-skill.ts
2460
- function buildPlanSkill(_searchEnabled, profile) {
2461
- const leadPlansDirectly = isCheapestFamily(profile) || isBalancedFamily(profile);
2462
- const planningMeans = 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)";
2463
- const dispatchStep = leadPlansDirectly ? `3. Compose the plan directly with that brief, then validate it against
2464
- the same bar: every task names files, states the change and its done
2465
- condition, and carries runnable acceptance commands; trade-offs appear as
2466
- options with a recommendation. If gaps remain, run ONE bounded self-review
2467
- pass naming the exact gaps (at most 2 review passes total). If still
2468
- underspecified, checkpoint with the gaps as residual risk instead of
2469
- pretending the plan is complete.` : `3. Dispatch ONE Plan subagent via the Agent tool (subagent_type Plan) with
2470
- that brief, then WAIT for its full return. Do not plan inline in parallel
2471
- and do not dispatch implementation subagents while it runs.`;
2472
- const validateStep = leadPlansDirectly ? `4. Validate the composed plan. Every task must name files, state the
2473
- change and its done condition, and carry runnable acceptance commands;
2474
- trade-offs must appear as options with a recommendation.` : `4. Validate the returned plan. Every task must name files, state the
2475
- change and its done condition, and carry runnable acceptance commands;
2476
- trade-offs must appear as options with a recommendation. If gaps remain,
2477
- send ONE bounded follow-up to the same Plan dispatch naming the exact gaps
2478
- (at most 2 follow-up rounds total). If still underspecified, checkpoint
2479
- with the gaps as residual risk instead of pretending the plan is complete.`;
2480
- const advisorStep = isCheapestFamily(profile) ? `
2481
- 6. Review the final plan with the Advisor before presenting it to the user:
2482
- consult \`advisor\` once for a framing check. It is non-binding counsel;
2483
- you retain decision ownership.
2484
-
2485
- ` : "";
2486
- const persistStepNumber = 5 + (leadPlansDirectly ? 1 : 0) + (advisorStep ? 1 : 0);
2487
- const checkpointStepNumber = persistStepNumber + 1;
2488
- return {
2489
- name: "gh-plan",
2490
- md: `---
2491
- name: gh-plan
2492
- 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.
2493
- user-invocable: true
2494
- requires: [fresh context.md with .complete marker]
2495
- produces: [plan.md, .complete]
2496
- consumes: [context.md, context.compact.md]
2497
- excludes: [trivial changes, implementation, missing context]
2498
- ---
2499
-
2500
- # gh-plan: ${leadPlansDirectly ? "lead-direct planning" : "native Plan-subagent planning"}
2501
-
2502
- Use this skill after /gh-gather-context (or when equivalent context is already
2503
- available) and before any implementation. For non-trivial work, ${planningMeans}.
2504
- The plan must be scoped, modular, non-overlapping, and ordered, with
2505
- enough detail for a native General-Purpose (or implementer, where the profile
2506
- provides one) subagent to execute each task in isolation. User approval is
2507
- 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."}
2508
-
2509
- ## Prerequisites
2510
-
2511
- - A freshness-stamped context brief from /gh-gather-context, or equivalent context.
2512
- - Read context.compact.md first; read context.md sections on demand (residual unknowns, evidence table).
2513
-
2514
- ## Stage gate 0 (do this BEFORE any planning)
2515
-
2516
- 1. Verify the context stage is finished: .github-router/context/<slug>/.complete
2517
- exists. If the marker is missing, STOP: do not plan on a partial brief.
2518
- Finish or re-invoke gathering first.
2519
- 2. Check freshness: if HEAD or the working-tree diff hash moved since the
2520
- brief's stamp, re-verify stale load-bearing claims before using them.
2521
- 3. Close the previous stage: send no further follow-ups to any lingering
2522
- gather-context Explore dispatches and record them as superseded with the
2523
- reason. Native subagents cannot be killed mid-run: let them finish but do
2524
- not wait on or use their output. Planning while Explore subagents still run
2525
- builds on shifting evidence and wastes both stages. Only advance once every
2526
- Explore dispatch has returned or is recorded as superseded.
2527
-
2528
- ## Triviality reassessment (do this AFTER gate 0, BEFORE ${leadPlansDirectly ? "planning" : "dispatching Plan"})
2529
-
2530
- 1. Reassess with fresh context: if the ask is trivial (typo, one-line config
2531
- read, obvious change of at most a few lines, pure explanation) or the
2532
- context shows no multi-file, risky, uncertain, or high-impact work, STOP.
2533
- Do NOT ${leadPlansDirectly ? "plan" : "dispatch Plan"}. Do NOT write plan.md or .complete.
2534
- 2. Return a trivial verdict: one-sentence reason, the recommended direct
2535
- action, and an explicit statement that no downstream stage (/gh-implement,
2536
- /gh-swe-pipeline stage 3) may run. A trivial ask must never pay planning
2537
- cost as ritual.
2538
-
2539
- ## Hard bounds
2540
-
2541
- - Maximum tasks: 20.
2542
- - Maximum parallel groups: 5.
2543
- - 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.
2544
- - 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.
2545
-
2546
- ## Procedure (non-trivial work only)
2547
-
2548
- 1. Ingest context.
2549
- - Read context.compact.md fully.
2550
- - Read the evidence table and residual unknowns from context.md.
2551
- - Identify acceptance criteria, constraints, integration seams, and forbidden changes.
2552
-
2553
- 2. Compose the ${leadPlansDirectly ? "plan" : "Plan dispatch brief"}. Include every item below; a vague brief
2554
- produces a vague plan, and a vague plan fails downstream:
2555
- - Ask summary and acceptance criteria (or candidates where ambiguous).
2556
- - Constraints, integration seams, and forbidden changes.
2557
- - Context pointers: context.compact.md path, the evidence table and
2558
- residual sections of context.md, plus the freshness stamp.
2559
- - Required output shape: objective; architectural invariants; interface
2560
- contracts; execution steps with files touched plus a done condition per
2561
- step; acceptance commands with the observable pass result; critical files
2562
- as file:line; a blind-spot table tagging each risk executable-checkable
2563
- or judgment-only (wrong-spec, root-cause, integration, regression,
2564
- review, concurrency or merge, missing-test); open questions as options
2565
- with a recommendation; cost estimate (task count, parallel groups,
2566
- context tokens).
2567
- - Plan-mode rule: plan and acceptance criteria only, no implementation
2568
- file edits.
2569
- - Permission to use Explore ${leadPlansDirectly ? "per the lead delegation graph" : "and reviewer per the delegation graph"}.
2570
- - Write the brief as plain directives, never reflective first-person prose:
2571
- Gemini-run subagents may suppress tool calls when the prompt contains
2572
- reflective text.
2573
- - Demand compact output: file:line plus one-line purposes, never pasted
2574
- source blocks. Output tokens cost several times input on every profile.
2575
- - Advisory ~5 minute budget.
2576
-
2577
- ${dispatchStep}
2578
-
2579
- ${validateStep}
2580
-
2581
- ${persistStepNumber}. Persist the validated plan to .github-router/plans/<slug>/plan.md.
2582
- - Ask summary and user-blessed acceptance criteria.
2583
- - Blind-spot table with executable-checkable or judgment-only tags.
2584
- - Ordered task list with ids, files, dependencies, parallel groups, acceptance criteria, verification commands, rollback concerns, and estimated context tokens.
2585
- - Open questions and user answers.
2586
- - Cost estimate: task count, parallel groups, and context tokens.
2587
- - Residual risks.
2588
- ${advisorStep}${checkpointStepNumber}. Checkpoint with the user and wait for explicit approval.
2589
- - Present the goal, acceptance criteria, task-to-group map, per-task blind spot killed, residual risks, and cost estimate.
2590
- - If the user rejects scope or cost, downshift to the smallest plan that kills the important blind spots.
2591
- - Do not proceed to implementation without approval.
2592
- - 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.
2593
-
2594
- ## Return format
2595
-
2596
- Return:
2597
-
2598
- - Trivial exit: yes with the recommended direct action and no plan file, or no with the plan below.
2599
- - Plan file: path to the durable plan.md.
2600
- - Task count and parallel groups.
2601
- - Open questions and user answers.
2602
- - Cost estimate.
2603
- - Residual risks and next action (implementation only after approval).
2604
-
2605
- ## Non-goals
2606
-
2607
- - Do not ${leadPlansDirectly ? "plan a trivial ask" : "dispatch Plan for a trivial ask"}; exit with a trivial verdict instead.
2608
- - Do not edit implementation files while planning; in plan mode, produce the plan and acceptance criteria only.
2609
- - Do not present judgment-only conclusions as executable guarantees.
2610
- - Do not hide open unknowns because the plan looks complete.
2611
- - Do not start planning while gather-context Explore subagents still run; record them superseded first.
2612
- - Do not dispatch implementation subagents from planning: stages never overlap.
2613
- `
2614
- };
2615
- }
2616
- buildPlanSkill(true);
2617
- //#endregion
2618
2769
  //#region src/lib/injected-skills/research-skill.ts
2619
2770
  function buildResearchSkill(searchEnabled, bluebirdEnabled = false) {
2620
2771
  return {
@@ -2800,7 +2951,9 @@ ${bluebirdEnabled ? "Grounding uses Bluebird semantic + lexical code search (fai
2800
2951
  //#endregion
2801
2952
  //#region src/lib/injected-skills/swe-pipeline-skill.ts
2802
2953
  function buildSwePipelineSkill(_searchEnabled, profile) {
2803
- const leadPlansDirectly = isCheapestFamily(profile) || isBalancedFamily(profile);
2954
+ const leadPlansDirectly = isCheapestFamily(profile) || isBalancedFamily(profile) || isLocalFamily(profile);
2955
+ const roster = leadPlansDirectly ? "Explore, General-Purpose, reviewer" : "Explore, Plan, General-Purpose, reviewer, implementer where provided";
2956
+ const planDispatches = leadPlansDirectly ? "lead planning" : "Plan subagents";
2804
2957
  return {
2805
2958
  name: "gh-swe-pipeline",
2806
2959
  md: `---
@@ -2816,7 +2969,7 @@ change. It coordinates the three pipeline stages in STRICT SEQUENCE. No two
2816
2969
  stages ever overlap: each stage runs to completion, its subagents are all
2817
2970
  finished or explicitly superseded, and its completion artifact exists before
2818
2971
  the next stage starts. Every stage dispatches ONLY native subagents present on
2819
- the profile roster (${leadPlansDirectly ? "Explore, General-Purpose, reviewer" : "Explore, Plan, General-Purpose, reviewer, implementer where provided"}) via the Agent tool, never worker-* MCP dispatchers.
2972
+ the profile roster (${roster}) via the Agent tool${isLocalFamily(profile) ? "" : ", never worker-* MCP dispatchers"}.
2820
2973
 
2821
2974
  All work runs at the 200K default window with bare slugs (no 1M accounting).
2822
2975
  Advisory budgets (the Task tool enforces no wall-clock): gather ~3 minutes
@@ -2846,7 +2999,7 @@ exists to prevent.
2846
2999
  ## Stage 1: gather context (to completion)
2847
3000
 
2848
3001
  1. Invoke the gh-gather-context skill and WAIT for its full return. Do not
2849
- plan, sketch tasks, or dispatch ${leadPlansDirectly ? "lead planning" : "Plan subagents"} while it runs.
3002
+ plan, sketch tasks, or dispatch ${planDispatches} while it runs.
2850
3003
  2. Its completion artifact is
2851
3004
  .github-router/context/<slug>/context.md plus context.compact.md and a
2852
3005
  .complete marker. If the marker is missing, the stage is NOT complete:
@@ -3062,8 +3215,11 @@ const PIPELINE_SKILL_PROFILES = [
3062
3215
  "cheap1m",
3063
3216
  "cheapest",
3064
3217
  "cheapest2",
3218
+ "cheaplocal",
3065
3219
  "balanced",
3066
- "balanced2"
3220
+ "balanced2",
3221
+ "local",
3222
+ "local2"
3067
3223
  ];
3068
3224
  function isPipelineSkillProfile(profileId) {
3069
3225
  return PIPELINE_SKILL_PROFILES.includes(profileId);
@@ -3229,12 +3385,12 @@ async function writeInjectedSkill(name, md) {
3229
3385
  * 200K default context). The orchestrator (`/gh-swe-pipeline`) runs the
3230
3386
  * other three in strict sequence; the three stages stay individually
3231
3387
  * invokable for users who only want one stage. Profiles without a `Plan`
3232
- * role (`cheapest`, `balanced`) get the lead-plans-directly `/gh-plan`
3233
- * variant.
3388
+ * role (`cheapest`, `balanced`, `local`) get the lead-plans-directly
3389
+ * `/gh-plan` variant.
3234
3390
  */
3235
3391
  function getPipelineSkills(searchEnabled, bluebirdEnabled = false, profile) {
3236
3392
  return [
3237
- buildGatherContextSkill(searchEnabled, bluebirdEnabled),
3393
+ buildGatherContextSkill(searchEnabled, bluebirdEnabled, profile),
3238
3394
  buildPlanSkill(searchEnabled || bluebirdEnabled, profile),
3239
3395
  buildImplementSkill(searchEnabled || bluebirdEnabled, profile),
3240
3396
  buildSwePipelineSkill(searchEnabled || bluebirdEnabled, profile)
@@ -3264,7 +3420,7 @@ function injectedSkillsForLaunch(selection) {
3264
3420
  const searchEnabled = selection.searchEnabled === true;
3265
3421
  const bluebirdEnabled = selection.bluebirdEnabled === true;
3266
3422
  const allSkills = getInjectedSkills(searchEnabled, bluebirdEnabled);
3267
- const pipelineSkills = getPipelineSkills(searchEnabled, bluebirdEnabled, isCheapestFamily(selection.profileId) || isBalancedFamily(selection.profileId) ? selection.profileId : void 0);
3423
+ const pipelineSkills = getPipelineSkills(searchEnabled, bluebirdEnabled, isCheapestFamily(selection.profileId) || isBalancedFamily(selection.profileId) || isLocalFamily(selection.profileId) ? selection.profileId : void 0);
3268
3424
  if (isPipelineSkillProfile(selection.profileId)) {
3269
3425
  if (!selection.sweEnabled) {
3270
3426
  if (selection.profileId === "max" && selection.firstMateEnabled) return allSkills.filter((skill) => skill.name.startsWith("gh-first-mate"));
@@ -3349,4 +3505,4 @@ async function injectAttributionSuppressionIntoSettingsFile(settingsPath) {
3349
3505
  //#endregion
3350
3506
  export { buildArtifactReviewSkill as a, injectAllowRules as c, BUILTIN_SUBAGENT_DEFINITIONS as d, injectPeerMcpIntoMirror as f, writePeerMcpRuntimeFiles as g, workersKeyOf as h, writeInjectedSkill as i, planModeAllowRules as l, resolveGroupKeysFromMirror as m, getInjectedSkills as n, SEAMLESS_BUILTIN_TOOLS as o, resolveCodexCliBackend as p, injectedSkillsForLaunch as r, configureServeDefaultPermissionMode as s, injectAttributionSuppressionIntoSettingsFile as t, sanitizeServeSettingsEnv as u };
3351
3507
 
3352
- //# sourceMappingURL=attribution-settings-D9PxJxkL.js.map
3508
+ //# sourceMappingURL=attribution-settings-zoBxw08y.js.map