@jakkrichm/create-nexus-devflow 2.9.5 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +3 -3
  2. package/dist/lib/dashboard-page.d.ts +1 -1
  3. package/dist/lib/dashboard-page.js +5 -1
  4. package/dist/lib/dashboard-page.js.map +1 -1
  5. package/dist/lib/project-config.d.ts +2 -0
  6. package/dist/lib/project-config.js +5 -2
  7. package/dist/lib/project-config.js.map +1 -1
  8. package/dist/lib/review.d.ts +38 -0
  9. package/dist/lib/review.js +429 -0
  10. package/dist/lib/review.js.map +1 -0
  11. package/dist/lib/skill-manager.d.ts +10 -1
  12. package/dist/lib/skill-manager.js +241 -19
  13. package/dist/lib/skill-manager.js.map +1 -1
  14. package/dist/lib/status.d.ts +19 -2
  15. package/dist/lib/status.js +83 -15
  16. package/dist/lib/status.js.map +1 -1
  17. package/dist/scripts/prepare-template.js +7 -0
  18. package/dist/scripts/prepare-template.js.map +1 -1
  19. package/package.json +1 -1
  20. package/template/.agents/skills/audit/SKILL.md +119 -144
  21. package/template/.agents/skills/audit/reference/independent-review.md +128 -0
  22. package/template/.agents/skills/autopilot/SKILL.md +22 -1
  23. package/template/.agents/skills/browser-tests/SKILL.md +163 -0
  24. package/template/.agents/skills/check/SKILL.md +32 -23
  25. package/template/.agents/skills/complete/SKILL.md +28 -39
  26. package/template/.agents/skills/continuous/SKILL.md +12 -0
  27. package/template/.agents/skills/doctor/SKILL.md +8 -4
  28. package/template/.agents/skills/feature/SKILL.md +22 -1
  29. package/template/.agents/skills/implement/SKILL.md +21 -1
  30. package/template/.agents/skills/onboard/SKILL.md +17 -1
  31. package/template/.agents/skills/{tests → setup-tests}/SKILL.md +8 -8
  32. package/template/.agents/skills/status/SKILL.md +12 -1
  33. package/template/.agents/skills/try/SKILL.md +9 -24
  34. package/template/.claude/skills/audit/SKILL.md +119 -144
  35. package/template/.claude/skills/audit/reference/independent-review.md +128 -0
  36. package/template/.claude/skills/autopilot/SKILL.md +22 -1
  37. package/template/.claude/skills/browser-tests/SKILL.md +163 -0
  38. package/template/.claude/skills/check/SKILL.md +32 -23
  39. package/template/.claude/skills/complete/SKILL.md +28 -39
  40. package/template/.claude/skills/continuous/SKILL.md +12 -0
  41. package/template/.claude/skills/doctor/SKILL.md +9 -4
  42. package/template/.claude/skills/feature/SKILL.md +22 -1
  43. package/template/.claude/skills/implement/SKILL.md +21 -1
  44. package/template/.claude/skills/onboard/SKILL.md +17 -1
  45. package/template/.claude/skills/{tests → setup-tests}/SKILL.md +8 -8
  46. package/template/.claude/skills/status/SKILL.md +12 -1
  47. package/template/.claude/skills/try/SKILL.md +9 -24
  48. package/template/AGENTS.md +8 -4
  49. package/template/devflow/build-plan.md +14 -0
  50. package/template/devflow/config.json +2 -0
  51. package/template/devflow/context/coding-standards.md +8 -1
@@ -0,0 +1,128 @@
1
+ # Independent review record
2
+
3
+ `devflow/context/{xxx-slug}/review.md` holds one active request or latest receipt for the
4
+ current work item. It is generated workflow state that is committed with the
5
+ work, archived by `/complete`, and then reset.
6
+
7
+ ## Reset stub
8
+
9
+ ```markdown
10
+ # Independent Review
11
+
12
+ > **Generated file.** Holds the active independent-review request or latest
13
+ > receipt for the current work item. `/audit independent current` prepares a
14
+ > handoff against an approved checkpoint, a fresh reviewer session completes it,
15
+ > and `/complete` refuses stale, pending, or changes-requested review state.
16
+
17
+ _No independent review requested. Run `/audit independent current` to prepare one._
18
+ ```
19
+
20
+ ## Pending request
21
+
22
+ Use full commit SHAs, the exact permitted base ref used to calculate the merge base,
23
+ a lowercase SHA-256 hash of the exact
24
+ `devflow/context/{xxx-slug}/spec.md` bytes, an ISO-8601 timestamp, and one of
25
+ `antigravity`, `claude`, `codex`, `copilot`, or `opencode` for each adapter field.
26
+ Model fields use the full identifier exposed by runtime or session metadata,
27
+ not a generic family label. When unavailable, record
28
+ `unknown (runtime did not expose exact model)` instead of guessing. When the
29
+ review runtime cannot select a specific model before the session starts, use
30
+ `runtime default (exact model not known until reviewer starts)` for Requested
31
+ model and record the exact runtime model in the completed receipt.
32
+
33
+ ```markdown
34
+ # Independent Review
35
+
36
+ **Status:** pending
37
+ **Target commit:** <full 40-character checkpoint SHA>
38
+ **Base commit:** <full 40-character merge-base SHA>
39
+ **Base ref:** <local branch or remote-tracking ref used for the merge base>
40
+ **Spec hash:** <64-character SHA-256>
41
+ **Prepared by:** <adapter>
42
+ **Builder model:** <exact model reported by the builder runtime>
43
+ **Requested reviewer:** <adapter>
44
+ **Requested model:** <exact model or user-selected runtime default>
45
+ **Requested at:** <ISO-8601 timestamp>
46
+ **Workflow:** <regular or continuous>
47
+ **Check required:** <yes or no>
48
+
49
+ ## Handoff
50
+
51
+ 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.
53
+ Run Check when required above. Do not edit product code, accept findings, or
54
+ reuse the existing findings as the review scope.
55
+ ```
56
+
57
+ For an independently enforceable receipt, `Base ref` must be a locally recorded
58
+ remote default branch, local `main`, or local `master`. It cannot be the current
59
+ work branch, and `Base commit` cannot equal `Target commit`. If none of those
60
+ base refs reliably covers the active work, stop instead of creating a receipt
61
+ whose review range cannot be re-derived.
62
+
63
+ ## Completed receipt
64
+
65
+ Keep the request fields unchanged and replace `pending` with `passed` or
66
+ `changes-requested`. Add these fields and sections:
67
+
68
+ ```markdown
69
+ **Reviewer adapter:** <adapter>
70
+ **Reviewer model:** <exact model reported by the reviewer runtime>
71
+ **Reviewer context:** fresh session
72
+ **Reviewed at:** <ISO-8601 timestamp>
73
+ **Scope:** current
74
+ **Lenses:** quality, security, performance, tests
75
+ **Verdict:** <passed or changes-requested>
76
+ **Check result:** <passed, failed, unavailable, or not-required>
77
+
78
+ ## Commands
79
+
80
+ - `<command>`: <pass, fail, or unavailable>
81
+
82
+ ## Evidence
83
+
84
+ - <safe concise evidence reference>
85
+
86
+ ## Findings
87
+
88
+ - <finding IDs, or `None`>
89
+
90
+ ## Remaining risk
91
+
92
+ - <risk or unavailable signal, or `None identified`>
93
+ ```
94
+
95
+ Every unavailable verification command must appear under Remaining risk, even
96
+ when Check was not required and the receipt may still pass.
97
+
98
+ All four completed-receipt sections must contain at least one entry. Use
99
+ `- None`, `- None identified`, or `- No commands run` when that is the truthful
100
+ result. When Check is required, `Check result` must be `passed` before the
101
+ receipt can pass. Use `not-required` only when Check was not required.
102
+
103
+ Use `passed` only when all four lenses covered the complete target delta, every
104
+ required check passed, and no P0 or P1 finding is `open` or `fixed`.
105
+ P2 and P3 findings may remain with their normal ledger status. Use
106
+ `changes-requested` for a blocking finding, failed required check, incomplete
107
+ scope, adapter mismatch, or missing fresh-session declaration.
108
+
109
+ ## Freshness
110
+
111
+ A receipt is current only when all of these hold:
112
+
113
+ - `HEAD` exactly equals `Target commit`.
114
+ - `Base ref` still resolves and its merge base with `Target commit` exactly
115
+ equals `Base commit`, and it remains a locally recorded remote default branch,
116
+ local `main`, or local `master`.
117
+ - The exact task spec bytes still match `Spec hash`.
118
+ - No tracked, staged, unstaged, or untracked path differs from the target except
119
+ `devflow/context/{xxx-slug}/review.md` and `devflow/context/{xxx-slug}/findings.md`.
120
+ - The completed reviewer adapter matches `Requested reviewer`.
121
+ - The completed reviewer model exactly matches `Requested model`, unless the
122
+ request explicitly selected the runtime-default sentinel above. In that case,
123
+ `Reviewer model` must still contain the exact model exposed after the reviewer
124
+ session starts, never the sentinel itself.
125
+
126
+ Any other code, test, configuration, spec, or acceptance-criteria change makes
127
+ the receipt stale. A stale receipt never proves the new state. Prepare a new
128
+ request against a new approved checkpoint and review the whole delta again.
@@ -82,6 +82,27 @@ If the only issue is that `project-overview.md` is stale and the plans are clear
82
82
  regenerate it using the `/overview` behavior and continue. Include that in the
83
83
  final packet.
84
84
 
85
+ ### Quality-gate and browser preflight
86
+
87
+ Read `qualityGates.regular.independentReview` from `devflow/config.json`.
88
+ `manual` is opt-in, `always` activates the gate, and `when-sensitive` activates
89
+ when the task touches authentication, authorization, secrets, payments,
90
+ personal data, destructive operations, dependencies, deployment, or another
91
+ security boundary. Reuse the target spec's recorded sensitivity decision; if it
92
+ is missing, record the evidence-backed decision before implementation.
93
+
94
+ Any product or living-spec edit invalidates an earlier receipt. After the final
95
+ Verify and targeted audit repairs, an active gate requires the
96
+ `audit independent current` handoff in a fresh reviewer context. Autopilot must
97
+ stop rather than self-approve when it cannot obtain a receipt with `passed`
98
+ verdict and `current` freshness; it never continues toward `/complete` on a
99
+ pending, malformed, changes-requested, stale, or missing receipt.
100
+
101
+ For browser-visible behavior, run `npm run test:browser` when `test:browser` is
102
+ declared and capture interactive evidence with `browseros-neo` when available.
103
+ If either path is unavailable, record the limitation in the review packet and do
104
+ not install a runner or claim browser proof implicitly.
105
+
85
106
  ## Step 2 - choose or write the spec
86
107
 
87
108
  If `devflow/context/{xxx-slug}/spec.md` already contains an active spec,
@@ -233,4 +254,4 @@ Stop immediately and report instead of continuing when Autopilot would need to:
233
254
 
234
255
  Format the output to match the project's conventions in
235
256
  `devflow/context/ai-interaction.md`: concise, scannable markdown, with lists for
236
- enumerations and tables for matrices rather than dense paragraphs.
257
+ enumerations and tables for matrices rather than dense paragraphs.
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: browser-tests
3
+ description: "[devflow] Add or normalize an optional repository-owned browser test harness (preferring Playwright) and connect with MCP browserOS neo (http://127.0.0.1:9010/mcp) when available for live visual inspection and repeatable E2E automation."
4
+ argument-hint: "[{runner or surface}]"
5
+ ---
6
+
7
+ # browser-tests - set up repeatable browser verification
8
+
9
+ $ARGUMENTS
10
+
11
+ **First action:** Before project inspection, preflight, or any other tool call,
12
+ publish `running` to `devflow/.state/run.json` using the dashboard activity
13
+ contract in `AGENTS.md`.
14
+
15
+ This is an explicit optional setup command. It creates a project-owned browser
16
+ test path that later Feature, Implement, Check, and Continuous runs can reuse. It
17
+ does not replace live browser inspection, install during another workflow
18
+ command, or make browser testing mandatory for every DevFlow project.
19
+
20
+ ---
21
+
22
+ ## Hybrid Browser Verification Architecture
23
+
24
+ Nexus-DevFlow uses a **Dual-Layer Browser Verification Hierarchy**:
25
+
26
+ ```text
27
+ ┌─────────────────────────────────────────────────────────────────────────────┐
28
+ │ 🌐 Hybrid Browser Verification Engine │
29
+ ├──────────────────────────────────────┬──────────────────────────────────────┤
30
+ │ 1. Code-Driven Test Automation (CI) │ 2. Interactive AI Visual QA (MCP) │
31
+ │ • Framework: Playwright │ • Server: MCP browseros-neo │
32
+ │ • Command: npm run test:browser │ • URL: http://127.0.0.1:9010/mcp │
33
+ │ • Purpose: Assertions, Headless, │ • Purpose: Live DOM Inspection, │
34
+ │ Regression Suite & Pre-commit │ Real Screenshot Proofs, /try │
35
+ └──────────────────────────────────────┴──────────────────────────────────────┘
36
+ ```
37
+
38
+ 1. **Layer 1: Code-Driven Repeatable Tests (Playwright)**:
39
+ - Sets up `@playwright/test` for headless, deterministic assertions.
40
+ - Documents command in `AGENTS.md` as `Browser tests: npm run test:browser` (or equivalent).
41
+ - Executed automatically during `/check` and Continuous mode.
42
+
43
+ 2. **Layer 2: Live Interactive QA (MCP browseros-neo)**:
44
+ - When the `browseros-neo` MCP server (`http://127.0.0.1:9010/mcp`) is active in IDE config (`mcp_config.json`), the AI Agent connects to it for live interactive inspection.
45
+ - Used during `/check` and `/try` to capture visual evidence, inspect rendered styles, and verify complex user interactions directly in a live browser.
46
+
47
+ ---
48
+
49
+ ## Input
50
+
51
+ No argument is required. A named runner, browser, application surface, or flow is
52
+ a preference to verify against the real project.
53
+
54
+ ## Step 1 - inspect the project
55
+
56
+ Read enough files to identify the actual browser surface and existing setup:
57
+
58
+ - `AGENTS.md`, especially Commands and any Verify command
59
+ - package or language manifests, lockfiles, workspaces, and runtime versions
60
+ - existing browser, integration, and end-to-end test configs and files
61
+ - build, dev, preview, extension-build, and test commands
62
+ - relevant CI workflows and ignore rules
63
+ - `devflow/context/coding-standards.md`
64
+ - Git branch and worktree state
65
+
66
+ Do not assume Node.js, npm, a web server, or a blank test setup. Do not install
67
+ dependencies or edit files during inspection.
68
+
69
+ ## Step 2 - choose the smallest useful harness
70
+
71
+ Reuse a working browser runner already established by the project. For a
72
+ compatible JavaScript or TypeScript web app or browser extension with no runner,
73
+ prefer Playwright Test (`@playwright/test`). If the stack or executable surface is unclear, stop and
74
+ ask instead of inventing a framework.
75
+
76
+ Choose one representative smoke path through a real project surface. It must
77
+ prove the harness can launch the app and observe behavior, not merely assert that
78
+ a static fixture exists. Keep authentication state, profiles, secrets, generated
79
+ reports, traces, videos, and screenshots out of Git unless the project already
80
+ has a deliberate safe convention.
81
+
82
+ For browser extensions, use a persistent test browser context and load the built
83
+ unpacked extension. Test an extension-owned page or content-script flow that the
84
+ runner can reach. Browser toolbar UI, permission prompts, and other browser
85
+ chrome may still require Check or Try evidence; do not claim those surfaces are
86
+ automated when they are not.
87
+
88
+ ## Step 3 - present the setup
89
+
90
+ Before editing, state:
91
+
92
+ - runner selected or reused
93
+ - exact dependency install command, when needed
94
+ - config, script, test, and ignore files to add or change
95
+ - application or extension surface covered by the smoke test
96
+ - exact browser-test command that will be documented
97
+ - any server, build, authentication, or browser-chrome limitation
98
+ - MCP `browseros-neo` availability for interactive checks
99
+
100
+ Dependency installation and browser-binary downloads require the user's approval
101
+ through the current tool's normal approval flow. Do not treat running this skill
102
+ as permission to change CI, download unrelated browsers, or add a broad suite.
103
+
104
+ ## Step 4 - create or normalize the harness
105
+
106
+ Make the smallest practical diff:
107
+
108
+ 1. Add only the required runner dependency and config (e.g. `playwright.config.ts`).
109
+ 2. Add one project-relevant smoke test (e.g. `e2e/smoke.spec.ts`).
110
+ 3. Add or reuse a conventional command such as `test:browser`.
111
+ 4. Document the exact invocation in the Commands section of `AGENTS.md` as
112
+ `Browser tests: <command>`. Include a working directory when a workspace
113
+ needs one.
114
+ 5. Configure runner-owned server lifecycle only when the project has a safe,
115
+ documented command and the runner can start and stop it reliably. Do not
116
+ create a duplicate server when the established harness reuses one.
117
+ 6. Ignore generated browser-test artifacts that should stay local (e.g. `test-results/`, `playwright-report/`).
118
+
119
+ Do not add browser tests to the default Verify command or GitHub workflow unless
120
+ the user separately asks for that slower gate or the project already requires
121
+ it. Preserve existing CI and existing browser coverage.
122
+
123
+ ## Step 5 - verify the path
124
+
125
+ Run the documented Browser tests command. Confirm that the smoke test exercises
126
+ the intended real surface and that the runner exits cleanly. Inspect generated
127
+ console, request, trace, screenshot, or report evidence only when relevant to
128
+ the claim.
129
+
130
+ A passing runner with no tests, a test against the wrong surface, or a skipped
131
+ browser launch is not a successful setup. If credentials, an external service,
132
+ browser chrome, or another unavailable dependency blocks the smoke path, report
133
+ the harness as incomplete instead of weakening the test.
134
+
135
+ ## Step 6 - report
136
+
137
+ Return a concise setup report:
138
+
139
+ - runner and browser surface
140
+ - command documented in `AGENTS.md`
141
+ - smoke behavior proven
142
+ - MCP `browseros-neo` connectivity status
143
+ - files added or changed
144
+ - verification result
145
+ - remaining manual or environment-specific boundary
146
+
147
+ Show the diff summary. Do not commit, merge, push, publish, or begin unrelated
148
+ feature work.
149
+
150
+ ---
151
+
152
+ ## Integration contract
153
+
154
+ Once `AGENTS.md` declares `Browser tests: <command>`:
155
+
156
+ - **Feature** may include a focused browser-test expectation for stable behavioral done-whens.
157
+ - **Implement** may add and run a focused browser test when it is proportionate to the current step.
158
+ - **Check** runs the documented command as repeatable evidence, connects to MCP `browseros-neo` (if active) for live visual verification & screenshots, and directly observes any done-when the suite does not prove.
159
+ - **Continuous** needs no separate browser mode. Its configured Check gate uses the same command.
160
+
161
+ The harness supplements direct evidence. A green browser suite does not prove
162
+ visual fidelity, authenticated real-profile behavior, browser chrome, or every
163
+ done-when unless the test actually observes those claims.
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: check
3
- description: "[devflow] Prove the current work actually does what its spec says and adheres to architectural standards through a Dual-Axis Independent Review. Supports Multi-Run: given an optional ID or name (/check 12), targets that spec and records proof to devflow/context/{xxx-slug}/findings.md. Drives the app, captures empirical evidence, checks Fowler smells, and reports pass/fail. Use when running /check, confirming work, or validating before /complete."
3
+ description: "[devflow] Prove the current work actually does what its spec says and adheres to architectural standards through a Dual-Axis Independent Review. Supports Multi-Run: given an optional ID or name (/check 12), targets that spec and records proof to devflow/context/{xxx-slug}/findings.md. Drives the app, captures empirical evidence using Playwright and MCP browseros-neo, checks Fowler smells, and reports pass/fail. Use when running /check, confirming work, or validating before /complete."
4
4
  argument-hint: "[{run-id, number, or name}]"
5
5
  ---
6
6
 
7
7
  # check - Dual-Axis Independent Verification Engine
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  **First action:** Before project inspection, preflight, or any other tool call,
10
12
  publish `running` to `devflow/.state/run.json` using the dashboard activity
11
13
  contract in `AGENTS.md`.
@@ -30,6 +32,29 @@ It changes no source and commits nothing — it executes, inspects, and reports
30
32
 
31
33
  ---
32
34
 
35
+ ## Hybrid Browser Verification Engine
36
+
37
+ Nexus-DevFlow uses a **Dual-Layer Browser Verification Hierarchy**:
38
+
39
+ ```text
40
+ ┌─────────────────────────────────────────────────────────────────────────────┐
41
+ │ 🌐 Hybrid Browser Verification Engine │
42
+ ├──────────────────────────────────────┬──────────────────────────────────────┤
43
+ │ 1. Code-Driven Test Automation (CI) │ 2. Interactive AI Visual QA (MCP) │
44
+ │ • Framework: Playwright │ • Server: MCP browseros-neo │
45
+ │ • Command: npm run test:browser │ • URL: http://127.0.0.1:9010/mcp │
46
+ │ • Purpose: Assertions, Headless, │ • Purpose: Live DOM Inspection, │
47
+ │ Regression Suite & Pre-commit │ Real Screenshot Proofs, /try │
48
+ └──────────────────────────────────────┴──────────────────────────────────────┘
49
+ ```
50
+
51
+ 1. **Layer 1: Code-Driven Repeatable Tests (Playwright)**:
52
+ - If `AGENTS.md` declares `Browser tests: <command>`, run that exact command as repeatable automated evidence.
53
+ 2. **Layer 2: Interactive AI Visual QA (MCP browseros-neo)**:
54
+ - When the `browseros-neo` MCP server (`http://127.0.0.1:9010/mcp`) is active, use it to inspect the live running app, verify rendered CSS/layout, test click flows, and capture actual screenshot proofs.
55
+
56
+ ---
57
+
33
58
  ## Step 1 - Build the Dual-Axis Review Matrix
34
59
 
35
60
  Read the target spec from `devflow/context/{xxx-slug}/spec.md` and `devflow/context/coding-standards.md`. Prepare the inspection criteria across two independent axes:
@@ -50,7 +75,7 @@ Read the target spec from `devflow/context/{xxx-slug}/spec.md` and `devflow/cont
50
75
 
51
76
  Use the project's real commands (from `AGENTS.md`):
52
77
 
53
- - **Web app**: Start (or reuse) the local dev server. Drive a real browser to relevant routes. Prefer Playwright when installed for screenshots, network errors, and console assertions.
78
+ - **Web app**: Start (or reuse) the local dev server. Drive a real browser to relevant routes. If `Browser tests: <command>` is declared, run it. When MCP `browseros-neo` is active, connect to inspect live visual state.
54
79
  - **CLI**: Execute commands with representative input fixtures, asserting exit codes and output snapshots.
55
80
  - **Server / API**: Hit endpoints with real payloads and assert on HTTP response status and bodies.
56
81
  - **Library**: Exercise public interfaces through integration tests or sample scripts.
@@ -60,7 +85,7 @@ Use the project's real commands (from `AGENTS.md`):
60
85
 
61
86
  ---
62
87
 
63
- ## Step 3 - Dual-Axis Independent Report
88
+ ## Step 3 - Dual-Axis Independent Report & State Update
64
89
 
65
90
  Format the report into two distinct, un-merged review axes:
66
91
 
@@ -72,6 +97,8 @@ Format the report into two distinct, un-merged review axes:
72
97
  - **Technical Lanes**:
73
98
  - [pass] Type Safety: `tsc --noEmit` (0 errors)
74
99
  - [pass] Automated Tests: `npm test` (All tests green)
100
+ - [pass] Browser Tests: `npm run test:browser` (Playwright passed)
101
+ - [pass] Visual Inspection: MCP browseros-neo verified UI layout & zero console errors
75
102
  - [pass] Security & Hygiene: Zero secrets, sanitized inputs
76
103
  - [pass] Findings Ledger: 0 blocking P0/P1 in `devflow/context/{xxx-slug}/findings.md`
77
104
  - **Deep Modules & Architecture**:
@@ -93,25 +120,7 @@ Line-by-line verification against `devflow/context/{xxx-slug}/spec.md`:
93
120
 
94
121
  ## 🚦 Final Routing & Verdict
95
122
 
96
- - **ALL PASSED**: Both axes green. Ready for `/complete`.
123
+ - **ALL PASSED**: Both axes green. Update `stage.md` (Passed -> Ready for `/complete`).
97
124
  - **ANY FAILURE**: Hand back to `/implement` with exact failure evidence and reproduction steps.
98
125
  - **UNVERIFIABLE**: Clearly document the gap and residual risk. Never fabricate a pass.
99
- ```
100
-
101
- ---
102
-
103
- ## Why Two Independent Axes?
104
-
105
- A code change can pass one axis and fail the other:
106
- - **Standards Pass, Spec Fail**: Code is beautifully architected and tested, but implements the wrong business behavior.
107
- - **Spec Pass, Standards Fail**: Feature works end-to-end, but violates encapsulation, introduces shallow modules, or leaks secrets.
108
-
109
- Reporting both axes side-by-side stops elegance from masking functional bugs, and stops functional completeness from excusing architectural rot.
110
-
111
- ---
112
-
113
- ## Rules
114
-
115
- - **Observe, don't change**: `/check` runs the app and reports. It never edits source or commits. Fixing is `/implement`'s job.
116
- - **Honest over green**: "Failed" and "Could not verify" are valid, valuable outputs. Faking a pass destroys the gate.
117
- - **Check the spec, not vibes**: Verify against documented ACs, not subjective feelings.
126
+ ```
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: complete
3
- description: "[devflow] Wrap up a finished feature, fix, or rollback. Supports Multi-Run: given an optional ID (/complete 12), archives that run from devflow/context/{xxx-slug}/ to devflow/history/, cleans up the run workspace, updates build-plan and HISTORY.md, and makes the work commit. Enforces mandatory user gate (Squash-merge vs MR/PR)."
3
+ description: "[devflow] Wrap up a finished feature, fix, or rollback. Supports Multi-Run: given an optional ID (/complete 12), archives that run from devflow/context/{xxx-slug}/ to devflow/history/, verifies independent review receipt and findings ledger, cleans up the run workspace, updates build-plan and HISTORY.md, and makes the work commit. Enforces mandatory user gate (Squash-merge vs MR/PR)."
4
4
  argument-hint: "[{run-id, number, or name}]"
5
5
  ---
6
6
 
7
7
  # complete - log the finished work, make the work commit, and deliver
8
8
 
9
+ $ARGUMENTS
10
+
9
11
  **First action:** Before project inspection, preflight, or any other tool call,
10
12
  publish `running` to `devflow/.state/run.json` using the dashboard activity
11
13
  contract in `AGENTS.md`.
@@ -28,6 +30,9 @@ passes.
28
30
 
29
31
  ## Before you start
30
32
 
33
+ Read `devflow/config.json`. A missing file means the built-in defaults apply.
34
+ If the file exists but is invalid, stop and point the user to `/doctor`.
35
+
31
36
  Confirm the target work is actually finished: `devflow/context/{xxx-slug}/spec.md`
32
37
  holds a real spec, its steps are built on a branch, and `Verify`, or the fallback
33
38
  build and tests, passes. If any of the
@@ -36,6 +41,19 @@ running app first - don't merge or complete on an unverified claim. Uncommitted
36
41
  expected (per-step checkpoints are optional); this skill commits it. Don't require
37
42
  the steps to be pre-committed.
38
43
 
44
+ Read `devflow/context/{xxx-slug}/review.md` (or `devflow/context/review.md`) when present. A pending,
45
+ changes-requested, malformed, or stale record is always a blocker because the
46
+ user already initiated that gate, even when its configured policy is `manual`.
47
+
48
+ ## Configured regular quality gates
49
+
50
+ Use `qualityGates.regular` for this work item:
51
+
52
+ - **Audit:** `manual` runs only when the user explicitly requests `/audit`; `when-sensitive` runs for sensitive categories; `always` runs for every work item.
53
+ - **Independent review:** `manual` runs only when explicitly requested (`/audit independent current`); `when-sensitive` requires it for sensitive domains; `always` requires it for every work item.
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
+ - **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
+
39
57
  ## Step 0 - final safety pass
40
58
 
41
59
  Before logging or committing, run a short safety pass and report blockers only:
@@ -47,15 +65,12 @@ Before logging or committing, run a short safety pass and report blockers only:
47
65
  declared test command and the change touched logic
48
66
  - behavioral done-whens have `/check` evidence or equivalent proof, and there is
49
67
  a clear manual try path
50
- - if workflow files changed, `.agents` and `.claude` stayed in sync where both
51
- adapters exist
68
+ - any check required by `qualityGates.regular` has evidence, and there is a clear manual try path
69
+ - a selected independent-review gate has a `passed` receipt in `review.md` whose target equals `HEAD`, whose spec hash matches, and whose receipt is current. Any mismatch is stale and blocks completion.
70
+ - if workflow files changed, `.agents` and `.claude` stayed in sync where both adapters exist
52
71
  - no P0 or P1 finding in `devflow/context/{xxx-slug}/findings.md` is `open` or `fixed`.
53
72
  `fixed` still blocks on purpose: the repair exists but no review has looked at
54
- it - run `/audit` to close it. The only waivers are `accepted` (the user's
55
- explicit decision in the current chat, reason recorded; never set it for
56
- them) or `invalid` (an `/audit` re-examination verdict with recorded
57
- evidence, or the user's explicit call). A missing ledger file means no
58
- findings.
73
+ it - run `/audit` to close it. The only waivers are `accepted` or `invalid`.
59
74
 
60
75
  Do not claim "passed", "verified", or "working" without naming the command,
61
76
  route, screenshot, or output that proves it. Stop before Step 1 if required
@@ -71,20 +86,14 @@ and records the exact target feature, archive, commit, and parent.
71
86
  - **Fix** - archive `devflow/context/{xxx-slug}/spec.md` to `devflow/history/fixes/{xxx-slug}.md`, and record an entry into `devflow/history/HISTORY.md`.
72
87
  - **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`.
73
88
 
74
- **Archive resolved findings.** If `devflow/context/{xxx-slug}/findings.md` holds any
75
- findings, append a `## Findings` section to the archive file just written with
76
- every `closed`, `accepted`, or `invalid` entry at its final status (`accepted`
77
- entries keep their recorded reason). Do not archive or remove a `fixed` finding
78
- at any severity; repaired findings must remain in the ledger until an `/audit`
79
- re-review closes them.
89
+ **Archive resolved findings & review receipts.**
90
+ - 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.
80
92
 
81
93
  **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/`.
82
94
 
83
95
  **Discard consumed prototypes.** If this feature built the look from `prototypes/`
84
- - its Design reference pointed there and an early step ported `prototypes/theme.css`
85
- into the app - delete the `prototypes/` folder now. The tokens live in the real
86
- stylesheet and the HTML mockups were always throwaway; fold the deletion into this
87
- feature's commit. Skip this if the feature didn't consume prototypes.
96
+ delete the `prototypes/` folder now.
88
97
 
89
98
  ## Step 2 - make the work commit on feature branch
90
99
 
@@ -127,24 +136,4 @@ Present the user with two clear delivery options:
127
136
  ## Step 4 - Finish & Try Path
128
137
 
129
138
  Point the user at `/feature`, `/fix`, or `/rollback` for the next task.
130
-
131
- Finish with a concise **How to try it** note for the completed work. For a
132
- rollback, explain how to confirm the removed behavior is gone and name one
133
- unaffected regression path. If the
134
- manual path is more than a couple of steps, tell the user to run `/try latest`;
135
- that command can read the archived feature from history.
136
-
137
- ## Rules
138
-
139
- - **Mandatory User Confirmation Gate**: Always ask before choosing between Team MR/PR Push vs Direct Squash-Merge.
140
- - **Never auto-merge into main/master**: The decision to merge into `main` or `master` belongs strictly to the user.
141
- - The work item is the unit of history: one squashed feature, fix, or rollback
142
- commit, even if the branch carried several checkpoint commits.
143
- - A rollback preserves the original feature archive and adds a separate rollback
144
- archive. Never rewrite history to make the feature look as if it never existed.
145
- - Don't merge or push unfinished or failing work. The documented `Verify` command, or
146
- the fallback build and tests, must pass first.
147
- - Never merge or push while a P0 or P1 finding is `open` or `fixed` in the ledger.
148
- - Pushing to remote is always explicit: confirm before running `git push`.
149
- - One item per completion. If a parent feature still has unchecked sub-features,
150
- leave the parent unchecked.
139
+ Finish with a concise **How to try it** note for the completed work.
@@ -88,9 +88,21 @@ Where this sits in the workflow:
88
88
  ### 2.4 Apply Continuous Quality Gates
89
89
  ตรวจสอบตามการตั้งค่า `qualityGates.continuous` ใน `devflow/config.json`:
90
90
  - **Audit**: `manual` (ข้ามอัตโนมัติ), `when-sensitive` (รันเมื่อแตะ Auth/Security/Database/Secrets), `always` (รันทุกฟีเจอร์)
91
+ - **Independent Review**: อ่าน `qualityGates.continuous.independentReview`; `manual` คือ opt-in, `always` บังคับทุกฟีเจอร์, และ `when-sensitive` บังคับเมื่อฟีเจอร์แตะ authentication, authorization, secrets, payments, personal data, destructive operations, dependencies, deployment หรือ security boundary อื่น บันทึกคำตัดสินและหลักฐานต่อฟีเจอร์ใน spec
91
92
  - **Check**: `manual` (ข้ามอัตโนมัติ), `when-behavioral` (รันเมื่อมี Runtime Behavior เช่น UI/CLI/API), `always` (รันทุกฟีเจอร์)
92
93
  - **Try Guide**: `manual` (ข้ามอัตโนมัติ), `when-user-facing` (สร้าง Try Guide เมื่อเป็น UI/CLI), `always` (สร้างทุกฟีเจอร์)
93
94
 
95
+ ทุก 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
100
+
101
+ สำหรับฟีเจอร์ browser-facing ให้รัน `npm run test:browser` เมื่อมี
102
+ `test:browser` script และเก็บ interactive evidence ผ่าน `browseros-neo` เมื่อ
103
+ พร้อมใช้งาน หาก script หรือ MCP ไม่มี ให้บันทึก limitation และหยุดเมื่อ evidence
104
+ นั้นเป็น gate ที่จำเป็น ห้ามติดตั้งหรืออ้างผลโดยปริยาย
105
+
94
106
  ### 2.5 Repair Findings
95
107
  - ซ่อมแซม Finding ระดับ P0/P1 ที่เกิดขึ้นจากฟีเจอร์นี้โดยอัตโนมัติ (ไม่เกิน `continuous.maxRepairAttempts` ครั้ง)
96
108
  - หากไม่สามารถซ่อมแซมได้ หรือมี P0/P1 ค้างอยู่ ให้หยุดการทำงานทันที
@@ -39,12 +39,16 @@ Gather these, then summarize. Do not dump file contents.
39
39
  `devflow/history/rollbacks/`. A missing rollback folder on a legacy
40
40
  installation is a warning, not a blocker; `/complete` creates it on the
41
41
  first rollback.
42
- - Check `devflow/context/findings.md`. Missing on a legacy installation is
43
- a warning, not a blocker; `/audit` and `/complete` create it on first use.
42
+ - Check `devflow/context/findings.md` and `devflow/context/{xxx-slug}/findings.md`.
43
+ Missing on a legacy installation is a warning, not a blocker; `/audit` and `/complete` create it on first use.
44
44
  When present, confirm its entry headers still match
45
45
  `### <id> [<severity>] <status> - <title>` and warn on a malformed ledger.
46
46
  Report any P0 or P1 finding still `open` or `fixed` by ID, since it will
47
47
  block `/complete`. Never block on the ledger yourself.
48
+ - Check `devflow/context/review.md` and `devflow/context/{xxx-slug}/review.md`. Missing is a
49
+ warning, not a blocker; `/audit independent current` and `/complete` create
50
+ it on first use. When present, validate the required request or receipt
51
+ fields and report pending, changes-requested, malformed, or stale state.
48
52
  - If `.gitignore` marks DevFlow workflow files as local-only, still require
49
53
  the files to exist on disk. Ignored but present is healthy; ignored and
50
54
  missing means the local workflow needs to be restored.
@@ -53,7 +57,8 @@ Gather these, then summarize. Do not dump file contents.
53
57
  file with `schemaVersion: 1`. Reject unknown keys and unsupported values.
54
58
  Report the effective workflow, git, verification, regular quality-gate,
55
59
  Continuous quality-gate, and Continuous Mode settings. Confirm each audit,
56
- check, and try-guide gate uses its supported values and defaults to `manual`.
60
+ independent-review, check, and try-guide gate uses its supported values and
61
+ defaults to `manual`.
57
62
  An invalid config is a setup blocker for mutating workflow skills because
58
63
  they must not guess which policy to follow.
59
64
  2. **Tool adapters**
@@ -61,7 +66,6 @@ Gather these, then summarize. Do not dump file contents.
61
66
  logical adapters: Codex, Claude Code, GitHub Copilot, Antigravity, and OpenCode.
62
67
  - Confirm at least one compatible skill tree exists. Codex, Antigravity, and
63
68
  GitHub Copilot use `.agents/skills/`. Claude Code uses `.claude/skills/`.
64
- OpenCode can use either tree.
65
69
  - If both skill trees are present, say that is healthy when the selected
66
70
  tools require both. Compare their skill folder names and warn about missing
67
71
  skills on either side.
@@ -151,6 +151,27 @@ discarded at `/complete`.
151
151
 
152
152
  This is a draft. Don't present it yet - critique it first.
153
153
 
154
+ ### Quality-gate and browser-evidence plan
155
+
156
+ Before finishing the draft, read `devflow/config.json` and record the effective
157
+ `qualityGates.regular.independentReview` policy in the spec. `manual` does not
158
+ activate an automatic gate, `always` does, and `when-sensitive` activates it
159
+ only when the feature touches authentication, authorization, secrets, payments,
160
+ personal data, destructive operations, dependencies, deployment, or another
161
+ security-sensitive boundary. Record the sensitivity decision and its evidence;
162
+ do not silently choose the conditional result later.
163
+
164
+ When the gate is active, add an explicit post-implementation handoff to
165
+ `audit independent current`. The receipt must be produced from a fresh reviewer
166
+ context after the final product/spec change; `/feature` only plans this handoff
167
+ and never fabricates or pre-approves a receipt.
168
+
169
+ Also inspect the repository's declared scripts and the feature behavior. If the
170
+ feature is browser-facing and `test:browser` exists, put `npm run test:browser`
171
+ in the verification matrix. Record an interactive `browseros-neo` handoff for
172
+ observable UI behavior when that MCP is available. If either capability is
173
+ absent, record it as unavailable instead of installing or claiming evidence.
174
+
154
175
  ## Step 4 - red-team the draft, then tighten
155
176
 
156
177
  Before the user reads it, turn on the spec yourself and try to break it. The
@@ -211,4 +232,4 @@ checked), archive the finished `devflow/context/{xxx-slug}/spec.md` to
211
232
 
212
233
  Format the output to match the project's conventions in
213
234
  `devflow/context/ai-interaction.md`: concise, scannable markdown, with lists for
214
- enumerations and tables for matrices rather than dense paragraphs.
235
+ enumerations and tables for matrices rather than dense paragraphs.