@ikon85/agent-workflow-kit 0.29.1 → 0.31.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 (52) hide show
  1. package/.agents/skills/board-to-waves/SKILL.md +14 -0
  2. package/.agents/skills/code-review/SKILL.md +22 -3
  3. package/.agents/skills/codex-adapter-sync/SKILL.md +134 -72
  4. package/.agents/skills/kit-update/SKILL.md +21 -1
  5. package/.agents/skills/local-ci/SKILL.md +16 -0
  6. package/.agents/skills/project-release/SKILL.md +18 -0
  7. package/.agents/skills/security-audit/SKILL.md +18 -0
  8. package/.agents/skills/setup-workflow/SKILL.md +39 -2
  9. package/.agents/skills/spec-self-critique/SKILL.md +16 -7
  10. package/.agents/skills/to-issues/SKILL.md +13 -1
  11. package/.agents/skills/to-prd/SKILL.md +14 -0
  12. package/.agents/skills/to-waves/SKILL.md +16 -2
  13. package/.agents/skills/triage/SKILL.md +24 -0
  14. package/.agents/skills/verify-spike/SKILL.md +20 -1
  15. package/.agents/skills/wrapup/SKILL.md +26 -4
  16. package/.claude/skills/board-to-waves/SKILL.md +14 -0
  17. package/.claude/skills/code-review/SKILL.md +22 -3
  18. package/.claude/skills/kit-update/SKILL.md +21 -1
  19. package/.claude/skills/local-ci/SKILL.md +16 -0
  20. package/.claude/skills/project-release/SKILL.md +18 -0
  21. package/.claude/skills/security-audit/SKILL.md +18 -0
  22. package/.claude/skills/setup-workflow/SKILL.md +39 -2
  23. package/.claude/skills/skill-manifest.json +46 -0
  24. package/.claude/skills/spec-self-critique/SKILL.md +16 -7
  25. package/.claude/skills/to-issues/SKILL.md +13 -1
  26. package/.claude/skills/to-prd/SKILL.md +14 -0
  27. package/.claude/skills/to-waves/SKILL.md +16 -2
  28. package/.claude/skills/triage/SKILL.md +24 -0
  29. package/.claude/skills/verify-spike/SKILL.md +20 -1
  30. package/.claude/skills/wrapup/SKILL.md +26 -4
  31. package/README.md +41 -0
  32. package/agent-workflow-kit.package.json +71 -31
  33. package/package.json +1 -1
  34. package/scripts/kit-update-pr.mjs +14 -1
  35. package/scripts/kit-update-pr.test.mjs +21 -0
  36. package/scripts/readiness.mjs +215 -0
  37. package/scripts/test_codex_adapter_sync_contract.py +154 -0
  38. package/scripts/test_retro_wrapup_contract.py +17 -0
  39. package/scripts/test_skill_optional_readiness.py +171 -0
  40. package/scripts/test_skill_portability_lint.py +57 -18
  41. package/scripts/test_skill_readiness_contract.py +139 -0
  42. package/scripts/test_skill_readiness_preflight.py +180 -0
  43. package/scripts/test_skill_required_readiness.py +233 -0
  44. package/scripts/test_skill_setup_workflow_seeds.py +22 -0
  45. package/src/cli.mjs +10 -2
  46. package/src/commands/init.mjs +3 -1
  47. package/src/commands/uninstall.mjs +5 -1
  48. package/src/commands/update.mjs +65 -8
  49. package/src/lib/bundle.mjs +7 -0
  50. package/src/lib/manifest.mjs +26 -2
  51. package/src/lib/updateCandidate.mjs +116 -2
  52. package/src/lib/updateReconcile.mjs +3 -1
@@ -8,6 +8,20 @@ disable-model-invocation: false
8
8
 
9
9
  **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.
10
10
 
11
+ <!-- readiness:required-preflight:start -->
12
+ ## 0. Required readiness preflight
13
+
14
+ 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:
15
+
16
+ ```bash
17
+ node scripts/readiness.mjs check --skill board-to-waves --json
18
+ ```
19
+
20
+ - `verdict=ready`: continue with the existing workflow without announcing the check. **Ready is silent.**
21
+ - `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.
22
+ - `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.
23
+ <!-- readiness:required-preflight:end -->
24
+
11
25
  ## Pipeline Position
12
26
 
13
27
  ```
@@ -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.
@@ -9,50 +9,128 @@ Use this skill when the user asks for a Codex adapter sync, Codex drift check,
9
9
  Claude-to-Codex migration check, or when changes to Claude-facing project
10
10
  knowledge may need to be reflected in Codex-facing files.
11
11
 
12
+ ## Audit mode (default)
13
+
14
+ Audit is a read-only diagnosis from the current checkout. Inventory and compare
15
+ the source and adapter surfaces, then report the exact proposed changes. Do not
16
+ create or switch branches or worktrees, edit files, or change external state.
17
+
18
+ ## Apply mode
19
+
20
+ Apply only when the user asked to update or fix the adapter. Create or reuse the
21
+ correct issue or slice worktree before the first edit. Never apply adapter
22
+ changes on `main`; move any accidental main-checkout diff into the worktree and
23
+ leave the main checkout clean.
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
42
+ in the main thread.
43
+
12
44
  ## Scope
13
45
 
14
46
  Source side:
15
- - `CLAUDE.md`
16
- - `frontend/CLAUDE.md`
17
- - `backend/CLAUDE.md`
47
+ - every repository instruction file matched by `**/CLAUDE.md`
18
48
  - `~/.claude/CLAUDE.md` when the user explicitly mentions global Claude
19
49
  instruction drift or global Claude changes
20
50
  - `.claude/skills/`
21
51
  - `.claude/agents/`
52
+ - Claude hook declarations and implementations
22
53
  - `.gitignore`
23
54
 
24
55
  Codex adapter side:
25
- - `AGENTS.md`
56
+ - every repository instruction file matched by `**/AGENTS.md` or
57
+ `**/AGENTS.override.md`
26
58
  - `.agents/skills/`
27
- - `.codex/config.toml`
59
+ - every trusted project config layer matched by `**/.codex/config.toml`
28
60
  - `.codex/agents/`
61
+ - Codex hook declarations
29
62
  - `.gitignore`
30
63
 
64
+ ## Inventory
65
+
66
+ Derive a fresh, counted inventory from the repository root; do not assume only
67
+ known package names or root-level files. Include:
68
+
69
+ - arbitrary nested `**/CLAUDE.md`, `**/AGENTS.md`, and
70
+ `**/AGENTS.override.md` instruction layers;
71
+ - every `**/.codex/config.toml`, noting that Codex loads project config and
72
+ hooks only from trusted project layers;
73
+ - `.claude/skills/**`, `.agents/skills/**`, `.claude/agents/**`, and
74
+ `.codex/agents/**`;
75
+ - Claude hook definitions in `.claude/settings*.json` and implementations in
76
+ `.claude/hooks/**` as adaptation candidates;
77
+ - Codex targets in `.codex/hooks.json` and inline `[hooks]` tables in each
78
+ active config layer; and
79
+ - ignore rules and every skill reference, asset, script, template, and other
80
+ distributed support file, regardless of extension.
81
+
82
+ For every relevant Claude hook behavior, record one explicit classification:
83
+ **Codex-adapted** with its target, or **intentionally Claude-only** with the
84
+ reason. Never port hooks blindly.
85
+
86
+ ## Custom-agent validation
87
+
88
+ Codex custom-agent files are standalone TOML config layers. Parse every
89
+ `.codex/agents/*.toml` file and require non-empty string values for the required
90
+ `name`, `description`, and `developer_instructions` fields. Validate supported
91
+ optional `model` and `model_reasoning_effort` fields as strings when present,
92
+ then let strict Codex config validation reject unsupported keys or values.
93
+ Reject a file that is malformed, misses a required field, or uses the legacy
94
+ schema. A README or no-op note is not a custom-agent TOML file.
95
+
96
+ ## Validation
97
+
98
+ Run validation from the repository root and keep the evidence in the report:
99
+
100
+ 1. Run `codex --strict-config --version` from the root and from a representative
101
+ nested directory for every discovered project config layer. Any unknown
102
+ active key is a failure, not a warning to ignore.
103
+ 2. Validate skill metadata and loading with the repository's strict
104
+ skill-frontmatter guard when one is available, then start a fresh Codex
105
+ session and check that every enabled skill is discoverable without load
106
+ warnings.
107
+ 3. Parse and validate every custom-agent TOML file against the
108
+ Custom-agent validation section above; strict config validation must also
109
+ accept its supported optional fields.
110
+ 4. Use `git check-ignore --no-index` on `.codex/config.toml`, every
111
+ `.codex/agents/*.toml`, `.agents/skills/**`, `.codex/hooks.json`, and any
112
+ adapted hook implementation. A checked-in adapter target being ignored is a
113
+ failure; local state and override files should remain ignored.
114
+ 5. Resolve every path named by skill prose and verify that all references,
115
+ assets, scripts, templates, and other distributed support files exist. Run
116
+ the repository's all-file mirror-parity guard when available so non-Markdown
117
+ presence parity and Markdown body/`mirror-xform` parity are both checked.
118
+ 6. Recompute the dual-surface skill denominator from the manifest, compare all
119
+ distributed files in both trees, and report the fresh result as **X of Y**
120
+ mirrored skills. Do not reuse a remembered count.
121
+ 7. Enforce this repository's 1024-character description cap as a named
122
+ repository safeguard. It is not a Codex product limit; the local guard owns
123
+ the policy and must fail when a description exceeds it.
124
+
31
125
  ## Workflow
32
126
 
33
- 1. Establish a worktree before making adapter changes pick the mode by how
34
- the sync was triggered:
35
- - **In-current-worktree (default for a per-slice gate).** If you are already
36
- in a non-main slice/feature worktree e.g. invoked as the mandatory
37
- `codex-adapter-sync` gate at the end of a skill-touching slice — sync the
38
- adapter **here**, in that same worktree. Commit the adapter changes
39
- alongside the slice and ship them in the slice's own PR. Do **not** spin up
40
- a separate adapter branch or PR: a per-slice gate that demanded its own
41
- worktree/PR would collide with the slice it is gating.
42
- - **Dedicated adapter worktree.** Only when invoked standalone from the main
43
- checkout (no active slice worktree): create or reuse a dedicated adapter
44
- worktree before inventory or edits — your project's worktree helper (or
45
- `git worktree add`) on an issue-anchored branch when an anchor exists, or a
46
- `chore/codex-adapter-sync-<slug>` worktree for a deliberate no-issue chore
47
- — and ship it through its own PR.
48
- - Either way: never land adapter changes directly on `main`. Move any
49
- accidental main-checkout adapter diff into the chosen worktree first, then
50
- leave the main checkout clean.
51
- 2. Inventory the source side and adapter side from inside that worktree. If
52
- global Claude instructions are in scope, read them from the main thread but
53
- keep personal overrides, secrets, and machine-local state out of the repo
54
- diff.
55
- 3. Compare project knowledge:
127
+ 1. Select the mode from the user's request. Audit in the current checkout. For
128
+ Apply, reuse the active non-main slice worktree when the sync gates that
129
+ slice; otherwise create or reuse a dedicated issue-anchored adapter worktree.
130
+ 2. Build the Inventory before proposing or making changes. If global Claude
131
+ instructions are in scope, inspect them without exposing personal overrides,
132
+ secrets, credentials, or machine-local state.
133
+ 3. Compare project knowledge and instruction precedence:
56
134
  - New or changed durable conventions in `CLAUDE.md` should be reflected in
57
135
  `AGENTS.md` only as concise adapter guidance or references.
58
136
  - Do not duplicate long `CLAUDE.md` sections into `AGENTS.md`.
@@ -62,26 +140,16 @@ Codex adapter side:
62
140
  Codex-facing adapter rule in `AGENTS.md` or a minimal safe Codex config
63
141
  change; do not copy personal style, identities, credentials, or long
64
142
  global sections.
65
- 4. Compare skills:
143
+ 4. Compare every skill and distributed support file:
66
144
  - Important repo/domain/workflow skills from `.claude/skills/` belong in
67
145
  `.agents/skills/`.
68
146
  - Keep each `SKILL.md` and its support files together.
69
147
  - Do not copy skills into `.codex/skills/`.
70
148
  - Leave clearly Claude-only setup, hook, or personal/meta skills out unless
71
149
  the user explicitly wants them ported.
72
- - Translate Claude-specific model delegation instead of copying it
73
- literally (tier mapping per your routing doctrine; if the repo carries a
74
- Codex mirror table in `AGENTS.md`, keep it in sync). In particular, Claude `Agent` dispatches with
75
- `model: sonnet` should become Codex `spawn_agent` dispatches with the
76
- appropriate `agent_type`; for mechanical coding/git work use a `worker`
77
- subagent with `model: gpt-5.4-mini` and `reasoning_effort: low` unless the
78
- source skill gives a stronger task-specific reason. Claude `opus` /
79
- judgment-tier dispatches (subtle logic, review/verify verdicts) map to
80
- `model: gpt-5.5` with `reasoning_effort: high` (verdicts never below
81
- high). Translate Claude `effort:` params to the nearest
82
- `reasoning_effort` value (`minimal|low|medium|high|xhigh`; Claude `max`
83
- → `xhigh`). Keep user gates, security judgment, and approval decisions
84
- in the main thread.
150
+ - 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.
85
153
  - Keep dual-surface generic/vendored skill bodies content-synced. When a
86
154
  Codex mirror must intentionally differ from the Claude source, bracket the
87
155
  source region and the Codex replacement with a matching transform marker
@@ -111,36 +179,30 @@ Codex adapter side:
111
179
  `chaseai-yt/grill-me-codex`, `docs/agents/skills/grill-with-docs-codex.md`)
112
180
  is not an escalation target and must NOT be rewritten — rewriting it would
113
181
  break attribution/a real link.
114
- 5. Validate Codex skill frontmatter:
115
- - `name` and `description` are required.
116
- - Quote `description` when it contains colons, arrows, commas, or other
117
- YAML-sensitive punctuation.
118
- - Keep `description` under 1024 characters.
119
- - Keep trigger detail in the body if the original Claude description is too
120
- long.
121
- 6. Compare agents:
122
- - Claude agents are `.md` files under `.claude/agents/`.
123
- - Codex agents are `.toml` files under `.codex/agents/`.
124
- - Convert agent instruction bodies into `developer_instructions`.
125
- - If no Claude agents exist, keep only a short README or no-op note.
126
- 7. Compare config and ignore rules:
127
- - Keep `.codex/config.toml` minimal and safe.
128
- - Never add secrets, provider credentials, auth tokens, or local personal
129
- overrides.
130
- - Ensure `.gitignore` excludes local Codex state and override files while
131
- allowing checked-in project config, agents, and skills.
132
- 8. Before edits, show the exact files that will be created or changed.
133
- 9. After edits, validate:
134
- - `.codex/config.toml` parses as TOML.
135
- - All `.agents/skills/*/SKILL.md` files load without Codex warnings.
136
- - No skill description exceeds 1024 characters.
137
- - `.codex/config.toml`, `.codex/agents/*.toml`, and `.agents/skills/**`
138
- are not accidentally ignored.
139
- 10. Prepare the branch for review:
140
- - Commit the adapter changes on the worktree branch after checking for
141
- secrets and ignored files.
142
- - Push the branch and create or update a PR.
143
- - Report the PR URL, changed files, skipped items, and verification results.
182
+ 5. Compare agents, hooks, config, and ignore rules:
183
+ - Claude agents are `.md`; Codex custom agents are `.toml` and must satisfy
184
+ Custom-agent validation.
185
+ - Classify each Claude hook behavior using the Inventory contract and check
186
+ Codex hook targets at every active trusted config layer.
187
+ - Keep `.codex/config.toml` minimal and safe. Never add secrets, provider
188
+ credentials, auth tokens, or local personal overrides.
189
+ - Ensure ignore rules exclude local Codex state and override files while
190
+ allowing checked-in config, agents, hooks, skills, and support files.
191
+ 6. In Audit mode, run every read-only Validation step that the checkout
192
+ supports and report the proposed file changes without mutating anything.
193
+ 7. In Apply mode, show the exact files to create or change before editing, make
194
+ only those changes, then run the complete Validation section. Prepare the
195
+ existing worktree branch for review: check for secrets and ignored files,
196
+ commit the adapter changes, push, and create or update its PR.
197
+
198
+ Codex skill frontmatter must also satisfy these repository rules:
199
+
200
+ - `name` and `description` are required.
201
+ - Quote `description` when it contains colons, arrows, commas, or other
202
+ YAML-sensitive punctuation.
203
+ - Enforce the Validation section's named description safeguard.
204
+ - Keep trigger detail in the body if the original Claude description is too
205
+ long.
144
206
 
145
207
  ## Output
146
208
 
@@ -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
@@ -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
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
 
@@ -10,6 +10,20 @@ description: "Turn a locked plan (PLAN.md in the worktree, conversation context,
10
10
 
11
11
  Takes an **already-locked plan** and publishes it as a **Draft-PRD issue**. **Never invents requirements** — only synthesizes what's already decided. Pipeline: `board-to-waves → grill(-with-docs) → to-prd → to-issues`. The **grill sits upstream**; to-prd writes the PRD after the grill. **Slicing + promotion to an anchor (cluster/Wave, child link) = `to-issues`** (future), not here.
12
12
 
13
+ <!-- readiness:required-preflight:start -->
14
+ ## 0. Required readiness preflight
15
+
16
+ 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:
17
+
18
+ ```bash
19
+ node scripts/readiness.mjs check --skill to-prd --json
20
+ ```
21
+
22
+ - `verdict=ready`: continue with the existing workflow without announcing the check. **Ready is silent.**
23
+ - `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 `/to-prd`.** Do not fall back to bare tracker or board commands.
24
+ - `managedBoard=not-applicable`: `STOP` and report that `/to-prd` 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.
25
+ <!-- readiness:required-preflight:end -->
26
+
13
27
  Board constants (project node, field/status IDs) + helpers live **consumer-side**: read `docs/agents/board-sync.md` from the project root + use the helper `scripts/board-sync.py` (missing → `/setup-workflow` scaffolds the project layer). Issue body **always** via `--body-file` (inline `--body` with backticks/parens crashes bash).
14
28
 
15
29
  ## 1. Input — source-agnostic
@@ -14,6 +14,20 @@ Takes a **Program-PRD** — the native Sub-Issue anchor over a multi-wave progra
14
14
  The **grill and to-prd sit upstream**; to-waves runs once the Program-PRD exists.
15
15
  It **never invents structure** — it only unfolds what the plan already decided.
16
16
 
17
+ <!-- readiness:required-preflight:start -->
18
+ ## 0. Required readiness preflight
19
+
20
+ 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:
21
+
22
+ ```bash
23
+ node scripts/readiness.mjs check --skill to-waves --json
24
+ ```
25
+
26
+ - `verdict=ready`: continue with the existing workflow without announcing the check. **Ready is silent.**
27
+ - `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-waves`.** Do not fall back to bare tracker or board commands.
28
+ - `managedBoard=not-applicable`: `STOP` and report that `/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.
29
+ <!-- readiness:required-preflight:end -->
30
+
17
31
  Board constants (project node, field/status IDs) + helpers live **consumer-side**:
18
32
  read `docs/agents/board-sync.md` from the project root + use the helper
19
33
  `scripts/board-sync.py` (missing → `/setup-workflow` scaffolds the project layer).
@@ -36,8 +50,8 @@ target, an anchor is already a single wave.
36
50
 
37
51
  ## 2. Parse + validate — the graph preflight
38
52
 
39
- Run the graph preflight first it is **read-only** (a single board read, zero
40
- mutations):
53
+ After the required readiness preflight, run the graph preflight before preview or
54
+ publication — it is **read-only** (a single board read, zero mutations):
41
55
 
42
56
  ```bash
43
57
  python3 scripts/board-sync.py validate-graph --issue <prd#>