@jakkrichm/create-nexus-devflow 2.0.24 → 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 (123) 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.d.ts +9 -3
  44. package/dist/lib/update.js +129 -22
  45. package/dist/lib/update.js.map +1 -1
  46. package/dist/lib/version-check.d.ts +22 -0
  47. package/dist/lib/version-check.js +59 -0
  48. package/dist/lib/version-check.js.map +1 -0
  49. package/dist/lib/workflow-state.d.ts +23 -0
  50. package/dist/lib/workflow-state.js +112 -0
  51. package/dist/lib/workflow-state.js.map +1 -0
  52. package/dist/scripts/prepare-template.js +3 -3
  53. package/package.json +1 -1
  54. package/template/{.claude/skills/00-discover → .agents/skills/00-explore}/SKILL.md +10 -10
  55. package/template/.agents/skills/10-define/SKILL.md +4 -4
  56. package/template/.agents/skills/20-spec/SKILL.md +2 -3
  57. package/template/.agents/skills/30-plan/SKILL.md +2 -3
  58. package/template/.agents/skills/40-execute/SKILL.md +2 -2
  59. package/template/.agents/skills/50-verify/SKILL.md +2 -2
  60. package/template/.agents/skills/60-report/SKILL.md +3 -3
  61. package/template/{.claude/skills/70-release → .agents/skills/70-deliver}/SKILL.md +7 -13
  62. package/template/.agents/skills/adopt/SKILL.md +136 -73
  63. package/template/.agents/skills/audit/SKILL.md +275 -0
  64. package/template/.agents/skills/autopilot/SKILL.md +228 -147
  65. package/template/.agents/skills/brainstorm/SKILL.md +3 -3
  66. package/template/.agents/skills/brief/SKILL.md +74 -51
  67. package/template/.agents/skills/check/SKILL.md +96 -76
  68. package/template/.agents/skills/ci/SKILL.md +140 -61
  69. package/template/.agents/skills/complete/SKILL.md +156 -101
  70. package/template/.agents/skills/convert-any-to-md/SKILL.md +2 -2
  71. package/template/.agents/skills/debug/SKILL.md +124 -49
  72. package/template/.agents/skills/devflow/SKILL.md +16 -10
  73. package/template/.agents/skills/discovery/SKILL.md +166 -0
  74. package/template/.agents/skills/doctor/SKILL.md +188 -72
  75. package/template/.agents/skills/feature/SKILL.md +195 -102
  76. package/template/.agents/skills/fix/SKILL.md +41 -90
  77. package/template/.agents/skills/idea/SKILL.md +3 -3
  78. package/template/.agents/skills/implement/SKILL.md +189 -46
  79. package/template/.agents/skills/onboard/SKILL.md +215 -85
  80. package/template/.agents/skills/overview/SKILL.md +51 -85
  81. package/template/.agents/skills/prototype/SKILL.md +82 -27
  82. package/template/.agents/skills/release/SKILL.md +160 -0
  83. package/template/.agents/skills/report-html/SKILL.md +2 -2
  84. package/template/.agents/skills/rollback/SKILL.md +123 -77
  85. package/template/.agents/skills/status/SKILL.md +109 -0
  86. package/template/.agents/skills/test/SKILL.md +2 -2
  87. package/template/.agents/skills/tests/SKILL.md +126 -0
  88. package/template/.agents/skills/try/SKILL.md +77 -65
  89. package/template/{.agents/skills/00-discover → .claude/skills/00-explore}/SKILL.md +9 -9
  90. package/template/.claude/skills/10-define/SKILL.md +2 -2
  91. package/template/.claude/skills/20-spec/SKILL.md +1 -1
  92. package/template/.claude/skills/30-plan/SKILL.md +1 -1
  93. package/template/.claude/skills/60-report/SKILL.md +1 -1
  94. package/template/{.agents/skills/70-release → .claude/skills/70-deliver}/SKILL.md +6 -12
  95. package/template/.claude/skills/adopt/SKILL.md +2 -2
  96. package/template/.claude/skills/audit/SKILL.md +141 -0
  97. package/template/.claude/skills/autopilot/SKILL.md +74 -52
  98. package/template/.claude/skills/brief/SKILL.md +67 -45
  99. package/template/.claude/skills/ci/SKILL.md +1 -1
  100. package/template/.claude/skills/complete/SKILL.md +1 -1
  101. package/template/.claude/skills/debug/SKILL.md +1 -1
  102. package/template/.claude/skills/devflow/SKILL.md +7 -7
  103. package/template/.claude/skills/discovery/SKILL.md +145 -0
  104. package/template/.claude/skills/doctor/SKILL.md +1 -1
  105. package/template/.claude/skills/feature/SKILL.md +67 -18
  106. package/template/.claude/skills/fix/SKILL.md +1 -1
  107. package/template/.claude/skills/idea/SKILL.md +2 -2
  108. package/template/.claude/skills/onboard/SKILL.md +3 -3
  109. package/template/.claude/skills/overview/SKILL.md +39 -88
  110. package/template/.claude/skills/prototype/SKILL.md +1 -1
  111. package/template/.claude/skills/release/SKILL.md +171 -0
  112. package/template/.claude/skills/rollback/SKILL.md +2 -2
  113. package/template/AGENTS.md +5 -5
  114. package/template/devflow/build-plan.md +40 -0
  115. package/template/devflow/context/ai-interaction.md +4 -4
  116. package/template/devflow/context/coding-standards.md +3 -3
  117. package/template/devflow/context/current-stage.md +1 -1
  118. package/template/devflow/context/findings.md +1 -1
  119. package/template/devflow/history/HISTORY.md +2 -2
  120. package/template/devflow/project-plan.md +27 -0
  121. package/template/devflow/reference/mockup.html +476 -0
  122. package/template/devflow/reference/project-overview-template.md +39 -0
  123. package/template/devflow/reference/running-id-contract.md +24 -2
@@ -1,95 +1,158 @@
1
1
  ---
2
2
  name: adopt
3
- description: "[Devflow] Survey existing brownfield codebase and bootstrap DevFlow context files."
3
+ description: "[devflow][B] Bring the blueprint into an existing (brownfield) codebase. Surveys the real repo, interviews for intent, generates the owned plans and coding standards, documents existing verification and CI, and points to the optional standalone CI setup. Use when the user runs /adopt, is overlaying the blueprint onto an app that already has meaningful code, or asks to adopt or bootstrap the workflow into an existing project. For freshly scaffolded or early projects, use onboard instead."
4
4
  ---
5
5
 
6
- # adopt - Bootstrap Nexus-DevFlow from an Existing Codebase
6
+ # adopt - bootstrap the blueprint from an existing codebase
7
7
 
8
8
  Where this sits in the workflow:
9
9
 
10
- ```text
11
- existing codebase -> [adopt] -> project-overview + coding-standards -> 00-discover or 10-define
12
- (already has code) (survey + (seeded from the real code; (first feature / refactoring
13
- interview) shipped architecture documented) delivery lifecycle)
14
- ```
10
+ existing codebase -> [adopt] -> project-plan + build-plan + coding-standards -> /overview -> normal loop
11
+ (already has code) (survey + (seeded from the real code; shipped (project- (/feature,
12
+ interview) features already checked off) overview.md) /implement, ...)
15
13
 
16
- Standard onboarding assumes a freshly scaffolded, near-empty app. That does not fit a codebase that already has thousands of lines of working code.
14
+ The standard onboarding assumes a freshly scaffolded, near-empty app: you write
15
+ the two plans from scratch and build forward. That doesn't fit a project that
16
+ already has thousands of lines of working code. `/adopt` is the brownfield
17
+ on-ramp: it reads what's already there, asks you only for what the code can't tell
18
+ it (the *why* and the *roadmap*), and produces the same input files the rest of
19
+ the workflow expects - so an existing project joins the loop without you
20
+ hand-writing everything.
17
21
 
18
- `adopt` is the brownfield on-ramp for Nexus-DevFlow: it reads what is already there, asks only for what the code cannot reveal (the *intent*, the *why*, and the *upcoming roadmap*), and produces the exact context files the rest of the DevFlow lifecycle expects (`project-overview.md`, `coding-standards.md`, `AGENTS.md` commands).
19
-
20
- ---
22
+ It generates the inputs; it does not generate `project-overview.md`. That stays
23
+ `/overview`'s job. `/adopt` ends by telling you to run `/overview`.
21
24
 
22
25
  ## Input
23
26
 
24
- A description of what the project is, if provided. Otherwise, inspect the repository directly. No argument is required.
25
-
26
- ---
27
-
28
- ## Step 0 - Confirm Brownfield Safety
29
-
30
- Inspect `devflow/context/project-overview.md` and `devflow/context/coding-standards.md`:
31
-
32
- - If they contain default placeholders or empty templates, proceed.
33
- - If they already hold rich, user-owned content, stop and inform the user; offer to refresh specific sections rather than overwriting existing context without confirmation.
34
-
35
- Never run a framework scaffolder (DevFlow is an overlay, never a generator).
36
-
37
- ---
38
-
39
- ## Step 1 - Survey the Codebase (Read-Only)
27
+ A description of what the project is, if the user offers one. Otherwise just the
28
+ repository itself. No argument is required.
29
+
30
+ ## Step 0 - confirm it's brownfield and safe
31
+
32
+ Look at `devflow/project-plan.md` and `devflow/build-plan.md`.
33
+
34
+ - If they're missing or still the empty worksheet/placeholder, proceed.
35
+ - If they already hold real content, this project is already adopted. Stop and say
36
+ so; offer to refresh a specific file instead of overwriting work the user owns.
37
+
38
+ Never overwrite a filled-in plan without explicit confirmation. Never run a
39
+ framework scaffolder (the blueprint is an overlay, never a generator).
40
+
41
+ Protect the project README:
42
+
43
+ - If the root `README.md` already looks like a real project README, leave it
44
+ alone.
45
+ - If the root `README.md` is the copied Blueprint workflow doc (for example it
46
+ starts with `# AI Coding Blueprint`), report it as obsolete overlay content
47
+ and ask before replacing or removing it. Do not move it into `blueprint/`.
48
+ - Do not create or overwrite a root project README for a brownfield app unless
49
+ the user explicitly asks. The existing project face belongs to the app, not the
50
+ workflow.
51
+
52
+ ## Step 1 - survey the codebase (read-only)
53
+
54
+ Read the repo to establish the facts. Change nothing in this step. Establish:
55
+
56
+ - **Stack and tooling** - language(s), framework(s), and versions, from the real
57
+ manifest (`package.json`, `requirements.txt`, `pyproject.toml`, `go.mod`,
58
+ `Gemfile`, `Cargo.toml`, etc.). Note the package manager actually in use (lockfile).
59
+ - **Commands** - the real dev / build / test / lint scripts. These feed the
60
+ Commands section of `AGENTS.md` and, per the testing opt-in switch, decide
61
+ whether a testing gate even applies.
62
+ - **Conventions in practice** - directory layout, component/file naming, styling
63
+ approach, state management, data-fetching pattern, error handling. Read what the
64
+ code *does*, not what a default template prescribes.
65
+ - **Testing reality** - is a runner configured and are there tests, or none? Be
66
+ honest; don't describe a gate the project doesn't have.
67
+ - **Verification and CI** - note any combined verification command, GitHub
68
+ remote, `.github/workflows/`, or external CI. Preserve what already exists.
69
+ - **What the app already does** - the shipped features, inferred from routes,
70
+ pages, entry points, and modules. This becomes the *checked* part of the build plan.
71
+
72
+ Keep notes; you'll turn them into the files in Step 3.
73
+
74
+ ## Step 2 - interview for intent
75
+
76
+ The code reveals *what* and *how*, never *why* or *what next*. Ask the user a short
77
+ set of questions (aim for three to five, not an interrogation) to fill the gaps:
78
+
79
+ - What is this project for, and who uses it? (the problem and the users)
80
+ - Is the stack and structure you found intentional, or are there parts they'd call
81
+ legacy / want to change?
82
+ - What do you want to build next? (the unchecked items in the build plan)
83
+ - Anything the survey got wrong or missed?
84
+
85
+ If the user already gave intent up front, skip what they've answered. Don't ask
86
+ what you can read from the code.
87
+
88
+ ## Step 3 - generate the inputs
89
+
90
+ Write these, drawn from the survey (facts) and the interview (intent). Mark every
91
+ inference you're unsure of with a clear `> TODO (confirm)` so the user can correct
92
+ it rather than inherit a wrong guess.
93
+
94
+ - **`devflow/project-plan.md`** - the what & why, following the existing
95
+ worksheet structure (problem, users, features, data, tech, monetization, UI/UX).
96
+ The "features" and "tech" sections describe what *already exists*; the rest comes
97
+ from the interview.
98
+ - **`devflow/build-plan.md`** - the ordered feature list as a checklist. **Mark
99
+ shipped features `- [x]`** (this is the brownfield difference: the build plan
100
+ reflects reality, so most of an existing app starts checked) and the roadmap
101
+ items from the interview as `- [ ]`. This makes `/status` and `/feature` work
102
+ immediately - the next unchecked item is genuinely what's next.
103
+ - **`devflow/context/coding-standards.md`** - rewrite the default to match the
104
+ project's *actual* conventions from Step 1, not the shipped Next.js/Prisma
105
+ defaults. Keep the Writing and Comments sections; replace the stack-specific ones
106
+ with what the code really does. Its Testing section must reflect the real testing
107
+ state (the opt-in switch is a `test` command in `AGENTS.md`).
108
+ - **`AGENTS.md` Commands section** - fill in the real dev / build / test / lint
109
+ commands you found, so the rest of the workflow (and the testing gate) uses the
110
+ project's actual scripts. Include `Verify` when a real combined command exists.
111
+
112
+ Do not write `project-overview.md`; that's `/overview`'s job, downstream of these.
113
+
114
+ ## Step 4 - point to optional CI setup
115
+
116
+ Do not create or change Verify commands or GitHub workflows during adoption.
117
+ Report any verification command or CI already present. When equivalent automatic
118
+ pull-request checks are absent, mention the optional standalone setup:
40
119
 
41
- Read the repository to establish the facts. Change nothing in this step:
42
-
43
- - **Stack & Tooling**: Languages, frameworks, and versions from manifest files (`package.json`, `requirements.txt`, `pyproject.toml`, `go.mod`, `Cargo.toml`, etc.). Note the active package manager from lockfiles.
44
- - **Commands**: Real dev, build, test, lint, and verify scripts.
45
- - **Conventions in Practice**: Directory layout, component naming, state management, styling, data-fetching, error handling, validation. Read what the code *actually does*.
46
- - **Testing Reality**: Inspect existing test suites, runners, and coverage. Be honest about test status.
47
- - **Shipped Capabilities & Architecture**: Inferred from routes, pages, controllers, database schemas, and entry points.
48
-
49
- Keep structured notes for generation in Step 3.
50
-
51
- ---
52
-
53
- ## Step 2 - Interview for Intent
54
-
55
- The code reveals *what* and *how*, but not *why* or *what next*. Ask a short set of 3-4 questions to fill the gaps:
56
-
57
- 1. **Purpose & Users**: What is the core problem this project solves, and who are the target users?
58
- 2. **Architecture Status**: Is the current structure and stack intentional, or are there legacy parts/technical debt the team wants to change or refactor?
59
- 3. **Upcoming Roadmap**: What are the top priorities to build, fix, or refactor next?
60
- 4. **Clarifications**: Anything the survey got wrong or missed?
61
-
62
- *(If the user already provided this context in the prompt, skip questions that are already answered).*
63
-
64
- ---
120
+ ```text
121
+ Run /ci or $ci when you want automatic GitHub checks.
122
+ ```
65
123
 
66
- ## Step 3 - Generate the Context Artifacts
124
+ Explain that CI is not required to finish adoption. The `/ci` skill owns
125
+ project-specific Verify and GitHub workflow setup.
67
126
 
68
- Write the baseline context files drawn from the survey (facts) and interview (intent):
127
+ ## Step 5 - review gate, then hand off
69
128
 
70
- 1. **`devflow/context/project-overview.md`**:
71
- - Project Name, Purpose, and Target Users
72
- - Architecture summary and directory layout
73
- - Shipped capabilities and existing major modules
74
- - Key technical stack components and verified commands
75
- - Known technical debt or architectural focus areas
129
+ Stop and show the user what you generated, calling out:
76
130
 
77
- 2. **`devflow/context/coding-standards.md`**:
78
- - Rewrite defaults to reflect the project's *actual* conventions discovered in Step 1
79
- - Framework patterns, state management, error handling, styling, and test rules based on real code
131
+ - the **build-plan split** - what you marked shipped vs not, since that's the
132
+ judgment most worth their eyes,
133
+ - every `> TODO (confirm)` you left,
134
+ - anything the survey and the interview disagreed on,
135
+ - verification command and GitHub checks status.
80
136
 
81
- 3. **`AGENTS.md` Commands Section**:
82
- - Fill in the real dev, build, test, lint, and verify commands found during survey.
137
+ These files are the ones the user *owns*. Have them review and adjust, then tell
138
+ them to run `/overview` to distill the plans into `project-overview.md` and start
139
+ the normal loop.
83
140
 
84
- ---
141
+ ## Rules
85
142
 
86
- ## Step 4 - Review Gate and Handoff
143
+ - **Read-only until Step 3.** The survey changes nothing; only generation writes.
144
+ - **Reflect reality, don't prescribe.** `coding-standards.md` must match the code
145
+ that exists. A project using Zustand and REST routes should not be handed
146
+ standards about Server Actions and Prisma just because that's the default.
147
+ - **Never invent intent.** Ask for the why and the roadmap; mark anything inferred
148
+ with `> TODO (confirm)`. Silent guesses about purpose are the main failure mode.
149
+ - **Don't clobber owned work.** If the plans already have real content, confirm
150
+ before touching them. Never run a scaffolder.
151
+ - **Be honest about testing.** If there's no runner, say testing is opt-in and not
152
+ yet set up; don't describe a gate the project hasn't adopted.
87
153
 
88
- Present the adoption summary for review:
154
+ ## Formatting
89
155
 
90
- - Shipped features and architectural baseline recorded
91
- - Inferred conventions and coding standards
92
- - Available verified commands in `AGENTS.md`
93
- - Recommended next step:
94
- - Run `00-discover` (or `00-discover`, `$00-discover`) to explore the next major initiative or feature
95
- - Run `10-define` (or `10-define`, `$10-define`) to immediately scope a delivery run for known roadmap items
156
+ Format the output to match the project's conventions in
157
+ `devflow/context/ai-interaction.md`: concise, scannable markdown, with lists for
158
+ enumerations and tables for matrices rather than dense paragraphs.
@@ -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.