@ikon85/agent-workflow-kit 0.31.0 → 0.32.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.
@@ -23,6 +23,35 @@ skills the other steps rely on drift, and nothing fixes them unless a recipe doe
23
23
  Not for: rewriting a domain skill's content on demand (that is the skill itself),
24
24
  or auditing application code (a code review or a diagnosis does that).
25
25
 
26
+ ## Readiness preflight — first
27
+
28
+ <!-- readiness:optional-preflight:start -->
29
+ Before enumerating skills, launching research subagents, or editing any skill,
30
+ run this once from the project root:
31
+
32
+ ```bash
33
+ node scripts/readiness.mjs check --skill audit-skills --json
34
+ ```
35
+
36
+ - `ready`: continue silently with the generic audit and the active
37
+ `projectChecks` block.
38
+ - `degraded`: keep the generic audit active, omit only `projectChecks`, and emit
39
+ exactly one concise summary: `Readiness degraded — inactive block
40
+ projectChecks (auditSkillsLayer: <state>). Run /setup-workflow, configure
41
+ docs/agents/skills/audit-skills.md, then rerun this skill.`
42
+ - `blocked`: stop before continuing and report the non-ready required capability
43
+ plus the exact `/setup-workflow` recovery path.
44
+ - Invalid evidence is always visible in that one summary; never interpret it as
45
+ an opt-out or invent project checks.
46
+ <!-- readiness:optional-preflight:end -->
47
+
48
+ <!-- readiness:block projectChecks -->
49
+ When `projectChecks` is active, read
50
+ `docs/agents/skills/audit-skills.md` and apply its concrete class assignments,
51
+ project-specific guard commands, and drift checks in addition to the generic
52
+ recipe below.
53
+ <!-- readiness:end -->
54
+
26
55
  ## Standing guards (run without this audit)
27
56
 
28
57
  Two automatic nets catch the most common drift classes before an audit — this
@@ -31,7 +60,7 @@ recipe complements them, it does not replace them:
31
60
  1. **A skill-sync test** — for any un-guessable enumeration a skill documents (a
32
61
  status→bucket map, a design-token list), a test parses the value out of the
33
62
  SKILL.md and asserts equality with the code constant. Drift breaks the build.
34
- Your project layer names the concrete tests.
63
+ Run the concrete tests available in the repository.
35
64
  2. **The drift-hint hook** (`.claude/hooks/skill-drift-hint.py`) + a per-skill
36
65
  `SOURCES.txt`: at SessionStart it flags any skill whose declared source file
37
66
  is newer in git than its SKILL.md.
@@ -79,8 +108,9 @@ plus the `SOURCES.txt` files. Sort every skill into one of three classes:
79
108
  scripts or hooks with no `SOURCES.txt` and no hook net. No hook warns, so
80
109
  re-check them manually each audit.
81
110
 
82
- Your project layer assigns each concrete skill to a class a completeness gate
83
- catches the next new skill that would otherwise stay invisible.
111
+ Derive each concrete skill's class from the manifest, its `SOURCES.txt`, and the
112
+ repository surfaces — a completeness gate catches the next new skill that would
113
+ otherwise stay invisible.
84
114
 
85
115
  ### 2. Audit in parallel — one subagent per skill
86
116
 
@@ -129,8 +159,7 @@ alongside the Claude source), sync the mirror in the **same** change — otherwi
129
159
  the second surface rots silently. Mirror the body, but preserve each surface's
130
160
  own frontmatter: a mirror's `description` may be deliberately condensed, so never
131
161
  blind-copy the whole file over it. A `SOURCES.txt` is a plain anchor list and can
132
- be mirrored verbatim. Your project layer names the surfaces and the exact
133
- transform.
162
+ be mirrored verbatim. Use the repository's declared surfaces and exact transform.
134
163
 
135
164
  ## Done
136
165
 
@@ -72,6 +72,35 @@ proof is still open for state resolution even when Git tracking lets the base
72
72
  scan enumerate it. Overrides are report input only and are never passed into
73
73
  scanning, fingerprinting, verification, or state resolution.
74
74
 
75
+ ## Durable enforcement
76
+
77
+ An activated census is a durable consumer contract, not a one-time activation
78
+ check. Before activating a candidate or reporting an unchanged census as
79
+ `current`, derive the complete set of every `localScanners[].test` from the
80
+ profile and inspect the repository's documented local CI and pre-push paths.
81
+
82
+ Reuse one existing shared project-local census check entry point when the
83
+ repository has one. Otherwise add the smallest such entry point through the
84
+ repository's established script mechanism; do not create a second census
85
+ engine or duplicate scanner logic. It must execute every declared focused test,
86
+ and both local CI and pre-push must transitively reach that same entry point.
87
+ Add or extend an executable wiring test that fails when either durable path or
88
+ any declared scanner test becomes unreachable; matching prose or a bare grep is
89
+ not sufficient proof.
90
+
91
+ Keep enforcement reconciliation idempotent. An already complete wiring graph
92
+ is a no-write result. Mark only the narrow gate block added for this lifecycle
93
+ with the repository's existing managed marker, or with
94
+ `agent-workflow-kit:census` when no marker convention exists; that block is the
95
+ kit-owned census wiring. Preserve surrounding consumer-owned gate logic.
96
+
97
+ Missing or partial durable wiring is a failed candidate verification. If the
98
+ repository has no safe documented gate seam, ask one bounded wiring question
99
+ and stop before activation. On a scanner-test or wiring-proof failure, report
100
+ `failed`, discard the candidate when safe, and confirm that the previous active
101
+ census bytes are unchanged. Never report `current` from activation-time test
102
+ success alone.
103
+
75
104
  ## Workflow
76
105
 
77
106
  1. **Check.** Read the local profile and active census, if present. Report a
@@ -95,8 +124,9 @@ scanning, fingerprinting, verification, or state resolution.
95
124
  and a focused passing test for that pattern. Run that test before rescanning.
96
125
  6. **Verify a candidate.** Build the candidate from the fresh scan and recorded
97
126
  decisions. Fail verification when any surface or behavior remains `offen`,
98
- when a required local scanner test fails, or when the candidate fingerprints
99
- do not describe the current repository.
127
+ when a required local scanner test fails, when durable enforcement or its
128
+ executable wiring test is incomplete, or when the candidate fingerprints do
129
+ not describe the current repository.
100
130
  7. **Activate.** Call `activateCensus` with a real verifier so it stages, verifies,
101
131
  and atomically swaps under its local lock. On `CensusTransactionError`, report
102
132
  `updating` or `failed` and keep the previous active census authoritative.
@@ -137,4 +167,5 @@ Return only the useful audit trail:
137
167
  - surface coverage `X of Y`;
138
168
  - separate behavior overview;
139
169
  - visible `nicht relevant` justifications and active override, if any; <!-- language-census: ok -->
140
- - local scanner tests run and the transaction/no-write result.
170
+ - local scanner tests run, durable local-CI/pre-push reachability, and the
171
+ transaction/no-write result.
@@ -20,11 +20,36 @@ discipline and its guards) didn't stop it.
20
20
 
21
21
  ## Precondition
22
22
 
23
- If your project has a prevention layer a SessionStart warning on active
24
- worktrees, a pre-edit guard that blocks edits on the wrong branch — this skill
25
- handles the case where that layer did NOT prevent a misplaced commit. Your project
26
- layer names those guards (`docs/agents/skills/git-worktree-recover.md`, seeded as
27
- an empty stub by `/setup-workflow`).
23
+ This generic recovery remains usable whether or not the project has prevention
24
+ guards or a custom worktree setup command.
25
+
26
+ ## Readiness preflight first
27
+
28
+ <!-- readiness:optional-preflight:start -->
29
+ Before assessing refs or moving a branch, run this once from the project root:
30
+
31
+ ```bash
32
+ node scripts/readiness.mjs check --skill git-worktree-recover --json
33
+ ```
34
+
35
+ - `ready`: continue silently with generic recovery and the active
36
+ `projectRecovery` block.
37
+ - `degraded`: keep generic reflog recovery active, omit only
38
+ `projectRecovery`, and emit exactly one concise summary: `Readiness degraded
39
+ — inactive block projectRecovery (worktreeRecoveryLayer: <state>). Run
40
+ /setup-workflow, configure docs/agents/skills/git-worktree-recover.md, then
41
+ rerun this skill.`
42
+ - `blocked`: stop before continuing and report the non-ready required capability
43
+ plus the exact `/setup-workflow` recovery path.
44
+ - Invalid evidence is always visible in that one summary; never interpret it as
45
+ an opt-out or invent a project command.
46
+ <!-- readiness:optional-preflight:end -->
47
+
48
+ <!-- readiness:block projectRecovery -->
49
+ When `projectRecovery` is active, read
50
+ `docs/agents/skills/git-worktree-recover.md` and apply its named prevention
51
+ guards and exact worktree setup command around the generic recovery below.
52
+ <!-- readiness:end -->
28
53
 
29
54
  ---
30
55
 
@@ -124,16 +149,12 @@ it.
124
149
 
125
150
  ## Phase 5 — Set up a worktree
126
151
 
127
- Set the recovered branch up cleanly in its own worktree. If your project has a
128
- worktree-setup command, use it (it typically runs `git worktree add`, installs
129
- deps and copies env files); otherwise:
152
+ Set the recovered branch up cleanly in its own worktree. The generic fallback is:
130
153
 
131
154
  ```bash
132
155
  git worktree add <path> <recovered-branch>
133
156
  ```
134
157
 
135
- Your project layer names the exact command and what it copies.
136
-
137
158
  **Verify after setup:**
138
159
 
139
160
  ```bash
@@ -43,11 +43,25 @@ release contain the same artifact.
43
43
  data, infer an external fact, or manufacture `pending`/`not-applicable` to
44
44
  make a capability appear ready.
45
45
 
46
+ Readiness-schema adoption also keeps the Claude and Codex instruction
47
+ surfaces compatible. When exactly one applicable instruction surface has a
48
+ non-empty `## Prod` section and another has no such section, the staged
49
+ candidate mirrors the same section body into the missing surface. This
50
+ narrow migration is previewed as `migrated`, destination-race checked,
51
+ idempotent, and covered by the same verification and rollback transaction.
52
+ It may create a missing instruction file, but it never rewrites an existing
53
+ `## Prod` body. Empty, malformed, or divergent sections are named as
54
+ conflicts and leave every consumer file untouched. This migration belongs
55
+ to `kit update`; do not rerun `setup-workflow` after an ordinary update.
56
+ Readiness JSON diagnoses only the affected path and problem category
57
+ (`missing-file`, `missing-section`, `empty-section`, or
58
+ `divergent-section`); it never echoes consumer content.
59
+
46
60
  3. Read the terminal report. `aktuell` proves a second run found no upstream
47
- delta. A conflict report names and counts every category and leaves every
48
- consumer file untouched. Follow its recommendation and resolve each named
49
- conflict manually; never auto-merge, delete a local edit, or silently choose
50
- the incoming copy.
61
+ delta or pending readiness migration. A conflict report names and counts
62
+ every category and leaves every consumer file untouched. Follow its
63
+ recommendation and resolve each named conflict manually; never auto-merge,
64
+ delete a local edit, or silently choose the incoming copy.
51
65
 
52
66
  Read all four availability categories alongside the file delta: newly
53
67
  available skill core, newly degraded optional blocks, newly blocked skill
@@ -13,13 +13,46 @@ correctly, AFK. Subagents BUILD; **you** integrate + verify + land.
13
13
  The anchor, its sub-issues and the locked plan doc contain the verbatim contracts
14
14
  you must NOT paraphrase.
15
15
 
16
- > **Phase 0 probes a project layer.** Concrete tooling exact test/verify
16
+ ## Readiness preflightfirst
17
+
18
+ <!-- readiness:optional-preflight:start -->
19
+ Before reading from the issue tracker, claiming a wave, creating worktrees, or
20
+ making any local or remote mutation, run this once from the project root:
21
+
22
+ ```bash
23
+ node scripts/readiness.mjs check --skill orchestrate-wave --json
24
+ ```
25
+
26
+ - `ready`: continue silently with the required tracker/board context and the
27
+ active `projectRecipe` block.
28
+ - `degraded`: required tracker and managed-board evidence is ready, so keep the
29
+ complete generic orchestration fallback active, omit only `projectRecipe`,
30
+ and emit exactly one concise summary: `Readiness degraded — inactive block
31
+ projectRecipe (orchestrateWaveRecipe: <state>); using the generic
32
+ orchestration fallback. Run /setup-workflow, configure
33
+ docs/agents/skills/orchestrate-wave.md, then rerun this skill.`
34
+ - `blocked`: `STOP` before tracker access, dispatch, claims, worktrees, or other
35
+ mutation. Report `issueTracker=<state>` and `managedBoard=<state>`, then give
36
+ exactly one recovery path: **Run `/setup-workflow`, then rerun
37
+ `/orchestrate-wave`.** Never fall back to bare tracker or board commands.
38
+ - `managedBoard=not-applicable`: `STOP` and report that `/orchestrate-wave` is
39
+ inapplicable without a managed board. This is a terminal project decision,
40
+ not invalid evidence and not a partially active mode.
41
+ - Invalid evidence is always visible and never treated as an opt-out.
42
+ <!-- readiness:optional-preflight:end -->
43
+
44
+ <!-- readiness:block projectRecipe -->
45
+ > **Phase 0 consumes the active project recipe.** Concrete tooling — exact test/verify
17
46
  > commands, a DB/tunnel setup, a headless login recipe, brand checks, deploy
18
47
  > lockstep — is project-specific and lives in a **project layer** this skill reads
19
48
  > at runtime, not in this skeleton. The skeleton names the layer's sections
20
49
  > (`§Setup`, `§Builder Commands`, `§Builder Hard Rules`, `§Integration Suites`,
21
50
  > `§Verify Recipe`, `§Headless Login`, `§Landing`) and falls back to generic
22
51
  > instructions when the layer is absent. See **Phase 0**.
52
+ >
53
+ > When `projectRecipe` is active, read the filled project layer before applying
54
+ > any phase-specific command below.
55
+ <!-- readiness:end -->
23
56
 
24
57
  ## Standing rules (all phases)
25
58
 
@@ -59,15 +92,11 @@ you must NOT paraphrase.
59
92
  1. **Read everything**: the anchor body, every sub-issue body (each has a Handoff
60
93
  block: scope, blast-radius, live-verify, PR line), and the locked plan /
61
94
  plan-review doc in the planning worktree (file-exact).
62
- 2. **Probe the project layer.** Read the project layer doc for this skill (the
63
- consumer's `docs/agents/skills/orchestrate-wave.md` or the path your project
64
- uses). If its `§`-sections carry **filled** content, follow the project recipe
65
- wherever a phase below points at a `§`-section. If the file is only a
66
- `setup-workflow` sentinel stub (empty headings, no real content) or absent,
67
- treat the layer as **ABSENT** → use the generic fallback in each phase and warn
68
- **once** that `/setup-workflow` plus project maintenance fill the layer (the
69
- commands/tunnel/login can't be guessed). Never treat an empty heading as a
70
- verify recipe.
95
+ 2. **Select exact commands or the generic fallback.** If the readiness result
96
+ activated `projectRecipe`, use the loaded filled recipe wherever a phase below
97
+ points at a `§`-section. Otherwise use each phase's generic fallback; the
98
+ preflight's single degraded summary is the only warning. Never guess a project
99
+ command, tunnel, login, or verify recipe.
71
100
  3. **Preflight — refuse a wave already in flight, otherwise claim it.** Before
72
101
  dispatch, inspect all three same-machine collision signals: **(a)** an existing
73
102
  `wave-active/<anchor>` tag; **(b)** any slice branch ahead of the wave's current
@@ -88,10 +117,10 @@ you must NOT paraphrase.
88
117
  tunnel or service the live-verify depends on. Absent layer → start whatever your
89
118
  live-verify environment requires before Phase 4.
90
119
 
91
- **Done when:** anchor + every sub-issue + plan read · project layer probed
92
- (filledproject recipe; stub/absent → generic + one-time warning) · preflight
93
- clean + this run's local claim planted · wave branch ff'd to `origin/main` + deps
94
- installed · project setup steps running.
120
+ **Done when:** anchor + every sub-issue + plan read · readiness result consumed
121
+ (active `projectRecipe` exact recipe; inactive → generic fallback) · collision
122
+ preflight clean + this run's local claim planted · wave branch ff'd to
123
+ `origin/main` + deps installed · project setup steps running.
95
124
 
96
125
  ## Phase 1 — Disjointness recon (the load-bearing step)
97
126
 
@@ -66,13 +66,20 @@ delegates this route to the shipped `census-update` contract and its focused
66
66
  `scripts/test_census_update_contract.test.mjs` proof; it does not reproduce
67
67
  activation, snapshots, or enforcement. Setup itself never calls `activateCensus`.
68
68
 
69
- Disable follows the ordered contract: remove the kit-owned hook, remove the
70
- kit-owned gate, then atomically replace only the profile's `enabled` value with
71
- `false`, preserving unknown keys, and verify `disabled` through
72
- `resolveCensusState`. Enforcement removal must finish before any profile
73
- mutation. Treat the choice document, local scanners, their tests, the profile,
74
- and the active snapshot as consumer-owned evidence. List those files and ask
75
- for separate deletion approval; without that approval, retain them.
69
+ Activation owns durable enforcement: every focused test declared by the active
70
+ profile must remain transitively reachable through one shared project-local
71
+ census check entry point from both local CI and pre-push. `census-update`
72
+ reconciles that narrow kit-owned census wiring idempotently and requires an
73
+ executable wiring proof before it can report `current`; setup does not pre-wire
74
+ the optional bootstrap state.
75
+
76
+ Disable follows the ordered contract: remove only the kit-owned census wiring
77
+ (including the kit-owned hook and gate block), then atomically replace only the
78
+ profile's `enabled` value with `false`, preserving unknown keys, and verify
79
+ `disabled` through `resolveCensusState`. Enforcement removal must finish before
80
+ any profile mutation. Treat the choice document, local scanners, their tests,
81
+ the profile, and the active snapshot as consumer-owned evidence. List those
82
+ files and ask for separate deletion approval; without that approval, retain them.
76
83
  Setup never deletes consumer-owned files as part of disable.
77
84
 
78
85
  ## Setup report
@@ -23,6 +23,35 @@ skills the other steps rely on drift, and nothing fixes them unless a recipe doe
23
23
  Not for: rewriting a domain skill's content on demand (that is the skill itself),
24
24
  or auditing application code (a code review or a diagnosis does that).
25
25
 
26
+ ## Readiness preflight — first
27
+
28
+ <!-- readiness:optional-preflight:start -->
29
+ Before enumerating skills, launching research subagents, or editing any skill,
30
+ run this once from the project root:
31
+
32
+ ```bash
33
+ node scripts/readiness.mjs check --skill audit-skills --json
34
+ ```
35
+
36
+ - `ready`: continue silently with the generic audit and the active
37
+ `projectChecks` block.
38
+ - `degraded`: keep the generic audit active, omit only `projectChecks`, and emit
39
+ exactly one concise summary: `Readiness degraded — inactive block
40
+ projectChecks (auditSkillsLayer: <state>). Run /setup-workflow, configure
41
+ docs/agents/skills/audit-skills.md, then rerun this skill.`
42
+ - `blocked`: stop before continuing and report the non-ready required capability
43
+ plus the exact `/setup-workflow` recovery path.
44
+ - Invalid evidence is always visible in that one summary; never interpret it as
45
+ an opt-out or invent project checks.
46
+ <!-- readiness:optional-preflight:end -->
47
+
48
+ <!-- readiness:block projectChecks -->
49
+ When `projectChecks` is active, read
50
+ `docs/agents/skills/audit-skills.md` and apply its concrete class assignments,
51
+ project-specific guard commands, and drift checks in addition to the generic
52
+ recipe below.
53
+ <!-- readiness:end -->
54
+
26
55
  ## Standing guards (run without this audit)
27
56
 
28
57
  Two automatic nets catch the most common drift classes before an audit — this
@@ -31,7 +60,7 @@ recipe complements them, it does not replace them:
31
60
  1. **A skill-sync test** — for any un-guessable enumeration a skill documents (a
32
61
  status→bucket map, a design-token list), a test parses the value out of the
33
62
  SKILL.md and asserts equality with the code constant. Drift breaks the build.
34
- Your project layer names the concrete tests.
63
+ Run the concrete tests available in the repository.
35
64
  2. **The drift-hint hook** (`.claude/hooks/skill-drift-hint.py`) + a per-skill
36
65
  `SOURCES.txt`: at SessionStart it flags any skill whose declared source file
37
66
  is newer in git than its SKILL.md.
@@ -79,8 +108,9 @@ plus the `SOURCES.txt` files. Sort every skill into one of three classes:
79
108
  scripts or hooks with no `SOURCES.txt` and no hook net. No hook warns, so
80
109
  re-check them manually each audit.
81
110
 
82
- Your project layer assigns each concrete skill to a class a completeness gate
83
- catches the next new skill that would otherwise stay invisible.
111
+ Derive each concrete skill's class from the manifest, its `SOURCES.txt`, and the
112
+ repository surfaces — a completeness gate catches the next new skill that would
113
+ otherwise stay invisible.
84
114
 
85
115
  ### 2. Audit in parallel — one subagent per skill
86
116
 
@@ -129,8 +159,7 @@ alongside the Claude source), sync the mirror in the **same** change — otherwi
129
159
  the second surface rots silently. Mirror the body, but preserve each surface's
130
160
  own frontmatter: a mirror's `description` may be deliberately condensed, so never
131
161
  blind-copy the whole file over it. A `SOURCES.txt` is a plain anchor list and can
132
- be mirrored verbatim. Your project layer names the surfaces and the exact
133
- transform.
162
+ be mirrored verbatim. Use the repository's declared surfaces and exact transform.
134
163
 
135
164
  ## Done
136
165
 
@@ -72,6 +72,35 @@ proof is still open for state resolution even when Git tracking lets the base
72
72
  scan enumerate it. Overrides are report input only and are never passed into
73
73
  scanning, fingerprinting, verification, or state resolution.
74
74
 
75
+ ## Durable enforcement
76
+
77
+ An activated census is a durable consumer contract, not a one-time activation
78
+ check. Before activating a candidate or reporting an unchanged census as
79
+ `current`, derive the complete set of every `localScanners[].test` from the
80
+ profile and inspect the repository's documented local CI and pre-push paths.
81
+
82
+ Reuse one existing shared project-local census check entry point when the
83
+ repository has one. Otherwise add the smallest such entry point through the
84
+ repository's established script mechanism; do not create a second census
85
+ engine or duplicate scanner logic. It must execute every declared focused test,
86
+ and both local CI and pre-push must transitively reach that same entry point.
87
+ Add or extend an executable wiring test that fails when either durable path or
88
+ any declared scanner test becomes unreachable; matching prose or a bare grep is
89
+ not sufficient proof.
90
+
91
+ Keep enforcement reconciliation idempotent. An already complete wiring graph
92
+ is a no-write result. Mark only the narrow gate block added for this lifecycle
93
+ with the repository's existing managed marker, or with
94
+ `agent-workflow-kit:census` when no marker convention exists; that block is the
95
+ kit-owned census wiring. Preserve surrounding consumer-owned gate logic.
96
+
97
+ Missing or partial durable wiring is a failed candidate verification. If the
98
+ repository has no safe documented gate seam, ask one bounded wiring question
99
+ and stop before activation. On a scanner-test or wiring-proof failure, report
100
+ `failed`, discard the candidate when safe, and confirm that the previous active
101
+ census bytes are unchanged. Never report `current` from activation-time test
102
+ success alone.
103
+
75
104
  ## Workflow
76
105
 
77
106
  1. **Check.** Read the local profile and active census, if present. Report a
@@ -95,8 +124,9 @@ scanning, fingerprinting, verification, or state resolution.
95
124
  and a focused passing test for that pattern. Run that test before rescanning.
96
125
  6. **Verify a candidate.** Build the candidate from the fresh scan and recorded
97
126
  decisions. Fail verification when any surface or behavior remains `offen`,
98
- when a required local scanner test fails, or when the candidate fingerprints
99
- do not describe the current repository.
127
+ when a required local scanner test fails, when durable enforcement or its
128
+ executable wiring test is incomplete, or when the candidate fingerprints do
129
+ not describe the current repository.
100
130
  7. **Activate.** Call `activateCensus` with a real verifier so it stages, verifies,
101
131
  and atomically swaps under its local lock. On `CensusTransactionError`, report
102
132
  `updating` or `failed` and keep the previous active census authoritative.
@@ -137,4 +167,5 @@ Return only the useful audit trail:
137
167
  - surface coverage `X of Y`;
138
168
  - separate behavior overview;
139
169
  - visible `nicht relevant` justifications and active override, if any; <!-- language-census: ok -->
140
- - local scanner tests run and the transaction/no-write result.
170
+ - local scanner tests run, durable local-CI/pre-push reachability, and the
171
+ transaction/no-write result.
@@ -26,11 +26,36 @@ discipline and its guards) didn't stop it.
26
26
 
27
27
  ## Precondition
28
28
 
29
- If your project has a prevention layer a SessionStart warning on active
30
- worktrees, a pre-edit guard that blocks edits on the wrong branch — this skill
31
- handles the case where that layer did NOT prevent a misplaced commit. Your project
32
- layer names those guards (`docs/agents/skills/git-worktree-recover.md`, seeded as
33
- an empty stub by `/setup-workflow`).
29
+ This generic recovery remains usable whether or not the project has prevention
30
+ guards or a custom worktree setup command.
31
+
32
+ ## Readiness preflight first
33
+
34
+ <!-- readiness:optional-preflight:start -->
35
+ Before assessing refs or moving a branch, run this once from the project root:
36
+
37
+ ```bash
38
+ node scripts/readiness.mjs check --skill git-worktree-recover --json
39
+ ```
40
+
41
+ - `ready`: continue silently with generic recovery and the active
42
+ `projectRecovery` block.
43
+ - `degraded`: keep generic reflog recovery active, omit only
44
+ `projectRecovery`, and emit exactly one concise summary: `Readiness degraded
45
+ — inactive block projectRecovery (worktreeRecoveryLayer: <state>). Run
46
+ /setup-workflow, configure docs/agents/skills/git-worktree-recover.md, then
47
+ rerun this skill.`
48
+ - `blocked`: stop before continuing and report the non-ready required capability
49
+ plus the exact `/setup-workflow` recovery path.
50
+ - Invalid evidence is always visible in that one summary; never interpret it as
51
+ an opt-out or invent a project command.
52
+ <!-- readiness:optional-preflight:end -->
53
+
54
+ <!-- readiness:block projectRecovery -->
55
+ When `projectRecovery` is active, read
56
+ `docs/agents/skills/git-worktree-recover.md` and apply its named prevention
57
+ guards and exact worktree setup command around the generic recovery below.
58
+ <!-- readiness:end -->
34
59
 
35
60
  ---
36
61
 
@@ -130,16 +155,12 @@ it.
130
155
 
131
156
  ## Phase 5 — Set up a worktree
132
157
 
133
- Set the recovered branch up cleanly in its own worktree. If your project has a
134
- worktree-setup command, use it (it typically runs `git worktree add`, installs
135
- deps and copies env files); otherwise:
158
+ Set the recovered branch up cleanly in its own worktree. The generic fallback is:
136
159
 
137
160
  ```bash
138
161
  git worktree add <path> <recovered-branch>
139
162
  ```
140
163
 
141
- Your project layer names the exact command and what it copies.
142
-
143
164
  **Verify after setup:**
144
165
 
145
166
  ```bash
@@ -43,11 +43,25 @@ release contain the same artifact.
43
43
  data, infer an external fact, or manufacture `pending`/`not-applicable` to
44
44
  make a capability appear ready.
45
45
 
46
+ Readiness-schema adoption also keeps the Claude and Codex instruction
47
+ surfaces compatible. When exactly one applicable instruction surface has a
48
+ non-empty `## Prod` section and another has no such section, the staged
49
+ candidate mirrors the same section body into the missing surface. This
50
+ narrow migration is previewed as `migrated`, destination-race checked,
51
+ idempotent, and covered by the same verification and rollback transaction.
52
+ It may create a missing instruction file, but it never rewrites an existing
53
+ `## Prod` body. Empty, malformed, or divergent sections are named as
54
+ conflicts and leave every consumer file untouched. This migration belongs
55
+ to `kit update`; do not rerun `setup-workflow` after an ordinary update.
56
+ Readiness JSON diagnoses only the affected path and problem category
57
+ (`missing-file`, `missing-section`, `empty-section`, or
58
+ `divergent-section`); it never echoes consumer content.
59
+
46
60
  3. Read the terminal report. `aktuell` proves a second run found no upstream
47
- delta. A conflict report names and counts every category and leaves every
48
- consumer file untouched. Follow its recommendation and resolve each named
49
- conflict manually; never auto-merge, delete a local edit, or silently choose
50
- the incoming copy.
61
+ delta or pending readiness migration. A conflict report names and counts
62
+ every category and leaves every consumer file untouched. Follow its
63
+ recommendation and resolve each named conflict manually; never auto-merge,
64
+ delete a local edit, or silently choose the incoming copy.
51
65
 
52
66
  Read all four availability categories alongside the file delta: newly
53
67
  available skill core, newly degraded optional blocks, newly blocked skill
@@ -21,13 +21,46 @@ correctly, AFK. Subagents BUILD; **you** integrate + verify + land.
21
21
  The anchor, its sub-issues and the locked plan doc contain the verbatim contracts
22
22
  you must NOT paraphrase.
23
23
 
24
- > **Phase 0 probes a project layer.** Concrete tooling exact test/verify
24
+ ## Readiness preflightfirst
25
+
26
+ <!-- readiness:optional-preflight:start -->
27
+ Before reading from the issue tracker, claiming a wave, creating worktrees, or
28
+ making any local or remote mutation, run this once from the project root:
29
+
30
+ ```bash
31
+ node scripts/readiness.mjs check --skill orchestrate-wave --json
32
+ ```
33
+
34
+ - `ready`: continue silently with the required tracker/board context and the
35
+ active `projectRecipe` block.
36
+ - `degraded`: required tracker and managed-board evidence is ready, so keep the
37
+ complete generic orchestration fallback active, omit only `projectRecipe`,
38
+ and emit exactly one concise summary: `Readiness degraded — inactive block
39
+ projectRecipe (orchestrateWaveRecipe: <state>); using the generic
40
+ orchestration fallback. Run /setup-workflow, configure
41
+ docs/agents/skills/orchestrate-wave.md, then rerun this skill.`
42
+ - `blocked`: `STOP` before tracker access, dispatch, claims, worktrees, or other
43
+ mutation. Report `issueTracker=<state>` and `managedBoard=<state>`, then give
44
+ exactly one recovery path: **Run `/setup-workflow`, then rerun
45
+ `/orchestrate-wave`.** Never fall back to bare tracker or board commands.
46
+ - `managedBoard=not-applicable`: `STOP` and report that `/orchestrate-wave` is
47
+ inapplicable without a managed board. This is a terminal project decision,
48
+ not invalid evidence and not a partially active mode.
49
+ - Invalid evidence is always visible and never treated as an opt-out.
50
+ <!-- readiness:optional-preflight:end -->
51
+
52
+ <!-- readiness:block projectRecipe -->
53
+ > **Phase 0 consumes the active project recipe.** Concrete tooling — exact test/verify
25
54
  > commands, a DB/tunnel setup, a headless login recipe, brand checks, deploy
26
55
  > lockstep — is project-specific and lives in a **project layer** this skill reads
27
56
  > at runtime, not in this skeleton. The skeleton names the layer's sections
28
57
  > (`§Setup`, `§Builder Commands`, `§Builder Hard Rules`, `§Integration Suites`,
29
58
  > `§Verify Recipe`, `§Headless Login`, `§Landing`) and falls back to generic
30
59
  > instructions when the layer is absent. See **Phase 0**.
60
+ >
61
+ > When `projectRecipe` is active, read the filled project layer before applying
62
+ > any phase-specific command below.
63
+ <!-- readiness:end -->
31
64
 
32
65
  ## Standing rules (all phases)
33
66
 
@@ -67,15 +100,11 @@ you must NOT paraphrase.
67
100
  1. **Read everything**: the anchor body, every sub-issue body (each has a Handoff
68
101
  block: scope, blast-radius, live-verify, PR line), and the locked plan /
69
102
  plan-review doc in the planning worktree (file-exact).
70
- 2. **Probe the project layer.** Read the project layer doc for this skill (the
71
- consumer's `docs/agents/skills/orchestrate-wave.md` or the path your project
72
- uses). If its `§`-sections carry **filled** content, follow the project recipe
73
- wherever a phase below points at a `§`-section. If the file is only a
74
- `setup-workflow` sentinel stub (empty headings, no real content) or absent,
75
- treat the layer as **ABSENT** → use the generic fallback in each phase and warn
76
- **once** that `/setup-workflow` plus project maintenance fill the layer (the
77
- commands/tunnel/login can't be guessed). Never treat an empty heading as a
78
- verify recipe.
103
+ 2. **Select exact commands or the generic fallback.** If the readiness result
104
+ activated `projectRecipe`, use the loaded filled recipe wherever a phase below
105
+ points at a `§`-section. Otherwise use each phase's generic fallback; the
106
+ preflight's single degraded summary is the only warning. Never guess a project
107
+ command, tunnel, login, or verify recipe.
79
108
  3. **Preflight — refuse a wave already in flight, otherwise claim it.** Before
80
109
  dispatch, inspect all three same-machine collision signals: **(a)** an existing
81
110
  `wave-active/<anchor>` tag; **(b)** any slice branch ahead of the wave's current
@@ -96,10 +125,10 @@ you must NOT paraphrase.
96
125
  tunnel or service the live-verify depends on. Absent layer → start whatever your
97
126
  live-verify environment requires before Phase 4.
98
127
 
99
- **Done when:** anchor + every sub-issue + plan read · project layer probed
100
- (filledproject recipe; stub/absent → generic + one-time warning) · preflight
101
- clean + this run's local claim planted · wave branch ff'd to `origin/main` + deps
102
- installed · project setup steps running.
128
+ **Done when:** anchor + every sub-issue + plan read · readiness result consumed
129
+ (active `projectRecipe` exact recipe; inactive → generic fallback) · collision
130
+ preflight clean + this run's local claim planted · wave branch ff'd to
131
+ `origin/main` + deps installed · project setup steps running.
103
132
 
104
133
  ## Phase 1 — Disjointness recon (the load-bearing step)
105
134