@jakkrichm/create-nexus-devflow 2.12.2 → 2.12.3

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 (50) hide show
  1. package/dist/lib/current-work.d.ts +6 -1
  2. package/dist/lib/current-work.js +41 -4
  3. package/dist/lib/current-work.js.map +1 -1
  4. package/dist/lib/history.js +28 -15
  5. package/dist/lib/history.js.map +1 -1
  6. package/dist/lib/project-config.d.ts +5 -1
  7. package/dist/lib/project-config.js +11 -2
  8. package/dist/lib/project-config.js.map +1 -1
  9. package/dist/lib/review.d.ts +4 -1
  10. package/dist/lib/review.js +35 -4
  11. package/dist/lib/review.js.map +1 -1
  12. package/dist/lib/run-state.d.ts +1 -1
  13. package/dist/lib/run-state.js +1 -9
  14. package/dist/lib/run-state.js.map +1 -1
  15. package/dist/lib/status.d.ts +3 -1
  16. package/dist/lib/status.js +25 -6
  17. package/dist/lib/status.js.map +1 -1
  18. package/package.json +1 -1
  19. package/template/.agents/skills/audit/SKILL.md +65 -18
  20. package/template/.agents/skills/audit/reference/independent-review.md +31 -4
  21. package/template/.agents/skills/autopilot/SKILL.md +62 -18
  22. package/template/.agents/skills/ci/SKILL.md +8 -1
  23. package/template/.agents/skills/complete/SKILL.md +27 -2
  24. package/template/.agents/skills/continuous/SKILL.md +9 -4
  25. package/template/.agents/skills/doctor/SKILL.md +8 -4
  26. package/template/.agents/skills/feature/SKILL.md +9 -1
  27. package/template/.agents/skills/fix/SKILL.md +2 -1
  28. package/template/.agents/skills/implement/SKILL.md +47 -3
  29. package/template/.agents/skills/onboard/SKILL.md +22 -6
  30. package/template/.agents/skills/overview/SKILL.md +14 -0
  31. package/template/.agents/skills/rollback/SKILL.md +3 -1
  32. package/template/.agents/skills/status/SKILL.md +14 -4
  33. package/template/.claude/skills/audit/SKILL.md +65 -18
  34. package/template/.claude/skills/audit/reference/independent-review.md +31 -4
  35. package/template/.claude/skills/autopilot/SKILL.md +62 -18
  36. package/template/.claude/skills/ci/SKILL.md +8 -1
  37. package/template/.claude/skills/complete/SKILL.md +27 -2
  38. package/template/.claude/skills/continuous/SKILL.md +9 -4
  39. package/template/.claude/skills/doctor/SKILL.md +8 -4
  40. package/template/.claude/skills/feature/SKILL.md +9 -1
  41. package/template/.claude/skills/fix/SKILL.md +2 -1
  42. package/template/.claude/skills/implement/SKILL.md +47 -3
  43. package/template/.claude/skills/onboard/SKILL.md +22 -6
  44. package/template/.claude/skills/overview/SKILL.md +14 -0
  45. package/template/.claude/skills/rollback/SKILL.md +3 -1
  46. package/template/.claude/skills/status/SKILL.md +14 -4
  47. package/template/AGENTS.md +4 -2
  48. package/template/devflow/build-plan.md +9 -0
  49. package/template/devflow/config.json +5 -2
  50. package/template/devflow/context/ai-interaction.md +2 -0
@@ -54,6 +54,31 @@ Use `qualityGates.regular` for this work item:
54
54
  - **Check:** `manual` runs only when explicitly requested; `when-behavioral` runs when done-whens need observed runtime behavior; `always` runs for every work item.
55
55
  - **Try guide:** `manual` runs only when explicitly requested; `when-user-facing` generates guide when change affects UI/UX; `always` generates one for every work item.
56
56
 
57
+ ### Independent review execution
58
+
59
+ After final Verify and required Check pass, set the active spec to `verified`.
60
+ If a selected or previously initiated independent review does not already have a
61
+ current passing receipt:
62
+
63
+ 1. Use an existing current pending request and its immutable target when one is
64
+ present. Otherwise show the exact product, test, and verified-spec candidate
65
+ for the immutable review checkpoint. Obtain explicit commit approval under
66
+ the normal Git rules, then create or use that clean checkpoint. Configuration,
67
+ including `review.independentExecution: "automatic"`, never grants permission
68
+ to commit. A pending request without `Requested execution` is legacy and
69
+ manual-only; never add execution fields or run a subagent against it.
70
+ 2. Prepare Phase A of `/audit independent current` when no current request
71
+ exists. Record `Requested execution` from `review.independentExecution`.
72
+ 3. For requested `automatic`, start the generic isolated current-runtime child
73
+ from the installed project-local Audit skill, wait, and validate the normal
74
+ receipt. Freeze parent product, test, spec, and config changes while it runs.
75
+ 4. For requested `manual`, or when automatic isolation, identity, model, or
76
+ completion is unavailable, preserve the pending request, set activity to
77
+ `ready`, and stop with the manual fresh-session handoff.
78
+ 5. Continue Complete only with a current passing receipt whose requested and
79
+ actual execution fields match the allowed review contract. Never self-review
80
+ or silently skip the gate.
81
+
57
82
  ## Step 0 - final safety pass
58
83
 
59
84
  Before logging or committing, run a short safety pass and report blockers only:
@@ -82,13 +107,13 @@ Check whether the spec is a feature, fix, or rollback. A fix is marked
82
107
  `Type: Fix` and has no build-plan number. A rollback is marked `Type: Rollback`
83
108
  and records the exact target feature, archive, commit, and parent.
84
109
 
85
- - **Feature** - archive `devflow/context/{xxx-slug}/spec.md` to `devflow/history/features/{xxx-slug}.md`, check it off in `devflow/build-plan.md` (and its parent item once all sub-items are checked), and record an entry into `devflow/history/HISTORY.md`.
110
+ - **Feature** - archive `devflow/context/{xxx-slug}/spec.md` to `devflow/history/features/{xxx-slug}.md`, check it off in `devflow/build-plan.md` (and its parent item once all sub-items are checked), recompute the overview fingerprint using `/overview`'s checkbox-normalized hash contract and update `devflow:source-hash` in `devflow/context/project-overview.md`, and record an entry into `devflow/history/HISTORY.md`.
86
111
  - **Fix** - archive `devflow/context/{xxx-slug}/spec.md` to `devflow/history/fixes/{xxx-slug}.md`, and record an entry into `devflow/history/HISTORY.md`.
87
112
  - **Rollback** - archive `devflow/context/{xxx-slug}/spec.md` to `devflow/history/rollbacks/YYYY-MM-DD-{xxx-slug}.md`, preserving the original completed feature archive. Uncheck the target item in `devflow/build-plan.md` and record in `devflow/history/HISTORY.md`.
88
113
 
89
114
  **Archive resolved findings & review receipts.**
90
115
  - If `devflow/context/{xxx-slug}/findings.md` holds findings, append `## Findings` to the archive file with resolved entries.
91
- - If `devflow/context/{xxx-slug}/review.md` holds a completed passing receipt, append `## Independent Review` to the archive file with the receipt summary.
116
+ - If `devflow/context/{xxx-slug}/review.md` holds a completed passing receipt, append a `## Independent review` section to the archive file with the receipt fields, commands, safe evidence references, findings, and remaining risk from `review.md`. Preserve the full target and base SHAs, spec hash, base ref, builder adapter and model, requested reviewer, model, and execution, actual reviewer adapter, model, and execution, Check result, fresh-context declaration, and review time. Do not archive a stale, pending, changes-requested, or malformed record.
92
117
 
93
118
  **Clean up run workspace.** Delete the task directory `devflow/context/{xxx-slug}/`. In Pure Multi-Run architecture, completed work leaves zero residual stubs in `devflow/context/`.
94
119
 
@@ -24,6 +24,7 @@ Where this sits in the workflow:
24
24
  ### ขอบเขตสิทธิ์ที่ได้รับอนุญาตเฉพาะในเครื่อง Local:
25
25
  - สร้างและสลับ Feature Branch ในเครื่อง Local
26
26
  - บันทึก Checkpoint Commits ย่อยบน Branch
27
+ - สร้าง required immutable independent-review checkpoints
27
28
  - บันทึก Feature Commit สุดท้าย
28
29
  - Squash-merge ฟีเจอร์ที่เสร็จสมบูรณ์ลง Default Branch ของ Local
29
30
  - ลบ Feature Branch เฉพาะใน Local หลังรวมโค้ดสำเร็จ
@@ -93,10 +94,14 @@ Where this sits in the workflow:
93
94
  - **Try Guide**: `manual` (ข้ามอัตโนมัติ), `when-user-facing` (สร้าง Try Guide เมื่อเป็น UI/CLI), `always` (สร้างทุกฟีเจอร์)
94
95
 
95
96
  ทุก product/spec edit ทำให้ receipt เดิมหมดอายุ เมื่อ Independent Review gate
96
- ทำงาน ให้รัน Verify และซ่อม audit findings ให้เสร็จก่อนส่ง
97
- `audit independent current` ไปยัง fresh reviewer context หากไม่สามารถรับ
98
- receipt ที่ verdict เป็น `passed` และ freshness เป็น `current` ให้หยุด Continuous
99
- Mode โดยคง workspace/branch ไว้ ห้ามข้ามไป archive หรือ local squash-merge
97
+ ทำงาน ให้รัน Verify และสร้าง immutable checkpoint (ได้รับอนุญาตภายใต้ Continuous Mode authority แม้ checkpointCommits จะ disabled) จากนั้นปฏิบัติตาม `/audit independent current`
98
+ หาก `review.independentExecution` เป็น `automatic` ให้ spawn และรอ isolated reviewer child พร้อมตรวจสอบ receipt ให้ผ่านก่อนดำเนินการต่อ
99
+ หากเป็น `manual` หรือ runtime ไม่สามารถพิสูจน์ isolation, identity, model ได้ ให้ตั้งสถานะเป็น `ready` และหยุดด้วย manual handoff
100
+ Continuous Mode จะไม่ทำการ audit งานของตัวเองโดยเด็ดขาด
101
+
102
+ คำขอจะบันทึก `Requested execution` และ receipt จะบันทึก `Actual execution`
103
+ การจับคู่ของ execution และ reviewer context จะต้องถูกต้องตามสัญญา review
104
+ หากเป็น legacy request ที่ไม่มี `Requested execution` ให้ถือว่าเป็น legacy manual-only ห้ามเติมฟิลด์หรือรัน subagent กับมัน
100
105
 
101
106
  สำหรับฟีเจอร์ browser-facing ให้รัน `npm run test:browser` เมื่อมี
102
107
  `test:browser` script และเก็บ interactive evidence ผ่าน `browseros-neo` เมื่อ
@@ -58,10 +58,14 @@ Gather these, then summarize. Do not dump file contents.
58
58
  - Read `devflow/config.json` when present. Missing is healthy and means
59
59
  built-in defaults. When present, require a regular non-symbolic-link JSON
60
60
  file with `schemaVersion: 1`. Reject unknown keys and unsupported values.
61
- Report the effective workflow, git, verification, regular quality-gate,
62
- Continuous quality-gate, and Continuous Mode settings. Confirm each audit,
63
- independent-review, check, and try-guide gate uses its supported values and
64
- defaults to `manual`.
61
+ Report the effective workflow, git, verification, review execution, regular
62
+ quality-gate, Continuous quality-gate, and Continuous Mode settings. Confirm each audit,
63
+ independent-review, check, and try-guide gate uses its supported values.
64
+ Independent review defaults to `when-sensitive` for both workflows; audit,
65
+ check, and try guide default to `manual`. Confirm
66
+ `review.independentExecution` is `manual` or `automatic` and defaults to
67
+ `automatic`. Do not claim automatic capability is available from installed
68
+ project files alone.
65
69
  An invalid config is a setup blocker for mutating workflow skills because
66
70
  they must not guess which policy to follow.
67
71
  2. **Tool adapters**
@@ -127,7 +127,15 @@ build plan starts high-level.
127
127
  ## Step 3 - write the spec
128
128
 
129
129
  For the one (sub-)feature being built now, allocate sequential ID (`xxx-slug`) and create a dedicated workspace at `devflow/context/{xxx-slug}/`. Write the full living spec to
130
- `devflow/context/{xxx-slug}/spec.md`, following `reference/feature-spec-template.md`. Also initialize `stage.md` and `findings.md` in that folder. Fill every section:
130
+ `devflow/context/{xxx-slug}/spec.md`, following `reference/feature-spec-template.md`. Also initialize `stage.md` and `findings.md` in that folder. The first heading and build-plan identity must use this canonical form:
131
+
132
+ ```markdown
133
+ # Feature: <title>
134
+
135
+ **From build-plan:** feature <id>
136
+ ```
137
+
138
+ Fill every section:
131
139
  - Goal, Problem Statement, and In/Out of scope
132
140
  - Acceptance Criteria (AC-1, AC-2, ...)
133
141
  - Small build steps as atomic 2-5 min checklist items (`- [ ]`, supporting `[TDD-Red]`, `[TDD-Green]`, `[TDD-Refactor]` triplets for functional logic)
@@ -32,7 +32,8 @@ or with a description, for example `/fix F-03`.
32
32
 
33
33
  Pull context from `devflow/context/project-overview.md` and `devflow/context/coding-standards.md`,
34
34
  calculate the next sequential running ID (e.g. `059-fix-slug`),
35
- then write a short spec to `devflow/context/{xxx-slug}/spec.md`. Also initialize `stage.md` and `findings.md` in that folder. Keep it lighter than a feature spec:
35
+ then write a short spec to `devflow/context/{xxx-slug}/spec.md`. Also initialize `stage.md` and `findings.md` in that folder. Its first heading must be exactly
36
+ `# Fix: <title>`, and it must retain the `**Type:** Fix` contract below. Keep it lighter than a feature spec:
36
37
 
37
38
  - **Title** - the bug or change in a few words.
38
39
  - **Type:** Fix (so `/complete` logs it to `devflow/history/fixes/`, not `devflow/history/features/`).
@@ -153,6 +153,29 @@ Never batch the whole thing into one diff. If a step's diff is too big to read,
153
153
  split it. The documented `Verify` command, or the fallback build and tests, must
154
154
  pass before any commit.
155
155
 
156
+ After final Verify and required Check pass, set the active spec to `verified`
157
+ with every completed box checked. Then resolve independent review before the
158
+ final packet:
159
+
160
+ 1. If `qualityGates.regular.independentReview` does not select review and no
161
+ request already exists, proceed directly to the final review packet.
162
+ 2. Otherwise show the exact product, test, and verified-spec candidate for the
163
+ immutable review checkpoint. Obtain explicit commit approval when the exact
164
+ checkpoint does not already exist, then create or use it. Configuration,
165
+ including `review.independentExecution: "automatic"`, never grants commit
166
+ permission, even when normal checkpoint commits are disabled.
167
+ 3. Follow `/audit independent current` to prepare or reuse the request and record
168
+ `Requested execution`. For requested `automatic`, start and wait for the
169
+ generic isolated current-runtime child instructed from the project-local
170
+ Audit skill, then validate the receipt. For requested `manual`, or when
171
+ automatic capability is unavailable, preserve the request and stop with the
172
+ manual fresh-session handoff. Treat an existing request without `Requested
173
+ execution` as legacy manual-only: never add execution fields or run a
174
+ subagent against it.
175
+ 4. Continue to the final packet only with a current passing receipt whose
176
+ requested execution, actual execution, and reviewer context form an allowed
177
+ pairing. Never self-review or silently skip a selected gate.
178
+
156
179
  ## Step 3 - hand off to /complete
157
180
 
158
181
  Before handing off, check `devflow/context/{xxx-slug}/findings.md`. A P0 or P1 finding
@@ -182,9 +205,30 @@ When every step is built and `Verify`, or the fallback build and tests, passes
182
205
  - known risks, skipped checks, or follow-up notes
183
206
  - next action, usually `/complete`
184
207
 
185
- Then tell the user `/complete` makes the one work-level commit, logs it (archive,
186
- update the build plan for a feature or rollback, reset), and merges with
187
- approval. This skill does not touch main.
208
+ After the final packet, always offer these choices:
209
+
210
+ 1. Walk me through the implementation.
211
+ 2. Request changes.
212
+ 3. Continue to the exact next workflow command.
213
+
214
+ The final walkthrough is available with either `workflow.stepReview` value and
215
+ regardless of `workflow.checkpointCommits`. It is a read-only code tour, not the
216
+ manual product-review path produced by `/try`, and it is not verification.
217
+
218
+ When the user chooses the walkthrough, begin with a short map of the completed
219
+ feature, then follow the spec's build steps. For each step, explain its purpose,
220
+ key files and symbols, important data or control flow, and non-obvious decisions.
221
+ Use file and line links when the client supports them. Do not narrate every line
222
+ or reload broad project context. End by offering a focused deep dive into one
223
+ named area. If the feature spans too many distinct areas for one useful pass,
224
+ name the sections first and let the user choose where to begin. Remain read-only
225
+ unless the user separately requests changes.
226
+
227
+ Never create an ordinary step, product, or work-level commit from this skill.
228
+ The sole exception is exactly one immutable independent-review checkpoint after
229
+ showing its exact candidate and receiving current explicit commit approval.
230
+ Configuration never supplies that approval. Never merge, push, deploy, publish,
231
+ or start unrelated work from this skill.
188
232
 
189
233
  ## Rules
190
234
 
@@ -164,7 +164,14 @@ than pretending a pattern exists.
164
164
  ## Step 4 - check AI interaction rules and workflow configuration
165
165
 
166
166
  `devflow/config.json` is the user-owned workflow policy for this project. Keep
167
- it lean and machine-readable: never write stack choices, conventions, custom
167
+ it lean and machine-readable: edit only supported keys, such as branch prefixes,
168
+ logic-test strictness, regular or Continuous quality gates, review execution, or
169
+ Continuous Mode limits. Independent review defaults to `when-sensitive` for
170
+ regular and Continuous work, and its execution defaults to `automatic`. Audit,
171
+ check, and try guide default to `manual`. Preserve these defaults unless the user
172
+ chooses different policies. A `manual` independent-review gate disables
173
+ automatic selection for that workflow without disabling explicit independent
174
+ audits. Never put stack choices, conventions, custom
168
175
  commands, product requirements, communication prose, secrets, or permission for
169
176
  commits, merges, pushes, deployments, publication, destructive actions, failed
170
177
  checks, or finding waivers into config.
@@ -172,12 +179,12 @@ checks, or finding waivers into config.
172
179
  Unless the user already chose these values, ask one short **Implementation
173
180
  style** question using the current tool's selectable prompt when available:
174
181
 
175
- 1. **Efficient (Recommended)** - one feature-level review packet and no step
176
- checkpoint prompts. Write `workflow.stepReview: "feature"` and
177
- `workflow.checkpointCommits: "disabled"`.
182
+ 1. **Efficient (Recommended)** - one feature-level review packet, a final code
183
+ walkthrough option, and no step checkpoint prompts. Write
184
+ `workflow.stepReview: "feature"` and `workflow.checkpointCommits: "disabled"`.
178
185
  2. **Guided** - pause for approval after every step and offer optional checkpoint
179
- commits. Write `workflow.stepReview: "every"` and
180
- `workflow.checkpointCommits: "enabled"`.
186
+ commits, followed by the same final code walkthrough option. Write
187
+ `workflow.stepReview: "every"` and `workflow.checkpointCommits: "enabled"`.
181
188
  3. **Custom** - ask separately when review should happen and whether checkpoint
182
189
  commits should be offered, then write the selected low-level values.
183
190
 
@@ -185,6 +192,8 @@ These are onboarding presets, not a third configuration field.
185
192
  Never write an `implementationStyle` key. Show the current two values before asking, preserve
186
193
  them if the user chooses not to change them, and explain that either value can be
187
194
  edited later. A later `/implement` run reads the current configuration.
195
+ The final code walkthrough is not a configuration setting and remains available
196
+ with every implementation style.
188
197
 
189
198
  Read `devflow/context/ai-interaction.md` and update only obvious mismatches.
190
199
  Usually the default review loop should stay intact. Flag preferences for the user
@@ -197,6 +206,13 @@ instead of guessing, such as:
197
206
  changing only `stepReview` restores the approval pauses, not checkpoint prompts
198
207
  - whether branches should use a different naming pattern
199
208
  - whether `/check` should require browser evidence for UI work
209
+ - whether audit, independent review, check, or try guides should stay manual, run only for their
210
+ documented conditional case, or run for every regular or Continuous work item
211
+ - whether a selected independent review should use the default automatic
212
+ isolated reviewer or `review.independentExecution: "manual"` for a
213
+ fresh-session handoff. Explain that automatic execution uses a fresh isolated
214
+ reviewer only when the active adapter can expose its exact identity and model,
215
+ and otherwise stops with the manual handoff
200
216
 
201
217
  If no changes are needed, say so.
202
218
 
@@ -63,6 +63,20 @@ The compiler writes:
63
63
 
64
64
  The generated output follows `devflow/reference/project-overview-template.md`.
65
65
 
66
+ After the title, write a plan fingerprint in this exact form:
67
+
68
+ ```markdown
69
+ <!-- devflow:source-hash <sha256> -->
70
+ ```
71
+
72
+ Before hashing, normalize only build-plan completion markers by replacing each
73
+ `- [x]` or `- [X]` marker with `- [ ]`, while preserving indentation and every
74
+ other byte. Compute `<sha256>` from the exact UTF-8 bytes of `project-plan.md`,
75
+ one zero byte, then the normalized UTF-8 bytes of `build-plan.md`. This lets
76
+ `/status` detect real plan changes after cloning, copying, or updating without
77
+ treating completed features as overview drift. Replace the previous marker every
78
+ time this skill regenerates the overview.
79
+
66
80
  ## Step 3 - output and report
67
81
 
68
82
  After compilation:
@@ -116,7 +116,9 @@ remediation or explicitly plan the dependent rollbacks.
116
116
  ## Step 4 - write the rollback spec
117
117
 
118
118
  Allocate sequential ID (`xxx-slug`) and create `devflow/context/{xxx-slug}/`. Write `devflow/context/{xxx-slug}/spec.md` using
119
- `reference/rollback-spec-template.md`. Also initialize `stage.md` and `findings.md` in that folder. Fill in:
119
+ `reference/rollback-spec-template.md`. Also initialize `stage.md` and `findings.md` in that folder. Its first heading must be exactly
120
+ `# Rollback: Feature <id> - <title>`, and it must retain the existing
121
+ `**Type:** Rollback` contract. Fill in:
120
122
 
121
123
  - target feature and archive
122
124
  - target commit and parent commit as full 40-character SHA values
@@ -35,9 +35,14 @@ Read these, distill them into a few lines, then stop. Do not dump file contents.
35
35
  3. **Findings** - `devflow/context/{xxx-slug}/findings.md`. Count findings by status and
36
36
  report open and fixed counts next to build-plan progress. Call out any P0 or
37
37
  P1 still `open` or `fixed` by ID, since those block `/complete`.
38
- 4. **Overview freshness** - if `devflow/context/project-overview.md` is missing,
39
- or if `project-plan.md` or `build-plan.md` appears newer than it by filesystem
40
- time, mention that `/overview` should run before new feature work.
38
+ 4. **Overview freshness** - if `devflow/context/project-overview.md` is missing
39
+ or has no `devflow:source-hash`, mention that `/overview` should run before
40
+ new feature work. Otherwise use `/overview`'s hash contract: exact project-plan
41
+ bytes, one zero byte, then build-plan bytes with line-start `- [x]` and
42
+ `- [X]` markers normalized to `- [ ]`. Treat a matching legacy exact-byte hash
43
+ as current for backward compatibility. Recommend `/overview` only when the
44
+ recorded hash matches neither value. Do not use filesystem timestamps;
45
+ `/complete` legitimately makes `build-plan.md` newer when it checks off work.
41
46
  5. **Git** - current branch, whether the working tree is clean or has uncommitted
42
47
  changes, roughly how many files changed, last commit subject, and whether the
43
48
  branch is ahead of its remote. If the directory is not a git repo, say so and
@@ -50,7 +55,12 @@ Read these, distill them into a few lines, then stop. Do not dump file contents.
50
55
  A missing file simply means no activity has been recorded. Invalid activity
51
56
  state is a warning, not a blocker for the underlying workflow; point to
52
57
  `/doctor` to inspect and offer the approved generated-state reset.
53
- 8. **Onboarding check** - Before recommending `/overview`, check whether `AGENTS.md`
58
+ 8. **Onboarding & Configuration check** - Read `devflow/config.json` when present.
59
+ Report effective regular and Continuous quality gates, plus `review.independentExecution`.
60
+ Explain that independent review defaults to `when-sensitive` for both workflows and
61
+ execution defaults to `automatic`, which uses an isolated reviewer only when
62
+ the current adapter supports it. Audit, check, and try guide default to `manual`.
63
+ Before recommending `/overview`, check whether `AGENTS.md`
54
64
  still contains the `<!-- devflow:onboarding-required -->` marker or standard template commands.
55
65
  When it does, onboarding is incomplete and `/onboard` is the next action.
56
66
  9. **Independent review and browser evidence** - read
@@ -85,10 +85,15 @@ Optional review mode:
85
85
 
86
86
  ## Independent mode
87
87
 
88
- `/audit independent current` is a two-session workflow. The builder session
89
- prepares a request. The selected fresh reviewer session runs the same command
90
- to complete it. DevFlow verifies the exact target and later staleness. The
91
- adapter, model, and fresh-session identity remain declared metadata.
88
+ `/audit independent current` is a two-context workflow. The builder prepares a
89
+ request. With `review.independentExecution: "manual"`, the selected fresh
90
+ reviewer session runs the same command to complete it. With `automatic`, the
91
+ current adapter may start a fresh isolated reviewer subagent after preparing the
92
+ request. DevFlow verifies the exact target and later staleness. The adapter,
93
+ model, and fresh-context identity remain declared metadata.
94
+ An explicit invocation uses this execution setting even when the active
95
+ workflow's `independentReview` gate is `manual`; that gate value disables only
96
+ automatic selection by the workflow.
92
97
 
93
98
  Read `reference/independent-review.md` before either phase.
94
99
 
@@ -97,6 +102,11 @@ Read `reference/independent-review.md` before either phase.
97
102
  Use this phase when `devflow/context/{xxx-slug}/review.md` has no current `pending`
98
103
  request for `HEAD` and the current spec hash.
99
104
 
105
+ A current pending request without `Requested execution` is legacy and manual
106
+ only. Never add execution fields to it or run a subagent against it. Stop with
107
+ the fresh-session handoff; Phase B must omit `Actual execution` so the legacy
108
+ request and receipt keep both execution fields absent.
109
+
100
110
  1. Require an active spec with every build step checked and status `verified`, a
101
111
  non-default work branch, a reliable merge base, and a clean working tree.
102
112
  Independent mode accepts only a locally recorded remote default branch,
@@ -109,22 +119,52 @@ request for `HEAD` and the current spec hash.
109
119
  2. Read installed adapters from `.nexus/nexus-devflow.json` or manifest when valid.
110
120
  Detect `.agents/skills` as `antigravity`/`codex`/`copilot` and `.claude/skills`
111
121
  as `claude`.
112
- 3. Ask which detected adapter and available model should review. Recommend an
113
- equal-or-stronger coding model, a different model family when practical, and
114
- high reasoning for sensitive work. Offer a fresh session in the current
115
- adapter as the fallback.
122
+ 3. Resolve the review executor from `review.independentExecution`:
123
+ - For `manual`, ask which detected adapter and available model should review.
124
+ Recommend an equal-or-stronger coding model, a different model family when
125
+ practical, and high reasoning for sensitive work. Offer a fresh session in
126
+ the current adapter as the fallback. Do not invent available models or
127
+ offer an adapter that is not installed in the project.
128
+ - For `automatic`, use only a live child-agent capability in the current
129
+ adapter that can start with no builder transcript, disclose the exact
130
+ reviewer adapter and model, and wait for completion. Spawn a generic fresh
131
+ isolated child through the current runtime. Do not discover, select, or
132
+ depend on a globally installed role, skill, prompt, or another workflow
133
+ such as TraversyFlow. If the runtime cannot start that generic child from
134
+ project-local instructions, or capability, isolation, identity, model, or
135
+ completion cannot be confirmed, use the manual path.
116
136
  4. Record the full target SHA, full merge-base SHA, the exact local base ref
117
137
  used to calculate it, exact spec SHA-256, current adapter and model,
118
- requested reviewer adapter and model, workflow, and
138
+ requested reviewer adapter and model, requested execution from
139
+ `review.independentExecution`, workflow, and
119
140
  whether the configured Check gate is required. Write the pending template
120
141
  into `devflow/context/{xxx-slug}/review.md`.
121
- 5. Set dashboard activity to `ready` and give the exact handoff command for the
122
- selected adapter. Claude Code uses `/audit independent current`; Google Antigravity uses
123
- `/audit independent current`; Codex uses `$audit independent current`. Tell
124
- the user to open a fresh session with only the handoff, not the builder chat.
125
-
126
- Stop after the handoff. The builder never continues into Phase B in the same
127
- session.
142
+ 5. Execute the configured path:
143
+ - For `manual`, set dashboard activity to `ready` and give the exact handoff
144
+ command for the selected adapter. Claude Code uses
145
+ `/audit independent current`; Google Antigravity uses
146
+ `/audit independent current`; Codex uses `$audit independent current`;
147
+ Copilot and OpenCode receive the equivalent plain-language instruction.
148
+ Tell the user to open a fresh session with only the handoff, not the builder
149
+ chat.
150
+ - For `automatic`, freeze all parent product, test, spec, and config changes.
151
+ Start one generic isolated child without the builder transcript. Instruct
152
+ it to read the project-local Audit skill and
153
+ `reference/independent-review.md` from the current adapter tree, then
154
+ execute Phase B against the prepared request. All review instructions come
155
+ from that installed DevFlow project. The reviewer may write only
156
+ `devflow/context/{xxx-slug}/findings.md` and `devflow/context/{xxx-slug}/review.md`; it must
157
+ not repair code, change the spec, commit, or perform external actions. Wait
158
+ for completion, then reread and validate the normal receipt before
159
+ continuing. Record `fresh subagent` as its reviewer context.
160
+
161
+ If automatic execution fails or any required property becomes uncertain, keep
162
+ the pending request intact, set activity to `ready`, and stop with the existing
163
+ manual fresh-session handoff. Never let the builder review its own work or skip
164
+ a selected independent-review gate.
165
+
166
+ The builder never performs Phase B itself. It may continue only after a manual
167
+ reviewer session or automatic isolated reviewer produced a valid current receipt.
128
168
 
129
169
  ### Phase B - perform the review
130
170
 
@@ -136,8 +176,12 @@ Use this phase when a current pending request exists in `devflow/context/{xxx-sl
136
176
  recorded merge base, the exact spec hash matches, and no path differs from
137
177
  the target except `devflow/context/{xxx-slug}/review.md` and
138
178
  `devflow/context/{xxx-slug}/findings.md`. Stop on any mismatch or stale state.
139
- 2. Proceed only from the fresh reviewer handoff. Record `fresh session` as a
140
- declaration. If the reviewer has the builder conversation, stop and request a fresh session.
179
+ 2. Proceed only from the fresh reviewer handoff. Record `fresh session` for a
180
+ manual reviewer or `fresh subagent` for an automatic isolated reviewer. This
181
+ is a declaration, never cryptographic proof. If the reviewer has the builder
182
+ conversation or is the builder continuing in place, stop and request a fresh
183
+ context. For a legacy request with no `Requested execution`, require a fresh
184
+ reviewer session, record `fresh session`, and omit `Actual execution`.
141
185
  3. Run Steps 1 through 3 across `current` with quality, security, performance,
142
186
  and tests together. Review the code fresh against the recorded
143
187
  `Base commit` and `Target commit`; exclude the request and findings files
@@ -150,6 +194,9 @@ Use this phase when a current pending request exists in `devflow/context/{xxx-sl
150
194
  with a completed receipt in `devflow/context/{xxx-slug}/review.md`. Use `passed` only when the whole target was
151
195
  reviewed, required checks passed, and no P0 or P1 finding is `open` or
152
196
  `fixed`.
197
+ Record actual `automatic` with `fresh subagent`, or actual `manual` with
198
+ `fresh session`, including an explicit manual fallback from an automatic
199
+ request.
153
200
  6. Report the receipt target, reviewer adapter and model, commands, evidence,
154
201
  findings, remaining risk, and whether the receipt passed. Never repair code
155
202
  from the reviewer session.
@@ -11,7 +11,7 @@ work, archived by `/complete`, and then reset.
11
11
 
12
12
  > **Generated file.** Holds the active independent-review request or latest
13
13
  > receipt for the current work item. `/audit independent current` prepares a
14
- > handoff against an approved checkpoint, a fresh reviewer session completes it,
14
+ > handoff against an approved checkpoint, a fresh reviewer context completes it,
15
15
  > and `/complete` refuses stale, pending, or changes-requested review state.
16
16
 
17
17
  _No independent review requested. Run `/audit independent current` to prepare one._
@@ -30,6 +30,11 @@ review runtime cannot select a specific model before the session starts, use
30
30
  `runtime default (exact model not known until reviewer starts)` for Requested
31
31
  model and record the exact runtime model in the completed receipt.
32
32
 
33
+ A pending request without `Requested execution` is a legacy manual request.
34
+ Never auto-upgrade it or send it to a subagent. Complete it only from a fresh
35
+ reviewer session, keep `Reviewer context: fresh session`, and omit `Actual
36
+ execution` so both execution fields remain absent.
37
+
33
38
  ```markdown
34
39
  # Independent Review
35
40
 
@@ -42,6 +47,7 @@ model and record the exact runtime model in the completed receipt.
42
47
  **Builder model:** <exact model reported by the builder runtime>
43
48
  **Requested reviewer:** <adapter>
44
49
  **Requested model:** <exact model or user-selected runtime default>
50
+ **Requested execution:** <manual or automatic>
45
51
  **Requested at:** <ISO-8601 timestamp>
46
52
  **Workflow:** <regular or continuous>
47
53
  **Check required:** <yes or no>
@@ -49,7 +55,7 @@ model and record the exact runtime model in the completed receipt.
49
55
  ## Handoff
50
56
 
51
57
  Review the active spec and the complete `<base>..<target>` delta in a fresh
52
- session without the builder conversation. Run all Audit lenses from scratch.
58
+ session or isolated subagent without the builder conversation. Run all Audit lenses from scratch.
53
59
  Run Check when required above. Do not edit product code, accept findings, or
54
60
  reuse the existing findings as the review scope.
55
61
  ```
@@ -68,7 +74,8 @@ Keep the request fields unchanged and replace `pending` with `passed` or
68
74
  ```markdown
69
75
  **Reviewer adapter:** <adapter>
70
76
  **Reviewer model:** <exact model reported by the reviewer runtime>
71
- **Reviewer context:** fresh session
77
+ **Reviewer context:** <fresh session or fresh subagent>
78
+ **Actual execution:** <manual or automatic>
72
79
  **Reviewed at:** <ISO-8601 timestamp>
73
80
  **Scope:** current
74
81
  **Lenses:** quality, security, performance, tests
@@ -104,7 +111,14 @@ Use `passed` only when all four lenses covered the complete target delta, every
104
111
  required check passed, and no P0 or P1 finding is `open` or `fixed`.
105
112
  P2 and P3 findings may remain with their normal ledger status. Use
106
113
  `changes-requested` for a blocking finding, failed required check, incomplete
107
- scope, adapter mismatch, or missing fresh-session declaration.
114
+ scope, adapter mismatch, or missing a valid fresh-context declaration.
115
+
116
+ Execution and context must agree. A manual request completes only as actual
117
+ `manual` with `fresh session`. An automatic request normally completes as
118
+ actual `automatic` with `fresh subagent`; when automatic capability falls back,
119
+ it may complete as actual `manual` with `fresh session`. Reject every other
120
+ pairing. Legacy receipts with neither execution field remain valid only with
121
+ `fresh session`; a legacy receipt can never claim `fresh subagent`.
108
122
 
109
123
  ## Freshness
110
124
 
@@ -122,7 +136,20 @@ A receipt is current only when all of these hold:
122
136
  request explicitly selected the runtime-default sentinel above. In that case,
123
137
  `Reviewer model` must still contain the exact model exposed after the reviewer
124
138
  session starts, never the sentinel itself.
139
+ - `Reviewer context` is exactly `fresh session` or `fresh subagent`. A subagent
140
+ receipt is valid only when the runtime started it without the builder
141
+ transcript and exposed its exact adapter and model. The automatic child is a
142
+ generic current-runtime child instructed from the project-local Audit skill
143
+ and this project-local contract. It never depends on a global role, skill,
144
+ prompt, or another workflow.
145
+ - `Requested execution` and `Actual execution` form one of the allowed pairings
146
+ above. New requests always record the requested value, and new receipts always
147
+ record the actual value.
125
148
 
126
149
  Any other code, test, configuration, spec, or acceptance-criteria change makes
127
150
  the receipt stale. A stale receipt never proves the new state. Prepare a new
128
151
  request against a new approved checkpoint and review the whole delta again.
152
+
153
+ The adapter, model, and context fields are declared metadata. DevFlow proves
154
+ the target and staleness, but it cannot cryptographically prove that a separate
155
+ agent or fresh context performed the review.