geneseed 5.6.0 → 6.0.1

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 (114) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +2 -2
  3. package/SHIPPED.md +2 -2
  4. package/adapters/opencode/README.md +7 -4
  5. package/docs/concepts/agents.md +10 -0
  6. package/docs/concepts/exclusions.md +1 -1
  7. package/docs/concepts/foreman-mode.md +4 -2
  8. package/docs/concepts/kits.md +20 -2
  9. package/docs/concepts/loops.md +5 -0
  10. package/docs/concepts/skills.md +1 -1
  11. package/docs/concepts/superpowers-kit.md +79 -0
  12. package/docs/extending.md +11 -4
  13. package/docs/guides/install-scripted.md +1 -1
  14. package/docs/reference/cli.md +2 -0
  15. package/docs/reference/profiles.md +10 -5
  16. package/harness.config.json +1 -1
  17. package/js/README.md +3 -0
  18. package/js/build/args.mjs +4 -2
  19. package/js/build/driver.mjs +8 -8
  20. package/js/build/emit-claude.mjs +5 -3
  21. package/js/build/emit-opencode.mjs +2 -2
  22. package/js/build/generate.mjs +1 -1
  23. package/js/build/profile.mjs +15 -7
  24. package/js/build/render.mjs +81 -10
  25. package/js/build/source.mjs +75 -1
  26. package/js/cli-table.json +17 -2
  27. package/js/hosts/installs.mjs +50 -4
  28. package/js/hosts/native.mjs +125 -9
  29. package/js/hosts/opencode.mjs +13 -15
  30. package/js/inspect/checks-authoring.mjs +24 -1
  31. package/js/inspect/checks-build.mjs +43 -2
  32. package/js/inspect/checks-counts.mjs +72 -1
  33. package/js/inspect/diff.mjs +17 -3
  34. package/js/inspect/doctor.mjs +23 -2
  35. package/js/inspect/status.mjs +5 -1
  36. package/js/inspect/validate.mjs +1 -1
  37. package/js/loop/catalog.mjs +10 -0
  38. package/js/maintain/kit-migration.mjs +109 -0
  39. package/js/maintain/plugin-detect.mjs +150 -0
  40. package/js/maintain/profiles.mjs +46 -5
  41. package/js/maintain/setup.mjs +45 -11
  42. package/js/maintain/update.mjs +1 -1
  43. package/js/web/actions.mjs +28 -7
  44. package/js/web/agent-models-api.mjs +172 -0
  45. package/js/web/api.mjs +3 -1
  46. package/js/web/profiles-api.mjs +11 -7
  47. package/js/web/routes.mjs +5 -1
  48. package/package.json +1 -1
  49. package/profiles/autonomous.json +1 -0
  50. package/profiles/corporate.json +1 -1
  51. package/profiles/mentor.json +1 -0
  52. package/profiles/minimal.json +2 -1
  53. package/profiles/starter.json +1 -1
  54. package/src/AGENT.md.tmpl +1 -6
  55. package/src/agents/_template.md +4 -0
  56. package/src/agents/advocate.md +1 -0
  57. package/src/agents/architect.md +1 -0
  58. package/src/agents/developer.md +12 -4
  59. package/src/agents/empiricist.md +1 -0
  60. package/src/agents/explorer.md +1 -0
  61. package/src/agents/framer.md +1 -0
  62. package/src/agents/historian.md +1 -0
  63. package/src/agents/operator.md +1 -0
  64. package/src/agents/performance.md +2 -1
  65. package/src/agents/pragmatist.md +1 -0
  66. package/src/agents/react-reviewer.md +1 -0
  67. package/src/agents/researcher.md +1 -0
  68. package/src/agents/reviewer.md +1 -0
  69. package/src/agents/security.md +1 -0
  70. package/src/agents/skeptic.md +1 -0
  71. package/src/agents/spring-reviewer.md +1 -0
  72. package/src/agents/spring-security.md +1 -0
  73. package/src/agents/steward.md +1 -0
  74. package/src/agents/user-advocate.md +1 -0
  75. package/src/agents/visionary.md +1 -0
  76. package/src/bricks/ci-fix.md +12 -2
  77. package/src/kits/superpowers/missing.md +3 -0
  78. package/src/kits/superpowers/provider.md +7 -0
  79. package/src/kits/superpowers/rules.md +6 -0
  80. package/src/kits/superpowers.json +45 -0
  81. package/src/modes/foreman.md +18 -12
  82. package/src/skills/parallel-agents.md +2 -2
  83. package/src/skills/spring-boot/cloud.md +8 -2
  84. package/src/skills/spring-boot.md +3 -1
  85. package/src/skills/spring-testing.md +3 -3
  86. package/src/upstreams.json +1 -1
  87. package/web/dist/assets/{ActiveLoops-DOJCPPPc.js → ActiveLoops-6p44eD86.js} +1 -1
  88. package/web/dist/assets/{Activity-bUSPM3Dl.js → Activity-CIgrq5R1.js} +1 -1
  89. package/web/dist/assets/{ActivityDetail-AHRoXeFN.js → ActivityDetail-Brqv1u4f.js} +1 -1
  90. package/web/dist/assets/{Bonsai-B5XY9pid.js → Bonsai-8NtlFrPO.js} +1 -1
  91. package/web/dist/assets/{CopyButton-C0wwRR9H.js → CopyButton-BHqKgdjJ.js} +1 -1
  92. package/web/dist/assets/{Dashboard-DPAA96EI.js → Dashboard-CoveJ_-U.js} +2 -2
  93. package/web/dist/assets/{Docs-CpGDq165.js → Docs-C1jzrFnD.js} +1 -1
  94. package/web/dist/assets/{Factories-cNhETa5Q.js → Factories-D5pLnt5S.js} +1 -1
  95. package/web/dist/assets/{GreenhouseView-DO3ADmT9.js → GreenhouseView-ofAQ-V5h.js} +1 -1
  96. package/web/dist/assets/Installs-DpWgyT5j.js +3 -0
  97. package/web/dist/assets/{JournalView--W-Lw_V9.js → JournalView-CsuN3_B-.js} +1 -1
  98. package/web/dist/assets/{Kits-ChfehxY6.js → Kits-P4xspDuN.js} +1 -1
  99. package/web/dist/assets/{Laws-CNxYmV36.js → Laws-DK3OwGDl.js} +1 -1
  100. package/web/dist/assets/{LibRows-CiPvsRYB.js → LibRows-CGO25X3D.js} +1 -1
  101. package/web/dist/assets/Library-e-94YED6.js +3 -0
  102. package/web/dist/assets/{Loops-DAblKkyq.js → Loops-C9DSBj-A.js} +1 -1
  103. package/web/dist/assets/{OperatorHudView-QtSaSyYm.js → OperatorHudView-Cc8mlViW.js} +1 -1
  104. package/web/dist/assets/{Personal-DxSGv638.js → Personal-DVh2jYPO.js} +1 -1
  105. package/web/dist/assets/{Settings-CgTbhvRv.js → Settings-CknBI-Fx.js} +1 -1
  106. package/web/dist/assets/{Tabs-Cf4X1hdz.js → Tabs-C30JrkJH.js} +1 -1
  107. package/web/dist/assets/api-DxwG8y94.js +1 -0
  108. package/web/dist/assets/index-CUJ8AaAF.css +1 -0
  109. package/web/dist/assets/{index-B_pTwZra.js → index-MB7E-va_.js} +3 -3
  110. package/web/dist/index.html +3 -3
  111. package/web/dist/assets/Installs-D3dDyq10.js +0 -3
  112. package/web/dist/assets/Library-BxQvbwVU.js +0 -3
  113. package/web/dist/assets/api-CZ-x0iWG.js +0 -1
  114. package/web/dist/assets/index-CzfImiYb.css +0 -1
@@ -302,6 +302,15 @@ export function stripSkillBodyLinks(body) {
302
302
  return body.replace(SKILL_BODY_LINK_RE, '$1');
303
303
  }
304
304
 
305
+ /**
306
+ * An agent's link to a SKILL (`../skills/debug.md`) resolves in the flat bundle and nowhere
307
+ * natively, where a skill is `skills/<name>/SKILL.md`. The link text stays; a skill body is
308
+ * de-linked the same way (`stripSkillBodyLinks`). Links to other agents stay: agents are flat.
309
+ */
310
+ export function stripAgentSkillLinks(body) {
311
+ return body.replace(/\[([^\]]+)\]\(\.\.\/skills\/[^)\s]*\.md(?:#[^)\s]*)?\)/g, '$1');
312
+ }
313
+
305
314
  /**
306
315
  * A first-party skill's SIDE FILES (`src/skills/<stem>/<file>`, beside the flat spec) are
307
316
  * linked from the spec as `[…](<stem>/<file>)` — the path that resolves in `src/` and in the
@@ -408,10 +417,10 @@ const WEBFETCH_MARKER = '<!-- webfetch: allow -->';
408
417
  * cannot name tools it has never seen, so a read-only agent in a session with such a server can
409
418
  * still write through it, until this becomes an allowlist (`tools:`).
410
419
  */
411
- function claudeAgentFrontmatter(stem, text, overrides) {
420
+ function claudeAgentFrontmatter(stem, text, model = null) {
412
421
  const fm = [`name: ${stem}`, `description: ${jsonDumps(agentDescription(text))}`];
413
- const ov = agentOverride(overrides, stem);
414
- if (isTruthy(ov.model)) fm.push(`model: ${formatValue(ov.model)}`);
422
+ // `model` is `claudeAgentModel(...).model`: the one precedence, resolved by the caller.
423
+ if (model) fm.push(`model: ${model}`);
415
424
  if (isReadonly(text)) {
416
425
  const list = ['Write', 'Edit', 'NotebookEdit', 'Agent', 'Task'];
417
426
  if (!text.includes(WEBFETCH_MARKER)) list.push('WebFetch');
@@ -469,7 +478,7 @@ const OVERRIDE_KEYS = ['model', 'temperature', 'variant', 'steps'];
469
478
  * boolean, a list, an object — threw a bare TypeError that aborted the emit with a stack trace
470
479
  * naming nothing the user wrote.
471
480
  */
472
- function overrideProblem(v) {
481
+ export function overrideProblem(v) {
473
482
  if (typeof v === 'string') return /[\r\n\u2028\u2029]/.test(v) ? 'contains a line break' : '';
474
483
  // `parseJson` yields exactly one object `isDict` refuses: its number wrapper.
475
484
  const isNumber = typeof v === 'object' && v !== null && !Array.isArray(v) && !isDict(v);
@@ -481,7 +490,7 @@ function overrideProblem(v) {
481
490
  * `_build_emit._load_agent_overrides`, with every value that would break the frontmatter
482
491
  * dropped and named on stderr — the user's file, so a bad entry is a warning, never an abort.
483
492
  */
484
- export function loadAgentOverrides(base) {
493
+ export function loadAgentOverrides(base, report = warn) {
485
494
  const file = path.join(base, 'agent-overrides.json');
486
495
  let data;
487
496
  try {
@@ -503,7 +512,7 @@ export function loadAgentOverrides(base) {
503
512
  for (const [stem, entry] of Object.entries(agents)) {
504
513
  if (entry === null) continue;
505
514
  if (!isDict(entry)) {
506
- warn(`[geneseed] WARN: ${file}: agents.${stem} is not an object — skipped`);
515
+ report(`[geneseed] WARN: ${file}: agents.${stem} is not an object — skipped`);
507
516
  delete agents[stem];
508
517
  continue;
509
518
  }
@@ -511,13 +520,115 @@ export function loadAgentOverrides(base) {
511
520
  if (!given(entry[key])) continue;
512
521
  const why = overrideProblem(entry[key]);
513
522
  if (!why) continue;
514
- warn(`[geneseed] WARN: ${file}: agents.${stem}.${key} ${why} — skipped`);
523
+ report(`[geneseed] WARN: ${file}: agents.${stem}.${key} ${why} — skipped`);
515
524
  delete entry[key];
516
525
  }
517
526
  }
518
527
  return agents;
519
528
  }
520
529
 
530
+ /**
531
+ * What Claude Code's own aliases are called on a cloud provider: `sonnet` is only a model there
532
+ * once `ANTHROPIC_DEFAULT_SONNET_MODEL` says which one (Bedrock and Vertex have no default).
533
+ */
534
+ const CLAUDE_ALIAS_ENV = Object.freeze({
535
+ opus: 'ANTHROPIC_DEFAULT_OPUS_MODEL', sonnet: 'ANTHROPIC_DEFAULT_SONNET_MODEL',
536
+ haiku: 'ANTHROPIC_DEFAULT_HAIKU_MODEL',
537
+ });
538
+ /** The model each non-strong tier gets on Claude Code when `tiers.<tier>` names none (spec D2). */
539
+ export const CLAUDE_TIER_DEFAULTS = Object.freeze({ standard: 'sonnet', light: 'haiku' });
540
+ /** The tier-map keys that take a model; `strong` is the parent's model and takes none (D9). */
541
+ const TIER_MAP_KEYS = ['standard', 'light'];
542
+
543
+ /** An env switch the way Claude Code reads it: set, and not spelled off. */
544
+ function envOn(env, name) {
545
+ const v = String(env[name] ?? '').trim().toLowerCase();
546
+ return v !== '' && v !== '0' && v !== 'false';
547
+ }
548
+
549
+ /**
550
+ * The model a tier gets on Claude Code, or null (inherit) — pure, so the table in
551
+ * `tests/unit/tiers.test.mjs` states every row. `map` is the user's `tiers` map
552
+ * (`loadTierMap`), `env` the environment.
553
+ *
554
+ * - `strong` never gets a line: it IS the parent's model.
555
+ * - A tier the map does not name gets the alias default (`CLAUDE_TIER_DEFAULTS`); a tier the map
556
+ * names with an empty value is the user choosing inherit.
557
+ * - D11 (revised 2026-11-17): the alias is ALWAYS written. On Bedrock or Vertex without
558
+ * `ANTHROPIC_DEFAULT_<ALIAS>_MODEL`, Claude Code resolves it to its built-in model id (seen on
559
+ * 2.1.326, Vertex: `haiku` -> claude-haiku-4-5@20251001, and the sub-agent runs), which may not
560
+ * exist in the user's cloud project. So `model` is unchanged and `warning` carries the advice to
561
+ * pin it; the doctor prints it (`tierEnvNotes`), the build says nothing. Only the three aliases
562
+ * are checked: any other value is a model id the user wrote and owns.
563
+ */
564
+ export function claudeTierModel(tier, map = {}, env = {}) {
565
+ if (!TIER_MAP_KEYS.includes(tier)) return { model: null, warning: null };
566
+ const named = Object.hasOwn(map, tier);
567
+ const value = named ? map[tier] : CLAUDE_TIER_DEFAULTS[tier];
568
+ if (!isTruthy(value)) return { model: null, warning: null };
569
+ const alias = String(value).trim().toLowerCase();
570
+ const cloud = ['CLAUDE_CODE_USE_BEDROCK', 'CLAUDE_CODE_USE_VERTEX'].find((n) => envOn(env, n));
571
+ const need = Object.hasOwn(CLAUDE_ALIAS_ENV, alias) ? CLAUDE_ALIAS_ENV[alias] : null;
572
+ const warning = cloud && need && !String(env[need] ?? '').trim()
573
+ ? `--tiers auto: ${cloud} is set but ${need} is not, so the ${tier} tier's '${alias}' alias `
574
+ + `resolves to Claude Code's built-in model id, which may not exist in your cloud project — `
575
+ + `pin it: set ${need}`
576
+ : null;
577
+ return { model: String(value), warning };
578
+ }
579
+
580
+ /**
581
+ * The model one agent gets on Claude Code, and why — THE ONE HOME of the precedence (spec D5),
582
+ * highest first: the user's pin (`agents.<name>.model`), then the `tiers` map, then the tier's
583
+ * default alias, then inherit. The emit writes `model` into the agent's frontmatter
584
+ * (`writeNativeLayer`) and the console shows the same answer (`js/web/agent-models-api.mjs`).
585
+ *
586
+ * `tiers` is `{ map, env }` while `--tiers auto` is on, else null (a pin still applies).
587
+ * `from`: `pin`, `map` (the map names the tier, an empty value included), `default`, `inherit`.
588
+ * `warning` is `claudeTierModel`'s, and only for a model the tier gave: a pinned agent has none.
589
+ */
590
+ export function claudeAgentModel(tier, pin, tiers = null) {
591
+ if (isTruthy(pin)) return { model: formatValue(pin), from: 'pin', warning: null };
592
+ if (!tiers) return { model: null, from: 'inherit', warning: null };
593
+ const { model, warning } = claudeTierModel(tier, tiers.map, tiers.env);
594
+ if (!model) return { model: null, from: 'inherit', warning: null };
595
+ return { model: formatValue(model), from: Object.hasOwn(tiers.map, tier) ? 'map' : 'default', warning };
596
+ }
597
+
598
+ /**
599
+ * The user's `tiers` map from `agent-overrides.json` (spec D9): `{ "standard": "<model>",
600
+ * "light": "<model>" }`. `strong` takes no value and is dropped with a notice, as is any other
601
+ * key; a value that would break the frontmatter is dropped like an `agents.*` one
602
+ * (`overrideProblem`). Missing or malformed file: `{}`, every tier on its default.
603
+ */
604
+ export function loadTierMap(base, report = warn) {
605
+ const file = path.join(base, 'agent-overrides.json');
606
+ let data;
607
+ try {
608
+ data = parseJson(readText(file));
609
+ } catch {
610
+ return {};
611
+ }
612
+ const tiers = isDict(data) ? data.tiers : null;
613
+ if (!isDict(tiers)) return {};
614
+ const out = {};
615
+ for (const [key, value] of Object.entries(tiers)) {
616
+ if (!TIER_MAP_KEYS.includes(key)) {
617
+ report(`[geneseed] WARN: ${file}: tiers.${key} is not a tier that takes a model `
618
+ + `(${TIER_MAP_KEYS.join(', ')}; strong is the parent's model) — skipped`);
619
+ continue;
620
+ }
621
+ if (value === null || value === undefined) continue;
622
+ const why = overrideProblem(value);
623
+ if (why) {
624
+ report(`[geneseed] WARN: ${file}: tiers.${key} ${why} — skipped`);
625
+ continue;
626
+ }
627
+ out[key] = value;
628
+ }
629
+ return out;
630
+ }
631
+
521
632
  /**
522
633
  * Warn once per override key the Claude dialect drops. The seeded `agent-overrides.json`
523
634
  * advertises all four keys on every host, and Claude Code's agent frontmatter takes `model`
@@ -690,10 +801,14 @@ export function writeNativeLayer(items, agentsDir, skillsDir, overrides = null,
690
801
  // choice. The caller (`emit-claude.mjs`) routes the suppressed names through
691
802
  // `writeAliasCommands(..., alsoUserOnly: true)` into `.bob/commands/*.md` instead (O2).
692
803
  bobDialect = false,
804
+ // `--tiers auto` on Claude Code: `{ map, env }` (`loadTierMap`, the build env), else null — no tier line.
805
+ tiers = null,
693
806
  } = {}) {
694
807
  const ov = overrides || {};
695
808
  if (bobDialect) warnBobIgnored(ov);
696
809
  else if (host === 'claude') warnClaudeIgnored(ov);
810
+ // D11: the build never withholds the alias; the doctor warns about a cloud provider (`tierEnvNotes`).
811
+ const tiersHere = tiers && host === 'claude' && !bobDialect ? tiers : null;
697
812
  let nAgents = 0;
698
813
  let nSkills = 0;
699
814
  const written = [];
@@ -707,7 +822,7 @@ export function writeNativeLayer(items, agentsDir, skillsDir, overrides = null,
707
822
  written.push(dest);
708
823
  };
709
824
 
710
- for (const { text, src: source, rel, licenceOf } of items) {
825
+ for (const { text, src: source, rel, licenceOf, tier = 'standard' } of items) {
711
826
  // A credited skill's upstream licence: copied verbatim beside its SKILL.md, held like a side
712
827
  // file until that claim holds. Routed by `licenceOf`, since `source` is the upstream's file.
713
828
  if (licenceOf) {
@@ -772,9 +887,10 @@ export function writeNativeLayer(items, agentsDir, skillsDir, overrides = null,
772
887
  let userOnly = false;
773
888
  if (folder === 'agents') {
774
889
  if (bobDialect) fm = bobAgentFrontmatter(stem, text);
775
- else if (host === 'claude') fm = claudeAgentFrontmatter(stem, text, ov);
890
+ else if (host === 'claude') fm = claudeAgentFrontmatter(stem, text, claudeAgentModel(tier, agentOverride(ov, stem).model, tiersHere).model);
776
891
  else fm = opencodeAgentFrontmatter(stem, text, ov, theme);
777
892
  dest = path.join(agentsDir, `${stem}.md`);
893
+ body = stripAgentSkillLinks(body);
778
894
  kind = 'agent';
779
895
  } else {
780
896
  // Skills are BYTE-IDENTICAL across hosts: name + description, body link-stripped.
@@ -27,7 +27,7 @@ import { writeText, readText, copyFile } from '../lib/fs.mjs';
27
27
  import { jsonDumps, jsonDumpsIndent, parseJson } from '../lib/json.mjs';
28
28
  import { comparePaths } from '../lib/paths.mjs';
29
29
  import { sourceReleaseVersion } from '../build/version.mjs';
30
- import { aliasesOf } from '../build/source.mjs';
30
+ import { aliasesOf, kitMembers, loadKits } from '../build/source.mjs';
31
31
  import { lstripNewlines } from './settings.mjs';
32
32
  import {
33
33
  firstBlockquote, isUserInvokedOnly, skillDescription, stripSkillBodyLinks, pointSideFiles,
@@ -83,23 +83,13 @@ const AGENT_OVERRIDES_STUB = {
83
83
  + 'steps (max tool-iterations — a runaway-loop cap). e.g. '
84
84
  + '"reviewer": {"model": "anthropic/claude-haiku-4-5", "temperature": 0.1, '
85
85
  + '"variant": "high", "steps": 20}. '
86
+ + 'Tiers (build with --tiers auto): "tiers": {"standard": "<model>", "light": "<model>"} '
87
+ + 'names the model each tier runs on; a tier you leave out gets its host default (Claude Code: '
88
+ + 'sonnet and haiku; other hosts inherit), an empty value means inherit, strong is always the session model. A '
89
+ + 'per-agent entry in "agents" wins over its tier. '
86
90
  + 'Host-specific; git-ignored. A future TUI screen edits this — rebuild to apply.'
87
91
  ),
88
92
  agents: {},
89
- // Inert: `loadAgentOverrides` reads `agents` only. This is the starting point the README
90
- // used to describe in prose — the seats whose work is read-and-summarise, where a smaller
91
- // model loses little and a council convenes 3–6 of them at once.
92
- _recommended: {
93
- _comment: (
94
- 'Cheap-tier seats: copy the ones you want into "agents" with your host\'s cheap '
95
- + 'model id (OpenCode: "anthropic/claude-haiku-4-5"; Claude Code: "haiku"). '
96
- + 'Read-and-summarise work — a council convenes several at once, so this is where '
97
- + 'the savings compound. Nothing applies until you copy it.'
98
- ),
99
- 'cheap-tier': ['explorer', 'researcher', 'tester', 'advocate', 'skeptic', 'pragmatist',
100
- 'steward', 'visionary', 'user-advocate', 'framer', 'empiricist', 'operator',
101
- 'historian'],
102
- },
103
93
  };
104
94
 
105
95
  /**
@@ -342,6 +332,12 @@ function writeCommandFile(dest, desc, body) {
342
332
  writeText(dest, `---\ndescription: ${jsonDumps(desc)}\n---\n\n${body}`);
343
333
  }
344
334
 
335
+ /** Every skill of a kit this build left OFF: not in `items`, and no error. */
336
+ function offKitSkills(cfg) {
337
+ const kits = loadKits(cfg.src);
338
+ return kitMembers(new Map([...kits].filter(([k]) => !(cfg.kits ?? []).includes(k)))).skills;
339
+ }
340
+
345
341
  /** `_build_emit._write_command_layer` — the opt-in /slash commands. */
346
342
  export function writeCommandLayer(cfg, items, commandDir, claim = (_dest) => true,
347
343
  skillDirOf = siblingSkillDir(commandDir)) {
@@ -352,6 +348,8 @@ export function writeCommandLayer(cfg, items, commandDir, claim = (_dest) => tru
352
348
  // A command runs a skill; `--exclude-skills` took that skill out, so the command goes too.
353
349
  if ((cfg.excludeSkills ?? []).includes(skill)) continue;
354
350
  const text = byName.get(skill);
351
+ // A skill of a kit that is off is not in `items`: its command goes with it, as for an exclusion.
352
+ if (text === undefined && offKitSkills(cfg).has(skill)) continue;
355
353
  if (text === undefined) {
356
354
  throw new Error(`COMMAND_SET: /${name} runs skill '${skill}', which src/skills/ does not have`);
357
355
  }
@@ -13,7 +13,7 @@
13
13
  * `node --check` over every OpenCode plugin. See `doctor.mjs` for what that allow-list costs.
14
14
  */
15
15
  import path from 'node:path';
16
- import { PLUGIN_SRC, SRC } from '../build/source.mjs';
16
+ import { PLUGIN_SRC, SRC, TIER_MARKER_RE } from '../build/source.mjs';
17
17
  import { HOSTS } from '../hosts/hosts.mjs';
18
18
  import { descBlockProblem, firstBlockquote } from '../hosts/native.mjs';
19
19
  import { readText } from '../lib/fs.mjs';
@@ -56,6 +56,7 @@ const ALLOWED_COMMENT_RES = [
56
56
  // js/web/docs.mjs HARNESS_OPEN_RE: `harness:` then one or more of its four ids, comma-separated.
57
57
  new RegExp(`^harness:\\s*(?:${HARNESS_IDS})(?:\\s*,\\s*(?:${HARNESS_IDS}))*$`),
58
58
  /^bash:\s*allow$/, // js/hosts/native.mjs BASH_MARKER
59
+ /^tier:\s*(strong|light)$/, // js/build/source.mjs TIER_MARKER_RE
59
60
  /^banned: ok$/, // checks-counts.mjs kitProblems: a kit line that names a banned string
60
61
  ];
61
62
 
@@ -146,6 +147,26 @@ export function factoryProblems(opts = {}) {
146
147
  * registry describes exactly what `src/` provides, no credential ships, and every vendored
147
148
  * folder carries an immutable upstream pin.
148
149
  */
150
+ /**
151
+ * The tier marker's shape in one agent spec, or '' when it holds. The build strips the whole line
152
+ * (`splitTier`), and that leaves the pre-marker text byte for byte only because the marker sits on
153
+ * a line of its own DIRECTLY ABOVE `## When to dispatch`; one anywhere else, twice, or naming a
154
+ * tier that does not exist would ship as live text or move a heading.
155
+ */
156
+ export function tierMarkerProblem(text) {
157
+ const lines = text.split(/\r?\n/);
158
+ const at = lines.map((l, i) => (/^\s*<!--\s*tier:/.test(l) ? i : -1)).filter((i) => i >= 0);
159
+ if (!at.length) return '';
160
+ if (at.length > 1) return 'has more than one tier marker';
161
+ if (!TIER_MARKER_RE.test(`${lines[at[0]]}\n`)) {
162
+ return `the tier marker '${lines[at[0]].trim()}' is not '<!-- tier: strong|light -->' on a line of its own`;
163
+ }
164
+ if (lines[at[0] + 1] !== '## When to dispatch') {
165
+ return "the tier marker is not directly above '## When to dispatch' (the line the build strips must leave the text unchanged)";
166
+ }
167
+ return '';
168
+ }
169
+
149
170
  export function authoringProblems() {
150
171
  const problems = [];
151
172
  for (const folder of ['agents', 'skills']) {
@@ -157,6 +178,8 @@ export function authoringProblems() {
157
178
  problems.push(`[authoring] ${folder}/${path.basename(spec)} unreadable: ${e.message}`);
158
179
  continue;
159
180
  }
181
+ const tierWhy = folder === 'agents' ? tierMarkerProblem(text) : '';
182
+ if (tierWhy) problems.push(`[authoring] agents/${path.basename(spec)}: ${tierWhy}`);
160
183
  if (!firstBlockquote(text)) {
161
184
  problems.push(`[authoring] ${folder}/${path.basename(spec)} has no '>' purpose line `
162
185
  + '(its OpenCode description would render empty)');
@@ -11,8 +11,10 @@ import { stripCapabilityLinks } from '../build/emit-common.mjs';
11
11
  import { STRUCTURE, renderAll } from '../build/render.mjs';
12
12
  import { CONFIG, CREDIT_RE, DESCRIPTION_LIMIT, makeCfg } from '../build/source.mjs';
13
13
  import { CLAUDE_STYLE, HOSTS, hostCatalogsNatively, resolvePath } from '../hosts/hosts.mjs';
14
- import { EMIT_HOST_SCOPE, footprintOfDir, readMaybe, renderedTier, themeFiles } from '../hosts/installs.mjs';
15
- import { isVendoredPath } from '../hosts/native.mjs';
14
+ import {
15
+ EMIT_HOST_SCOPE, footprintOfDir, installState, installTargets, readMaybe, renderedTier, themeFiles, tiersOfDir,
16
+ } from '../hosts/installs.mjs';
17
+ import { claudeTierModel, isVendoredPath, loadAgentOverrides, loadTierMap } from '../hosts/native.mjs';
16
18
  import { PALETTE_ROLES, colorThemeFiles } from '../hosts/opencode.mjs';
17
19
  import { readText, withDiscardableStderr } from '../lib/fs.mjs';
18
20
  import { parseJson, formatRepr } from '../lib/json.mjs';
@@ -229,6 +231,45 @@ export function renderedPathNotes() {
229
231
  return notes;
230
232
  }
231
233
 
234
+ /**
235
+ * Each Claude Code install, global or project, built `--tiers auto` whose tier alias cannot
236
+ * resolve in this process's environment (spec D11, revised): a Bedrock or Vertex provider with no
237
+ * `ANTHROPIC_DEFAULT_<ALIAS>_MODEL`. The build wrote the alias anyway, and Claude Code resolves it
238
+ * to its built-in model id, which may not exist in the user's cloud project; this names the
239
+ * variable to pin. A tier is skipped when every agent of it carries its own `agents.<name>.model`
240
+ * pin, since no alias is then in play. A NOTE, not a problem: nothing is known to be broken.
241
+ * `env` is a parameter so a test plants the provider without touching the real one.
242
+ *
243
+ * Which installs: `installTargets()` (the cwd, the registered project roots and every host's
244
+ * global dir), each read at its own overrides dir: the config dir itself for a global install,
245
+ * `<root>/.claude` for a project one (where the emit read the map from).
246
+ */
247
+ export function tierEnvNotes(env = process.env) {
248
+ const notes = [];
249
+ let agents = null; // the agent stems of each tier, rendered once, only when an install needs it
250
+ for (const [host, scope, root] of installTargets()) {
251
+ if (host !== 'claude' || installState(root, host, scope) !== 'active') continue;
252
+ if (tiersOfDir(root, host) !== 'auto') continue;
253
+ const dir = scope === 'global' ? root : path.join(root, '.claude');
254
+ const map = loadTierMap(dir, () => {});
255
+ const pins = loadAgentOverrides(dir);
256
+ if (agents === null) {
257
+ agents = { standard: [], light: [] };
258
+ for (const { rel, tier = 'standard' } of renderAll(makeCfg(), 'neutral').items) {
259
+ const m = /^agents\/([^_/][^/]*)\.md$/.exec(rel);
260
+ if (m && agents[tier]) agents[tier].push(m[1]);
261
+ }
262
+ }
263
+ for (const tier of ['standard', 'light']) {
264
+ if (agents[tier].every((stem) => Object.hasOwn(pins, stem) && pins[stem]?.model)) continue;
265
+ const { warning } = claudeTierModel(tier, map, env);
266
+ const where = scope === 'global' ? host : `${host} (project ${root})`;
267
+ if (warning) notes.push(`${NOTE}[tiers] ${where}: ${warning}`);
268
+ }
269
+ }
270
+ return notes;
271
+ }
272
+
232
273
  /**
233
274
  * A committed bundle must match a fresh render of
234
275
  * `src/` for its OWN recorded theme, emit and footprint.
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import path from 'node:path';
10
10
  import {
11
- DOCS, DOC_FOLDERS, PLUGIN_SRC, RETIRED_KIT_IDS, ROOT, SRC, kitMembers, loadKits, makeCfg, ruleCanon, specLinks, upstreams,
11
+ DOCS, DOC_FOLDERS, PLUGIN_SRC, RETIRED_KIT_IDS, ROOT, SRC, kitMembers, linkTargetOf, loadKits, makeCfg, ruleCanon, specLinks, upstreams,
12
12
  } from '../build/source.mjs';
13
13
  import { effectiveTheme, renderFile } from '../build/render.mjs';
14
14
  import { themeFiles } from '../hosts/installs.mjs';
@@ -375,6 +375,7 @@ export function kitProblems(src = SRC) {
375
375
  if (words > budget) {
376
376
  problems.push(`[authoring] src/${m.rules} renders to ${words} words, over kit '${kit}' rulesWordBudget of ${budget}`);
377
377
  }
378
+ if (m.replacedBy) problems.push(...replacedByProblems(src, kit, m, cfg, theme, budget));
378
379
  }
379
380
  // R4. A core member (R3, named above) is left out: every core file linking it would repeat that.
380
381
  const r4 = new Set();
@@ -382,10 +383,80 @@ export function kitProblems(src = SRC) {
382
383
  // Links run kit -> core only: a core file, or ANOTHER kit's file, linking a member dangles
383
384
  // whenever that member's kit is off.
384
385
  if (!l.owner || l.kit === l.owner || core[l.kind].has(l.name)) continue;
386
+ // `replacedBy` is the one exception: the render rewrites a link to such a member when its kit is off.
387
+ // ...and only where the rewrite resolves the link (`linkTargetOf`), the same function it runs.
388
+ if (l.kind === 'skills' && kits.get(l.owner)?.replacedBy && !l.kit && linkTargetOf(l.rel, `{{DIR_SKILLS}}/${l.name}.md`)) continue;
385
389
  r4.add(l.kit
386
390
  ? `[authoring] src/${l.rel} (kit '${l.kit}') links ${l.kind}/${l.name}, a member of kit '${l.owner}' — links run kit → core only`
387
391
  : `[authoring] src/${l.rel} links ${l.kind}/${l.name}, a kit member — the link dangles when the kit is off`);
388
392
  }
389
393
  problems.push(...r4);
394
+ problems.push(...bareMentionProblems(src, kits));
390
395
  return problems;
391
396
  }
397
+
398
+ /**
399
+ * A kit's `replacedBy` (spec 2): a plugin skill for EVERY member and for nothing else, an upstream
400
+ * key `src/upstreams.json` holds, a spelling per host that carries `{name}`, and the two blocks
401
+ * the render leaves behind with the kit off (`provider`, `missing`), each inside the word budget.
402
+ */
403
+ function replacedByProblems(src, kit, m, cfg, theme, budget) {
404
+ const at = `src/kits/${kit}.json`;
405
+ const r = m.replacedBy;
406
+ const out = [];
407
+ let keys = [];
408
+ try { keys = Object.keys(upstreams()); } catch { /* creditProblems names a bad upstreams.json */ }
409
+ if (!keys.includes(r.upstream)) out.push(`[authoring] ${at}: replacedBy.upstream '${r.upstream}' is not a key of src/upstreams.json`);
410
+ for (const s of m.skills) {
411
+ if (typeof r.skills[s] !== 'string' || !r.skills[s]) out.push(`[authoring] ${at}: replacedBy.skills has no plugin skill for member '${s}'`);
412
+ }
413
+ if (r.plain !== undefined) {
414
+ for (const s of m.skills) {
415
+ if (typeof r.plain[s] !== 'string' || !r.plain[s]) out.push(`[authoring] ${at}: replacedBy.plain has no wording for member '${s}'`);
416
+ }
417
+ }
418
+ for (const s of Object.keys(r.skills)) {
419
+ if (!m.skills.includes(s)) out.push(`[authoring] ${at}: replacedBy.skills names '${s}', which is not a skill of kit '${kit}'`);
420
+ }
421
+ for (const [host, tpl] of Object.entries(r.hosts)) {
422
+ if (typeof tpl !== 'string' || !tpl.includes('{name}')) out.push(`[authoring] ${at}: replacedBy.hosts.${host} must be a spelling with {name}`);
423
+ }
424
+ for (const field of ['provider', 'missing']) {
425
+ const f = r[field];
426
+ if (typeof f !== 'string' || !isFile(path.join(src, f))) {
427
+ out.push(`[authoring] ${at}: replacedBy.${field} must name a file under src/`);
428
+ continue;
429
+ }
430
+ const words = renderFile(cfg, path.join(src, f), theme).split(/\s+/).filter(Boolean).length;
431
+ if (words > budget) out.push(`[authoring] src/${f} renders to ${words} words, over kit '${kit}' rulesWordBudget of ${budget}`);
432
+ }
433
+ return out;
434
+ }
435
+
436
+ /**
437
+ * A member of a kit with `replacedBy` named in prose, with no link: the kit-off rewrite only sees
438
+ * links, so the name would ship as a Rite the install does not have. Refused in core specs:
439
+ * `<member> {{SKILL}}` or a backticked `member` outside a link label. Turn the mention into a link.
440
+ */
441
+ function bareMentionProblems(src, kits) {
442
+ const names = [...kits.values()].filter((k) => k.replacedBy).flatMap((k) => k.skills);
443
+ if (!names.length) return [];
444
+ const owned = new Set([...kits.values()].flatMap((k) => [...k.skills, ...k.agents]));
445
+ const alt = names.join('|');
446
+ const re = new RegExp(`(?<![\\[\\x60/-])(?:\\b(?:${alt}) \\{\\{SKILL\\}\\}|\\x60(?:${alt})\\x60 (?:skill|\\{\\{SKILL\\}\\}))`);
447
+ const out = [];
448
+ // Every folder that renders into an install, not only skills/ and agents/ (the rewrite reads them all).
449
+ for (const dir of ['skills', 'agents', 'laws', 'doctrines', 'modes', 'postures', 'ontology', '.']) {
450
+ for (const f of mdIn(path.join(src, dir)).concat(dir === '.' ? ['AGENT.md.tmpl'] : [])) {
451
+ if (dir !== '.' && (owned.has(f.slice(0, -3)) || f.startsWith('_'))) continue;
452
+ const rel = dir === '.' ? f : `${dir}/${f}`;
453
+ if (!isFile(path.join(src, rel))) continue;
454
+ readText(path.join(src, rel)).split('\n').forEach((line, i) => {
455
+ if (re.test(line.replace(/\[[^\]]*\]\([^)]*\)/g, ''))) {
456
+ out.push(`[authoring] src/${rel}:${i + 1} names a superpowers-kit skill without a link, so the kit-off rewrite cannot see it`);
457
+ }
458
+ });
459
+ }
460
+ }
461
+ return out;
462
+ }
@@ -40,7 +40,7 @@ import {
40
40
  } from '../hosts/hosts.mjs';
41
41
  import {
42
42
  EMIT_HOST_SCOPE, defaultTheme, doctrinesForBuild, excludedRulesOfDir,
43
- contextWindowOfDir, excludedSkillsOfDir, gatesOfDir, kitsOfDir, sharedTierOfDir,
43
+ contextWindowOfDir, excludedSkillsOfDir, gatesOfDir, sharedTierOfDir, tiersOfDir,
44
44
  footprintOfDir, modeOfDir, postureOfDir,
45
45
  trustOfDir,
46
46
  readJsonMaybe, readMaybe, renderedTier, themeOfDir,
@@ -53,6 +53,7 @@ import { NOTES_DIRS, sharedPaths } from '../lib/machine-dir.mjs';
53
53
  import { normcase, toPlatformPath } from '../lib/paths.mjs';
54
54
  import { projectNotesDir } from '../hosts/spec-feedback.mjs';
55
55
  import { relPosix } from '../lib/text.mjs';
56
+ import { migratedKitsOfDir } from '../maintain/kit-migration.mjs';
56
57
 
57
58
  /**
58
59
  * This process's start, in epoch seconds.
@@ -129,11 +130,19 @@ const posixRel = (rel) => rel.split('\\').join('/');
129
130
  * is its name, which the texts still spell (`locatedAt`).
130
131
  */
131
132
  function renderExpected(host, axes) {
133
+ const { overridesText = null, ...renderAxes } = axes;
132
134
  const tmp = mkdtempSync(path.join(os.tmpdir(), 'geneseed-diff-'));
133
135
  try {
134
136
  const expected = path.join(tmp, 'expected');
137
+ // The deployed `agent-overrides.json`, seeded BEFORE the emit: the emit reads the user's per-agent
138
+ // pins and `tiers` map out of the config dir it writes, so a render without it states every
139
+ // map- or pin-driven `model:` line as drift, and a restore would write the default over it.
140
+ if (overridesText !== null) {
141
+ mkdirSync(expected, { recursive: true });
142
+ writeText(path.join(expected, 'agent-overrides.json'), overridesText);
143
+ }
135
144
  withStdoutSwallowed(() => emitGlobalInto(host, {
136
- ...axes, out: path.join(tmp, 'bundle'), cfgDir: expected,
145
+ ...renderAxes, out: path.join(tmp, 'bundle'), cfgDir: expected,
137
146
  }));
138
147
  const texts = new Map();
139
148
  for (const p of rglobFiles(expected)) texts.set(relPosix(expected, p), readText(p));
@@ -264,11 +273,16 @@ export function diffCollect({
264
273
  // The excluded skills, or every skill the install left out reads as deleted.
265
274
  excludeSkills: excludedSkillsOfDir(dir, host),
266
275
  // The kits on, or every kit file reads as added and the Kits block as drift.
267
- kits: kitsOfDir(dir, host),
276
+ kits: migratedKitsOfDir(dir, host),
268
277
  // The shared-tier marker, or an install built `--shared-tier on` reads its `Shared tier: on` line as drift.
269
278
  sharedTier: sharedTierOfDir(dir, host),
270
279
  // The context window, or a `1m` install reads its `Context window: 1m` line as drift.
271
280
  contextWindow: contextWindowOfDir(dir, host),
281
+ // The tier routing, or an install built `--tiers auto` reads its `Model tiers: auto` line and every tiered agent as drift.
282
+ tiers: tiersOfDir(dir, host),
283
+ // The user's own overrides file (pins and the tiers map): a render input like every axis above, so it is
284
+ // part of the memo key, and `null` (no file) leaves the emit to seed its stub as before.
285
+ overridesText: readMaybe(path.join(dir, 'agent-overrides.json')),
272
286
  // The gate switches, or a disarmed install reads its `<gate>: off` line as drift.
273
287
  ...gatesOfDir(dir, host),
274
288
  // The tier root it rendered, or an install left relative reads every file as behind source.
@@ -35,14 +35,16 @@ import { emitGlobalInto, emitProjectInto, main as driverMain } from '../build/dr
35
35
  import { ROOT } from '../build/source.mjs';
36
36
  import { CLAUDE_STYLE, opencodeShadowedInstall, resolvePath } from '../hosts/hosts.mjs';
37
37
  import {
38
- hookShellProblems, installedDefaults, openclaudeDualHarnessRoots, themeFiles,
38
+ hookShellProblems, installTargets, installedDefaults, openclaudeDualHarnessRoots, themeFiles,
39
39
  } from '../hosts/installs.mjs';
40
+ import { installProfile } from '../build/profile.mjs';
41
+ import { providerWarning } from '../maintain/kit-migration.mjs';
40
42
  import { validateIsVendored } from '../hosts/native.mjs';
41
43
  import { printErr, printOut } from '../lib/fs.mjs';
42
44
  import { authoringProblems, factoryProblems, loopProblems } from './checks-authoring.mjs';
43
45
  import { gateProbe, guardProbe } from './checks-probe.mjs';
44
46
  import {
45
- checkBuild, colorThemeProblems, renderedPathNotes, renderedProblems, themeParityProblems,
47
+ checkBuild, colorThemeProblems, renderedPathNotes, renderedProblems, themeParityProblems, tierEnvNotes,
46
48
  } from './checks-build.mjs';
47
49
  import {
48
50
  bobBlockProblems, hostMatrixProblems, localNoteProblems, moduleMapProblems, scorecardProblems,
@@ -78,6 +80,23 @@ export function openclaudeDualHarnessNotes() {
78
80
  + 'longer use if this was not intended');
79
81
  }
80
82
 
83
+ /**
84
+ * The workflow-provider WARN per install (`providerWarning`): the superpowers kit and the official
85
+ * plugin both on, or neither. A NOTE, never a problem: either is a legal configuration its owner
86
+ * may have chosen, and doctor must not fail on it. Read from files only, and never on the hook path.
87
+ */
88
+ export function providerNotes() {
89
+ const out = [];
90
+ for (const [host, scope, root] of installTargets()) {
91
+ let p;
92
+ try { p = installProfile(host, scope, root); } catch { continue; }
93
+ if (p.state === 'absent') continue;
94
+ const w = providerWarning({ host, scope, root, kits: p.kits });
95
+ if (w) out.push(`${NOTE}[superpowers] ${host}:${scope} — ${w}`);
96
+ }
97
+ return out;
98
+ }
99
+
81
100
  /**
82
101
  * `swallowStdout` and `captureBoth` below are the same operation over a different stream
83
102
  * list: replace each stream's `write` with a no-op for the duration of `fn`, then restore
@@ -269,6 +288,8 @@ export function doctorCollect({
269
288
  problems = problems.concat(ran('openclaude_dual', 'OpenClaude dual harness',
270
289
  openclaudeDualHarnessNotes()));
271
290
  problems = problems.concat(ran('shared_paths', 'Rendered shared paths', renderedPathNotes()));
291
+ problems = problems.concat(ran('providers', 'Workflow provider', providerNotes()));
292
+ problems = problems.concat(ran('tier_env', 'Model tier aliases', tierEnvNotes()));
272
293
  problems = problems.concat(ran('map', 'Module map', moduleMapProblems()));
273
294
  problems = problems.concat(ran('host_matrix', 'Host tables', hostMatrixProblems()));
274
295
  problems = problems.concat(ran('host_claims', 'Host claims',
@@ -52,6 +52,7 @@ import {
52
52
  installsReferencingShim, openclaudeDualHarnessRoots, themeOfDir, readJsonMaybe, readMaybe,
53
53
  } from '../hosts/installs.mjs';
54
54
  import { installProfile, rebuildCommand } from '../build/generate.mjs';
55
+ import { providerWarning } from '../maintain/kit-migration.mjs';
55
56
  import { isDoctorNote } from './scan.mjs';
56
57
  import { pendingDrafts } from '../hosts/hooks-context.mjs';
57
58
  import { factCount } from '../hosts/memory-files.mjs';
@@ -379,7 +380,8 @@ export function statusData() {
379
380
  // Only when something is kept, so `--json` without kits stays the bytes it was.
380
381
  const kept = keptKitFiles(host, scope, root, p.kits);
381
382
  const rebuild = rebuildCommand(p.argv);
382
- return { ...p, ...(kept ? { keptKitFiles: kept } : {}), rebuild };
383
+ const warn = providerWarning({ host, scope, root, kits: p.kits });
384
+ return { ...p, ...(kept ? { keptKitFiles: kept } : {}), ...(warn ? { providerWarning: warn } : {}), rebuild };
383
385
  } catch (e) {
384
386
  return { host, scope, root, state: 'unreadable', error: String(e?.message ?? e) };
385
387
  }
@@ -510,10 +512,12 @@ export function statusLines(d, color = false, boxed = true) {
510
512
  ...(p.sharedTier ? ['shared tier: on'] : []),
511
513
  // Elided at the default, like the shared tier, so a default row prints what it did.
512
514
  ...(p.contextWindow && p.contextWindow !== DEFAULT_CONTEXT_WINDOW ? [`context window: ${p.contextWindow}`] : []),
515
+ ...(p.tiers && p.tiers !== 'off' ? [`model tiers: ${p.tiers}`] : []),
513
516
  // Each elided when armed. The law's text still binds; only its tool-boundary gate is off.
514
517
  ...GATE_SWITCHES.filter((g) => p[g.key] === false)
515
518
  .map((g) => `${g.marker.toLowerCase()}: off${g.law ? ` (Law ${g.law} text still binds)` : ''}`)]
516
519
  .join(` ${DOT} `) + where]);
520
+ if (p.providerWarning) rows.push([`${p.host}:${p.scope}`, `${p.providerWarning}${where}`]);
517
521
  // R6: a member its owner edited outlives its kit; name it, so turning the kit off is visible.
518
522
  for (const [kit, rels] of Object.entries(p.keptKitFiles ?? {})) {
519
523
  rows.push([`${p.host}:${p.scope}`, `kept from inactive kit ${kit}: ${rels.join(', ')}${where}`]);
@@ -155,7 +155,7 @@ export function cmdValidate(args) {
155
155
  theme: args.theme, footprint: args.footprint, posture: args.posture, mode: args.mode,
156
156
  trust: args.trust, doctrines: args.doctrines, excludeRules: args.excludeRules,
157
157
  excludeSkills: args.excludeSkills, kits: args.kits, sharedTier: args.sharedTier === 'on',
158
- contextWindow: args.contextWindow,
158
+ contextWindow: args.contextWindow, tiers: args.tiers,
159
159
  ...Object.fromEntries(GATE_SWITCHES.map((g) => [g.key, args[g.arg] ? false : null])),
160
160
  };
161
161
  let scanDirs;
@@ -72,6 +72,16 @@ const listFiles = (dir, ext) => (isDir(dir)
72
72
  ? readdirSync(dir).filter((n) => n.endsWith(ext) && !n.startsWith('_') && n !== 'README.md').sort()
73
73
  : []);
74
74
 
75
+ /**
76
+ * A brick is available when the agent or skill it names ships. THE SKILL CHECK READS `src/`, NOT AN
77
+ * INSTALL, and that is a decision, not an oversight: this catalogue serves `geneseed loop next`,
78
+ * which hands the model a brick's prompt and has no install to read (see the module header). A
79
+ * skill of a kit that is off (`debug`, for `ci-fix`) is therefore still "shipped" here. What keeps
80
+ * that honest is the brick, not this check: `ci-fix` carries its CI-specific steps in its own body
81
+ * and tells the model to load the plugin's `systematic-debugging` when there is no `debug` skill,
82
+ * so it works with the superpowers kit on, off, or on a host with no plugin. A brick that needed a
83
+ * kit skill's body would have to say so the same way.
84
+ */
75
85
  function availability(brick, srcRoot) {
76
86
  if (brick.agent && !isFile(path.join(srcRoot, 'agents', `${brick.agent}.md`))) {
77
87
  return { available: false, reason: `agent ${brick.agent} is not shipped` };