@jakkrichm/create-nexus-devflow 2.0.25 → 2.0.27

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 (122) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/create-nexus-devflow.d.ts +18 -1
  3. package/dist/bin/create-nexus-devflow.js +439 -11
  4. package/dist/bin/create-nexus-devflow.js.map +1 -1
  5. package/dist/lib/command-catalog.d.ts +11 -0
  6. package/dist/lib/command-catalog.js +63 -0
  7. package/dist/lib/command-catalog.js.map +1 -0
  8. package/dist/lib/current-work.js +94 -48
  9. package/dist/lib/current-work.js.map +1 -1
  10. package/dist/lib/dashboard-page.d.ts +2 -0
  11. package/dist/lib/dashboard-page.js +201 -0
  12. package/dist/lib/dashboard-page.js.map +1 -0
  13. package/dist/lib/dashboard-snapshot.d.ts +49 -0
  14. package/dist/lib/dashboard-snapshot.js +96 -0
  15. package/dist/lib/dashboard-snapshot.js.map +1 -0
  16. package/dist/lib/dashboard.d.ts +2 -0
  17. package/dist/lib/dashboard.js +360 -8
  18. package/dist/lib/dashboard.js.map +1 -1
  19. package/dist/lib/discoveries.d.ts +19 -0
  20. package/dist/lib/discoveries.js +81 -0
  21. package/dist/lib/discoveries.js.map +1 -0
  22. package/dist/lib/doctor.d.ts +26 -0
  23. package/dist/lib/doctor.js +474 -0
  24. package/dist/lib/doctor.js.map +1 -0
  25. package/dist/lib/findings.d.ts +26 -2
  26. package/dist/lib/findings.js +165 -1
  27. package/dist/lib/findings.js.map +1 -1
  28. package/dist/lib/gatekeeper.d.ts +19 -0
  29. package/dist/lib/gatekeeper.js +77 -0
  30. package/dist/lib/gatekeeper.js.map +1 -0
  31. package/dist/lib/git-hooks.d.ts +16 -0
  32. package/dist/lib/git-hooks.js +78 -0
  33. package/dist/lib/git-hooks.js.map +1 -0
  34. package/dist/lib/history.d.ts +6 -1
  35. package/dist/lib/history.js +98 -11
  36. package/dist/lib/history.js.map +1 -1
  37. package/dist/lib/ideas.d.ts +26 -0
  38. package/dist/lib/ideas.js +179 -0
  39. package/dist/lib/ideas.js.map +1 -0
  40. package/dist/lib/status.d.ts +2 -0
  41. package/dist/lib/status.js +60 -6
  42. package/dist/lib/status.js.map +1 -1
  43. package/dist/lib/update.js +2 -2
  44. package/dist/lib/update.js.map +1 -1
  45. package/dist/lib/version-check.d.ts +22 -0
  46. package/dist/lib/version-check.js +59 -0
  47. package/dist/lib/version-check.js.map +1 -0
  48. package/dist/lib/workflow-state.d.ts +23 -0
  49. package/dist/lib/workflow-state.js +112 -0
  50. package/dist/lib/workflow-state.js.map +1 -0
  51. package/dist/scripts/prepare-template.js +3 -3
  52. package/package.json +1 -1
  53. package/template/{.claude/skills/00-discover → .agents/skills/00-explore}/SKILL.md +10 -10
  54. package/template/.agents/skills/10-define/SKILL.md +4 -4
  55. package/template/.agents/skills/20-spec/SKILL.md +2 -3
  56. package/template/.agents/skills/30-plan/SKILL.md +2 -3
  57. package/template/.agents/skills/40-execute/SKILL.md +2 -2
  58. package/template/.agents/skills/50-verify/SKILL.md +2 -2
  59. package/template/.agents/skills/60-report/SKILL.md +3 -3
  60. package/template/{.claude/skills/70-release → .agents/skills/70-deliver}/SKILL.md +7 -13
  61. package/template/.agents/skills/adopt/SKILL.md +136 -73
  62. package/template/.agents/skills/audit/SKILL.md +275 -0
  63. package/template/.agents/skills/autopilot/SKILL.md +228 -147
  64. package/template/.agents/skills/brainstorm/SKILL.md +3 -3
  65. package/template/.agents/skills/brief/SKILL.md +74 -51
  66. package/template/.agents/skills/check/SKILL.md +96 -76
  67. package/template/.agents/skills/ci/SKILL.md +140 -61
  68. package/template/.agents/skills/complete/SKILL.md +156 -101
  69. package/template/.agents/skills/convert-any-to-md/SKILL.md +2 -2
  70. package/template/.agents/skills/debug/SKILL.md +124 -49
  71. package/template/.agents/skills/devflow/SKILL.md +16 -10
  72. package/template/.agents/skills/discovery/SKILL.md +166 -0
  73. package/template/.agents/skills/doctor/SKILL.md +188 -72
  74. package/template/.agents/skills/feature/SKILL.md +195 -102
  75. package/template/.agents/skills/fix/SKILL.md +41 -90
  76. package/template/.agents/skills/idea/SKILL.md +3 -3
  77. package/template/.agents/skills/implement/SKILL.md +189 -46
  78. package/template/.agents/skills/onboard/SKILL.md +215 -85
  79. package/template/.agents/skills/overview/SKILL.md +51 -85
  80. package/template/.agents/skills/prototype/SKILL.md +82 -27
  81. package/template/.agents/skills/release/SKILL.md +160 -0
  82. package/template/.agents/skills/report-html/SKILL.md +2 -2
  83. package/template/.agents/skills/rollback/SKILL.md +123 -77
  84. package/template/.agents/skills/status/SKILL.md +109 -0
  85. package/template/.agents/skills/test/SKILL.md +2 -2
  86. package/template/.agents/skills/tests/SKILL.md +126 -0
  87. package/template/.agents/skills/try/SKILL.md +77 -65
  88. package/template/{.agents/skills/00-discover → .claude/skills/00-explore}/SKILL.md +9 -9
  89. package/template/.claude/skills/10-define/SKILL.md +2 -2
  90. package/template/.claude/skills/20-spec/SKILL.md +1 -1
  91. package/template/.claude/skills/30-plan/SKILL.md +1 -1
  92. package/template/.claude/skills/60-report/SKILL.md +1 -1
  93. package/template/{.agents/skills/70-release → .claude/skills/70-deliver}/SKILL.md +6 -12
  94. package/template/.claude/skills/adopt/SKILL.md +2 -2
  95. package/template/.claude/skills/audit/SKILL.md +141 -0
  96. package/template/.claude/skills/autopilot/SKILL.md +74 -52
  97. package/template/.claude/skills/brief/SKILL.md +67 -45
  98. package/template/.claude/skills/ci/SKILL.md +1 -1
  99. package/template/.claude/skills/complete/SKILL.md +1 -1
  100. package/template/.claude/skills/debug/SKILL.md +1 -1
  101. package/template/.claude/skills/devflow/SKILL.md +7 -7
  102. package/template/.claude/skills/discovery/SKILL.md +145 -0
  103. package/template/.claude/skills/doctor/SKILL.md +1 -1
  104. package/template/.claude/skills/feature/SKILL.md +67 -18
  105. package/template/.claude/skills/fix/SKILL.md +1 -1
  106. package/template/.claude/skills/idea/SKILL.md +2 -2
  107. package/template/.claude/skills/onboard/SKILL.md +3 -3
  108. package/template/.claude/skills/overview/SKILL.md +39 -88
  109. package/template/.claude/skills/prototype/SKILL.md +1 -1
  110. package/template/.claude/skills/release/SKILL.md +171 -0
  111. package/template/.claude/skills/rollback/SKILL.md +2 -2
  112. package/template/AGENTS.md +5 -5
  113. package/template/devflow/build-plan.md +40 -0
  114. package/template/devflow/context/ai-interaction.md +4 -4
  115. package/template/devflow/context/coding-standards.md +3 -3
  116. package/template/devflow/context/current-stage.md +1 -1
  117. package/template/devflow/context/findings.md +1 -1
  118. package/template/devflow/history/HISTORY.md +2 -2
  119. package/template/devflow/project-plan.md +27 -0
  120. package/template/devflow/reference/mockup.html +476 -0
  121. package/template/devflow/reference/project-overview-template.md +39 -0
  122. package/template/devflow/reference/running-id-contract.md +24 -2
@@ -0,0 +1,275 @@
1
+ ---
2
+ name: audit
3
+ description: "[devflow][B] Read-only code audit for a Blueprint project, except for the findings ledger it maintains at devflow/context/findings.md. Reviews the active feature, changed files, a selected path, or the full project through all concerns or a focused quality, security, performance, or tests lens. Use when the user runs /audit, invokes $audit, asks for a code or quality audit, security review, performance review, test quality review, dead-code or duplication check, vibe-coded project cleanup, or standards review."
4
+ ---
5
+
6
+ # audit - review code quality against the project standards
7
+
8
+ Where this sits in the workflow:
9
+
10
+ /implement or /autopilot -> [audit] -> fixes or /complete
11
+ (code exists) (review + (repair quality issues
12
+ ledger) or close the feature)
13
+
14
+ `/check` proves behavior against the spec. `/doctor` checks Blueprint setup and
15
+ workflow health. This skill checks the code itself through either a broad review
16
+ or one focused lens: quality, security, performance, or tests.
17
+
18
+ It reviews code without changing it: it never edits source files, installs
19
+ dependencies, commits, merges, pushes, or starts product work. Its one write is
20
+ the findings ledger at `devflow/context/findings.md` (Step 4), the durable
21
+ record of findings and their status.
22
+
23
+ ## Input
24
+
25
+ Treat scope and lens as separate controls. Arguments may appear in either order,
26
+ such as `/audit security current` or `/audit src/auth tests`.
27
+
28
+ Optional scope:
29
+
30
+ - no scope argument: use `current` when an active feature exists, otherwise use
31
+ `changed` when local changes exist, otherwise use `full`
32
+ - `current`: audit the active `current-feature.md`, every committed feature-branch
33
+ change from its merge base through `HEAD`, staged and unstaged changes,
34
+ untracked source files, and nearby code affected by the feature
35
+ - `changed`: audit staged, unstaged, and untracked source files plus nearby code
36
+ - `full`: audit all project-owned source, tests, and configuration while excluding
37
+ dependencies, generated files, build output, coverage output, caches, vendored
38
+ code, and minified assets unless the user explicitly includes them
39
+ - path or directory: audit that area and the tests or callers needed to understand it
40
+
41
+ Optional lens:
42
+
43
+ - no lens: review all four lenses
44
+ - `quality`: maintainability, duplication, dead code, consistency, complexity,
45
+ and standards drift
46
+ - `security`: authorization, input trust, injection, data exposure, secret
47
+ handling, and unsafe configuration
48
+ - `performance`: query, network, rendering, memory, payload, concurrency, and
49
+ unbounded-work risks
50
+ - `tests`: missing coverage for important logic, weak assertions, skipped or
51
+ focused tests, poor isolation, brittle mocks, and likely flakiness
52
+
53
+ `full` is always the full-project scope, not a lens. `/audit full` therefore runs
54
+ all lenses across the full project. When only a lens is supplied, select scope
55
+ with the normal no-scope rules. A focused pass may name one or more lenses. If
56
+ the request names multiple lenses, review their union and report them separately.
57
+
58
+ If the requested scope is unclear, pick the smallest useful scope and state it.
59
+ If the lens is unclear, use all lenses and state that choice.
60
+
61
+ ## Step 1 - gather context
62
+
63
+ Read:
64
+
65
+ - `AGENTS.md`
66
+ - `devflow/context/project-overview.md`
67
+ - `devflow/context/coding-standards.md`
68
+ - `devflow/context/current-feature.md`
69
+ - `devflow/context/findings.md`, for existing IDs and statuses
70
+ - `devflow/context/ai-interaction.md`
71
+ - `devflow/build-plan.md`, when feature order matters
72
+ - git branch and working tree status
73
+ - relevant source files, tests, and configs for the chosen scope
74
+
75
+ For `current`, resolve the comparison base without network access:
76
+
77
+ 1. Use a base branch declared by the active spec or project instructions.
78
+ 2. Otherwise use the locally recorded remote default branch when available.
79
+ 3. Otherwise use an existing local `main`, then `master`.
80
+ 4. Find the merge base and inspect the committed delta through `HEAD`, then add
81
+ staged, unstaged, and untracked work.
82
+ 5. If no reliable base exists, say so and use the active spec plus local changes.
83
+ Never claim that committed feature work was fully covered in that case.
84
+
85
+ Do not fetch or pull to discover the base. For `full`, state the excluded paths
86
+ before reviewing so generated or third-party code does not consume the audit.
87
+
88
+ Prefer `rg` and targeted file reads. Do not dump large files into the response.
89
+
90
+ ## Step 2 - run available signals
91
+
92
+ Use existing commands only. Do not install tools.
93
+
94
+ Run or inspect only the signals relevant to the selected lens and scope:
95
+
96
+ - lint and typecheck commands when declared and relevant
97
+ - test command for the tests lens or when it directly validates a suspected risk
98
+ - build command when the selected lens needs compilation or bundle evidence
99
+ - existing security command for the security lens, when declared and locally runnable
100
+ - existing performance command for the performance lens, when declared and locally runnable
101
+ - targeted lightweight searches for the chosen lens, such as unused exports and
102
+ copied logic for quality, unsafe trust boundaries for security, repeated or
103
+ unbounded work for performance, and skipped or weak tests for tests
104
+
105
+ Do not run broad checks unrelated to a focused lens. If a useful command is
106
+ missing, report that as a gap. Do not invent a pass or claim that a focused
107
+ review covered the other lenses.
108
+
109
+ ## Step 3 - review the code
110
+
111
+ For all lenses, ground findings in reachable code and project-specific
112
+ expectations. Apply only the selected lens or lenses:
113
+
114
+ - **Quality:** duplicated logic, dead or unused code, unreachable paths,
115
+ oversized modules, abstractions that do not pay for themselves, risky missing
116
+ abstractions, inconsistent patterns, and drift from the standards or spec.
117
+ - **Security:** missing authentication or authorization, client-controlled
118
+ ownership, injection, unsafe parsing or deserialization, sensitive-data
119
+ exposure, secret handling, insecure defaults, and trust-boundary mistakes.
120
+ Inspect existing dependency or scanner output when available, but never imply
121
+ that local manifest inspection is a current vulnerability scan.
122
+ - **Performance:** N+1 queries, repeated network or database work, unnecessary
123
+ rendering, blocking work on hot paths, unbounded loops or collections, memory
124
+ growth, oversized payloads, missing pagination, and unsafe concurrency. Mark
125
+ hypotheses as unverified when runtime or profiling evidence is missing.
126
+ - **Tests:** important logic without coverage when a test command exists, weak
127
+ assertions, tests that only mirror implementation, excessive mocking, shared
128
+ state, time or order dependence, skipped or focused tests, placeholder tests,
129
+ swallowed failures, and missing browser or integration evidence where behavior
130
+ crosses a real boundary. Never invent a coverage percentage.
131
+
132
+ Do not nitpick harmless style differences unless they signal drift from the local
133
+ patterns. Prefer a short list of real findings over a broad list of guesses.
134
+
135
+ Do not broaden a focused pass because another category might be interesting.
136
+ Do not report or call out non-critical concerns from omitted lenses, even as
137
+ suggestions for a later audit. If an obvious P0 is directly encountered outside
138
+ the selected lens, report and record it as an out-of-lens critical risk, but do
139
+ not continue searching that other lens.
140
+
141
+ If a possible secret is found, never quote its value, paste the matching source
142
+ line, or include raw command output containing it. Report only the redacted secret
143
+ category, file, line, risk, and remediation. Redact sensitive values from all
144
+ audit evidence before responding.
145
+
146
+ ## Step 4 - update the findings ledger
147
+
148
+ `devflow/context/findings.md` is the durable record of findings. Chat reports
149
+ do not survive a context clear; the ledger does. It is the only file this skill
150
+ writes. If it is missing (an older install), create it with a `# Findings`
151
+ heading first.
152
+
153
+ **The ledger never scopes the review.** Review the code fresh in Step 3, then
154
+ record what the review found. Working from the open findings as a checklist and
155
+ verifying only those is the exact failure this file exists to prevent: a repair
156
+ can introduce a new defect that no existing entry points at.
157
+
158
+ One block per finding. The header line is the machine-readable contract and must
159
+ keep this exact shape; the prose below it is for humans and may vary:
160
+
161
+ ### F-03 [P0] open - Retained auth volumes carry the run label
162
+
163
+ **File:** ops/agent-proof/compose.yaml:86
164
+ **Found:** 2026-07-21 by /audit (scope: current; lens: security)
165
+ **Why it matters:** ...
166
+ **Suggested fix:** ...
167
+ **Resolution:**
168
+
169
+ IDs are sequential within the ledger (`F-01`, `F-02`, ...), never reused and
170
+ never renumbered while their entries live here, even after a finding closes.
171
+ Bare IDs are scoped to the live ledger: `/complete` archives resolved entries
172
+ under a work-item prefix (feature 12's `F-03` becomes `12/F-03`), and that
173
+ prefixed form is the permanent reference. A later ledger that has emptied and
174
+ reset starts at `F-01` again without colliding. Severity reuses the P0-P3
175
+ scheme from Step 5; only P0 and P1 block `/complete`. Status is one of:
176
+
177
+ | Status | Meaning | Blocks P0/P1 at /complete |
178
+ |---|---|---|
179
+ | `unverified` | Suspected, no confirming evidence yet | No |
180
+ | `open` | Confirmed, not yet repaired | Yes |
181
+ | `fixed` | Repaired, not yet re-reviewed | Yes |
182
+ | `closed` | Repaired and re-reviewed against the new code | No |
183
+ | `accepted` | Not fixing, by the user's explicit decision; reason recorded in Resolution | No |
184
+ | `invalid` | Re-examination proved the finding wrong; evidence recorded in Resolution | No |
185
+
186
+ After the review:
187
+
188
+ - Append each new confirmed finding as `open` with the next sequential ID, one
189
+ past the highest ID present in the ledger (entries carried forward from
190
+ earlier work count; a fresh ledger starts at `F-01`).
191
+ - Record an unverified risk worth tracking as `unverified`. It is a lead, not a
192
+ defect, and never gates a merge.
193
+ - Update the entries this pass re-examined: correct the status or severity and
194
+ note the evidence in **Resolution**.
195
+ - Move a `fixed` finding to `closed` only when all three hold: this pass's
196
+ reviewed set included the finding's file, re-examining the repaired code
197
+ confirmed the original defect is gone and the repair introduced no new one,
198
+ and the report names the finding as closed. An unrelated new finding in the
199
+ same file gets its own entry and does not keep the repaired one open. Never
200
+ close a finding implicitly.
201
+ - Set `accepted` only on the user's explicit decision in the current session,
202
+ and record their reason. Never accept a finding on their behalf.
203
+ - Set `invalid` only when re-examination shows the finding was wrong, and
204
+ record that evidence in **Resolution**. It is a review verdict (or the
205
+ user's explicit call), never a shortcut past the gate for blocked work.
206
+
207
+ `fixed` blocking `/complete` is deliberate: a repair is not done when the code
208
+ changes, it is done when a review has looked at the result. `/implement` marks
209
+ repairs `fixed`; only a review pass moves them to `closed`.
210
+
211
+ ## Step 5 - report findings
212
+
213
+ Lead with findings, ordered by severity, using the IDs the ledger assigned:
214
+
215
+ F-04 [P1] Title
216
+ File: path:line
217
+ Why it matters: ...
218
+ Suggested fix: ...
219
+
220
+ Severity:
221
+
222
+ - `P0` - data loss, security break, or code that cannot ship
223
+ - `P1` - likely bug, broken contract, missing guard, or high-risk duplication
224
+ - `P2` - maintainability issue worth fixing before the feature closes
225
+ - `P3` - small cleanup, consistency issue, or follow-up candidate
226
+
227
+ Use P0 or P1 only when a concrete code path, violated contract or security
228
+ boundary, failing command or test, or reproducible behavior confirms the risk. If
229
+ the evidence is incomplete, list it under `Unverified risks` with the missing
230
+ validation instead of presenting it as a confirmed high-severity finding.
231
+
232
+ If there are no findings, say that clearly for the selected lens and name any
233
+ remaining risk or missing signal, such as "no test command declared" or
234
+ "browser flow not audited."
235
+
236
+ Then include:
237
+
238
+ - ledger changes: findings added, updated, or closed this pass, by ID
239
+ - commands run and results
240
+ - selected scope
241
+ - selected lens or lenses
242
+ - base branch, merge base, and commit range for `current`, when available
243
+ - files or directories reviewed
244
+ - generated, third-party, or otherwise excluded paths
245
+ - applicable standards checked
246
+ - browser or runtime evidence inspected, when relevant
247
+ - skipped, focused, or placeholder tests found, when the tests lens was selected
248
+ - checks that were unavailable or could not run
249
+ - suggested repair order
250
+
251
+ For `full`, say whether coverage was complete or partial. Never label a partial
252
+ review as a full-project audit.
253
+
254
+ ## Rules
255
+
256
+ - The findings ledger is the only file this skill writes. Never edit, format,
257
+ install, commit, merge, push, or delete anything else.
258
+ - A focused lens is not a broad audit. State what was not reviewed and never
259
+ imply that omitted lenses passed.
260
+ - The ledger reports status; it never defines what the review looks at. Do not
261
+ turn open findings into the review checklist.
262
+ - Never fetch, pull, or run network-backed audit tools without explicit approval.
263
+ - Never reproduce secrets or sensitive values in findings or command output.
264
+ - Findings first. Keep summaries short.
265
+ - Ground every finding in a file path and line number when possible.
266
+ - Avoid speculative rewrites. Recommend the smallest fix that removes the risk.
267
+ - Respect existing project patterns over generic advice.
268
+ - Do not require perfection. The goal is code that is understandable, consistent,
269
+ testable where it matters, and safe to keep building on.
270
+
271
+ ## Formatting
272
+
273
+ Format the output to match the project's conventions in
274
+ `devflow/context/ai-interaction.md`: concise, scannable markdown, with lists for
275
+ enumerations and tables for matrices rather than dense paragraphs.
@@ -1,175 +1,256 @@
1
1
  ---
2
2
  name: autopilot
3
- description: "[Devflow] Optional explicit mode for one bounded spec/plan/implement/verify/report pass with checkpoint commits and review packet."
3
+ description: "[devflow][B] Optional explicit Blueprint mode for one bounded spec/build/check/audit pass. It can pick or resume the current feature, write the spec when needed, create or reuse the branch, implement small steps, run build/tests/checks, create checkpoint commits after passing steps, audit changed code, repair confirmed high-severity findings, and stop with a review packet. It never completes, merges, pushes, deploys, publishes, sends, or performs destructive actions without explicit approval. Use only when the user explicitly runs /autopilot, invokes $autopilot, or directly asks for Autopilot."
4
4
  ---
5
5
 
6
- # autopilot - Autonomous Bounded DevFlow Loop
6
+ # autopilot - optional Blueprint loop
7
7
 
8
8
  Where this sits in the workflow:
9
9
 
10
- ```text
11
- devflow -> [autopilot] -> review packet -> 70-release
12
- (where (spec, plan, (human review, (package, PR,
13
- are we?) build, verify, walkthrough) merge with approval)
14
- report)
15
- ```
10
+ /status -> [autopilot] -> review packet -> /complete
11
+ (where (spec, build, (human review, (log, commit,
12
+ are we?) check, audit) fixes if needed) merge with approval)
16
13
 
17
- Autopilot is an explicit opt-in execution skill for Nexus-DevFlow 2.0. It runs a single bounded loop across the delivery lifecycle (**`20-spec` -> `30-plan` -> `40-execute` -> `50-verify` -> `60-report`**) without requiring human confirmation between every sub-step.
14
+ Autopilot is an explicit opt-in path. It uses the same Blueprint files and the
15
+ same quality gates, but it does not stop after every normal review point. A
16
+ single user request is permission to run one bounded loop until the feature is
17
+ ready for review, blocked, or unsafe to continue.
18
18
 
19
- It does **not** replace the normal step-by-step workflow. Mainline commands (`20-spec`, `30-plan`, `40-execute`, `50-verify`, `60-report`, `70-release`) remain the conservative default.
19
+ It does **not** replace the normal workflow. `/feature`, `/implement`, `/check`,
20
+ and `/complete` remain the conservative default.
20
21
 
21
- Do not suggest Autopilot as the default next action. Use it only when the user explicitly asks for it.
22
+ Do not suggest Autopilot as the default next action. Use it only when the user
23
+ explicitly asks for it.
22
24
 
23
- The explicit Autopilot request is permission to create checkpoint commits on the feature or fix branch after passing implementation steps. It is **not** permission to merge into `main`, push to remote, deploy, publish, delete data, or run destructive actions.
25
+ The explicit Autopilot request is permission to create checkpoint commits on the
26
+ feature or fix branch after passing implementation steps. It is not permission to
27
+ merge, push, deploy, publish, send, delete data, or run destructive actions.
24
28
 
25
29
  ## Input
26
30
 
27
31
  Common forms:
28
32
 
29
- - **No argument**: resume the active run in `devflow/context/current-stage.md`, or target the next planned run/feature in `devflow/context/project-overview.md`.
30
- - **Running ID or feature name**: target that run, e.g. `autopilot RUN-004` or `autopilot "add user authentication"`.
31
- - **`fix "<issue>"`**: write and execute an ad-hoc fix run.
32
- - **`resume`**: continue the current active run on its existing branch.
33
+ - No argument: resume the current feature if one exists, otherwise target the next
34
+ unchecked build-plan item.
35
+ - A number or name: target that build-plan feature, for example `/autopilot 3` or
36
+ `$autopilot "directory listing"`.
37
+ - `fix "<issue>"`: write and build an ad-hoc fix spec.
38
+ - `resume`: continue the current feature on its existing branch.
33
39
 
34
- If the requested target conflicts with a run already in progress, stop and ask which one should win. Do not overwrite active stage artifacts silently.
40
+ If the requested target conflicts with a feature already in progress, stop and
41
+ ask which one should win. Do not overwrite `devflow/context/current-feature.md`
42
+ silently.
35
43
 
36
- > [!IMPORTANT]
37
- > Rollback is intentionally excluded from Autopilot. If the request is a rollback or the stage is marked Rollback, stop and direct the user to `rollback` and reviewed `40-execute`. Reversing completed work requires explicit dependency and human review gates.
44
+ Rollback is intentionally excluded from Autopilot. If the request is a rollback
45
+ or `current-feature.md` is marked `Type: Rollback`, stop and direct the user to
46
+ the reviewed `/implement` path. Reversing completed work requires the explicit
47
+ dependency and conflict gates in `/rollback` and `/implement`.
38
48
 
39
- ---
40
-
41
- ## Step 1 - Preflight & Safety Check
49
+ ## Step 1 - preflight like /status
42
50
 
43
- Read the project state:
51
+ Read the same state `/status` reads:
44
52
 
45
- - `AGENTS.md` & `CLAUDE.md`
53
+ - `AGENTS.md`
54
+ - `devflow/project-plan.md`
55
+ - `devflow/build-plan.md`
46
56
  - `devflow/context/project-overview.md`
47
- - `devflow/context/current-stage.md`
57
+ - `devflow/context/current-feature.md`
58
+ - `devflow/context/findings.md`
48
59
  - `devflow/context/coding-standards.md`
49
60
  - `devflow/context/ai-interaction.md`
50
- - `devflow/context/findings.md`
51
61
  - git branch, status, and recent log
52
62
 
53
- Stop before changing files when:
54
-
55
- 1. The repo is not a git repository.
56
- 2. The working tree is dirty with uncommitted changes unrelated to this run.
57
- 3. `current-stage.md` has an active run and the user requested a different target without resolving conflict.
58
- 4. The task requires architectural, financial, auth, billing, or destructive decisions not documented in the context.
59
-
60
- ---
61
-
62
- ## Step 2 - Choose or Write Specification (`20-spec`)
63
-
64
- 1. If `devflow/runs/{running-id}-{slug}20-spec.md` already exists, resume it.
65
- 2. If no spec exists:
66
- - Ensure `10-define.md` exists with locked scope and allocated Running ID.
67
- - Write `20-spec.md` following the DevFlow specification schema.
68
- - Critique and red-team the spec (edge cases, unhappy paths, testable criteria).
69
- - Apply fixes to the spec.
70
-
71
- ---
72
-
73
- ## Step 3 - Branch Setup & Implementation Plan (`30-plan`)
74
-
75
- 1. **Branch Management**:
76
- - Feature: `feature/{slug}-{running-id}`
77
- - Fix: `fix/{slug}-{running-id}`
78
- - Switch to or create the working branch. Never run Autopilot directly on `main` or `master`.
79
- 2. **Planning**:
80
- - Write `devflow/runs/{running-id}-{slug}30-plan.md`.
81
- - Seed `checklists/implementation-checklist.md` and `checklists/verification-checklist.md`.
82
-
83
- ---
84
-
85
- ## Step 4 - Implement in Small Increments (`40-execute`)
86
-
87
- Work through the implementation checklist in order. Each step must remain reviewable.
88
-
89
- For every subtask:
90
-
91
- 1. Implement only that scoped unit.
92
- 2. Run relevant verification (unit tests, typecheck, lint, build).
93
- 3. If UI is involved, inspect behavior, verify console errors and network calls.
94
- 4. Self-review diff against `coding-standards.md`.
95
- 5. Fix issues and rerun failed checks.
96
- 6. Mark the task checked `[x]` in `checklists/implementation-checklist.md`.
97
- 7. **Create a Checkpoint Commit** on the feature/fix branch for the passing step:
98
- ```bash
99
- git add <modified-files> devflow/runs/{running-id}-{slug}/checklists/implementation-checklist.md
100
- git commit -m "feat({running-id}): checkpoint <concise step description>"
101
- ```
102
- 8. Write `devflow/runs/{running-id}-{slug}40-execute.md`.
103
-
104
- ---
105
-
106
- ## Step 5 - Senior QA Verification (`50-verify`)
63
+ Then decide whether it is safe to run.
107
64
 
108
- 1. Execute full project verification commands:
109
- - Framework integrity (`npm run check` or equivalent)
110
- - Static contracts (`npm run check:static` when applicable)
111
- - Project test suite (Unit tests, integration tests)
112
- - Build / Package smoke tests
113
- 2. Update `checklists/verification-checklist.md` with concrete evidence.
114
- 3. Write `devflow/runs/{running-id}-{slug}50-verify.md` with QA verdict (`PASS` / `FAIL`).
115
-
116
- ---
117
-
118
- ## Step 6 - Targeted Quality Audit & Repair
119
-
120
- Review diffs and inspect `devflow/context/findings.md`:
121
-
122
- 1. **Repair confirmed P0 and P1 findings** within the current run scope.
123
- 2. Update finding status in `devflow/context/findings.md`.
124
- 3. Rerun verification tests after repairs.
125
- 4. Create a checkpoint commit for the fix.
126
- 5. If a P0/P1 finding cannot be repaired within scope or fails twice consecutively, stop immediately and report.
127
-
128
- ---
129
-
130
- ## Step 7 - Delivery Digest & Review Packet (`60-report`)
131
-
132
- 1. Write `devflow/runs/{running-id}-{slug}60-report.md`.
133
- 2. Render standalone HTML dashboard `devflow/runs/{running-id}-{slug}60-report.html` (via `md2html` or report generator).
134
- 3. Update `devflow/context/current-stage.md` to indicate ready for `70-release`.
135
- 4. Stop with a concise **Review Packet Dashboard** for human approval.
136
-
137
- ---
138
-
139
- ## 🛑 Strict Hard Stops (Never Exceed)
140
-
141
- Stop immediately and report to the user instead of continuing when Autopilot would need to:
142
-
143
- - Commit directly to `main` or `master`, merge branches, delete branches, or force push.
144
- - Run `git push` to remote repositories.
145
- - Deploy to staging/production or publish packages to npm/registries.
146
- - Delete data, drop databases, or run irreversible destructive migrations.
147
- - Make product, business, or architecture decisions not specified in the context.
148
- - Continue after two failed attempts to fix the same issue (Two-attempt hard stop).
149
-
150
- ---
151
-
152
- ## Output Review Packet Format
153
-
154
- When Autopilot finishes successfully, output a scannable review packet:
155
-
156
- ```markdown
157
- ### 🛸 Autopilot Execution Summary: [{running-id}]
158
-
159
- - **Branch**: `{branch-name}`
160
- - **Target Run**: `{running-id} - {title}`
161
- - **Artifacts Generated**:
162
- - Spec: `devflow/runs/{id}20-spec.md`
163
- - Plan: `devflow/runs/{id}30-plan.md`
164
- - Implement Evidence: `devflow/runs/{id}40-execute.md`
165
- - QA Verify Report: `devflow/runs/{id}50-verify.md`
166
- - Digest Report: `devflow/runs/{id}60-report.md`
167
- - HTML Dashboard: `devflow/runs/{id}60-report.html`
168
- - **Validation & Tests**: `All Passed (Green)`
169
- - **Checkpoint Commits**: `{count} commits created on {branch-name}`
170
- - **Manual QA Walkthrough**: Run `try {running-id}` for human review guide
65
+ Stop before changing files when:
171
66
 
172
- ---
173
- 👉 **Next Recommended Action**:
174
- Inspect diffs and `try` walkthrough, then run `70-release {running-id}` to package, merge, or create PR.
175
- ```
67
+ - The repo is not a git repo.
68
+ - The working tree is dirty and there is no current feature tying those changes
69
+ to this run.
70
+ - `current-feature.md` has real work and the user requested a different target.
71
+ - `project-overview.md` is missing or stale and the planning docs are not clear
72
+ enough to regenerate it.
73
+ - The next feature is visual or replication-heavy and no design reference exists.
74
+ - The task needs product, data, auth, billing, or destructive decisions the docs
75
+ do not answer.
76
+
77
+ If the only issue is that `project-overview.md` is stale and the plans are clear,
78
+ regenerate it using the `/overview` behavior and continue. Include that in the
79
+ final packet.
80
+
81
+ ## Step 2 - choose or write the spec
82
+
83
+ If `devflow/context/current-feature.md` already contains an active spec,
84
+ resume it. Read checked steps and continue from the first unchecked step.
85
+
86
+ If there is no active spec:
87
+
88
+ 1. Use the `/feature` behavior for a planned feature, or `/fix` behavior for a
89
+ requested fix.
90
+ 2. Write `devflow/context/current-feature.md`.
91
+ 3. Red-team the spec before building:
92
+ - missing unhappy paths
93
+ - oversized steps
94
+ - undefined contracts
95
+ - missing design reference
96
+ - scope creep
97
+ - vague done-whens
98
+ - missing testing plan when `AGENTS.md` declares a test command
99
+ 4. Apply the spec fixes.
100
+
101
+ Autopilot may continue past this spec gate because the user explicitly invoked
102
+ Autopilot. Still report what the critique changed in the final packet.
103
+
104
+ ## Step 3 - create or reuse the branch
105
+
106
+ Use the same branch rules as `/implement`:
107
+
108
+ - Feature: `feature/<name>`
109
+ - Fix: `fix/<name>`
110
+
111
+ If the branch already exists, switch to it only if it matches the active spec.
112
+ If switching branches would strand unrelated dirty work, stop and report the
113
+ problem.
114
+
115
+ ## Step 4 - implement in small steps
116
+
117
+ Work through the spec's build steps in order. Each step must remain reviewable.
118
+ Unlike `/implement`, do not pause for user approval after each passing step. The
119
+ review happens at the final packet unless a hard stop is hit.
120
+
121
+ For every step:
122
+
123
+ 1. Implement only that step.
124
+ 2. Run the relevant verification:
125
+ - the exact `Verify` command from `AGENTS.md`, when declared
126
+ - otherwise the build, relevant test, lint, and typecheck commands already
127
+ documented by the project
128
+ - browser, CLI, API, or app-level evidence for behavioral done-whens
129
+ 3. If UI is involved, inspect the running app when possible. Prefer Playwright if
130
+ it is already installed or declared. Capture screenshots when they add useful
131
+ evidence. Check for console errors and failed requests.
132
+ 4. Self-review the diff for the step:
133
+ - does it match the spec?
134
+ - did it add scope?
135
+ - is the error path handled?
136
+ - did it follow `coding-standards.md`?
137
+ - are tests present for new in-scope logic when the test gate is on?
138
+ 5. Fix obvious issues and rerun the failed checks.
139
+ 6. Mark the step checked in `current-feature.md` only after the step passes.
140
+ 7. Create a checkpoint commit on the feature or fix branch for the passing step.
141
+ Include the code, tests, and the updated `current-feature.md` checkbox. Use a
142
+ conventional message such as `feat: checkpoint mock snapshot route` or
143
+ `fix: checkpoint stale service filter`. Keep the message about the step, not
144
+ about Autopilot.
145
+
146
+ Do not batch the whole feature into one large diff. If a step gets too large,
147
+ split the step in `current-feature.md` and continue with the first smaller step.
148
+
149
+ ## Step 5 - acceptance check
150
+
151
+ After all implementation steps are checked, run the `/check` behavior for the
152
+ feature when any done-when is behavioral, visual, or integration-facing.
153
+
154
+ For pure library or CLI work, build plus tests and representative command output
155
+ may be enough. Be explicit about the evidence used.
156
+
157
+ ## Step 6 - targeted quality audit and repair
158
+
159
+ After the acceptance check, apply the `/audit current` behavior to the active
160
+ feature, its diff, and the nearby code affected by the change. This is a targeted
161
+ feature audit, not a repository-wide cleanup pass. Findings are recorded in
162
+ `devflow/context/findings.md` with durable IDs and statuses, as `/audit`
163
+ defines; the ledger reports status and never scopes what the audit examines.
164
+
165
+ For every finding:
166
+
167
+ 1. Validate it against the actual code, spec, tests, `coding-standards.md`, and
168
+ local project patterns. An audit finding is evidence to investigate, not an
169
+ automatic instruction to edit.
170
+ 2. Repair confirmed P0 and P1 findings when the fix stays inside the approved
171
+ feature scope and does not require a product or architecture decision. Set
172
+ the repaired finding to `fixed` in the ledger, never `closed`.
173
+ 3. Report P2 and P3 findings in the final packet. Fix them only when the change
174
+ is small, directly caused by the current feature, and clearly required by the
175
+ project standards.
176
+ 4. If a confirmed P0 or P1 finding cannot be repaired safely within scope, stop
177
+ and report it. Do not present the feature as ready for `/complete`.
178
+
179
+ After any audit repair:
180
+
181
+ 1. Rerun the documented `Verify` command when present; otherwise rerun the
182
+ affected build, lint, typecheck, and test commands.
183
+ 2. Rerun the acceptance evidence affected by the repair.
184
+ 3. Recheck the repaired area using the same targeted audit criteria. When that
185
+ recheck confirms the original defect is gone and the repair introduced no
186
+ new one, move the `fixed` finding to `closed` under the `/audit` close
187
+ conditions and name it in the packet. An unrelated new finding gets its own
188
+ ledger entry and does not keep the repaired one open.
189
+ 4. Create a checkpoint commit only after the repair and its checks pass.
190
+
191
+ Use the existing two-attempt hard stop for repeated repair failures. Do not widen
192
+ the feature into a general refactor, silently suppress a finding, or turn this
193
+ step into a full-project hardening pass. A broader cleanup remains a separate
194
+ `/audit` followed by planned `/fix` work.
195
+
196
+ ## Step 7 - final review packet
197
+
198
+ Stop with a concise review packet. Keep it useful enough for `/complete` but not
199
+ a full audit report:
200
+
201
+ - branch name
202
+ - target feature or fix
203
+ - whether the spec was created or resumed
204
+ - what the spec critique changed
205
+ - changed files and why each changed
206
+ - build/test/check commands run, with pass or fail
207
+ - screenshots or output paths, when relevant
208
+ - how to try it manually, or a pointer to `/try` for the full walkthrough
209
+ - checkpoint commits created
210
+ - self-review findings
211
+ - targeted audit scope and findings
212
+ - audit repairs made and checks rerun
213
+ - P0/P1 findings still `open` or `fixed` in `devflow/context/findings.md`,
214
+ which block `/complete`
215
+ - unresolved risks or skipped checks
216
+ - exact next action
217
+
218
+ If everything is green, the next action is usually: review the diff, then run
219
+ `/try` if you want a manual walkthrough, then `/complete`.
220
+
221
+ If something failed, name the failing check and the next fix target.
222
+
223
+ ## Hard Stops
224
+
225
+ Stop immediately and report instead of continuing when Autopilot would need to:
226
+
227
+ - commit on `main`, merge, delete a branch, push, deploy, publish, or send
228
+ anything
229
+ - delete data, reset a database, run irreversible migrations, kill processes, or
230
+ change system settings
231
+ - install dependencies or use network access without the current tool's approval
232
+ flow
233
+ - make a product decision not covered by the docs
234
+ - continue after two failed fix attempts on the same issue
235
+ - hide, skip, or hand-wave a failing check
236
+
237
+ ## Rules
238
+
239
+ - One Autopilot run handles one feature or one fix.
240
+ - Autopilot creates checkpoint commits on the feature or fix branch after passing
241
+ steps.
242
+ - Autopilot audits the active feature and affected code, not the entire project.
243
+ - A P0 or P1 finding left `open` or `fixed` in `devflow/context/findings.md`
244
+ blocks readiness for `/complete`. The ledger is what makes this enforceable.
245
+ - Autopilot stops before `/complete`. It never merges.
246
+ - The Blueprint files remain the state machine. Keep
247
+ `current-feature.md` accurate as steps complete.
248
+ - Follow `coding-standards.md`, `ai-interaction.md`, and `AGENTS.md`.
249
+ - Prefer fewer, higher-quality changes over broad coverage.
250
+ - Report uncertainty plainly. A blocked run is useful if it tells the truth.
251
+
252
+ ## Formatting
253
+
254
+ Format the output to match the project's conventions in
255
+ `devflow/context/ai-interaction.md`: concise, scannable markdown, with lists for
256
+ enumerations and tables for matrices rather than dense paragraphs.