@ikon85/agent-workflow-kit 0.30.0 → 0.32.0

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 (48) hide show
  1. package/.agents/skills/audit-skills/SKILL.md +34 -5
  2. package/.agents/skills/board-to-waves/SKILL.md +14 -0
  3. package/.agents/skills/code-review/SKILL.md +22 -3
  4. package/.agents/skills/git-worktree-recover/SKILL.md +31 -10
  5. package/.agents/skills/kit-update/SKILL.md +21 -1
  6. package/.agents/skills/local-ci/SKILL.md +16 -0
  7. package/.agents/skills/orchestrate-wave/SKILL.md +43 -14
  8. package/.agents/skills/project-release/SKILL.md +18 -0
  9. package/.agents/skills/security-audit/SKILL.md +18 -0
  10. package/.agents/skills/setup-workflow/SKILL.md +39 -2
  11. package/.agents/skills/spec-self-critique/SKILL.md +16 -7
  12. package/.agents/skills/to-issues/SKILL.md +13 -1
  13. package/.agents/skills/to-prd/SKILL.md +14 -0
  14. package/.agents/skills/to-waves/SKILL.md +16 -2
  15. package/.agents/skills/triage/SKILL.md +24 -0
  16. package/.agents/skills/verify-spike/SKILL.md +20 -1
  17. package/.agents/skills/wrapup/SKILL.md +26 -4
  18. package/.claude/skills/audit-skills/SKILL.md +34 -5
  19. package/.claude/skills/board-to-waves/SKILL.md +14 -0
  20. package/.claude/skills/code-review/SKILL.md +22 -3
  21. package/.claude/skills/git-worktree-recover/SKILL.md +31 -10
  22. package/.claude/skills/kit-update/SKILL.md +21 -1
  23. package/.claude/skills/local-ci/SKILL.md +16 -0
  24. package/.claude/skills/orchestrate-wave/SKILL.md +43 -14
  25. package/.claude/skills/project-release/SKILL.md +18 -0
  26. package/.claude/skills/security-audit/SKILL.md +18 -0
  27. package/.claude/skills/setup-workflow/SKILL.md +39 -2
  28. package/.claude/skills/spec-self-critique/SKILL.md +16 -7
  29. package/.claude/skills/to-issues/SKILL.md +13 -1
  30. package/.claude/skills/to-prd/SKILL.md +14 -0
  31. package/.claude/skills/to-waves/SKILL.md +16 -2
  32. package/.claude/skills/triage/SKILL.md +24 -0
  33. package/.claude/skills/verify-spike/SKILL.md +20 -1
  34. package/.claude/skills/wrapup/SKILL.md +26 -4
  35. package/README.md +41 -0
  36. package/agent-workflow-kit.package.json +36 -36
  37. package/package.json +1 -1
  38. package/scripts/kit-update-pr.mjs +14 -1
  39. package/scripts/kit-update-pr.test.mjs +21 -0
  40. package/scripts/test_retro_wrapup_contract.py +17 -0
  41. package/scripts/test_skill_optional_readiness.py +171 -0
  42. package/scripts/test_skill_readiness_contract.py +127 -7
  43. package/scripts/test_skill_readiness_preflight.py +180 -0
  44. package/scripts/test_skill_required_readiness.py +233 -0
  45. package/scripts/test_skill_setup_workflow_seeds.py +22 -0
  46. package/src/cli.mjs +10 -2
  47. package/src/commands/update.mjs +65 -8
  48. package/src/lib/updateCandidate.mjs +116 -2
@@ -21,10 +21,29 @@ This is the "Verify First" rule with a runnable harness behind it: when you cann
21
21
 
22
22
  If the question is really "what should this be", it is not a verify-spike — those are open, not yes/no.
23
23
 
24
+ ## Readiness preflight — first
25
+
26
+ <!-- readiness:optional-preflight:start -->
27
+ Before framing or running the spike, run this once from the project root:
28
+
29
+ ```bash
30
+ node scripts/readiness.mjs check --skill verify-spike --json
31
+ ```
32
+
33
+ - `ready`: continue without a readiness message. Ready is silent.
34
+ - `degraded`: keep the generic empirical spike active, omit only the inactive block `projectPlacement`, and emit exactly one concise summary: `Readiness degraded — inactive block projectPlacement (verifySpikeLayer: <state>). Run /setup-workflow, configure docs/agents/skills/verify-spike.md, then rerun this skill.`
35
+ - `blocked`: stop before continuing and report the non-ready required capability plus the exact `/setup-workflow` recovery path.
36
+ - Invalid is always visible: include the `invalid` capability state in the single summary and never treat it as an opt-out. Do not emit separate warnings later in the workflow.
37
+ <!-- readiness:optional-preflight:end -->
38
+
39
+ <!-- readiness:block projectPlacement -->
40
+ When `projectPlacement` is active, read `docs/agents/skills/verify-spike.md` and follow its project-specific harness-placement and import rules.
41
+ <!-- readiness:end -->
42
+
24
43
  ## Steps
25
44
 
26
45
  1. **Frame one falsifiable question.** Write it down as a single sentence with a yes/no answer and the exact version/context it is scoped to — e.g. "Does `customType.mapFromDriverValue` run on `drizzle-orm@1.0.0-rc.3` + node-postgres?". Name what a YES vs a NO looks like in the output *before* you run anything.
27
- 2. **Build the smallest harness that forces the answer.** Borrow the feedback-loop toolkit from `diagnose` Phase 1 — a one-call throwaway script, a fixture replay, a tiny HTTP/curl probe, a headless-browser assertion. Pick the cheapest one that touches the real thing (real lib version, real runtime, the actual DB read). One command to run; locate it in a clearly-throwaway path (`scratch/`, `*.spike.ts`). If a project layer exists at `docs/agents/skills/verify-spike.md`, follow its harness-placement/import rules — some repos need spikes inside a package dir so real imports resolve.
46
+ 2. **Build the smallest harness that forces the answer.** Borrow the feedback-loop toolkit from `diagnose` Phase 1 — a one-call throwaway script, a fixture replay, a tiny HTTP/curl probe, a headless-browser assertion. Pick the cheapest one that touches the real thing (real lib version, real runtime, the actual DB read). One command to run; locate it in a clearly-throwaway path (`scratch/`, `*.spike.ts`).
28
47
  3. **Run it and capture the proof.** Keep the raw output — the value, the error, the stack, the HTTP status. The verdict is only as good as the evidence pasted under it.
29
48
  4. **Record the verdict durably, with its evidence inline.** Yes/No + the proof (output snippet / `file:line` / version) + the date + the scope it was checked at. Sink it where the decision lives: an ADR, the issue body, the plan, or a PR comment. A verdict without inline evidence is just an unverified claim — keep the proof attached so a later reader does not have to re-run the spike to trust it.
30
49
  5. **Delete the harness.** The *answer* is the only keeper. Remove the spike code (or fold the proven fact into real code) so nothing throwaway rots in the repo.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: wrapup
3
3
  disable-model-invocation: true
4
- "description": "Use ONLY when the user types /wrapup. Session-end \"land & clean\" for a finished feature/fix worktree — merges the open PR (= triggers prod deploy), kills the worktree dev server, removes the worktree + local branch, and fast-forwards the main checkout so main is current again, then sweeps merged-branch leftovers (local + stale remote whose PR is merged). If the slice isn't landed yet, it first makes it landable (Step 0): commits a dirty tree (after an .env/secret check), pushes, and opens the PR — reusing one if it already exists. User-triggered only (never auto-invoke, never hook). Aborts hard only on: not in a feature worktree, a detected .env/secret, a rejected push, a conflicting PR, or red (FAILURE) checks."
4
+ "description": "Use ONLY when the user types /wrapup. Session-end \"land & clean\" for a finished feature/fix worktree — merges the open PR, kills the worktree dev server, removes the worktree + local branch, and fast-forwards the main checkout so main is current again, then sweeps merged-branch leftovers (local + stale remote whose PR is merged). If the slice isn't landed yet, it first makes it landable (Step 0): commits a dirty tree (after an .env/secret check), pushes, and opens the PR — reusing one if it already exists. User-triggered only (never auto-invoke, never hook). Aborts hard only on: not in a feature worktree, a detected .env/secret, a rejected push, a conflicting PR, or red (FAILURE) checks."
5
5
  ---
6
6
 
7
7
  # wrapup — land PR & tear down worktree
@@ -10,7 +10,11 @@ Trigger: user types `/wrapup` (optionally with a PR number). **Manual only** —
10
10
 
11
11
  ## ⚠ Spec context
12
12
 
13
- **Merging to `main` = prod deploy.** The agent never deploys on its own — the user's `/wrapup` input IS the explicit merge+deploy authorization for that run. Never call this skill from a hook, another skill, or autonomously. Deploy banner before the merge, no y/n confirmation (deliberate); the pre-flight hard stops are non-negotiable.
13
+ The user's `/wrapup` input IS the explicit landing authorization for that run.
14
+ It authorizes the normal merge flow whether Prod readiness is ready or degraded;
15
+ it never authorizes the agent to invent or configure a deploy target. Never call
16
+ this skill from a hook, another skill, or autonomously. There is no second merge
17
+ confirmation; the pre-flight hard stops are non-negotiable.
14
18
 
15
19
  ## Execution model — script does mechanics, the agent does judgment
16
20
 
@@ -27,6 +31,17 @@ python3 scripts/wrapup-land.py preflight
27
31
  ```
28
32
  Hard stop (the only pure precondition): not in a feature worktree / on `main` — the script exits 1. The report carries everything the later steps need: dirty files, `.env` hits, secret-grep hits, issue + parent (leaf vs. anchor slice), existing PR + whether its body has a `**Retro:**` line, parsed `ANNAHMEN.md` drift lines, profile values (`retro_values`, `vor_bau`, remote-sweep switch).
29
33
 
34
+ Then run:
35
+
36
+ ```bash
37
+ node scripts/readiness.mjs check --skill wrapup --json
38
+ ```
39
+
40
+ `prodTarget: ready` activates only `deployReport` below. `pending` or `missing`
41
+ omits that block, emits exactly one concise note — `Prod readiness is pending or missing; deploy reporting omitted.` — and landing continues normally.
42
+ `invalid` means malformed or divergent Prod evidence: STOP and report the
43
+ conflicting instruction surfaces; never choose a target on the user's behalf.
44
+
30
45
  ### 2 · Retro gate (blocking, optional retro-exit — before anything is committed)
31
46
  One reminder, not a merge confirmation:
32
47
  > "Already ran a retro? **(a)** yes / continue → landing now. **(b)** you want one first → the retro starts now; afterwards, invoke `/wrapup` again — repo-file patches then travel in this PR."
@@ -72,10 +87,17 @@ One call covers: push → PR create/reuse (+ drift markers merged into the body)
72
87
  STOP → diagnose in the main conversation, fix, re-run `land` (an already-merged PR resumes at teardown).
73
88
 
74
89
  ### 6 · Post-merge (agent)
75
- - **Deploy banner**, one line: `⚠ PR #<pr> merged → main deploys (~7 min live).`
76
90
  - **Sibling propagation:** for each `drift_markers` entry in the land report, append the note to the target issue's `vor_bau` section + re-stamp its `plan_revision`. Log-based markers → **write directly, then show what was written where** (mandatory report — visibility moved from a pre-gate into the report, decision 2026-07-06); fallback candidates the user hasn't confirmed yet → confirm first. Program context widens the target set to unbuilt wave-stubs/leaves and the Program-PRD itself — same append-only mechanism. **Exception:** appends to the Program-PRD or unbuilt wave-stubs do **not** re-stamp `plan_revision` — that stays reserved for structural wave-plan edits via the `to-waves` escalation path; a mere drift note must not stale-block published stubs.
77
91
  - **Anchor close:** report says `anchor_complete: true` → `gh issue close <anchor> -c "Wave complete — all slices merged via PR #<pr>."` and verify board status Done. The guard keeps anchors away from every auto-close — this verified close is the only close path; without it the anchor stays silently open after the last slice. **Then re-run the upward propagation**: the land-time `program-sync` ran BEFORE this close, so on a wave-completing slice the Wellenplan still shows 🔄 and the Phasen-Gate stays unchecked — after the board shows Done, run `python3 scripts/board-sync.py program-sync <program-prd#>` once more (the report's `program_sync.program` names it; skip when the report says the parent is not a program). Board auto-rules can lag the close (Close→Done race) — verify Done first, that's what the token reads.
78
- - **Report**, concise, from the land JSON: PR merged · issue close (auto/manual) · worktree removed · branch deleted · sweep counts local/remote · anchor synced + complete/pending · program propagation (`program_sync`: Wellenplan refreshed / gates checked / skipped) · propagation writes (what → where) · `main` at `<sha>` · deploy running.
92
+ - **Report**, concise, from the land JSON: PR merged · issue close (auto/manual) · worktree removed · branch deleted · sweep counts local/remote · anchor synced + complete/pending · program propagation (`program_sync`: Wellenplan refreshed / gates checked / skipped) · propagation writes (what → where) · `main` at `<sha>`.
93
+
94
+ <!-- readiness:block deployReport -->
95
+ - **Deploy-aware report:** read the coherent `## Prod` block; before merging,
96
+ state the configured deploy trigger and expected outcome. After merge, report
97
+ the configured target and its actual known state. Do not claim a deployment
98
+ is running or live unless the configured trigger and observed evidence prove
99
+ it; keep unknown timing explicit.
100
+ <!-- readiness:end -->
79
101
 
80
102
  ## Out of scope
81
103
  - Live-verify / DoD: must happen **before** `/wrapup` — this skill lands, it does not verify.
@@ -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
 
@@ -21,6 +21,20 @@ description: >-
21
21
 
22
22
  **Survey the board → cluster open issues by theme → anchor stub issues.** Systematizes how Welle F came about: first look at what's open and what fits together, then form thematic waves. Result lands durably as an anchor issue on the board (GitHub = SSOT), not as a chat list.
23
23
 
24
+ <!-- readiness:required-preflight:start -->
25
+ ## 0. Required readiness preflight
26
+
27
+ This is the first executable workflow step. From the project root, before any remote write or other `gh`/`board-sync.py` command, run this read-only check:
28
+
29
+ ```bash
30
+ node scripts/readiness.mjs check --skill board-to-waves --json
31
+ ```
32
+
33
+ - `verdict=ready`: continue with the existing workflow without announcing the check. **Ready is silent.**
34
+ - `verdict=blocked`: `STOP` before any mutation. Report every required capability as `<capability>=<state>` so `missing`, `pending`, and `invalid` remain distinct, then give exactly one recovery path: **Run `/setup-workflow`, then rerun `/board-to-waves`.** Do not fall back to bare tracker or board commands.
35
+ - `managedBoard=not-applicable`: `STOP` and report that `/board-to-waves` is **inapplicable** for a project that deliberately has no managed board. This is a terminal project decision, not invalid evidence and not a partially active mode.
36
+ <!-- readiness:required-preflight:end -->
37
+
24
38
  ## Pipeline Position
25
39
 
26
40
  ```
@@ -16,7 +16,26 @@ A code-review compares one diff against **two independent axes** — Standards a
16
16
  | "Why is this broken / slow?" (root-cause of a known defect) | `diagnose` |
17
17
  | "Clean this up — reuse, simplify, cut waste." (no bug-hunting) | a dedicated simplification pass |
18
18
 
19
- ## Preflight (fail-fast, before either axis starts)
19
+ ## Readiness preflight first
20
+
21
+ <!-- readiness:optional-preflight:start -->
22
+ Before the diff preflight or either review axis, run this once from the project root:
23
+
24
+ ```bash
25
+ node scripts/readiness.mjs check --skill code-review --json
26
+ ```
27
+
28
+ - `ready`: continue without a readiness message. Ready is silent.
29
+ - `degraded`: keep the generic two-axis review active, omit only the inactive block `projectEnrichment`, and emit exactly one concise summary: `Readiness degraded — inactive block projectEnrichment (codeReviewLayer: <state>). Run /setup-workflow, configure docs/agents/code-review.md, then rerun this skill.`
30
+ - `blocked`: stop before continuing and report the non-ready required capability plus the exact `/setup-workflow` recovery path.
31
+ - Invalid is always visible: include the `invalid` capability state in the single summary and never treat it as an opt-out. Do not emit separate warnings later in the workflow.
32
+ <!-- readiness:optional-preflight:end -->
33
+
34
+ <!-- readiness:block projectEnrichment -->
35
+ When `projectEnrichment` is active, read `docs/agents/code-review.md` first. Apply its project-specific guidance about which sources count and how this method relates to adjacent tools already running in the environment.
36
+ <!-- readiness:end -->
37
+
38
+ ## Diff preflight (fail-fast, before either axis starts)
20
39
 
21
40
  1. **Fixed point** — whatever the requester names: a SHA, branch, tag, `main`, `HEAD~N`. Missing → ask; do not guess.
22
41
  2. **Three-dot diff against the merge-base** — `git diff <fixed-point>...HEAD` (three dots, not two — two dots diffs tip-to-tip and pulls in unrelated upstream changes), plus the commit list: `git log <fixed-point>..HEAD --oneline`.
@@ -24,7 +43,7 @@ A code-review compares one diff against **two independent axes** — Standards a
24
43
 
25
44
  ## Axis 1 — Standards
26
45
 
27
- **Sources.** This repo's own documented conventions: a root convention file (`CLAUDE.md`/`AGENTS.md`/`CONTRIBUTING.md` — whichever this repo uses), any per-package convention files in a monorepo, a `docs/conventions/` folder. If `docs/agents/code-review.md` exists (this skill's project layer, seeded by `/setup-workflow`), read it first — it names exactly which sources count here and how this method relates to any other review tooling already running in this environment. Absent that file, gather the sources yourself from the repo root before reviewing.
46
+ **Sources.** This repo's own documented conventions: a root convention file (`CLAUDE.md`/`AGENTS.md`/`CONTRIBUTING.md` — whichever this repo uses), any per-package convention files in a monorepo, and a `docs/conventions/` folder. Gather these generic sources from the repo root before reviewing.
28
47
 
29
48
  **Plus a Fowler-smell baseline** (*Refactoring*, ch. 3) — applies even when the repo documents nothing. Each smell is a **judgment call** (flag as "possible X"), never a hard violation:
30
49
 
@@ -61,4 +80,4 @@ A code-review compares one diff against **two independent axes** — Standards a
61
80
 
62
81
  ## Relationship to adjacent review tooling
63
82
 
64
- This skill governs one thing: a diff/branch/PR review split into Standards vs. Spec. It is not the only review-shaped tool an environment may have — a pre-code plan-review loop, a security-specific audit, a pure reuse/simplification pass, or a dedicated reviewer subagent can all coexist with it; each stays its own axis, not a replacement for this one. If this repo has seeded `docs/agents/code-review.md`, it names the concrete adjacent tools and how they relate; absent that, treat any other review tool you find as complementary unless it explicitly says otherwise.
83
+ This skill governs one thing: a diff/branch/PR review split into Standards vs. Spec. It is not the only review-shaped tool an environment may have — a pre-code plan-review loop, a security-specific audit, a pure reuse/simplification pass, or a dedicated reviewer subagent can all coexist with it; each stays its own axis, not a replacement for this one. Without active project enrichment, treat any other review tool you find as complementary unless it explicitly says otherwise.
@@ -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
@@ -34,12 +34,30 @@ release contain the same artifact.
34
34
  `npm test` command there, and activates only a verified candidate. A staging
35
35
  or verification failure leaves the installed tree byte-identical.
36
36
 
37
+ The staged candidate also adopts the current readiness schema without
38
+ invoking `setup-workflow`: it preserves explicit readiness decisions and
39
+ legacy project evidence, and seeds only newly introduced safe project-layer
40
+ stubs whose destinations are absent. Those generated consumer-owned paths
41
+ are destination-race checked and activate or roll back in the same
42
+ transaction as kit files and the consumer manifest. Never create project
43
+ data, infer an external fact, or manufacture `pending`/`not-applicable` to
44
+ make a capability appear ready.
45
+
37
46
  3. Read the terminal report. `aktuell` proves a second run found no upstream
38
47
  delta. A conflict report names and counts every category and leaves every
39
48
  consumer file untouched. Follow its recommendation and resolve each named
40
49
  conflict manually; never auto-merge, delete a local edit, or silently choose
41
50
  the incoming copy.
42
51
 
52
+ Read all four availability categories alongside the file delta: newly
53
+ available skill core, newly degraded optional blocks, newly blocked skill
54
+ core, and still unresolved capability states. Missing readiness for genuinely
55
+ new behavior does not block a compatible kit update; only that behavior stays
56
+ unavailable. A compatible update must stop if it would make previously
57
+ available skill core unavailable. `--yes` answers only package reconciliation
58
+ questions and never supplies a readiness decision. Automated update pull
59
+ requests carry the same availability summary and remain manual-merge only.
60
+
43
61
  For each conflicted kit-shipped file, always ask the user whether the local
44
62
  edit is a generic improvement or project-specific; never decide or act
45
63
  automatically. For a generic improvement, offer to file an issue in the
@@ -74,4 +92,6 @@ release contain the same artifact.
74
92
  The update API reports `checking -> preview/awaiting_decision -> staging ->
75
93
  verifying -> applied | conflicted | failed | aborted`. `conflicted`, `failed`,
76
94
  and `aborted` never authorize partial activation. The existing manifest,
77
- three-way diff, and atomic-write seams remain the source of truth.
95
+ three-way diff, and atomic-write seams remain the source of truth. A failure
96
+ also names its transaction phase and whether consumer state stayed unchanged or
97
+ was rolled back.
@@ -20,6 +20,22 @@ live in the **project layer** for this skill (its `docs/agents/skills/local-ci.m
20
20
  seeded as an empty stub by `/setup-workflow` and filled per project). This
21
21
  skeleton names the two profiles generically; run the two your project layer names.
22
22
 
23
+ ## Required readiness preflight
24
+
25
+ Before running a guard, hook, test, or any other project command, run:
26
+
27
+ ```sh
28
+ node scripts/readiness.mjs check --skill local-ci --json
29
+ ```
30
+
31
+ Treat the result as authoritative. A `ready` verdict is silent: continue with
32
+ the existing gate and its safety rules. For a `blocked` verdict, stop without
33
+ running any guessed command and report `Local CI unavailable`, the
34
+ `localCiRecipe` state (`missing`, `pending`, `not-applicable`, or `invalid`),
35
+ and one recovery path: run `/setup-workflow`, then fill
36
+ `docs/agents/skills/local-ci.md` with the project's exact commands. Never infer
37
+ commands from package scripts, hooks, CI configuration, or another repository.
38
+
23
39
  ## When
24
40
 
25
41
  - **Before opening ANY PR** → run the full local gate. Red → fix it, or defer a
@@ -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
 
@@ -9,6 +9,24 @@ Prepare a consumer-owned multi-package release through the kit's shared
9
9
  SemVer, preview, and transactional apply engine. This skill changes only the
10
10
  profiled version files. It does not commit, tag, push, publish, or merge.
11
11
 
12
+ ## Required readiness preflight
13
+
14
+ Before previewing a release or changing any version file, run:
15
+
16
+ ```sh
17
+ node scripts/readiness.mjs check --skill project-release --json
18
+ ```
19
+
20
+ Treat the result as authoritative. A `ready` verdict is silent and hands
21
+ execution to `scripts/project-release.mjs`; the helper remains the authority
22
+ for preview, confirmation, validation, and transactional apply. For a
23
+ `blocked` verdict, stop without invoking that helper or changing files and
24
+ report `Project Release unavailable`, the `projectReleaseProfile` state
25
+ (`missing`, `pending`, `not-applicable`, or `invalid`), and one recovery path:
26
+ run `/setup-workflow`, then fill the `projectRelease` section in
27
+ `docs/agents/workflow-capabilities.json`. Never infer packages, version files,
28
+ tag prefixes, or versions.
29
+
12
30
  ## Profile contract
13
31
 
14
32
  Read `docs/agents/workflow-capabilities.json`. The consumer owns this file and
@@ -13,6 +13,24 @@ generic runbook structure ships as a template you copy and fill:
13
13
  your actual stack, and keep it as the checklist single source of truth. Read your
14
14
  filled runbook first.
15
15
 
16
+ ## Required readiness preflight
17
+
18
+ Before reading application code, creating a tracking issue, launching either
19
+ model, or writing audit scratch files, run:
20
+
21
+ ```sh
22
+ node scripts/readiness.mjs check --skill security-audit --json
23
+ ```
24
+
25
+ Treat the result as authoritative. A `ready` verdict is silent: continue with
26
+ the existing two-model procedure and all human approval gates. For a `blocked`
27
+ verdict, stop without starting an audit or mutating repository or remote state
28
+ and report `Security Audit unavailable`, the `securityAuditRunbook` state
29
+ (`missing`, `pending`, `not-applicable`, or `invalid`), and one recovery path:
30
+ run `/setup-workflow`, then fill `docs/agents/skills/security-audit.md` and the
31
+ project runbook it references. Never guess the stack, security scope, commands,
32
+ tracking anchor, or board wiring.
33
+
16
34
  **Scope guard:** code + config only. Infrastructure (firewall, exposed ports,
17
35
  TLS, SSH, backups) is audited **separately** — an exposed database port beats any
18
36
  code fix. Keep the two audits apart.
@@ -331,7 +331,36 @@ Seed `## Workflow` from [workflow-overview.md](./workflow-overview.md) when the
331
331
 
332
332
  > `wrapup` and live-verify reference where this project deploys (host, command, URL). It lives in the `## Prod` block of CLAUDE.md/AGENTS.md, not a separate file.
333
333
 
334
- Ask for the deploy target in plain terms (where does this ship, how is it deployed, what's the live URL?). Record it for the `## Prod` block (Write step). If the user has no deploy target, skip — do not invent one.
334
+ First run `node scripts/readiness.mjs check --skill wrapup --json`. If
335
+ `prodTarget` is `ready`, adopt the evidence, clear any superseded pending
336
+ decision with `node scripts/readiness.mjs decision clear prodTarget`, and do
337
+ not ask again. Malformed or divergent `## Prod` evidence is `invalid`: leave
338
+ all instruction files untouched, show the conflict, and stop this section
339
+ until the user resolves it.
340
+
341
+ For a missing or pending target, ask where this ships, how it is deployed, and
342
+ what the live URL is. Offer only the bounded choices permitted by the readiness
343
+ catalog:
344
+
345
+ - **Configure now** — collect a non-empty host/platform, deploy command or
346
+ trigger, and live URL. Preview the exact local `## Prod` replacement for
347
+ every applicable existing Claude/Codex instruction surface and obtain
348
+ approval before writing it. Any external mutation retains its own separate
349
+ preview and approval; approving the local block never approves repository,
350
+ hosting, DNS, or deployment changes.
351
+ - **Configure later** — run
352
+ `node scripts/readiness.mjs decision set prodTarget pending`; create or alter
353
+ no `## Prod` block, and report exactly:
354
+ `wrapup.deployReport omitted (prodTarget pending)`.
355
+ - **Not applicable** — offer only when the manifest catalog entry has
356
+ `allowNotApplicable: true`; record it with `readiness.mjs decision set` and
357
+ deactivate the dependent block (or the whole skill when the declaration
358
+ requires the capability). `prodTarget` does not permit this choice, so never
359
+ offer it for Prod.
360
+
361
+ Ready and terminal `not-applicable` choices are not re-asked. A pending choice
362
+ remains deliberately retryable so a later `setup-workflow` run can take the
363
+ Configure-now path. Never invent a deploy target.
335
364
 
336
365
  ### 8b. Section H — Size-Profil (optional LoC-offender gate, non-interactive)
337
366
 
@@ -391,6 +420,14 @@ For the **`## Workflow`**, **`## Agent skills`**, and **`## Prod`** blocks, reco
391
420
  - If **neither** exists → ask the user which surface(s) to create (**default `CLAUDE.md`**), then write there.
392
421
  - If a `## Workflow` block already exists → skip it; this block is often repo-specific.
393
422
  - If an `## Agent skills` / `## Prod` block already exists → update its contents in-place; never duplicate or clobber surrounding user content.
423
+ - For Configure now, apply the approved `## Prod` preview to every applicable
424
+ existing surface as one coherent local change. Preserve each file's
425
+ `## Workflow` and `## Agent skills` blocks byte-for-byte, including spacing,
426
+ and leave all unrelated setup blocks untouched. Re-read every written Prod
427
+ body and run `node scripts/readiness.mjs check --skill wrapup --json`; all
428
+ surfaces must agree and `activeBlocks` must be exactly `["deployReport"]`.
429
+ Only then clear a prior `prodTarget` decision. A partial write is not ready:
430
+ restore the previewed surface set before reporting the section complete.
394
431
 
395
432
  `## Workflow` block:
396
433
 
@@ -411,7 +448,7 @@ Use [workflow-overview.md](./workflow-overview.md) verbatim as the generic seed.
411
448
  [one-line summary — single- or multi-context]. See `docs/agents/domain.md`.
412
449
  ```
413
450
 
414
- `## Prod` block (only if Section F produced a deploy target):
451
+ `## Prod` block (only if Section G's Configure-now path produced a deploy target):
415
452
 
416
453
  ```markdown
417
454
  ## Prod
@@ -11,15 +11,24 @@ A portable, structural self-review pass over a freshly written spec/plan. The **
11
11
 
12
12
  - After a spec was written/edited (a `SPEC.md` / `PLAN.md`, or a spec/design doc), BEFORE the user-review gate.
13
13
 
14
- ## Step 0Project-layer probe
14
+ ## Readiness preflightfirst
15
15
 
16
- First, check whether a project layer exists: from the project root, look for `docs/agents/skills/spec-self-critique.md`.
16
+ <!-- readiness:optional-preflight:start -->
17
+ Before any other step, run this once from the project root:
17
18
 
18
- - **Present** → **full pass**: run the 12 generic checks AND apply the per-point enrichment that file defines (incidents, grep patterns, extra sub-checks).
19
- - **Absent** **base pass**: run the 12 generic checks only, then add this one-line warning to the summary:
20
- > ⚠ No project layer found (`docs/agents/skills/spec-self-critique.md`) — only the generic base checks ran. `/setup-workflow` creates the layer; it fills in project-specific content via `/retro`.
19
+ ```bash
20
+ node scripts/readiness.mjs check --skill spec-self-critique --json
21
+ ```
22
+
23
+ - `ready`: continue without a readiness message. Ready is silent.
24
+ - `degraded`: keep the generic 12-point critique active, omit only the inactive block `projectEnrichment`, and emit exactly one concise summary: `Readiness degraded — inactive block projectEnrichment (specCritiqueLayer: <state>). Run /setup-workflow, configure docs/agents/skills/spec-self-critique.md, then rerun this skill.`
25
+ - `blocked`: stop before continuing and report the non-ready required capability plus the exact `/setup-workflow` recovery path.
26
+ - Invalid is always visible: include the `invalid` capability state in the single summary and never treat it as an opt-out. Do not emit separate warnings later in the workflow.
27
+ <!-- readiness:optional-preflight:end -->
21
28
 
22
- > **Routing keep this skeleton clean.** Project-specific checks, incidents, and grep patterns belong in the project layer (`docs/agents/skills/spec-self-critique.md`), **NOT here**. `/retro` appends new project-specific lore to the project layer, never into this generic skeleton.
29
+ <!-- readiness:block projectEnrichment -->
30
+ When `projectEnrichment` is active, read `docs/agents/skills/spec-self-critique.md` and apply its per-point enrichment, including project-specific incidents, grep patterns, conventions, and extra sub-checks. Project-specific checks belong in that layer, **not here**; `/retro` appends new project-specific lore there rather than into this generic skeleton.
31
+ <!-- readiness:end -->
23
32
 
24
33
  ## Altitude — a portable kit concept
25
34
 
@@ -63,7 +72,7 @@ Self-Critique complete — <N> corrections:
63
72
  - ...
64
73
  ```
65
74
 
66
- or, if none were needed: `Self-Critique complete — no corrections needed.` (append the Step-0 layer-absent warning if it applied). THEN ask the user-review question.
75
+ or, if none were needed: `Self-Critique complete — no corrections needed.` THEN ask the user-review question.
67
76
 
68
77
  ## The 12-point checklist
69
78
 
@@ -9,7 +9,19 @@ description: Break a plan, spec, or PRD into independently-grabbable issues on t
9
9
 
10
10
  Break a plan into independently-grabbable issues using vertical slices (tracer bullets).
11
11
 
12
- The issue tracker and triage label vocabulary should have been provided to you — run `/setup-workflow` if not.
12
+ <!-- readiness:required-preflight:start -->
13
+ ## 0. Required readiness preflight
14
+
15
+ This is the first executable workflow step. From the project root, before any remote write or other `gh`/`board-sync.py` command, run this read-only check:
16
+
17
+ ```bash
18
+ node scripts/readiness.mjs check --skill to-issues --json
19
+ ```
20
+
21
+ - `verdict=ready`: continue with the existing workflow without announcing the check. **Ready is silent.**
22
+ - `verdict=blocked`: `STOP` before any mutation. Report every required capability as `<capability>=<state>` so `issueTracker`, `managedBoard`, and `specCompleteness` failures — including distinct `missing`, `pending`, and `invalid` states — stay visible, then give exactly one recovery path: **Run `/setup-workflow`, then rerun `/to-issues`.** Do not fall back to bare tracker or board commands.
23
+ - `managedBoard=not-applicable`: `STOP` and report that `/to-issues` is **inapplicable** for a project that deliberately has no managed board. This is a terminal project decision, not invalid evidence and not a partially active mode.
24
+ <!-- readiness:required-preflight:end -->
13
25
 
14
26
  ## Process
15
27