@williambeto/ai-workflow 1.18.6 → 1.18.8

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.
@@ -46,6 +46,19 @@ When acting as backend implementer, Codex must:
46
46
  10. update or add tests when behavior changes;
47
47
  11. document assumptions, limitations, and untested areas.
48
48
 
49
+ ## Branch safety gate (mandatory before edits)
50
+
51
+ Before changing files, enforce branch safety:
52
+
53
+ 1. run `git status -sb`;
54
+ 2. if current branch is `main`, create/switch to a scoped branch before writing:
55
+
56
+ ```bash
57
+ git switch -c feat/<short-task-slug>
58
+ ```
59
+
60
+ Never implement directly on `main`.
61
+
49
62
  ## Backend implementation principles
50
63
 
51
64
  ### 1. Existing patterns first
@@ -47,6 +47,19 @@ When acting as deploy engineer, Codex must:
47
47
  10. avoid unsafe deployment recommendations without evidence;
48
48
  11. provide a clear release recommendation.
49
49
 
50
+ ## Branch safety gate (mandatory before edits)
51
+
52
+ This role is often review-only. If deployment/release work requires file edits (workflow, runbook, or config changes):
53
+
54
+ 1. run `git status -sb`;
55
+ 2. if current branch is `main`, create/switch to a scoped branch before writing:
56
+
57
+ ```bash
58
+ git switch -c chore/<short-task-slug>
59
+ ```
60
+
61
+ Do not apply release-related edits directly on `main`.
62
+
50
63
  ## Deployment principles
51
64
 
52
65
  ### 1. Build before deploy
@@ -48,6 +48,19 @@ When acting as docs writer, Codex must:
48
48
  10. check code fences, headings, tables, and lists;
49
49
  11. state assumptions and gaps clearly.
50
50
 
51
+ ## Branch safety gate (mandatory for non-trivial docs edits)
52
+
53
+ For non-trivial documentation updates (new sections, policy changes, runbook/process updates):
54
+
55
+ 1. run `git status -sb`;
56
+ 2. if current branch is `main`, create/switch to a scoped branch before writing:
57
+
58
+ ```bash
59
+ git switch -c docs/<short-task-slug>
60
+ ```
61
+
62
+ Do not edit non-trivial documentation directly on `main`.
63
+
51
64
  ## Documentation principles
52
65
 
53
66
  ### 1. Audience first
@@ -46,6 +46,19 @@ When acting as frontend implementer, Codex must:
46
46
  10. validate the change with relevant checks;
47
47
  11. document assumptions, limitations, and untested areas.
48
48
 
49
+ ## Branch safety gate (mandatory before edits)
50
+
51
+ Before changing files, enforce branch safety:
52
+
53
+ 1. run `git status -sb`;
54
+ 2. if current branch is `main`, create/switch to a scoped branch before writing:
55
+
56
+ ```bash
57
+ git switch -c feat/<short-task-slug>
58
+ ```
59
+
60
+ Never implement directly on `main`.
61
+
49
62
  ## Frontend implementation principles
50
63
 
51
64
  ### 1. Existing patterns first
@@ -45,6 +45,19 @@ When acting as tester, Codex must:
45
45
  10. separate confirmed issues from hypotheses;
46
46
  11. provide a clear approval or rejection recommendation.
47
47
 
48
+ ## Branch safety gate (mandatory if fixes are applied)
49
+
50
+ Tester is primarily review/validation. If a validation task includes direct fixes:
51
+
52
+ 1. run `git status -sb`;
53
+ 2. if current branch is `main`, create/switch to a scoped branch before writing:
54
+
55
+ ```bash
56
+ git switch -c fix/<short-task-slug>
57
+ ```
58
+
59
+ Do not apply fixes directly on `main`.
60
+
48
61
  ## Validation mindset
49
62
 
50
63
  Act as a skeptical reviewer.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.18.8] - 2026-05-20
11
+
12
+ ### Added
13
+
14
+ - **Discovery gate enforcement**: `opencode/agents/discovery.md` now explicitly blocks execution/delegation requests and routes them to `orchestrator`.
15
+ - **Discovery routing guard docs**: added explicit guard behavior to `opencode/agents/README.md` and `runbooks/agent-delegation-workflow.md` to keep gate behavior consistent across agent docs and runbooks.
16
+ - **Roadmap simplification phases**: added Phase 17/18/19 plan in `ROADMAP.md` for OpenCode-first focus, artifact surface reduction, and consumer-validation/Napkin hardening.
17
+
18
+ ### Changed
19
+
20
+ - **Roadmap priority update**: `ROADMAP.md` next sprint, next step, and next recommended PR now point to Phase 17 platform focus as immediate priority.
21
+
10
22
  ## [1.18.6] - 2026-05-20
11
23
 
12
24
  ### Added
package/README.md CHANGED
@@ -7,8 +7,6 @@ Most AI coding workflows fail because they start with code.
7
7
 
8
8
  **AI Workflow Kit** is a software delivery workflow for Codex and OpenCode: requirements first, small PRs, specialist agents, validation evidence, and no-regression rules.
9
9
 
10
- > Historical note: this project originated as `codex-repo-starter` and now continues as AI Workflow Kit. The npm CLI package is `@williambeto/ai-workflow`.
11
-
12
10
  ## Why this exists
13
11
 
14
12
  AI coding tools are powerful, but without workflow discipline they often create oversized changes, vague requirements, hidden assumptions, unreviewable diffs, skipped validation, architecture drift, and cleanup work disguised as speed.
@@ -6,8 +6,6 @@ This document is the detailed reference for **AI Workflow Kit**.
6
6
 
7
7
  Use the root `README.md` as the landing page. Use this document when you need the full repository map, workflow explanation, role model, validation model, and adoption guidance.
8
8
 
9
- Historical note: this project started as `codex-repo-starter` and now continues as `ai-workflow`.
10
-
11
9
  ## What AI Workflow Kit is
12
10
 
13
11
  AI Workflow Kit is a documentation-first workflow system for AI-assisted software delivery.
@@ -68,7 +68,7 @@ The `init` command installs workflow assets into `.ai-workflow/` and creates sym
68
68
  - Run `npx @williambeto/ai-workflow init --force` to regenerate managed files when the package is updated.
69
69
  - Backup copies of replaced files are stored in `.ai-workflow-backups/`.
70
70
 
71
- There is no `.workflow/` directory. Workflow assets are managed under `.ai-workflow/` with symlinks in project-root paths for tool compatibility.
71
+ There is no `.workflow/` directory in this onboarding path. Legacy `.workflow` submodule guidance is deprecated for npm consumers. Workflow assets are managed under `.ai-workflow/` with symlinks in project-root paths for tool compatibility.
72
72
 
73
73
  ## OpenCode quickstart
74
74
 
@@ -56,6 +56,11 @@ Orchestrated delivery (automatic routing gates):
56
56
  orchestrator (gate A/B/C/D) -> next agent by pass/block result
57
57
  ```
58
58
 
59
+ Discovery routing guard:
60
+
61
+ - `discovery` is clarification-only.
62
+ - If execution, file edits, validation execution, release actions, or specialist delegation is requested during discovery, the correct behavior is `Blocked` + handoff to `orchestrator`.
63
+
59
64
  Delegation policy baseline:
60
65
 
61
66
  - route ownership by dominant task type using `AGENTS.md` delegation matrix;
@@ -88,7 +93,7 @@ Do not use Napkin as a temporary task log, and never store secrets.
88
93
 
89
94
  | Agent | Purpose | Use when | Should not do |
90
95
  | ----- | ------- | -------- | ------------- |
91
- | `discovery` | Turn vague requests into a discovery brief. | Scope, risks, dependencies, and unknowns are unclear. | Estimate price, implement, or create a detailed technical plan. |
96
+ | `discovery` | Turn vague requests into a discovery brief. | Scope, risks, dependencies, and unknowns are unclear. | Estimate price, implement, edit files, perform execution/delegation routing directly (must return `Blocked` and route to `orchestrator`). |
92
97
  | `planner` | Turn approved scope into requirements, specs, technical plans, and PR breakdowns. | Scope is approved and implementation needs a handoff. | Implement. |
93
98
  | `implementer` | Implement one selected PR. | A PR plan or handoff exists. | Expand scope or do opportunistic refactors. |
94
99
  | `fixer` | Diagnose and fix bugs, regressions, failures, and warnings. | There is broken behavior or failed validation. | Rewrite large areas without evidence. |
@@ -25,14 +25,23 @@ Turn vague client or user requests, screenshots, notes, and rough ideas into a c
25
25
  - Surface risks, dependencies, and blocked decisions.
26
26
  - Ask up to 5 discovery questions.
27
27
  - Recommend the next workflow step.
28
+ - If the request includes implementation, file edits, execution flow, or specialist delegation, return `Blocked` and hand off to `orchestrator`.
28
29
 
29
30
  ## Constraints
30
31
 
31
32
  - Do not estimate price directly.
32
33
  - Do not implement.
34
+ - Do not edit files or perform write operations.
33
35
  - Do not create a detailed technical plan before scope is clear.
34
36
  - Do not ask more than 5 questions.
35
37
 
38
+ ## Gate behavior (defensive)
39
+
40
+ - Discovery is a clarification step, not an execution owner.
41
+ - If a request requires implementation, review, validation, release actions, or multi-agent routing, output `Blocked` and route to `orchestrator`.
42
+ - Branch gate ownership is `orchestrator` (and step owners). Discovery must not bypass it.
43
+ - If Discovery is ever asked to perform a write operation, stop and return `Blocked` with this minimum safe instruction: run `git status -sb`; if branch is `main`, create/switch to a scoped branch before any edits.
44
+
36
45
  ## Expected output
37
46
 
38
47
  - Objective
@@ -43,6 +52,8 @@ Turn vague client or user requests, screenshots, notes, and rough ideas into a c
43
52
  - Dependencies
44
53
  - Up to 5 discovery questions
45
54
  - Recommended next step
55
+ - Gate result (`Pass` for discovery-only scope, `Blocked` when execution/delegation is requested)
56
+ - Next agent (`orchestrator`) when blocked
46
57
 
47
58
  ## Stop conditions
48
59
 
@@ -29,6 +29,7 @@ Diagnose and fix bugs, regressions, failing tests, build failures, warnings, and
29
29
 
30
30
  ## Constraints
31
31
 
32
+ - Enforce branch gate before any write: run `git status -sb`; if branch is `main`, create/switch to `git switch -c fix/<short-task-slug>` before editing.
32
33
  - Do not rewrite large areas without evidence.
33
34
  - Do not mix unrelated refactors into the fix.
34
35
  - Do not change behavior without stating it.
@@ -34,6 +34,7 @@ Route work automatically across agents and run end-to-end workflow orchestration
34
34
  - Enforce design-pattern justification before allowing formal pattern abstractions.
35
35
  - Evaluate gate criteria for the next transition.
36
36
  - Route to next agent only when gate is `Pass`.
37
+ - Enforce delegation-by-step: for planner/implementer/reviewer/validator/release-manager steps, delegate to the step owner instead of executing specialist work inline.
37
38
  - Return blocked transitions with smallest safe fix request.
38
39
  - Ask user confirmation only at required checkpoints.
39
40
  - Preserve branch gate and no-regression constraints.
@@ -90,11 +91,17 @@ Every specialist response must include:
90
91
  ## Anti-overdelegation rules
91
92
 
92
93
  - Do not delegate trivial one-file documentation edits.
93
- - Do not delegate when the active primary agent can safely complete the task using existing instructions.
94
+ - Do not delegate when the active primary agent can safely complete the task using existing instructions **only for non-specialist trivial work** (for example: one-file wording or formatting updates).
94
95
  - Do not delegate to more than 2 agents unless the task is explicitly cross-functional.
95
96
  - Prefer one owner + one reviewer instead of broad parallel delegation.
96
97
  - Always delegate validation/review for high-risk implementation.
97
98
 
99
+ ## Delegation enforcement
100
+
101
+ - For any active step owner in `planner -> implementer -> reviewer -> validator -> release-manager`, orchestration must delegate to that owner.
102
+ - If orchestration cannot delegate due to missing input packet, missing context, or unresolved gate criteria, return `Blocked` and request the smallest safe missing input.
103
+ - Do not bypass required owner delegation by completing specialist work in orchestrator responses.
104
+
98
105
  ## Escalation rules
99
106
 
100
107
  - If implementation changes architecture, consult `tech-lead`.
@@ -39,6 +39,7 @@ Transform approved scope into a requirement, functional specification, technical
39
39
  ## Constraints
40
40
 
41
41
  - Do not implement.
42
+ - If non-trivial documentation edits are requested, enforce branch gate first: run `git status -sb`; if branch is `main`, create/switch to `git switch -c <type>/<short-task-slug>` before writing.
42
43
  - Do not plan multiple unrelated features together.
43
44
  - Do not skip validation planning.
44
45
  - Do not ignore `AGENTS.md`.
@@ -30,6 +30,7 @@ Close the Git and PR cycle safely.
30
30
  ## Constraints
31
31
 
32
32
  - Do not merge with a dirty worktree.
33
+ - If requested to apply fixes before release, enforce branch gate first: run `git status -sb`; if branch is `main`, create/switch to `git switch -c chore/<short-task-slug>` before editing.
33
34
  - Do not skip validation.
34
35
  - Do not invent commit messages unrelated to the diff.
35
36
  - Do not delete branches or merge unless explicitly requested.
@@ -20,10 +20,12 @@ This command does not implement code by itself; it routes work to the correct ne
20
20
  4. If gate is `Blocked`, stop escalation and return smallest safe fix request to previous owner.
21
21
  5. Enforce branch gate for any execution step (no implementation on `main`).
22
22
  6. Preserve one primary agent per step.
23
- 7. Do not skip validation gate before release recommendations.
24
- 8. Apply anti-overdelegation: do not delegate trivial one-file doc edits; do not route to more than 2 agents unless cross-functional.
25
- 9. Use delegation contract fields in every handoff: task summary, relevant files, constraints, expected output, validation required, risk level, do-not-change list, evidence required.
26
- 10. Require specialist responses to include summary/findings, files changed or inspected, risks, validation commands, open questions, and recommendation.
23
+ 7. Enforce delegation-by-step: do not execute planner/implementer/reviewer/validator/release-manager specialist work inline; route to the step owner.
24
+ 8. If required owner delegation cannot be performed (missing packet/context/gate input), return `Blocked` with the smallest safe missing-input request.
25
+ 9. Do not skip validation gate before release recommendations.
26
+ 10. Apply anti-overdelegation: do not delegate trivial one-file doc edits; do not route to more than 2 agents unless cross-functional.
27
+ 11. Use delegation contract fields in every handoff: task summary, relevant files, constraints, expected output, validation required, risk level, do-not-change list, evidence required.
28
+ 12. Require specialist responses to include summary/findings, files changed or inspected, risks, validation commands, open questions, and recommendation.
27
29
 
28
30
  ## Expected Output
29
31
 
package/opencode.jsonc CHANGED
@@ -195,7 +195,7 @@
195
195
  },
196
196
  "deploy": {
197
197
  "description": "Prepare deployment readiness and rollback plan",
198
- "agent": "release-manager",
198
+ "agent": "deploy-engineer",
199
199
  "template": "{file:./opencode/commands/deploy.md}"
200
200
  }
201
201
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.18.6",
2
+ "version": "1.18.8",
3
3
  "name": "@williambeto/ai-workflow",
4
4
  "description": "AI Workflow Kit repository for designing and validating AI-assisted software delivery workflows with Codex and OpenCode",
5
5
  "license": "MIT",
@@ -64,7 +64,8 @@
64
64
  "validate:delegation": "node scripts/validate-delegation.mjs",
65
65
  "validate:cli-smoke": "node scripts/validate-cli-smoke.mjs",
66
66
  "test:e2e": "node tests/validate-e2e.mjs",
67
- "validate": "node scripts/validate-all.mjs"
67
+ "validate": "node scripts/validate-all.mjs",
68
+ "release:ship": "node scripts/release-ship.mjs"
68
69
  },
69
70
  "devDependencies": {
70
71
  "@semantic-release/changelog": "^6.0.3",
@@ -14,6 +14,12 @@ Delegate when at least one is true:
14
14
 
15
15
  Do not delegate for trivial one-file edits that the active primary agent can complete safely.
16
16
 
17
+ ## Discovery guard (mandatory)
18
+
19
+ - `discovery` is clarification-only and is not an execution owner.
20
+ - If a request during discovery requires implementation, file edits, validation execution, release actions, or specialist delegation, return `Blocked` and hand off to `orchestrator`.
21
+ - Branch gate ownership remains with `orchestrator` and step owners (`planner`, `implementer`, `fixer`, `reviewer`, `validator`, `release-manager`) before write operations.
22
+
17
23
  ## Delegation matrix
18
24
 
19
25
  | Task type | Primary owner |
@@ -23,9 +23,30 @@ Use this runbook to publish `@williambeto/ai-workflow` to npm with explicit safe
23
23
  - [ ] `package.json` version is intentional.
24
24
  - [ ] `CHANGELOG.md` reflects the release.
25
25
  - [ ] `npm run validate` passes.
26
+ - [ ] `npm pack --dry-run` reviewed (file list, size, no surprises).
27
+ - [ ] No sensitive or non-essential files appear in tarball output.
28
+ - [ ] `package.json` `files` allowlist still matches intended distributable assets.
29
+ - [ ] `.npmignore` hardening file is present and reviewed for drift.
26
30
  - [ ] Dry-run workflow succeeded (`dry_run=true`).
27
31
  - [ ] Release decision/approval is explicit.
28
32
 
33
+ ## Continuous hardening baseline (every release)
34
+
35
+ Run this baseline before any real publish:
36
+
37
+ ```bash
38
+ npm run validate
39
+ npm pack --dry-run
40
+ ```
41
+
42
+ Then verify explicitly:
43
+
44
+ 1. Tarball contains only expected runtime/docs assets.
45
+ 2. No local, test, evidence, or backup outputs leaked.
46
+ 3. Publish path remains allowlist-first (`package.json` `files`) with `.npmignore` as defense-in-depth.
47
+
48
+ If any unexpected file appears, stop and return `Blocked` until the package boundary is corrected.
49
+
29
50
  ## Publish steps
30
51
 
31
52
  1. Open GitHub Actions.
@@ -40,6 +61,7 @@ Use this runbook to publish `@williambeto/ai-workflow` to npm with explicit safe
40
61
  - Workflow run URL.
41
62
  - `npm run validate` result from workflow logs.
42
63
  - `npm pack --dry-run` output.
64
+ - Tarball boundary decision note (why contents are safe for public publish).
43
65
  - Published version and npm package URL.
44
66
  - Any warnings and mitigation notes.
45
67