@ikon85/agent-workflow-kit 0.33.0 → 0.34.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 (85) hide show
  1. package/.agents/skills/ask-matt/SKILL.md +4 -3
  2. package/.agents/skills/audit-skills/SKILL.md +6 -0
  3. package/.agents/skills/board-to-waves/SKILL.md +6 -2
  4. package/.agents/skills/code-review/SKILL.md +6 -0
  5. package/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +11 -1
  6. package/.agents/skills/codex-adapter-sync/SKILL.md +23 -19
  7. package/.agents/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +6 -0
  8. package/.agents/skills/improve-codebase-architecture/SKILL.md +10 -1
  9. package/.agents/skills/kit-release/SKILL.md +29 -4
  10. package/.agents/skills/kit-update/SKILL.md +13 -0
  11. package/.agents/skills/orchestrate-wave/SKILL.md +1 -1
  12. package/.agents/skills/orchestrate-wave/references/dispatch-subagents.md +23 -11
  13. package/.agents/skills/orchestrate-wave/references/dispatch-workflow.md +8 -0
  14. package/.agents/skills/research/SKILL.md +6 -0
  15. package/.agents/skills/scale-check/SKILL.md +9 -7
  16. package/.agents/skills/setup-workflow/SKILL.md +47 -1
  17. package/.agents/skills/setup-workflow/board-sync.md +7 -2
  18. package/.agents/skills/setup-workflow/workflow-overview.md +1 -2
  19. package/.agents/skills/to-issues/SKILL.md +66 -8
  20. package/.agents/skills/to-waves/SKILL.md +24 -12
  21. package/.claude/skills/ask-matt/SKILL.md +4 -3
  22. package/.claude/skills/audit-skills/SKILL.md +6 -0
  23. package/.claude/skills/board-to-waves/SKILL.md +6 -2
  24. package/.claude/skills/code-review/SKILL.md +6 -0
  25. package/.claude/skills/codebase-design/DESIGN-IT-TWICE.md +8 -0
  26. package/.claude/skills/improve-codebase-architecture/INTERFACE-DESIGN.md +6 -0
  27. package/.claude/skills/improve-codebase-architecture/SKILL.md +6 -0
  28. package/.claude/skills/kit-release/SKILL.md +29 -4
  29. package/.claude/skills/kit-update/SKILL.md +13 -0
  30. package/.claude/skills/orchestrate-wave/SKILL.md +1 -1
  31. package/.claude/skills/orchestrate-wave/references/dispatch-subagents.md +23 -11
  32. package/.claude/skills/orchestrate-wave/references/dispatch-workflow.md +8 -0
  33. package/.claude/skills/research/SKILL.md +6 -0
  34. package/.claude/skills/scale-check/SKILL.md +9 -7
  35. package/.claude/skills/setup-workflow/SKILL.md +47 -1
  36. package/.claude/skills/setup-workflow/board-sync.md +7 -2
  37. package/.claude/skills/setup-workflow/workflow-overview.md +1 -2
  38. package/.claude/skills/to-issues/SKILL.md +66 -8
  39. package/.claude/skills/to-waves/SKILL.md +24 -12
  40. package/README.md +89 -13
  41. package/agent-workflow-kit.package.json +204 -44
  42. package/docs/adr/0004-release-intent-is-a-version-tag.md +42 -0
  43. package/docs/adr/0005-to-issues-is-the-planning-facade.md +42 -0
  44. package/docs/adr/0006-routing-knowledge-access-and-policy-are-separate.md +91 -0
  45. package/docs/agents/skills/local-ci.md +89 -0
  46. package/docs/agents/wave-anchor-template.md +2 -2
  47. package/docs/methodology.html +1 -1
  48. package/docs/methodology.svg +1 -1
  49. package/docs/workflow.html +2 -2
  50. package/docs/workflow.png +0 -0
  51. package/package.json +1 -1
  52. package/scripts/codex-exec.sh +47 -8
  53. package/scripts/codex-exec.test.mjs +56 -0
  54. package/scripts/kit-release.test.mjs +178 -0
  55. package/scripts/release-state.mjs +35 -5
  56. package/scripts/release-state.test.mjs +122 -5
  57. package/scripts/test_codex_adapter_sync_contract.py +30 -15
  58. package/scripts/test_orchestrate_wave_contract.py +73 -0
  59. package/scripts/test_program_planning_contract.py +70 -0
  60. package/scripts/test_skill_portability_lint.py +54 -0
  61. package/src/cli.mjs +109 -2
  62. package/src/commands/init.mjs +17 -1
  63. package/src/commands/routing-policy-update.mjs +204 -0
  64. package/src/commands/update.mjs +22 -0
  65. package/src/lib/agentSurfaceRegistry.mjs +60 -0
  66. package/src/lib/bundle.mjs +24 -0
  67. package/src/lib/capabilityMatrix.mjs +85 -0
  68. package/src/lib/dispatchReceipt.mjs +162 -0
  69. package/src/lib/frontendWorkloads.mjs +170 -0
  70. package/src/lib/routeDispatcher.mjs +158 -0
  71. package/src/lib/routingAccessGraph.mjs +105 -0
  72. package/src/lib/routingAdapters/claude.mjs +62 -0
  73. package/src/lib/routingAdapters/codex.mjs +136 -0
  74. package/src/lib/routingCatalog.mjs +123 -0
  75. package/src/lib/routingEvidenceCache.mjs +222 -0
  76. package/src/lib/routingIntent.mjs +93 -0
  77. package/src/lib/routingPolicy.mjs +67 -0
  78. package/src/lib/routingProfile.mjs +334 -0
  79. package/src/lib/routingResolver.mjs +176 -0
  80. package/src/lib/routingSources/artificialAnalysis.mjs +129 -0
  81. package/src/lib/routingSources/benchlm.mjs +151 -0
  82. package/src/lib/routingSources/codeArena.mjs +162 -0
  83. package/src/lib/routingSources/deepswe.mjs +106 -0
  84. package/src/lib/routingSources/openhands.mjs +102 -0
  85. package/src/lib/routingSources/openhandsFrontend.mjs +135 -0
@@ -49,7 +49,8 @@ Prefer the smallest depth that produces a clear next action.
49
49
  undertaking, several independently-shippable stages. Run `/scale-check`
50
50
  first (it owns the altitude criteria catalog — this router only names it);
51
51
  two or more criteria tripped routes to a program grill → `/to-prd` →
52
- `/to-waves`.
52
+ `/to-issues`. The explicit Program identity makes the Planning facade select
53
+ its internal graph engine; the user never chooses that engine.
53
54
  - **Deep:** `/grill-with-docs` followed by `/to-prd` and `/to-issues` when
54
55
  terminology, contracts, rollout order, or ownership are still uncertain.
55
56
  - **Medium:** `/to-issues` for a ready artefact that needs slicing.
@@ -73,9 +74,9 @@ A starting situation that generates work, then merges onto the main flow.
73
74
 
74
75
  - **Bugs and requests piling up** → **`/triage`**. Moves issues through triage and produces agent-ready issues that `/implement` later picks up. Only for issues **you didn't create** — `/to-issues` output is already agent-ready, don't triage it.
75
76
  - **Something's broken** → **`/diagnose`**. For the hard ones: the bug that resists a first glance, the intermittent flake, the regression between two known-good states. Refuses to theorise until it has a **tight feedback loop** — one command that already goes red on *this* bug — then fixes with a regression test. Its post-mortem hands off to **`/improve-codebase-architecture`** when the finding is that there's no good seam.
76
- - **A huge, foggy effort too big for one agent session** — a greenfield build or a sprawling feature where the way from here to the destination isn't yet visible, and it's still **pre-spec** (before any grill or PRD) → **`/wayfinder`** (user-invoked). It charts a **shared map** of investigation slices on the tracker and resolves them one at a time — producing **decisions, not deliverables** — until the fog lifts and the route is clear, then merges onto the main flow at **`/to-prd`** (or, if the effort turned out small enough, straight to **`/implement`**). Where `/grill-with-docs` sharpens an idea you can hold in one session, wayfinder is for the one you can't. Once an undertaking has already resolved into several independently-shippable waves, `/scale-check` → `/to-waves` stays the primary route.
77
+ - **A huge, foggy effort too big for one agent session** — a greenfield build or a sprawling feature where the way from here to the destination isn't yet visible, and it's still **pre-spec** (before any grill or PRD) → **`/wayfinder`** (user-invoked). It charts a **shared map** of investigation slices on the tracker and resolves them one at a time — producing **decisions, not deliverables** — until the fog lifts and the route is clear, then merges onto the main flow at **`/to-prd`** (or, if the effort turned out small enough, straight to **`/implement`**). Where `/grill-with-docs` sharpens an idea you can hold in one session, wayfinder is for the one you can't. Once an undertaking has already resolved into several independently-shippable waves, `/scale-check` → `/to-issues` stays the primary route.
77
78
  - **A backlog to cluster** → **`/board-to-waves`**. Groups an existing board into themed waves when you need to *find* the next wave rather than start fresh.
78
- - **A whole wave to LAND** → **`/orchestrate-wave`**. When a wave anchor (file-disjoint slices, specs already locked) is ready to build, verify and land end-to-end — often AFK: it dispatches an implementer per slice in its own worktree, integrates serially, verifies centrally, and lands the wave. The execute-and-land node of the wave ladder (`scale-check` → `to-waves`/`board-to-waves` → `orchestrate-wave`). A single slice just goes to `/implement`.
79
+ - **A whole wave to LAND** → **`/orchestrate-wave`**. When a wave anchor (file-disjoint slices, specs already locked) is ready to build, verify and land end-to-end — often AFK: it dispatches an implementer per slice in its own worktree, integrates serially, verifies centrally, and lands the wave. The execute-and-land node of the wave ladder (`scale-check` → `to-issues`/`board-to-waves` → `orchestrate-wave`). A single slice just goes to `/implement`.
79
80
 
80
81
  ## Cross-model review (Codex)
81
82
 
@@ -114,6 +114,12 @@ otherwise stay invisible.
114
114
 
115
115
  ### 2. Audit in parallel — one subagent per skill
116
116
 
117
+ Before dispatch, resolve a provider-neutral Routing intent through
118
+ `src/lib/routeDispatcher.mjs` and require a Dispatch receipt from the shared
119
+ spawn guard. A detected transport is not authorization; AFK dispatch stops
120
+ unless requested/applied route, model/effort enforcement, environment
121
+ precedence, and catalog/access/policy revisions are proved.
122
+
117
123
  Run **one read-only research subagent per skill** — several in parallel in a
118
124
  SINGLE message (they are independent and read-only, so they don't contend for the
119
125
  git index). Per subagent prompt:
@@ -36,7 +36,11 @@ to-issues slices + promotes (sets type:cluster + Wave at ≥2 slices)
36
36
 
37
37
  **Stops at stubs.** No slice plan, no PRD, no sub-issue link, no promotion. Whether/when a stub becomes a real wave = separate step (`to-prd → to-issues`), <maintainer>'s call.
38
38
 
39
- **S4 exit — no stub at all.** A candidate that trips the `scale-check` altitude criteria (Splitter S4 below) skips the stub step entirely — it is reported as an escalation, pointing at `scale-check` (→ a program grill → `to-prd` program mode → `to-waves`), never at `to-prd`/`to-issues` directly. Still <maintainer>'s call, still no board write here.
39
+ **S4 exit — no stub at all.** A candidate that trips the `scale-check` altitude
40
+ criteria (Splitter S4 below) skips the stub step entirely — it is reported as
41
+ an escalation, pointing at `scale-check` (→ a program grill → `to-prd` Program
42
+ mode → `to-issues`), never straight into ordinary Feature decomposition. Still
43
+ <maintainer>'s call, still no board write here.
40
44
 
41
45
  Model: **strongest available reasoning model for board-wide judgment calls** (survey/plan/brainstorm — cross-board judgment, <maintainer>'s table).
42
46
 
@@ -64,7 +68,7 @@ Model: **strongest available reasoning model for board-wide judgment calls** (su
64
68
  - **S1 Too big** — > ~7 slices / not shippable in a manageable sequence → split into two waves.
65
69
  - **S2 Foreign parent** — issue already hangs under another wave (GitHub 1-parent; `to-issues` link check is the final word).
66
70
  - **S3 "Same type alone" ≠ wave** — type is a booster, never a gate. Otherwise "all refactors" becomes a junk drawer.
67
- - **S4 Programm-Verdacht** — the candidate trips the `scale-check` altitude criteria (`.claude/skills/scale-check/SKILL.md` § "Altitude criteria (the single source of truth)" — referenced here, **never** re-forked; e.g. staged delivery + several subsystems that each stand on their own) → **escalate to the Program route instead of creating a candidate stub**: report it in the candidate list (§3/§5) pointing at `scale-check` (grill once into a Program-PRD with a Wellenplan, then `to-waves` unfolds it), not `to-prd`/`to-issues`. The bottom-up Wave-stamping rule above is unaffected — an escalated candidate is still just a proposal, not yet a committed wave, exactly like any other candidate.
71
+ - **S4 Programm-Verdacht** — the candidate trips the `scale-check` altitude criteria (`.claude/skills/scale-check/SKILL.md` § "Altitude criteria (the single source of truth)" — referenced here, **never** re-forked; e.g. staged delivery + several subsystems that each stand on their own) → **escalate to the Program route instead of creating a candidate stub**: report it in the candidate list (§3/§5) pointing at `scale-check` (grill once into a Program-PRD with a Wellenplan, then `to-issues` selects the Program graph path from that explicit identity), not directly to a hidden engine. The bottom-up Wave-stamping rule above is unaffected — an escalated candidate is still just a proposal, not yet a committed wave, exactly like any other candidate.
68
72
 
69
73
  **Rule:** issue → candidate X if **Gate(X) satisfied AND ≥1 booster fires** and no splitter applies. Otherwise: own candidate or leftover bucket "unclustered / standalone issue".
70
74
 
@@ -73,6 +73,12 @@ When `projectEnrichment` is active, read `docs/agents/code-review.md` first. App
73
73
 
74
74
  ## Execution
75
75
 
76
+ Before dispatch, resolve a provider-neutral Routing intent through
77
+ `src/lib/routeDispatcher.mjs` and require a Dispatch receipt from the shared
78
+ spawn guard. A detected transport is not authorization; AFK dispatch stops
79
+ unless requested/applied route, model/effort enforcement, environment
80
+ precedence, and catalog/access/policy revisions are proved.
81
+
76
82
  - Run both axes as **parallel sub-agents** — separate context each, so neither poisons the other's read. Give the Standards sub-agent the Standards sources **plus** the full Fowler baseline in its prompt; it has no other way to see the baseline.
77
83
  - Report **side by side**, under `## Standards` and `## Spec` headers, verbatim or lightly cleaned — never merge or re-rank the two into one combined verdict.
78
84
  - Cap each sub-agent's report under 400 words — findings, not padding.
@@ -18,7 +18,17 @@ Show this to the user, then immediately proceed to Step 2. The user reads and th
18
18
 
19
19
  ### 2. Spawn sub-agents
20
20
 
21
- Spawn 3+ sub-agents in parallel using the Agent tool. Each must produce a **radically different** interface for the deepened module.
21
+ Before dispatch, resolve a provider-neutral Routing intent through
22
+ `src/lib/routeDispatcher.mjs` and require a Dispatch receipt from the shared
23
+ spawn guard. A detected transport is not authorization; AFK dispatch stops
24
+ unless requested/applied route, model/effort enforcement, environment
25
+ precedence, and catalog/access/policy revisions are proved.
26
+
27
+ <!-- mirror-xform:start codex-parallel-subagent-dispatch -->
28
+ When the user has authorized subagent delegation, make 3+ parallel
29
+ `spawn_agent` calls using only `task_name`, `message`, and `fork_turns`. Each
30
+ must produce a **radically different** interface for the deepened module.
31
+ <!-- mirror-xform:end -->
22
32
 
23
33
  Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category from [DEEPENING.md](DEEPENING.md), what sits behind the seam). The brief is independent of the user-facing problem-space explanation in Step 1. Give each agent a different design constraint:
24
34
 
@@ -22,23 +22,27 @@ correct issue or slice worktree before the first edit. Never apply adapter
22
22
  changes on `main`; move any accidental main-checkout diff into the worktree and
23
23
  leave the main checkout clean.
24
24
 
25
- ## Model routing
26
-
27
- Default to inherited parent model configuration. Do not pin a model merely
28
- because the source workflow delegates, and do not invent model or role fields
29
- on a spawn call. The supported built-in agent names are `default`, `worker`, and
30
- `explorer`; custom agents declare overrides in their TOML files.
31
-
32
- When an explicit custom-agent model is genuinely justified, route by task
33
- shape:
34
-
35
- - `gpt-5.6-sol` for complex, open-ended judgment work.
36
- - `gpt-5.6-terra` for everyday tool-using development.
37
- - `gpt-5.6-luna` for clear, repeatable, high-volume work.
38
-
39
- Use `model_reasoning_effort` for a supported reasoning override. The family
40
- name `gpt-5.6` describes the family and is not a fourth concrete variant in
41
- this routing table. Keep user gates, security judgment, and approval decisions
25
+ ## Routing intent
26
+
27
+ Durable issues and handoffs describe task shape with provider-neutral
28
+ `routing-intent` and `reasoning-intent` values. Never persist a provider model
29
+ identifier or copy a resolved route back into shared work. The supported
30
+ built-in agent names remain `default`, `worker`, and `explorer`.
31
+
32
+ At dispatch time, resolve the intent by comparing the Kit-owned Evidence
33
+ catalog with the user-local Access graph and Routing policy. Keep those
34
+ contracts separate: catalog facts include inaccessible models, the Access graph
35
+ attests available paths and enforcement, and personal policy filters facts
36
+ without changing them. Report the best overall route separately from the best
37
+ currently executable route. Unknown transports and stale capability evidence
38
+ block; missing routing infrastructure may fall back only through explicit
39
+ `inherit`.
40
+
41
+ Apply any selected provider route only through the active surface's verified
42
+ adapter. An AFK dispatch must prove its requested and applied route plus model
43
+ and effort enforcement in a one-execution Dispatch receipt. Credentials,
44
+ personal access state, and personal policy stay outside repositories and
45
+ package-owned files. Keep user gates, security judgment, and approval decisions
42
46
  in the main thread.
43
47
 
44
48
  ## Scope
@@ -148,8 +152,8 @@ Run validation from the repository root and keep the evidence in the report:
148
152
  - Leave clearly Claude-only setup, hook, or personal/meta skills out unless
149
153
  the user explicitly wants them ported.
150
154
  - Translate Claude-specific delegation rather than copying it literally.
151
- Apply the Model routing section above only when an explicit custom-agent
152
- override is justified; otherwise preserve inherited parent configuration.
155
+ Apply the Routing intent section above only when an explicit user-local
156
+ route is justified; otherwise preserve explicit inheritance.
153
157
  - Keep dual-surface generic/vendored skill bodies content-synced. When a
154
158
  Codex mirror must intentionally differ from the Claude source, bracket the
155
159
  source region and the Codex replacement with a matching transform marker
@@ -18,6 +18,12 @@ Show this to the user, then immediately proceed to Step 2. The user reads and th
18
18
 
19
19
  ### 2. Spawn sub-agents
20
20
 
21
+ Before dispatch, resolve a provider-neutral Routing intent through
22
+ `src/lib/routeDispatcher.mjs` and require a Dispatch receipt from the shared
23
+ spawn guard. A detected transport is not authorization; AFK dispatch stops
24
+ unless requested/applied route, model/effort enforcement, environment
25
+ precedence, and catalog/access/policy revisions are proved.
26
+
21
27
  <!-- mirror-xform:start codex-parallel-subagent-dispatch -->
22
28
  When the user has authorized subagent delegation, spawn 3+ sub-agents in parallel with `spawn_agent`. Each must produce a **radically different** interface for the deepened module.
23
29
  <!-- mirror-xform:end -->
@@ -35,8 +35,17 @@ This skill is _informed_ by the project's domain model. The domain language give
35
35
 
36
36
  Read the project's domain glossary and any ADRs in the area you're touching first.
37
37
 
38
+ Before dispatch, resolve a provider-neutral Routing intent through
39
+ `src/lib/routeDispatcher.mjs` and require a Dispatch receipt from the shared
40
+ spawn guard. A detected transport is not authorization; AFK dispatch stops
41
+ unless requested/applied route, model/effort enforcement, environment
42
+ precedence, and catalog/access/policy revisions are proved.
43
+
38
44
  <!-- mirror-xform:start codex-explorer-dispatch -->
39
- When the user has authorized subagent delegation, use `spawn_agent` with `agent_type: explorer` to walk the codebase; otherwise explore locally. Don't follow rigid heuristics — explore organically and note where you experience friction:
45
+ When the user has authorized subagent delegation, use `spawn_agent` with only
46
+ `task_name`, `message`, and `fork_turns` to walk the codebase; otherwise explore
47
+ locally. Don't follow rigid heuristics — explore organically and note where you
48
+ experience friction:
40
49
  <!-- mirror-xform:end -->
41
50
 
42
51
  - Where does understanding one concept require bouncing between many small modules?
@@ -1,13 +1,14 @@
1
1
  ---
2
2
  name: kit-release
3
- description: "Prepare a verified release PR for agent-workflow-kit, delegate landing to wrapup, then monitor the trusted post-merge publishing flow through npm/GitHub parity."
3
+ description: "Prepare and integrate a verified agent-workflow-kit release, then record separately confirmed publication intent with an annotated version tag and monitor npm/GitHub parity."
4
4
  ---
5
5
 
6
6
  # Kit Release
7
7
 
8
8
  Prepare a release deterministically. This skill owns the shipped-delta decision,
9
- metadata preparation, and verification. It does not implement commit, push, PR,
10
- merge, registry publishing, tags, or release creation.
9
+ metadata preparation, verification, and the separate post-merge publication
10
+ gate. It delegates commit, branch push, PR, merge, and cleanup to wrapup. It
11
+ never publishes to a registry or creates a GitHub release directly.
11
12
 
12
13
  ## Workflow
13
14
 
@@ -42,7 +43,20 @@ merge, registry publishing, tags, or release creation.
42
43
  `scripts/wrapup-land.py` exclusively own commit, push, PR creation, merge,
43
44
  and cleanup. Do not reproduce those operations here.
44
45
 
45
- 5. After merge, monitor the `release.yml` workflow and inspect its externally
46
+ 5. After merge, report the exact integrated version and commit as
47
+ `awaiting-tag`. Merging integrates the prepared release; it cannot start
48
+ publication. Ask the user for a second, explicit confirmation to publish
49
+ that exact `v<version>`. The earlier Semver confirmation authorized metadata
50
+ preparation, not publication.
51
+
52
+ 6. After that confirmation, verify that the package version on current
53
+ `origin/main` is exactly `<version>`. Create a matching annotated
54
+ `v<version>` tag on that commit and push only that tag. A lightweight tag,
55
+ mismatching version, or commit outside canonical `main` is invalid release
56
+ intent. Never infer a tag target, move an existing tag, or tag an unmerged
57
+ commit.
58
+
59
+ 7. Monitor the tag-triggered `release.yml` workflow and inspect its externally
46
60
  reconstructable state:
47
61
 
48
62
  ```sh
@@ -56,6 +70,17 @@ merge, registry publishing, tags, or release creation.
56
70
  release asset have identical version, manifest hash, and tarball integrity.
57
71
  The release is complete only at `released`.
58
72
 
73
+ Manual dispatch is recovery only. It requires the explicit existing
74
+ annotated tag and runs the same idempotent reconciler:
75
+
76
+ ```sh
77
+ gh workflow run release.yml -f tag=v<version>
78
+ ```
79
+
80
+ Use it only after reconstructing the release state for that tag. Never use
81
+ dispatch as the normal publication route or substitute a new version for a
82
+ partial release.
83
+
59
84
  The registry identity is **`@ikon85/agent-workflow-kit`**. The unscoped
60
85
  `agent-workflow-kit` package is owned by another publisher and must never be
61
86
  queried, published, or treated as this repository's release.
@@ -57,6 +57,19 @@ release contain the same artifact.
57
57
  (`missing-file`, `missing-section`, `empty-section`, or
58
58
  `divergent-section`); it never echoes consumer content.
59
59
 
60
+ Independently, run the routing-profile read-only preflight before applying
61
+ the package candidate. A valid unchanged user-local profile reports
62
+ `still valid` and causes zero prompts. Ask after successful Kit activation
63
+ only when the profile is missing, invalid, materially stale, references a
64
+ removed route, or a newly detected surface creates a meaningful choice.
65
+ Re-inspect after package activation, present a typed delta containing only
66
+ that changed choice, and preserve unaffected personal fields. Fingerprint
67
+ and exclusively lock the destination before writing; a concurrent personal
68
+ edit blocks reconciliation and remains untouched. Unattended update records
69
+ `needs-reconcile`; it never invents a personal answer. Declining the
70
+ routing reconcile leaves the successful Kit update applied because package
71
+ installation and personal policy are separate transactions.
72
+
60
73
  3. Read the terminal report. `aktuell` proves a second run found no upstream
61
74
  delta or pending readiness migration. A conflict report names and counts
62
75
  every category and leaves every consumer file untouched. Follow its
@@ -92,7 +92,7 @@ node scripts/readiness.mjs check --skill orchestrate-wave --json
92
92
  Pass only host-supplied inventory through `capabilityAdapter.claude` or `.codex`,
93
93
  then call the selector. It returns exactly one target; missing or `unknown` evidence
94
94
  degrades A → B → C. A model claim is not evidence; do not emulate a missing primitive.
95
-
95
+ Before any spawn, resolve the provider-neutral Routing intent through the shared resolver and spawn guard, then use the active Claude or Codex adapter. Codex contributes only its dated host attestation through `routingAdapters/codex.mjs`; it does not create a second catalog, Access graph, or Routing policy. A detected transport is not authorization. The Dispatch receipt must show requested and applied route, model/effort enforcement, environment precedence on mismatch, and catalog/access/policy revisions. AFK blocks unverified, unauthorized, overridden, unenforced, or silently degraded routes; a Codex host without model and effort selectors blocks differentiated AFK before spawn, and unreachable routes follow policy handoff/inherit/block exactly.
96
96
  - **Path A:** requires the literal `Workflow` tool, callable and permitted, plus
97
97
  individually proven named phases, run identity, runtime output validation,
98
98
  journal, and resume. Then read [its recipe](references/dispatch-workflow.md).
@@ -5,13 +5,14 @@ requires proven native spawn, wait, and aggregate primitives plus effective
5
5
  concurrency and thread capacity ≥2. Route from proven capabilities only, never
6
6
  from a surface name, and do not emulate a missing primitive.
7
7
 
8
- This recipe is **dormant on the current Codex host.** A verify spike against
9
- codex-cli 0.144.6 (2026-07-21) proved native start plus bounded wait, and an
10
- effective concurrency of 4, but the host exposes tool entries carrying only a
11
- name and a description: no tool schema, no callable or permitted flags, no
12
- thread capacity. The adapter therefore emits `unknown` for those fields and the
13
- selector fails closed to Path C. Only a future host that supplies the complete
14
- normalized inventory selects this path.
8
+ This recipe is **dormant unless the current host's complete orchestration
9
+ inventory proves Path B.** The dated Codex routing attestation is a separate
10
+ gate: the observed explicit-spawn schema exposes only `task_name`, `message`,
11
+ and `fork_turns`, with no model or effort selector. Therefore
12
+ `routingAdapters/codex.mjs` blocks differentiated AFK before spawn even when
13
+ native start/wait/aggregate evidence is otherwise sufficient for Path B. A
14
+ future host may enable the route only by attesting both orchestration primitives
15
+ and applied model/effort controls; neither is inferred from the surface name.
15
16
 
16
17
  ## Main-thread preparation
17
18
 
@@ -55,10 +56,21 @@ Reconciliation is never delegated to a subagent.
55
56
 
56
57
  For the current reconciled batch, spawn **one builder per slice**, again as one
57
58
  concurrent batch joined by an explicit wait. Give each builder the verbatim
58
- builder contract, its reconciled allowlist, and its required commands. The host
59
- exposes no per-agent role, model, or reasoning selector, so routing falls back
60
- to the parent session configuration — record the tier you intended in the
61
- prompt itself rather than assuming the host honoured it.
59
+ builder contract, its reconciled allowlist, and its required commands. Resolve
60
+ the provider-neutral Routing intent immediately before each spawn. Pass the
61
+ decision through `routeDispatcher.mjs` and the active surface adapter. Claude
62
+ uses its native or explicitly policy-approved transport attestation; Codex uses
63
+ only its dated `routingAdapters/codex.mjs` host attestation. Both must prove
64
+ their requested and applied model and effort controls before invocation.
65
+ Detection alone never authorizes a transport.
66
+
67
+ The spawn guard compares the requested route with the adapter's applied route
68
+ and environment precedence. It emits the shared Dispatch receipt with
69
+ catalog/access/policy revisions. An unverified control, unauthorized transport,
70
+ override mismatch, or unenforced effort blocks AFK before spawn. A genuinely
71
+ unreachable route follows the policy's handoff, inherit, or block result; never
72
+ silently inherit. A host without a proved per-agent selector remains on its
73
+ existing parent-session fallback only when explicit non-AFK policy permits it.
62
74
 
63
75
  Each builder returns exactly one builder report. Validate it against the builder
64
76
  schema and then run `semanticVerify` on it in the main thread. A subagent's own
@@ -48,6 +48,14 @@ current reconciled batch, make one `agent()` call per slice with explicit
48
48
  the reconciled allowlist and required commands in each verbatim builder prompt;
49
49
  the main thread still performs `semanticVerify` on every returned report.
50
50
 
51
+ Before each `agent()` call, resolve its provider-neutral Routing intent and pass
52
+ the decision through the shared spawn guard and active surface adapter. The
53
+ Claude adapter must attest Workflow model/effort precedence in the current
54
+ environment; a future Codex host may use this path only when its dated
55
+ `routingAdapters/codex.mjs` attestation proves the same controls. Create the
56
+ Dispatch receipt before invocation; any requested/applied mismatch, unverified
57
+ control, or unauthorized transport blocks AFK rather than silently degrading.
58
+
51
59
  ## Resume exactly once
52
60
 
53
61
  Resume an interrupted Recon or Build run with its recorded `resumeFromRunId`
@@ -3,6 +3,12 @@ name: research
3
3
  description: "Investigate a question against high-trust primary sources and capture the findings as a Markdown file in the repo. Use when the user wants a topic researched, docs or API facts gathered, or reading legwork delegated to a background agent."
4
4
  ---
5
5
 
6
+ Before dispatch, resolve a provider-neutral Routing intent through
7
+ `src/lib/routeDispatcher.mjs` and require a Dispatch receipt from the shared
8
+ spawn guard. A detected transport is not authorization; AFK dispatch stops
9
+ unless requested/applied route, model/effort enforcement, environment
10
+ precedence, and catalog/access/policy revisions are proved.
11
+
6
12
  Spin up a **background agent** to do the research, so you keep working while it reads.
7
13
 
8
14
  Its job:
@@ -87,8 +87,9 @@ skills — this skill only picks the entry point.
87
87
 
88
88
  ### Program (≥2 criteria)
89
89
 
90
- A multi-wave undertaking: grill it once into a Program-PRD with a wave plan, then
91
- unfold that plan onto the board after a chat preview gate.
90
+ A multi-wave undertaking: grill it once into a Program-PRD with a wave plan,
91
+ then hand that explicit Program identity to the public Planning facade. The
92
+ facade unfolds the plan onto the board after a chat preview gate.
92
93
 
93
94
  ```
94
95
  New program: <one-sentence outcome from Q2>.
@@ -97,10 +98,11 @@ Tripped altitude criteria: <e.g. C1 staged delivery, C2 multiple subsystems, C4
97
98
  structure-bearing decisions (escalate a single bounded choice to `decision-gate`).
98
99
  2. `to-prd` — it auto-detects the program mode from the Wellenplan chapter and writes
99
100
  a Program-PRD (native anchor over the waves).
100
- 3. `to-waves` — after one complete chat preview, materialize the whole Program with
101
- **all waves execute-ready by default**: complete slice contracts, buckets,
102
- dependencies and handoffs. Decision Gates, Verify Spikes and Design-Grill waves
103
- are explicit planned exceptions; generic late-binding cleanup is not.
101
+ 3. `to-issues` — its explicit Program identity selects the internal graph path.
102
+ After one complete chat preview, materialize the whole Program with **all
103
+ waves execute-ready by default**: complete slice contracts, buckets,
104
+ dependencies and handoffs. Decision Gates, Verify Spikes and Design-Grill
105
+ waves are explicit planned exceptions; generic late-binding cleanup is not.
104
106
  ```
105
107
 
106
108
  ### Feature (0–1 criteria, or any doubt)
@@ -134,7 +136,7 @@ Bug: <what's broken — expected vs. actual>.
134
136
  ```
135
137
  scale-check: verdict=<Program | Feature | Direct-Slice | Bug>
136
138
  criteria tripped=<C1,C2,… | none | n/a (bug/direct)>
137
- route=<program grill → to-prd → to-waves (all waves execute-ready by default) | grill-with-docs → to-prd → to-issues | implement | diagnose>
139
+ route=<program grill → to-prd → to-issues (Program mode; all waves execute-ready by default) | grill-with-docs → to-prd → to-issues (Feature mode) | implement | diagnose>
138
140
  start-prompt: <the paste-ready block above, filled in>
139
141
  ```
140
142
 
@@ -28,6 +28,7 @@ This is a prompt-driven skill, not a deterministic script. Explore, present what
28
28
  | `docs/agents/census.md` | optional-census choice, paths, state, and safe disable contract seeded from [census.md](./census.md) (Section A3) |
29
29
  | `docs/agents/workflow-capabilities.json` + capability assets | consumer-owned Worktree Lifecycle, Memory Lifecycle, Workflow Advisories, and Safety Guardrails choices (Sections A4–A7) |
30
30
  | `.claude/settings.json` | additive activation of the advisory kit-origin Edit/Write hint (Section A8) |
31
+ | user-local routing profile | familiar agent surfaces + switching autonomy (Section A9; never package- or repository-owned) |
31
32
 
32
33
  ## Idempotency contract — read before writing anything
33
34
 
@@ -60,6 +61,9 @@ Read the current state; don't assume. For every target file, read its first line
60
61
  - `docs/agents/census.md`, `.census/profile.json`, `.census/active.json` — an existing census choice or consumer-owned census to adopt.
61
62
  - `docs/agents/workflow-capabilities.json`, `.claude/settings.json`, `git config --get core.hooksPath` — existing capability choices/profile plus Worktree Lifecycle, Workflow Advisories, Safety Guardrails, and kit-origin hint wiring to adopt.
62
63
  - `.memory/active/`, `.memory/archive/`, and `.memory/receipts/` — consumer-owned Memory Lifecycle policies or recovery evidence to adopt without normalization.
64
+ - The Kit routing-profile preflight — adopt a valid user-local choice without
65
+ printing or copying it into the repository. Never infer personal routing
66
+ policy from instruction files, credentials, or package-owned metadata.
63
67
  - `gh auth status` (if GitHub) — is `gh` authenticated, and with which scopes?
64
68
 
65
69
  ### 2. Section A — Issue tracker
@@ -280,6 +284,41 @@ This is an additive, idempotent settings edit, not a settings rewrite:
280
284
  `PreToolUse`, are consumer-owned conflicts: leave the file untouched and
281
285
  report the skipped activation. Never replace or normalize them.
282
286
 
287
+ ### 2h. Section A9 — Agent surfaces and switching autonomy
288
+
289
+ > Routing setup asks which familiar agent apps you use and whether the Kit may
290
+ > switch between them. Surface adapters establish providers, transports,
291
+ > selectors, and enforcement capabilities; the default interview never asks
292
+ > the user to describe those technical facts.
293
+
294
+ Read the versioned agent-surface registry and detection result. Show its
295
+ multi-select labels with detected entries preselected; never embed a separate
296
+ list in prompt prose. Then ask only one plain-language autonomy question:
297
+
298
+ - **Switch automatically** — record `automatic`.
299
+ - **Ask before switching** — record `ask`.
300
+ - **Stay in the current app** — record `current-surface-only`.
301
+
302
+ When exactly one surface is selected, skip the autonomy question and use
303
+ `current-surface-only`. Show an activation summary with explicit **Back**,
304
+ **Advanced**, **Approve**, and **Safe current surface** actions. Back revisits
305
+ the simple choices. Advanced is the only flow that may collect model
306
+ preferences or optimization overrides, but those values remain a draft and
307
+ return to the activation summary; Advanced alone never writes. Only a later
308
+ Approve or Safe current surface action activates the draft. Safe current
309
+ surface activates the selection with `current-surface-only`.
310
+
311
+ Store the answer through `src/lib/routingProfile.mjs` in its user-local state
312
+ location, outside the consumer repository and package manifest. Never print
313
+ credentials or derive personal choices from detected transports. A valid
314
+ existing profile is terminal and reports `still valid`; do not prompt again.
315
+ Missing or invalid profiles receive one migration interview. Reconcile a
316
+ materially stale profile, a removed route, or a newly detected meaningful
317
+ surface with a typed delta that names only the changed choice and preserves
318
+ unaffected surfaces, autonomy, and advanced values. Re-read the profile before
319
+ activation and use its fingerprint plus the exclusive profile lock; a
320
+ concurrent user-local change blocks activation and remains byte-preserved.
321
+
283
322
  ### 3. Section B — Triage labels
284
323
 
285
324
  > When `triage` processes an incoming issue it applies labels (or your tracker's equivalent). It needs strings you've actually configured, or it creates duplicates.
@@ -309,7 +348,14 @@ Seed `docs/agents/domain.md` from [domain.md](./domain.md).
309
348
 
310
349
  **Fallback (the single catch-all — no board / >1 / ambiguous / scope error / read failure):** do **not** auto-create a board (`gh project create` alone cannot provision the Status options + workflow fields a board needs). Write `board-sync.md` with `state=stub`, `mode=github-projects-v2`, and inline **instructions**: which fields the workflow profile needs (a Status single-select with your stage options; optionally a Wave number, a Cluster text, a Spec-Path / Plan-Path text), how to create the board in the GitHub UI / `gh`, and "then run `/setup-workflow` again — it will discover and fill the IDs." Retryable.
311
350
 
312
- **Optional — Phase field + saved Views (Program route only):** never auto-discovered or auto-created, unlike the fields above — a Phase field's option set is plan-specific. If this project plans to use the Program route (`scale-check` → `to-waves` → `validate-graph`), point the user at the seeded [board-sync.md](./board-sync.md)'s "Optional: the Program route" section for the `gh project field-create` command, the optional `fields.phase` / `labels.programType` profile keys, and the two saved Views to create by hand.
351
+ **Optional — Phase field + saved Views (Program route only):** never
352
+ auto-discovered or auto-created, unlike the fields above — a Phase field's
353
+ option set is plan-specific. If this project plans to use the Program route
354
+ (`scale-check` → `to-issues` with explicit Program identity → internal graph
355
+ validation), point the user at the seeded [board-sync.md](./board-sync.md)'s
356
+ "Optional: the Program route" section for the `gh project field-create`
357
+ command, the optional `fields.phase` / `labels.programType` profile keys, and
358
+ the two saved Views to create by hand.
313
359
 
314
360
  ### 6. Section E — Spec-layer seeds (non-interactive)
315
361
 
@@ -16,7 +16,7 @@ How the board-managed workflow skills (`to-prd`, `to-issues`, `board-to-waves`,
16
16
  | Cluster | text | optional | thematic cluster tag |
17
17
  | Spec-Path | text | optional | link from an issue to its spec doc |
18
18
  | Plan-Path | text | optional | link from an issue to its plan doc |
19
- | Phase | single-select | optional | groups waves into phases for the Program route (`to-waves`/`validate-graph`) — only needed if this project uses it |
19
+ | Phase | single-select | optional | groups waves into phases for the Program route (`to-issues` Program mode / internal graph validation) — only needed if this project uses it |
20
20
 
21
21
  ## Machine profile (SSOT) — `scripts/board_config.py` reads this
22
22
 
@@ -112,7 +112,12 @@ their titles unchanged; set it once to match your board's language.
112
112
 
113
113
  ## Optional: the Program route (Phase field + saved Views)
114
114
 
115
- Skip this section entirely unless this project actually plans to use the Program route (`scale-check` → `to-waves` → `validate-graph`) — `fields.phase` / `labels.programType` are never auto-discovered or auto-created (a Phase field's option set is plan-specific, not something `/setup-workflow` can guess), and a profile without them keeps loading unchanged.
115
+ Skip this section entirely unless this project actually plans to use the Program
116
+ route (`scale-check` → `to-issues` with explicit Program identity → internal
117
+ graph validation) — `fields.phase` / `labels.programType` are never
118
+ auto-discovered or auto-created (a Phase field's option set is plan-specific,
119
+ not something `/setup-workflow` can guess), and a profile without them keeps
120
+ loading unchanged.
116
121
 
117
122
  1. **Create the Phase field:** `gh project field-create <number> --owner <owner> --name Phase --data-type SINGLE_SELECT --single-select-options "P1,P2,P3"` (name the options after this project's actual phases).
118
123
  2. **Fill `fields.phase`** in the `<!-- board-sync:profile -->` block above with the same `{id, options}` shape as `fields.status` — read both back via `gh project field-list <number> --owner <owner> --format json`.
@@ -8,8 +8,7 @@ Use this section as the entry-point map for agent-assisted work. The individual
8
8
  - **A new build whose size is unclear** (a new app, a big cross-cutting feature, an unclear where-to-start): run `scale-check` — a short plain-language dialog that routes it to a program, a feature, a single slice, or a bug, and hands back a paste-ready start prompt.
9
9
  - **New capability or unclear change:** start with `grill-with-docs` when the domain language or decisions need sharpening, then publish the agreed shape with `to-prd`.
10
10
  - **A slice hinges on an unresolved fact or trade-off before it can be built:** clear it first — a binary yes/no question against real code/runtime/platform with `verify-spike`, a bounded "which option" choice with `decision-gate`.
11
- - **Existing plan, PRD, or ready issue:** use `to-issues` to split it into independently buildable tracer-bullet slices.
12
- - **A Program-PRD with a wave plan:** use `to-waves` to unfold it into named wave stubs + slice leaves on the board, after a chat preview gate that shows the whole plan before any write.
11
+ - **Existing plan, PRD, or ready issue:** use `to-issues`, the single Planning facade. Explicit Feature identity selects tracer-bullet decomposition; explicit Program identity selects the internal graph path and its complete preview before any write.
13
12
  - **A backlog of open issues needs clustering into themed waves:** use `board-to-waves`.
14
13
  - **A whole wave anchor (file-disjoint slices, specs already locked) to build, verify and land end-to-end — often AFK:** use `orchestrate-wave` — it dispatches implementers per slice, integrates serially, verifies centrally, and lands. (A single slice just goes to `implement`.)
15
14
  - **Bugs or requests piling up that you didn't create:** use `triage` to move them into agent-ready issues.