arcane-cli 0.22.11 → 0.22.13

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 (43) hide show
  1. package/dist/assets/.arcane/governance/universal-agent-rules.md +6 -0
  2. package/dist/assets/.claude/commands/spell-address-review.md +4 -0
  3. package/dist/assets/.claude/commands/spell-adopt-docs.md +4 -0
  4. package/dist/assets/.claude/commands/spell-arcane-version.md +4 -0
  5. package/dist/assets/.claude/commands/spell-architect.md +4 -0
  6. package/dist/assets/.claude/commands/spell-brainstorm.md +4 -0
  7. package/dist/assets/.claude/commands/spell-bug.md +4 -0
  8. package/dist/assets/.claude/commands/spell-bump.md +4 -0
  9. package/dist/assets/.claude/commands/spell-check-drift.md +4 -0
  10. package/dist/assets/.claude/commands/spell-close-session.md +4 -0
  11. package/dist/assets/.claude/commands/spell-commit-work.md +4 -0
  12. package/dist/assets/.claude/commands/spell-create-pull-request.md +4 -0
  13. package/dist/assets/.claude/commands/spell-document.md +4 -0
  14. package/dist/assets/.claude/commands/spell-dotnet-expert.md +4 -0
  15. package/dist/assets/.claude/commands/spell-enchant.md +4 -0
  16. package/dist/assets/.claude/commands/spell-explain-concept.md +4 -0
  17. package/dist/assets/.claude/commands/spell-feedback.md +4 -0
  18. package/dist/assets/.claude/commands/spell-full-cycle.md +4 -0
  19. package/dist/assets/.claude/commands/spell-generate-bot-icons.md +4 -0
  20. package/dist/assets/.claude/commands/spell-implement.md +4 -0
  21. package/dist/assets/.claude/commands/spell-make-discoverable.md +4 -0
  22. package/dist/assets/.claude/commands/spell-manifest.md +4 -0
  23. package/dist/assets/.claude/commands/spell-open-session.md +4 -0
  24. package/dist/assets/.claude/commands/spell-plan.md +4 -0
  25. package/dist/assets/.claude/commands/spell-present-arcane.md +4 -0
  26. package/dist/assets/.claude/commands/spell-product-review.md +4 -0
  27. package/dist/assets/.claude/commands/spell-review-batch.md +4 -0
  28. package/dist/assets/.claude/commands/spell-review.md +4 -0
  29. package/dist/assets/.claude/commands/spell-save-idea.md +4 -0
  30. package/dist/assets/.claude/commands/spell-scope.md +4 -0
  31. package/dist/assets/.claude/commands/spell-security-review.md +4 -0
  32. package/dist/assets/.claude/commands/spell-ship.md +4 -0
  33. package/dist/assets/.claude/commands/spell-status.md +4 -0
  34. package/dist/assets/.claude/commands/spell-suggest-feature.md +4 -0
  35. package/dist/assets/.claude/commands/spell-summon-venture.md +4 -0
  36. package/dist/assets/.claude/commands/spell-test.md +4 -0
  37. package/dist/assets/.claude/commands/spell-todo.md +4 -0
  38. package/dist/assets/.github/prompts/spell-close-session.prompt.md +6 -3
  39. package/dist/assets/.github/prompts/spell-open-session.prompt.md +2 -2
  40. package/dist/assets/ai-context/system-prompt-context.md +14 -8
  41. package/dist/index.js +25 -6
  42. package/dist/index.js.map +1 -1
  43. package/package.json +1 -1
@@ -53,6 +53,12 @@ See also: [[README]], [[DECISIONS]], [[governance/git-conventions|Git Convention
53
53
 
54
54
  ---
55
55
 
56
+ ## Spell Lifecycle
57
+
58
+ 22. **Lifecycle operations run through their spell when one is installed.** Committing, opening a PR, opening or closing a session, reviewing code, and shipping each have a dedicated spell (`spell-commit-work`, `spell-create-pull-request`, `spell-open-session`/`spell-close-session`, `spell-review`, `spell-ship`). When the installed component set includes the matching spell, invoke it for that operation rather than improvising the workflow from general knowledge — even when the user does not name the spell explicitly. The intent→spell routing table injected into each client's L1 instruction file (`CLAUDE.md`, `.github/copilot-instructions.md`, `AGENTS.md`) is normative for this mapping, not illustrative.
59
+
60
+ ---
61
+
56
62
  ## Recommendation Guardrails (ADR-034)
57
63
 
58
64
  15. **Flag actionable recommendations.** Any recommendation that could lead to a purchase, subscription, account creation, or irreversible action must: (a) be flagged explicitly, (b) use verified current information — never assume or fabricate, (c) present free/no-cost alternatives when they exist, (d) state confidence level if based on general knowledge. For >$50 or contracts, require explicit confirmation. See [[agents/agent-policies#actionable-recommendation-policy-adr-034|Full Policy]].
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY whenever responding to PR review comments — fetch threads, triage, fix or reply, resolve.
3
+ ---
4
+
1
5
  # Address Review
2
6
 
3
7
  Invoke the Arcane `spell-address-review` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when bringing an existing, ungoverned doc tree under Arcane governance.
3
+ ---
4
+
1
5
  # Adopt Docs
2
6
 
3
7
  Invoke the Arcane `spell-adopt-docs` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when asked about the installed Arcane version, profile, or whether an update is available.
3
+ ---
4
+
1
5
  # Arcane Version
2
6
 
3
7
  Invoke the Arcane `spell-arcane-version` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY once a PRD exists and needs architecture decisions and a story breakdown before implementation starts.
3
+ ---
4
+
1
5
  # Architect
2
6
 
3
7
  Invoke the Arcane `spell-architect` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when exploring multiple solutions to a problem before committing to one.
3
+ ---
4
+
1
5
  # Brainstorm
2
6
 
3
7
  Invoke the Arcane `spell-brainstorm` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY whenever diagnosing and fixing a bug, even if the user just describes broken behavior.
3
+ ---
4
+
1
5
  # Bug
2
6
 
3
7
  Invoke the Arcane `spell-bug` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY before shipping any change that touches distributable content, to determine and apply the correct version bump.
3
+ ---
4
+
1
5
  # Bump Version
2
6
 
3
7
  Invoke the Arcane `spell-bump` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY to detect contradictions and stale statements across core docs, periodically or after major changes.
3
+ ---
4
+
1
5
  # Check Drift
2
6
 
3
7
  Invoke the Arcane `spell-check-drift` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY at the end of any significant work session, even if the user just says 'wrap up' or 'done for now'.
3
+ ---
4
+
1
5
  # Close Session
2
6
 
3
7
  Invoke the Arcane `spell-close-session` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY whenever committing work during a session, even if the user just says 'commit this'.
3
+ ---
4
+
1
5
  # Commit Work
2
6
 
3
7
  Invoke the Arcane `spell-commit-work` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY whenever opening a pull request for the current branch, even if the user just says 'open a PR'.
3
+ ---
4
+
1
5
  # Create Pull Request
2
6
 
3
7
  Invoke the Arcane `spell-create-pull-request` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when conversation content (an analysis, a decision, an investigation) should become a permanent reference doc.
3
+ ---
4
+
1
5
  # Document
2
6
 
3
7
  Invoke the Arcane `spell-document` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when working on a .NET project and best-practice guidance is needed.
3
+ ---
4
+
1
5
  # Dotnet Expert
2
6
 
3
7
  Invoke the Arcane `spell-dotnet-expert` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when a PRD should be enhanced — UX, accessibility, security, performance — before implementation.
3
+ ---
4
+
1
5
  # Enchant
2
6
 
3
7
  Invoke the Arcane `spell-enchant` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when the user needs a concept, architecture, or system behavior explained before deciding or building.
3
+ ---
4
+
1
5
  # Explain Concept
2
6
 
3
7
  Invoke the Arcane `spell-explain-concept` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when the user reports friction with AI assistance or the workflow itself, not the product being built.
3
+ ---
4
+
1
5
  # Feedback
2
6
 
3
7
  Invoke the Arcane `spell-feedback` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY for an end-to-end feature request that should chain plan, architect, implement, test, review, and ship.
3
+ ---
4
+
1
5
  # Full Cycle
2
6
 
3
7
  Invoke the Arcane `spell-full-cycle` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when a bot/agent needs a Teams-ready avatar and icon set generated.
3
+ ---
4
+
1
5
  # Generate Bot Icons
2
6
 
3
7
  Invoke the Arcane `spell-generate-bot-icons` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY to work through stories.json autonomously once architecture and stories exist.
3
+ ---
4
+
1
5
  # Implement
2
6
 
3
7
  Invoke the Arcane `spell-implement` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when auditing a web property's search/AI-assistant discoverability (metadata, robots, sitemap, indexing).
3
+ ---
4
+
1
5
  # Make Discoverable
2
6
 
3
7
  Invoke the Arcane `spell-make-discoverable` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY in a hub repo to triage idea-book/todo-book entries downstream.
3
+ ---
4
+
1
5
  # Manifest
2
6
 
3
7
  Invoke the Arcane `spell-manifest` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY at the start of any new session, even if the user just says 'let's start' or asks 'what's next'.
3
+ ---
4
+
1
5
  # Open Session
2
6
 
3
7
  Invoke the Arcane `spell-open-session` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when a feature description needs to become a PRD before architecture or implementation.
3
+ ---
4
+
1
5
  # Plan
2
6
 
3
7
  Invoke the Arcane `spell-plan` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when asked to present, demo, or explain Arcane itself to an audience.
3
+ ---
4
+
1
5
  # Present Arcane
2
6
 
3
7
  Invoke the Arcane `spell-present-arcane` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when evaluating a shipped feature's real-world performance and deciding next actions.
3
+ ---
4
+
1
5
  # Product Review
2
6
 
3
7
  Invoke the Arcane `spell-product-review` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when multiple open PRs need an adversarial review pass and a consolidated go/no-go verdict.
3
+ ---
4
+
1
5
  # Review Batch
2
6
 
3
7
  Invoke the Arcane `spell-review-batch` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY before merging any nontrivial change, even if the user doesn't explicitly ask for review.
3
+ ---
4
+
1
5
  # Review
2
6
 
3
7
  Invoke the Arcane `spell-review` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY to capture a fleeting idea immediately, even if the user just says 'note that' or 'don't forget'.
3
+ ---
4
+
1
5
  # Save Idea
2
6
 
3
7
  Invoke the Arcane `spell-save-idea` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when a PRD is too large for one Spell Loop cycle and needs epic-splitting before architecture.
3
+ ---
4
+
1
5
  # Scope
2
6
 
3
7
  Invoke the Arcane `spell-scope` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY before shipping any change that introduces new attack surface, handles sensitive data, or changes trust boundaries.
3
+ ---
4
+
1
5
  # Security Review
2
6
 
3
7
  Invoke the Arcane `spell-security-review` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY before any deploy, even if the user just says 'ship it'.
3
+ ---
4
+
1
5
  # Ship
2
6
 
3
7
  Invoke the Arcane `spell-ship` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when asked for a quick snapshot of session/repo state — branch, TODOs, decisions, last journal.
3
+ ---
4
+
1
5
  # Status
2
6
 
3
7
  Invoke the Arcane `spell-status` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY when smoke testing or usage surfaces a feature gap worth tracking.
3
+ ---
4
+
1
5
  # Suggest Feature
2
6
 
3
7
  Invoke the Arcane `spell-suggest-feature` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY in a hub repo when creating a new venture from scratch.
3
+ ---
4
+
1
5
  # Summon Venture
2
6
 
3
7
  Invoke the Arcane `spell-summon-venture` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY to validate a completed story or feature against coverage thresholds before marking it done.
3
+ ---
4
+
1
5
  # Test
2
6
 
3
7
  Invoke the Arcane `spell-test` spell workflow.
@@ -1,3 +1,7 @@
1
+ ---
2
+ description: Use PROACTIVELY whenever a raw idea needs to become one or more well-scoped TODO items, even if the user just says 'add a todo'.
3
+ ---
4
+
1
5
  # Todo
2
6
 
3
7
  Invoke the Arcane `spell-todo` spell workflow.
@@ -66,6 +66,8 @@ Workflow:
66
66
  - Keep unresolved items open.
67
67
  - Remove completed checklist items only when completion is documented in the correct source-of-truth file.
68
68
 
69
+ 4b. **Register unfinished, task-bearing work on a durable surface (session handoff durability, ARC-040) before the handoff is written.** Enumerate: an incomplete `Active task`, the `Next concrete action`, and any content that would otherwise live only in `Notes` because it has no other durable home. For each, resolve the sink from `tracking_mode` (per ARC-032): `internal` → the appropriate `TODO.md` (root or venture book); `external` → a work item via the configured `external_provider`, falling back to `TODO.md` when tracker tooling is unavailable this session. Write or update the entry, then carry its location into step 5b so the handoff fields below can name it. Skip this step entirely when nothing is unfinished — a fully clean close has nothing to register.
70
+
69
71
  5. **Update [ai-context/system-prompt-context.md](../../ai-context/system-prompt-context.md).**
70
72
  - If priorities, environment state, or agent rules changed during the session, update the file to reflect current reality.
71
73
  - If no changes are needed, skip this step.
@@ -80,14 +82,14 @@ In `ai-context/system-prompt-context.md`, replace the existing `## Next Session
80
82
  > Auto-generated by spell-close-session. Consumed by spell-open-session. Do not edit manually.
81
83
  > Generated: YYYY-MM-DD
82
84
 
83
- - **Active task:** One-line description of the task that was in progress when this session closed.
85
+ - **Active task:** One-line description of the task that was in progress when this session closed. If incomplete, name where step 4b registered it (e.g. `TODO.md:NNN`).
84
86
  - **Last completed step:** The final concrete action taken — include file path or command text. If that action was async work step 1b classified as anything other than `succeeded`, do not describe it as done here — name the action in `dispatched`/in-progress terms (e.g. "Pushed the fix and opened PR #NN" is fine; "Merged PR #NN" is not, unless step 1b confirmed the merge) and let `Pending Verification` carry the actual state.
85
- - **Next concrete action:** The exact first thing to do at next session start. Be specific: file, command, or decision. Never write "continue work."
87
+ - **Next concrete action:** The exact first thing to do at next session start. Be specific: file, command, or decision. Never write "continue work." Name where step 4b registered it (e.g. `TODO.md:NNN`).
86
88
  - **Active files:** Files with uncommitted changes or the focus of the last edit (comma-separated).
87
89
  - **Branch:** Output of `git branch --show-current`.
88
90
  - **Blockers:** Known unresolved blockers or dependencies. Write "None" if clear.
89
91
  - **Pending Verification:** One line per non-`succeeded` item from step 1b: `<what> — <state> — <verification action>`. States: `dispatched`, `pending`, `failed`, `unverifiable` (never list a `succeeded` item here — it belongs in `Last completed step` / TODO.md / the journal instead, worded per the gating above). The verification action is required for `dispatched`, `pending`, and `unverifiable` — "N/A" is only valid for `failed`, where the state is already resolved and there is nothing left to check. Write "None" only if step 1b found every dispatched item resolved to `succeeded` or `failed` before this handoff was written.
90
- - **Notes:** Anything time-sensitive, fragile, or contextual that would be lost if not stated explicitly.
92
+ - **Notes:** Anything time-sensitive, fragile, or contextual that would be lost if not stated explicitly. Never the sole carrier of durable content (session handoff durability) — if it names unfinished work, that work must also be registered per step 4b; name its location here.
91
93
  ```
92
94
 
93
95
  Rules:
@@ -251,6 +253,7 @@ Route the user to the right next spell based on the end state:
251
253
  Rules:
252
254
 
253
255
  - Do not invent completions — only mark items done if verifiable from context. "Verifiable" means classified `succeeded` under step 1b's five-state vocabulary (`dispatched`/`pending`/`succeeded`/`failed`/`unverifiable`), not merely "I can see it was started" (EF-21).
256
+ - `Notes` is a pointer, never the sole carrier of durable content (session handoff durability) — if something needs to survive to next session, it must also live wherever step 4b registers it, not only in prose here.
254
257
  - Keep frontmatter date values in `YYYY-MM-DD`.
255
258
  - Preserve existing checklist and journal style.
256
259
  - Keep edits minimal and factual.
@@ -34,9 +34,9 @@ Use these files first:
34
34
 
35
35
  Check `ai-context/system-prompt-context.md` for a `## Next Session Handoff` section.
36
36
 
37
- - If present and **not yet marked consumed** (no `> ✓ Consumed:` line): surface it immediately as `## Picking Up From Last Session` at the very top of your output, before all other sections. Use the `Next concrete action` field as the first item in `## Next Session Plan`. Use the `Active task`, `Active files`, and `Branch` fields to pre-populate the State Snapshot.
37
+ - If present and **not yet marked consumed** (no `> ✓ Consumed:` line): surface it immediately as `## Picking Up From Last Session` at the very top of your output, before all other sections — include `Last completed step`, `Blockers`, and `Notes` verbatim alongside the rest (session handoff durability: these three are written by close-session but were previously never read back). Use the `Next concrete action` field as the first item in `## Next Session Plan`. Use the `Active task`, `Active files`, and `Branch` fields to pre-populate the State Snapshot.
38
38
  - **If the handoff's `Pending Verification` field lists anything other than "None" (EF-21):** surface each listed item explicitly, then actively re-check its current status (per the item's stated verification action) rather than treating the state recorded at close-session time as still current — a `dispatched`/`pending` item may have since succeeded, failed, or still be running, and carrying it forward as inert text would repeat the exact failure mode this field exists to prevent. Report what you found (resolved succeeded / resolved failed / still pending / still unverifiable) before relying on anything downstream that depended on it.
39
- - After surfacing it, apply the Mutation Guard below before appending `> ✓ Consumed: YYYY-MM-DD` (today's date). The marker write is a repository mutation.
39
+ - After surfacing it, apply the Mutation Guard below, then run the **Durability check** (session handoff durability, ARC-040): confirm that an incomplete `Active task`, the `Next concrete action`, and any task-bearing `Notes` content each name a durable location that genuinely exists (the cited `TODO.md` line, or tracker work item). If a named location is missing, or close-session's own step 4b was skipped when it shouldn't have been, register the missing content now — on this session's own branch — before proceeding. Only then append `> ✓ Consumed: YYYY-MM-DD` (today's date); the marker write is a repository mutation. If the Durability check cannot complete, leave the handoff unconsumed so the next open-session retries the same check idempotently, rather than silently losing the gap.
40
40
  - If the section is absent or already marked consumed: skip this step and proceed with the normal workspace scan.
41
41
 
42
42
  ## Mutation Guard (run lazily before the first repository write)
@@ -23,11 +23,17 @@
23
23
 
24
24
  ## Next Session Handoff
25
25
 
26
- **Active task:** None yet.
27
- **Last completed step:** Initial scaffold via `spell init`.
28
- **Next concrete action:** Begin work.
29
- **Active files:** —
30
- **Branch:** main
31
- **Blockers:** None.
32
- **Pending Verification:** None.
33
- **Notes:** —
26
+ > Auto-generated by spell-close-session. Consumed by spell-open-session. Do not edit manually.
27
+ > Generated: YYYY-MM-DD
28
+
29
+ - **Active task:** None yet.
30
+ - **Last completed step:** Initial scaffold via `spell init`.
31
+ - **Next concrete action:** Begin work.
32
+ - **Active files:** —
33
+ - **Branch:** main
34
+ - **Blockers:** None.
35
+ - **Pending Verification:** None.
36
+ - **Notes:** —
37
+
38
+ > ✓ Consumed: YYYY-MM-DD — scaffold placeholder, not a real session; ships pre-consumed so the first
39
+ > real spell-open-session run does not mistake this for live handoff content.
package/dist/index.js CHANGED
@@ -1444,6 +1444,22 @@ ${rules}
1444
1444
  **Denied:** ${def.tools.denied.join(", ")}
1445
1445
  `;
1446
1446
  }
1447
+ function renderSpellRoutingSection() {
1448
+ return `## Spell Routing
1449
+
1450
+ | When you're about to... | Invoke |
1451
+ |---|---|
1452
+ | Commit work | \`spell-commit-work\` |
1453
+ | Open a session | \`spell-open-session\` |
1454
+ | Close a session | \`spell-close-session\` |
1455
+ | Open a pull request | \`spell-create-pull-request\` |
1456
+ | Ship a feature end-to-end | \`spell-full-cycle\` |
1457
+ | Fix a bug | \`spell-bug\` |
1458
+ | Review code or a PR | \`spell-review\` |
1459
+
1460
+ If a spell exists for the workflow you are about to perform, invoke it \u2014 do not improvise the workflow from general knowledge, even when the user doesn't name the spell.
1461
+ `;
1462
+ }
1447
1463
  function renderAgentRosterSection(entries) {
1448
1464
  const rows = entries.map(
1449
1465
  ({ def, displayName }) => `| **${displayName}** | ${def.role} | ${def.category} |`
@@ -1564,32 +1580,35 @@ async function syncAgents(targetDir, assetsDir, roster, options = {}) {
1564
1580
  }
1565
1581
  synced.push(`.github/agents/${fileName}`);
1566
1582
  }
1567
- const rosterSection = renderAgentRosterSection(resolved);
1583
+ const copilotSection = `${renderSpellRoutingSection()}
1584
+ ${renderAgentRosterSection(resolved)}`;
1568
1585
  const copilotMerged = await mergeIntoFile(
1569
1586
  targetDir,
1570
1587
  ".github/copilot-instructions.md",
1571
- rosterSection,
1588
+ copilotSection,
1572
1589
  { force: true, dryRun: options.dryRun }
1573
1590
  );
1574
1591
  if (copilotMerged)
1575
1592
  synced.push(".github/copilot-instructions.md (agents section)");
1576
1593
  }
1577
1594
  if (options.claude !== false) {
1578
- const rosterSection = renderAgentRosterSection(resolved);
1595
+ const claudeSection = `${renderSpellRoutingSection()}
1596
+ ${renderAgentRosterSection(resolved)}`;
1579
1597
  const claudeMerged = await mergeIntoFile(
1580
1598
  targetDir,
1581
1599
  "CLAUDE.md",
1582
- rosterSection,
1600
+ claudeSection,
1583
1601
  { force: true, dryRun: options.dryRun }
1584
1602
  );
1585
1603
  if (claudeMerged) synced.push("CLAUDE.md (agents section)");
1586
1604
  }
1587
1605
  if (options.codex !== false) {
1588
- const rosterSection = renderAgentRosterSection(resolved);
1606
+ const codexSection = `${renderSpellRoutingSection()}
1607
+ ${renderAgentRosterSection(resolved)}`;
1589
1608
  const codexMerged = await mergeIntoFile(
1590
1609
  targetDir,
1591
1610
  "AGENTS.md",
1592
- rosterSection,
1611
+ codexSection,
1593
1612
  { force: true, dryRun: options.dryRun }
1594
1613
  );
1595
1614
  if (codexMerged) synced.push("AGENTS.md (agents section)");