@jakkrichm/create-nexus-devflow 2.18.2 → 2.19.0
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.
- package/README.md +7 -6
- package/dist/bin/create-nexus-devflow.js +80 -47
- package/dist/bin/create-nexus-devflow.js.map +1 -1
- package/dist/lib/doctor.js +27 -0
- package/dist/lib/doctor.js.map +1 -1
- package/dist/lib/tooling/commands/scan-doc-contract.js +0 -1
- package/dist/lib/tooling/commands/scan-doc-contract.js.map +1 -1
- package/dist/lib/ui.d.ts +23 -0
- package/dist/lib/ui.js +85 -0
- package/dist/lib/ui.js.map +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/lib/update.js.map +1 -1
- package/dist/scripts/prepare-template.js +3 -7
- package/dist/scripts/prepare-template.js.map +1 -1
- package/package.json +2 -2
- package/template/.agents/skills/audit/SKILL.md +4 -1
- package/template/.agents/skills/brainstorm/SKILL.md +5 -4
- package/template/.agents/skills/bughunter/SKILL.md +1 -1
- package/template/.agents/skills/check/SKILL.md +26 -116
- package/template/.agents/skills/check/reference/guide.md +36 -4
- package/template/.agents/skills/check/reference/verify.md +129 -0
- package/template/.agents/skills/ci/SKILL.md +35 -13
- package/template/.agents/skills/complete/SKILL.md +2 -0
- package/template/.agents/skills/devflow/SKILL.md +3 -2
- package/template/.agents/skills/discovery/SKILL.md +9 -0
- package/template/.agents/skills/doctor/SKILL.md +2 -0
- package/template/.agents/skills/explore/SKILL.md +2 -1
- package/template/.agents/skills/feature/SKILL.md +4 -1
- package/template/.agents/skills/feature/reference/feature-spec-template.md +16 -16
- package/template/.agents/skills/fix/SKILL.md +3 -3
- package/template/.agents/skills/grill/SKILL.md +6 -1
- package/template/.agents/skills/idea/SKILL.md +6 -6
- package/template/.agents/skills/implement/SKILL.md +45 -119
- package/template/.agents/skills/test/SKILL.md +26 -0
- package/template/.claude/skills/audit/SKILL.md +4 -1
- package/template/.claude/skills/brainstorm/SKILL.md +5 -4
- package/template/.claude/skills/bughunter/SKILL.md +1 -1
- package/template/.claude/skills/check/SKILL.md +26 -116
- package/template/.claude/skills/check/reference/guide.md +36 -4
- package/template/.claude/skills/check/reference/verify.md +129 -0
- package/template/.claude/skills/ci/SKILL.md +35 -13
- package/template/.claude/skills/complete/SKILL.md +2 -0
- package/template/.claude/skills/devflow/SKILL.md +3 -2
- package/template/.claude/skills/discovery/SKILL.md +11 -3
- package/template/.claude/skills/doctor/SKILL.md +2 -0
- package/template/.claude/skills/explore/SKILL.md +2 -1
- package/template/.claude/skills/feature/SKILL.md +4 -1
- package/template/.claude/skills/feature/reference/feature-spec-template.md +16 -16
- package/template/.claude/skills/fix/SKILL.md +3 -3
- package/template/.claude/skills/grill/SKILL.md +6 -1
- package/template/.claude/skills/idea/SKILL.md +6 -6
- package/template/.claude/skills/implement/SKILL.md +45 -119
- package/template/.claude/skills/test/SKILL.md +26 -0
- package/template/AGENTS.md +27 -38
- package/template/devflow/context/ai-interaction.md +15 -14
- package/template/devflow/context/coding-standards.md +67 -6
- package/template/devflow/context/glossary.md +26 -6
- package/template/devflow/decisions/README.md +15 -1
- package/template/devflow/reference/feature-spec-template.md +59 -79
- package/template/devflow/reference/help-playbook-protocol.md +33 -0
- package/template/devflow/reference/slicing-archetypes.md +105 -0
- package/template/devflow/docs/USAGE.md +0 -195
- package/template/devflow/docs/diagrams/nexus-devflow-architecture.html +0 -14821
- package/template/devflow/docs/diagrams/nexus-devflow-architecture.json +0 -80
- package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.html +0 -14860
- package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.json +0 -88
- package/template/devflow/docs/examples/living-spec/adr.example.md +0 -43
- package/template/devflow/docs/examples/living-spec/current-feature.example.md +0 -113
- package/template/devflow/docs/examples/living-spec/discovery.example.md +0 -45
- package/template/devflow/docs/examples/living-spec/ideas.example.md +0 -22
- package/template/devflow/docs/governance-rules.md +0 -39
- package/template/devflow/docs/manual-review-workflow-spec.md +0 -116
- package/template/devflow/docs/markdown-metadata-contract.md +0 -140
- package/template/devflow/docs/quickstart.md +0 -124
- package/template/devflow/docs/release-process.md +0 -52
- package/template/devflow/docs/skill-selection-policy.md +0 -64
- package/template/devflow/docs/workflow-surface-map.md +0 -86
- package/template/devflow/runs/.gitkeep +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement
|
|
3
|
-
description: "[devflow]
|
|
3
|
+
description: "[devflow] Build and verify a task-isolated spec. Use for /implement or requests to implement an approved plan."
|
|
4
4
|
argument-hint: "[{run-id, number, or name}] [--ticket <NN | path>]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# implement - build the target spec
|
|
7
|
+
# implement - build and verify the target spec
|
|
8
8
|
|
|
9
9
|
**Context reuse:** Reuse any required file already loaded in project instructions or the current session. Read it again only if absent, changed, or exact current bytes or line references are needed.
|
|
10
10
|
|
|
@@ -20,17 +20,23 @@ Where this sits in the workflow:
|
|
|
20
20
|
|
|
21
21
|
`/feature`, `/fix`, or `/rollback` wrote the spec to
|
|
22
22
|
`devflow/context/{xxx-slug}/spec.md` and stopped.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
Build the selected spec through its acceptance criteria and required verification, then present the configured review handoff. Preserve authorization already given for this work. Read only relevant conventions and reuse loaded context.
|
|
24
|
+
|
|
25
|
+
## Review cadence and checkpoints
|
|
26
|
+
|
|
27
|
+
Read `workflow.stepReview` and `workflow.checkpointCommits` from `devflow/config.json` independently; defaults are `feature` and `disabled`.
|
|
28
|
+
|
|
29
|
+
- `stepReview: "feature"`: continue through all authorized steps without asking Continue after each step. Record evidence as work proceeds and present one final review packet.
|
|
30
|
+
- `stepReview: "every"`: after a working step, show its diff and evidence, then wait for approval before the next step. A walkthrough is available on request.
|
|
31
|
+
- `checkpointCommits: "disabled"`: omit ordinary checkpoint offers.
|
|
32
|
+
- `checkpointCommits: "enabled"`: offer an optional checkpoint at the configured review boundary (per-step for `every`, final packet for `feature`). Show the exact candidate and obtain commit authorization before committing. The setting itself is not authorization.
|
|
33
|
+
|
|
34
|
+
Independent-review checkpoints follow their separate contract below. Review cadence never authorizes commit, merge, push, or deployment.
|
|
29
35
|
|
|
30
36
|
## Multi-Run Target & Ticket-Driven Target Resolution
|
|
31
37
|
|
|
32
|
-
- **Given an ID or name** (e.g. `/implement 12`, `/implement 012`, `/implement kanban`) -> locates the matching run folder `devflow/context/{xxx-slug}/`,
|
|
33
|
-
- **With no argument** (`/implement`) -> checks current
|
|
38
|
+
- **Given an ID or name** (e.g. `/implement 12`, `/implement 012`, `/implement kanban`) -> locates the matching run folder `devflow/context/{xxx-slug}/`, selects the branch matching the run type and configured prefix, and loads only that run's `spec.md`.
|
|
39
|
+
- **With no argument** (`/implement`) -> checks the current feature, fix, or rollback branch against the configured prefixes, or auto-picks if only 1 spec is active in `devflow/context/`, or prompts the user if multiple specs are queued.
|
|
34
40
|
- **Ticket Input (`--ticket <NN | path>`)**: Targets a specific tracer-bullet ticket directly (e.g. `/implement 12 --ticket 01`, `/implement --ticket 02`, `/implement --ticket issues/01-auth.md`, or `/implement 01` when run-id is not ambiguous).
|
|
35
41
|
|
|
36
42
|
### Ticket Discovery Hierarchy
|
|
@@ -80,23 +86,23 @@ receipt. After the final Verify pass, an active gate routes to
|
|
|
80
86
|
`current` freshness may proceed toward `/complete`. This skill never approves
|
|
81
87
|
its own work or rewrites receipt evidence.
|
|
82
88
|
|
|
83
|
-
For
|
|
84
|
-
record the result in the step evidence. Use `browseros-neo` for the interactive
|
|
85
|
-
handoff when it is available and the done-when is visual or behavioral. When the
|
|
86
|
-
script or MCP is absent, report that exact limitation; do not silently install a
|
|
87
|
-
runner or claim browser evidence.
|
|
89
|
+
For browser-facing changes, run focused browser tests during iteration when available. Run the required `npm run test:browser` gate once before handoff if the spec or project requires it. Use `browseros-neo` for visual or behavioral evidence when available and relevant. Record missing tooling accurately; install a runner only when setup is in the authorized scope.
|
|
88
90
|
|
|
89
91
|
**Resuming?** If the spec already has some build steps checked off (`- [x]`), this
|
|
90
92
|
feature was started earlier and interrupted (often a cleared context). The spec and
|
|
91
93
|
its ticked steps are files, so pick up where it left off: read which steps are done,
|
|
92
94
|
check the git branch and `git status`/log to see what is committed and what is still
|
|
93
95
|
in the working tree, then continue from the **first unchecked step** instead of
|
|
94
|
-
|
|
96
|
+
### Step 0 - Mechanical Input Coverage Pre-flight Gate
|
|
97
|
+
|
|
98
|
+
Before touching code or executing build tasks, perform a positive **Input Coverage Test** against the active Living Spec:
|
|
99
|
+
- Enumerate every value, state, or data field this implementation must produce, compute, or display (from the acceptance criteria and spec design).
|
|
100
|
+
- For each required value, verify that the spec explicitly names where it comes from (e.g. database schema/column, API request parameter, calculated derivation from a named source, or explicit prior architectural decision).
|
|
101
|
+
- **Anti-Hallucination Guard**: Any required value with no named source is an **Owed Decision**. Do NOT rationalize it as "just wiring" and do NOT silently invent an ad-hoc provider, schema field, or business rule. Stop and route to `/grill` or request user clarification before proceeding.
|
|
95
102
|
|
|
96
103
|
## Step 1 - branch
|
|
97
104
|
|
|
98
|
-
Create
|
|
99
|
-
`fix/{xxx-slug}` for a fix, or `rollback/{xxx-slug}` for a Type: Rollback spec. If the
|
|
105
|
+
Create or select the branch for the spec using `git.featureBranchPrefix`, `git.fixBranchPrefix`, or `git.rollbackBranchPrefix` from config (defaults: `feature/`, `fix/`, `rollback/`). Preserve unrelated working-tree changes before switching. If the
|
|
100
106
|
project isn't a git repo yet, say so and ask the user to run `git init` first;
|
|
101
107
|
the loop needs branches. On resume, the branch already exists - check it out
|
|
102
108
|
instead of creating a new one.
|
|
@@ -105,99 +111,23 @@ instead of creating a new one.
|
|
|
105
111
|
|
|
106
112
|
When implementing a rollback task, follow the exact safety procedure in `reference/rollback-implementation.md`.
|
|
107
113
|
|
|
108
|
-
## Step 2 -
|
|
109
|
-
|
|
110
|
-
Work
|
|
111
|
-
|
|
112
|
-
1.
|
|
113
|
-
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
**Green-Phase Discipline**: Write the minimum code needed to pass the test; add only the options/features it requires (YAGNI constraint).
|
|
126
|
-
|
|
127
|
-
> 📖 For anti-patterns and Bad vs Good examples, read [`tdd-anti-patterns.md`](tdd-anti-patterns.md).
|
|
128
|
-
|
|
129
|
-
2. Implement just that step: the smallest change that satisfies its "done when."
|
|
130
|
-
3. Show the **diff**, not whole files.
|
|
131
|
-
4. **Explain it, and prove it.** Give a short summary: what the step delivered,
|
|
132
|
-
one line per changed file on what it does and why, then confirm the step's
|
|
133
|
-
"done when" is met with empirical evidence (test pass output, build output, or screenshot). This summary is the comprehension gate, so keep it concrete, not
|
|
134
|
-
vague. Include a short **How to try it** note when the step has a manual
|
|
135
|
-
path: the command, URL, click, endpoint, or output the user can check.
|
|
136
|
-
5. **Verify the step.** If `AGENTS.md` declares a `Verify` command, run that exact
|
|
137
|
-
command as the automated gate. It is only an umbrella for checks the project
|
|
138
|
-
actually has, so do not invent tests or other checks to satisfy it. If no
|
|
139
|
-
`Verify` command exists, run the documented build command and the test command
|
|
140
|
-
when the project declares one. A step that adds logic must ship a passing test
|
|
141
|
-
in the same diff when the test gate is on, and the suite must be green before
|
|
142
|
-
the step is approved (see the Testing gate in `coding-standards.md`). UI and
|
|
143
|
-
integration-only steps ride on screenshot plus build evidence. Run a focused
|
|
144
|
-
test separately when it gives faster feedback, then use `Verify` as the final
|
|
145
|
-
automated gate. For UI or integration done-whens, prefer Playwright when it is
|
|
146
|
-
already installed or declared in `AGENTS.md`; do not add it silently for an
|
|
147
|
-
unrelated feature. Create focused test files next to the source they cover,
|
|
148
|
-
per `coding-standards.md`. Never install a runner mid-step unless the current
|
|
149
|
-
spec is explicitly the unit-testing setup itself (for example `/fix "add unit
|
|
150
|
-
testing"`). If a step surfaces non-trivial logic the spec did not foresee, add
|
|
151
|
-
a focused test then, or note why not. When a step's done-when is behavioral (a
|
|
152
|
-
click, a download, or a flow across screens), run `/check` to prove it against
|
|
153
|
-
the running app rather than eyeballing it.
|
|
154
|
-
5. **Iterate until it works.** If it fails or the user wants changes, revise the
|
|
155
|
-
step (re-prompt or hand-edit the code), show the updated diff, and re-test.
|
|
156
|
-
Repeat until it works and the user approves. Nothing is committed until the
|
|
157
|
-
user is happy with the step.
|
|
158
|
-
6. **Mark it done, then prompt to move on.** Once the step is approved, check that
|
|
159
|
-
step off (`- [x]`) in `devflow/context/{xxx-slug}/spec.md` so progress survives a context
|
|
160
|
-
clear. If the step repaired a finding tracked in
|
|
161
|
-
`devflow/context/{xxx-slug}/findings.md`, set that finding's status to `fixed` now too
|
|
162
|
-
and note the repair in its **Resolution** line. Never set `closed`: a repair
|
|
163
|
-
is re-reviewed by `/audit` before it clears, because a fix can introduce a
|
|
164
|
-
worse defect than the one it removed. Then offer a short choice, noting that checkpoints are optional since
|
|
165
|
-
`/complete` makes the real feature-level commit. Use the current tool's short
|
|
166
|
-
user-input prompt when available; when you've just produced a long block to
|
|
167
|
-
read (a deep explanation, a big
|
|
168
|
-
walk-through), ask in plain text instead, so the prompt doesn't cover what the
|
|
169
|
-
user is still reading:
|
|
170
|
-
- **Continue** (default) - roll into the next step without committing.
|
|
171
|
-
- **Commit checkpoint** - commit just this step on the branch with a
|
|
172
|
-
conventional message (a cheap rollback point).
|
|
173
|
-
- **Walk me through it** - give a deeper, line-level explanation of the new or
|
|
174
|
-
changed code (why this approach, what each part does, any gotchas), then
|
|
175
|
-
re-ask this checkpoint prompt. A loop-back, not a terminal choice.
|
|
176
|
-
- **Stop here** - pause the loop so the user can review or come back later.
|
|
177
|
-
|
|
178
|
-
On **Continue** or after **Commit checkpoint**, go to the next step. On **Walk
|
|
179
|
-
me through it**, explain in depth and then re-ask this prompt in plain text (the
|
|
180
|
-
explanation is long, so a modal would cover it). On **Stop here**, stop and say
|
|
181
|
-
where things stand: the branch is intact; run `/implement` again to resume, or
|
|
182
|
-
`/complete` to wrap up what's built so far.
|
|
183
|
-
|
|
184
|
-
### Ticket-Driven TDD Execution (when working from a Ticket)
|
|
185
|
-
|
|
186
|
-
When executing a tracer-bullet ticket (via `--ticket` or auto-frontier):
|
|
187
|
-
1. **Extract Scope**: Read *What to build* and *Acceptance criteria* checklist (`- [ ]`) from the active ticket file.
|
|
188
|
-
2. **Strict TDD Cycle per Criterion**:
|
|
189
|
-
- **🔴 RED**: Write the unit/integration test for the criterion first at the agreed seam. Execute the test command and verify the expected failing assertion.
|
|
190
|
-
- **🟢 GREEN**: Implement only the minimal code in the source file necessary to make the test pass. Re-run test and show passing output.
|
|
191
|
-
- **🔵 REFACTOR**: Refactor and format cleanly, verifying that 100% of tests remain green.
|
|
192
|
-
3. **Verify Gate**: Run the project's Verify command (`npm run check` or documented test suite) to ensure whole-system health before concluding the ticket.
|
|
193
|
-
4. **Bidirectional State Sync**:
|
|
194
|
-
- Mark each completed criterion `- [x]` in the ticket file.
|
|
195
|
-
- Once all criteria in the ticket pass, update the ticket status to `**Status:** done` (or `Status: done`).
|
|
196
|
-
- Mirror the completed work, status, and diff evidence into `devflow/context/{xxx-slug}/spec.md` (under `## 📋 3. Execution Plan & TDD Checklist` and `## ⚡ 4. Implementation Log & Evidence`) so the Living Spec remains the authoritative single source of truth for `/check`, `/audit`, and `/complete`.
|
|
197
|
-
|
|
198
|
-
Never batch the whole thing into one diff. If a step's diff is too big to read,
|
|
199
|
-
split it. The documented `Verify` command, or the fallback build and tests, must
|
|
200
|
-
pass before any commit.
|
|
114
|
+
## Step 2 - implement and verify
|
|
115
|
+
|
|
116
|
+
Work in small reviewable diffs, keeping progress in the selected spec.
|
|
117
|
+
|
|
118
|
+
1. For logic or behavior changes with the test gate on, use Red-Green-Refactor: write a focused failing test, confirm the assertion fails for the missing behavior, implement the smallest change, then refactor with affected tests green. Preserve the user's existing work. Consult [TDD anti-patterns](tdd-anti-patterns.md) when test design needs it.
|
|
119
|
+
- **Proportional Engineering**: Add an abstraction, dependency, service, configuration surface, compatibility layer, or security mechanism only when the approved spec or an established repository requirement needs it now. Prefer existing code, standard library, and native platform features.
|
|
120
|
+
2. Match the step's done-when and run focused checks. Documentation or formatting-only edits use structural checks and review; they do not require artificial unit tests. Capture relevant runtime or browser proof for behavioral criteria, following the selected Check policy.
|
|
121
|
+
3. Fix failures caused by the change and rerun affected checks without requesting authorization again. Broaden verification when dependencies, failures, or risk justify it.
|
|
122
|
+
4. Record the diff summary and evidence. Mark a step complete once its done-when passes and any configured per-step review has been approved. A repaired finding becomes `fixed` with resolution evidence; only a subsequent audit can close it. Apply the review cadence above before proceeding.
|
|
123
|
+
|
|
124
|
+
Run a proportionality check before final verification: every new abstraction, dependency, service, configuration surface, compatibility layer, and security mechanism must trace to the approved spec or an established repository requirement. Remove speculative machinery this work added without weakening real trust-boundary validation, data-loss prevention, accessibility, or configured verification.
|
|
125
|
+
|
|
126
|
+
At the final handoff, run the exact documented Verify command and all required gates. If there is no Verify command, use the project's declared build and test commands. Reuse a passing result for unchanged inputs within this pass; rerun affected gates after subsequent edits. Do not add tests or tools just to inflate the verification matrix.
|
|
127
|
+
|
|
128
|
+
### Ticket execution
|
|
129
|
+
|
|
130
|
+
When a ticket is selected, use its acceptance criteria as the steps above. Mark completed criteria in the ticket, mark it `done` after its criteria and required verification pass, and mirror status and evidence into the run's spec. A ticket handoff runs required gates once; criteria within the ticket use focused checks. A request to finish the whole run continues through the dependency frontier until the authorized scope is verified.
|
|
201
131
|
|
|
202
132
|
After final Verify and required Check pass, set the active spec to `verified`
|
|
203
133
|
with every completed box checked. Then resolve independent review before the
|
|
@@ -270,23 +200,19 @@ named area. If the feature spans too many distinct areas for one useful pass,
|
|
|
270
200
|
name the sections first and let the user choose where to begin. Remain read-only
|
|
271
201
|
unless the user separately requests changes.
|
|
272
202
|
|
|
273
|
-
|
|
274
|
-
The sole exception is exactly one immutable independent-review checkpoint after
|
|
275
|
-
showing its exact candidate and receiving current explicit commit approval.
|
|
276
|
-
Configuration never supplies that approval. Never merge, push, deploy, publish,
|
|
203
|
+
Ordinary checkpoint commits are available only through the configured review boundary and explicit candidate approval above. The immutable independent-review checkpoint also requires explicit candidate approval. Work-level completion commits belong to `/complete`. Configuration never supplies commit approval. Never merge, push, deploy, publish,
|
|
277
204
|
or start unrelated work from this skill.
|
|
278
205
|
|
|
279
206
|
## Rules
|
|
280
207
|
|
|
281
|
-
-
|
|
208
|
+
- Keep diffs small and apply the configured review cadence.
|
|
282
209
|
- Explain every change in plain English. Understanding the code is the point.
|
|
283
210
|
- Iterate on the branch until each step works; never commit code the user hasn't
|
|
284
211
|
approved.
|
|
285
212
|
- Follow `devflow/context/coding-standards.md` (server vs client, scope user-owned queries
|
|
286
213
|
by the authenticated user id, validate inputs, and so on).
|
|
287
|
-
-
|
|
288
|
-
|
|
289
|
-
- Per-step commits are optional checkpoints. The work-level commit, the merge,
|
|
214
|
+
- Keep the spec aligned with the authorized scope. Correct routine omissions with evidence; ask only when a material scope or design decision is unresolved.
|
|
215
|
+
- Configured checkpoint offers are optional. The work-level commit, the merge,
|
|
290
216
|
and any push are `/complete`'s job.
|
|
291
217
|
- For Type: Rollback, reverse only the approved product diff and preserve all
|
|
292
218
|
protected Blueprint paths.
|
|
@@ -87,6 +87,32 @@ When generating or logging test runs during `/implement` or `/check`:
|
|
|
87
87
|
|
|
88
88
|
---
|
|
89
89
|
|
|
90
|
+
## 7. 5-Tier Test File Classification Strategy
|
|
91
|
+
|
|
92
|
+
Do not write identical test patterns for all file types. Classify files into 5 distinct tiers:
|
|
93
|
+
|
|
94
|
+
| Tier | Category / File Paths | Recommended Test Strategy | What NOT to do |
|
|
95
|
+
| :--- | :--- | :--- | :--- |
|
|
96
|
+
| 🧠 **Tier 1** | **Pure Logic & Algorithms**<br>`src/utils/`, `src/services/`, `lib/` | Fast in-memory Unit Tests with 100% boundary & edge cases coverage. Use TDD (Red-Green-Refactor). | Do not over-mock pure mathematical or transformation functions. |
|
|
97
|
+
| 🎨 **Tier 2** | **UI Components**<br>`src/components/`, `src/pages/` | Component rendering, event dispatching, visual verification via Playwright / BrowserOS Neo. | **Prohibited**: Do not write trivial unit tests that merely assert static HTML tags exist. |
|
|
98
|
+
| 🔌 **Tier 3** | **API & Data Integration**<br>`src/api/`, route handlers, DB models | Contract tests, schema validation (Zod), HTTP status codes, error payload shapes. | Do not test external third-party network APIs without isolated fakes. |
|
|
99
|
+
| ⚙️ **Tier 4** | **Config & Build Tooling**<br>`*.json`, `*.yaml`, `scripts/` | Static contract validation (`npm run check:static`), budget linters (`npm run check:budgets`), smoke tests. | Do not skip static validation on build tool modifications. |
|
|
100
|
+
| 📝 **Tier 5** | **Documentation & Prose**<br>`*.md`, `devflow/docs/` | Structural checks, markdown contract scans, and link integrity verification. | Do not write artificial unit test suites for documentation files. |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 8. Acceptance Criteria (`AC-N`) Traceability Protocol
|
|
105
|
+
|
|
106
|
+
To guarantee 100% spec fidelity, every automated test suite must trace back to the active Living Spec:
|
|
107
|
+
- **Test Title Tagging**: Prefix test titles or describe blocks with the target Acceptance Criterion:
|
|
108
|
+
```typescript
|
|
109
|
+
it('AC-1: enforces 32KB byte budget on SKILL.md files', async () => { ... });
|
|
110
|
+
it('AC-2: returns exit code 1 when budget violation occurs', async () => { ... });
|
|
111
|
+
```
|
|
112
|
+
- **Traceability Verification**: During `/check`, cross-reference every `- [ ] AC-N` against the passing test assertion name to ensure zero untracked requirements.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
90
116
|
## Relationship To DevFlow 2.6.x
|
|
91
117
|
|
|
92
118
|
- **Classification**: Companion command & Engineering standard
|
package/template/AGENTS.md
CHANGED
|
@@ -11,14 +11,33 @@ This project uses **Nexus-DevFlow**, an agentic workflow layer supporting **The
|
|
|
11
11
|
|
|
12
12
|
To start a new project, scaffold the application first in an empty folder, then run `npx nexus-devflow` (or `npm create @jakkrichm/nexus-devflow`) to overlay DevFlow onto your codebase.
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## Load context for the task
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- `devflow/
|
|
19
|
-
- `devflow/context/
|
|
20
|
-
- `devflow/context/
|
|
21
|
-
- `devflow/context/
|
|
16
|
+
Reuse instructions already loaded. Read relevant sections, rather than every document before every edit:
|
|
17
|
+
|
|
18
|
+
- `devflow/config.json` for workflow policy and quality-gate decisions.
|
|
19
|
+
- `devflow/context/project-overview.md` for project purpose, architecture, and cross-module boundaries.
|
|
20
|
+
- `devflow/context/coding-standards.md` for conventions affecting changed code.
|
|
21
|
+
- `devflow/context/ai-interaction.md` for workflow interaction and review cadence.
|
|
22
|
+
- `devflow/context/glossary.md` when domain terminology matters.
|
|
23
|
+
- `devflow/context/{xxx-slug}/` for the selected run's spec, stage, findings, and review receipt.
|
|
24
|
+
|
|
25
|
+
## Task intent and authorization
|
|
26
|
+
|
|
27
|
+
Explicit user scope takes precedence over skill guidance, within runtime permissions and safety constraints. A request to draft a spec ends at the spec; a request to implement and verify continues through those authorized steps. A skill transition is not a new approval requirement. Ask when a material decision or authorization is missing, reuse existing authorization, and identify the exact instruction if it requires a pause. Preserve separate authorization for commit, merge, push, and deployment.
|
|
28
|
+
|
|
29
|
+
Use focused checks during edits, and run the documented required gates before handoff. Repeat passing checks only after relevant changes, failures, or unresolved concerns. Apply TDD to logic and behavior changes; documentation-only edits need appropriate structural or review evidence.
|
|
30
|
+
|
|
31
|
+
## Proportional engineering
|
|
32
|
+
|
|
33
|
+
Build for established requirements, not hypothetical scale, threats, or future flexibility. Reuse existing code, the standard library, native platform features, and installed dependencies before adding machinery.
|
|
34
|
+
|
|
35
|
+
- Unknown scale or extensibility defaults to the smaller reversible design. Do not infer enterprise, multi-tenant, hostile-user, or compliance requirements.
|
|
36
|
+
- Derive trust and data-integrity boundaries from actual reachability: untrusted input, auth/session/ownership, shared persisted data, destructive operations, payments, secrets, and sensitive data.
|
|
37
|
+
- Ask only when an unknown materially changes behavior, architecture, persisted data, interoperability, a real security boundary, or cost. Otherwise choose the simplest repository-native implementation.
|
|
38
|
+
- Add an abstraction, dependency, service, configuration surface, compatibility layer, or security mechanism only for a current requirement.
|
|
39
|
+
- Simplicity never removes real trust-boundary validation, data-loss prevention, accessibility, explicit security requirements, configured tests, or project rules.
|
|
40
|
+
- Stack-specific template standards apply only when the project uses that stack.
|
|
22
41
|
|
|
23
42
|
## Proportional engineering
|
|
24
43
|
|
|
@@ -61,37 +80,7 @@ Unused adapter families can be removed. Codex, Antigravity, GitHub Copilot, and
|
|
|
61
80
|
3. **Google Antigravity & Claude Code**: Native skill engines automatically discover and surface `.agents/skills/` and `.claude/skills/`.
|
|
62
81
|
4. **State-Aware Inspection**: When unsure what to do next, invoke `devflow` to automatically inspect active task directories in `devflow/context/{xxx-slug}/`, `devflow/discoveries/`, and `devflow/ideas.md`.
|
|
63
82
|
5. **Default Artifact & Communication Language (Thai)**: All generated markdown stage artifacts (`spec.md`, `discovery.md`, etc.) and user communication MUST default to **Thai (`th`)**, while code, technical terms, file paths, and identifiers remain in English.
|
|
64
|
-
6. **
|
|
65
|
-
Whenever any skill or command is invoked with a help keyword or flag (e.g., `/bughunter help`, `bughunter --help`, `/archify -h`, `/check ?`, `/feature help`):
|
|
66
|
-
- **Execution Safety Gate**: DO NOT execute the skill's primary or mutating actions (do not launch scans/attacks, do not modify source code, and do not initialize new task runs).
|
|
67
|
-
- **Dynamic Workspace Inspection**: Read the target skill definition (`.agents/skills/<skill>/SKILL.md`, `.claude/skills/<skill>/SKILL.md`, and any vendored resources such as `devflow/.vendor/<skill>/`), then scan the active workspace (`devflow/context/project-overview.md`, `package.json`, tech stack, active tasks, endpoints, and file hierarchy).
|
|
68
|
-
- **Persistent HTML Playbook & Token-Saving Cache**:
|
|
69
|
-
- **Output Location & Light Theme Mandate**: Compile and persist the tailored playbook as a standalone, styled HTML report at `devflow/docs/playbooks/{skill}.html` adhering to the **Paper/Ink Light Theme Standard** (`data-theme="light"`, teal accent, ruler corner, terminal mockup UI, and diagram slot per `devflow/docs/playbooks/template.html`). Never generate dark-mode-first documentation.
|
|
70
|
-
- **First Run**: Render the comprehensive 5W1H playbook in chat and write the complete HTML report to `devflow/docs/playbooks/{skill}.html`.
|
|
71
|
-
- **Subsequent Invocations (Delta Updates & Zero Token Bloat)**: If `devflow/docs/playbooks/{skill}.html` already exists:
|
|
72
|
-
- Inspect the existing HTML file and compute the diff/delta against the current repository state (e.g., new file paths, modified endpoints, or newly installed vendor assets).
|
|
73
|
-
- DO NOT repeat unchanged boilerplate or full static content in chat.
|
|
74
|
-
- Provide a concise **Delta Summary** in chat (highlighting what changed, new recommendations, or newly available commands).
|
|
75
|
-
- In-place update `devflow/docs/playbooks/{skill}.html` with the fresh timestamp and state.
|
|
76
|
-
- Provide a direct clickable link to [devflow/docs/playbooks/{skill}.html](file:///d:/devtools/nexus-devflow/devflow/docs/playbooks/{skill}.html) for browser viewing.
|
|
77
|
-
- **Render the User-Friendly 5W1H Playbook**: Emit an easy-to-read, practical guide organized around the **5W 1H Framework** (rendered on initial run or updated in the HTML playbook):
|
|
78
|
-
1. **What (Concept & Capabilities)**: Clear, jargon-free summary of what this skill does, its core concept, and its bundled tools/capabilities.
|
|
79
|
-
2. **Why (Problems Solved & Key Benefits)**: The problems it solves, key advantages, and why you should use it instead of ad-hoc manual work.
|
|
80
|
-
3. **Who (Target Roles & Personas)**: Target audience or engineering role (e.g., Feature Developer, Senior QA, Security Auditor, Solo Dev, or Tech Lead).
|
|
81
|
-
4. **Where (Boundaries & Artifact Locations)**: Target workspace boundaries, affected directories, and generated artifact locations (e.g., `devflow/context/`, `devflow/discoveries/`, `findings.md`).
|
|
82
|
-
5. **When (Timing & Prerequisites/Next Steps)**:
|
|
83
|
-
- **Timing & Triggers**: Practical situations or milestones when this skill should be invoked.
|
|
84
|
-
- **Run Before (Prerequisites)**: What to check, prepare, or run beforehand to get the best result.
|
|
85
|
-
- **Run After (Next Steps)**: What DevFlow command or lifecycle stage should follow next (e.g., handing off to `/fix`, `/feature`, or `/complete`).
|
|
86
|
-
6. **How (Execution Lifecycle & Real Command Examples)**:
|
|
87
|
-
- **How It Works (Lifecycle)**: Simple, plain-language breakdown of the execution steps or phases.
|
|
88
|
-
- **Available Commands & Options**: Common sub-commands, arguments, and flags with brief explanations.
|
|
89
|
-
- **Safety, Guardrails & Precautions**: Operational boundaries, credential hygiene, read-only vs. mutating constraints, and explicit special safety constraints / precautions.
|
|
90
|
-
7. **Diagram Slot & Architecture Flow**:
|
|
91
|
-
- **Real Diagram Mandate**: MUST embed a real, verified vector SVG or interactive diagram reflecting actual skill lifecycle, state transitions, or threat models in Light Theme (`data-theme="light"`).
|
|
92
|
-
- **Thai Language & Legible Typography**: Architecture and flow diagrams must describe workflows and nodes in Thai language while preserving technical identifiers, paths, and commands in English. Typography must be sufficiently sized and legible for Thai script (Headers 13–14px, box content/descriptions 11–12px, line spacing 18–22px) to prevent tone marks and vowels from clipping or overlapping.
|
|
93
|
-
- **Strictly No Placeholders**: NEVER output empty placeholder cards, generic instruction text, or phrases like *"when invoking archify..."*. Every playbook must ship with a real visual architectural diagram.
|
|
94
|
-
- Always conclude the response with: `"Help menu displayed successfully"`.
|
|
83
|
+
6. **Contextual Help**: When a DevFlow command is invoked with `help`, `--help`, `-h`, or `?`, read [the playbook protocol](devflow/reference/help-playbook-protocol.md). Produce its help deliverable without running the command's primary action or creating a task run.
|
|
95
84
|
|
|
96
85
|
---
|
|
97
86
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
- **Be Concise and Direct**: State conclusions, status, and findings first; provide supporting context afterward.
|
|
10
10
|
- **Explain Non-Obvious Decisions Briefly**: Highlight architectural trade-offs, edge-case rationale, or safety considerations in 1–2 sentences.
|
|
11
|
-
- **Ask
|
|
11
|
+
- **Authorization**: Reuse explicit authorization already given for the requested work. Ask before destructive actions or material architectural changes outside that scope. Identify the instruction requiring a pause; routine implementation choices do not require renewed approval.
|
|
12
12
|
- **Don't Add Unplanned Scope**: Stick strictly to the Acceptance Criteria defined in the spec. Avoid adding "nice-to-have" features that were not requested.
|
|
13
13
|
- **Preserve Existing Codebase Patterns**: Respect existing file structure, typing patterns, naming conventions, and deep module boundaries.
|
|
14
14
|
|
|
@@ -21,8 +21,8 @@ Format every response for fast scanning and readability:
|
|
|
21
21
|
- **Real Markdown, Not Prose Walls**: Use bold labels, concise bullet points, and blank lines between blocks.
|
|
22
22
|
- **Enumerations Are Lists**: Numbered or bulleted lists for sequential steps or findings, never inline runs crammed into paragraphs.
|
|
23
23
|
- **Tables for Comparative Matrices**: Use markdown tables when comparing status, options, test results, or trade-offs.
|
|
24
|
-
- **Backticks for Code References**: Wrap file paths, variable names, functions, CLI flags, and commands in backticks (e.g. `
|
|
25
|
-
- **Clickable File Links**: Use
|
|
24
|
+
- **Backticks for Code References**: Wrap file paths, variable names, functions, CLI flags, and commands in backticks (e.g. `devflow/context/{xxx-slug}/spec.md`, `npm run check`).
|
|
25
|
+
- **Clickable File Links**: Use the active client's supported local-file link format with the actual resolved path.
|
|
26
26
|
- **Lead With the Result**: State pass/fail status or completed action before presenting logs.
|
|
27
27
|
|
|
28
28
|
---
|
|
@@ -97,7 +97,7 @@ After the first successful `/overview`, DevFlow offers a reviewed local commit f
|
|
|
97
97
|
## 4. Strict TDD & Two-Stage Review Interaction Rules
|
|
98
98
|
|
|
99
99
|
### 🔴🟢 Strict TDD Execution Discipline
|
|
100
|
-
|
|
100
|
+
For logic and behavior changes during `/implement`, follow the spec's test decision:
|
|
101
101
|
- **Show Red Phase**: First execute tests to demonstrate expected failure *before* adding production code.
|
|
102
102
|
- **Show Green Phase**: Add minimal production code, re-run tests, and report pass rate.
|
|
103
103
|
- **Show Refactor Phase**: Polish and clean up with zero test regression.
|
|
@@ -111,10 +111,10 @@ During `/check`:
|
|
|
111
111
|
|
|
112
112
|
### ⚡ Review Cadence & Implementation Loop
|
|
113
113
|
- **Efficient Default (`stepReview: "feature"`)**: Presents one comprehensive review packet after all implementation steps of the feature complete, with step checkpoint commits disabled (`checkpointCommits: "disabled"`). This minimizes review fatigue and saves context window tokens.
|
|
114
|
-
- **Guided Review (`stepReview: "every"`)**: Available for high-risk changes, pair programming, or instructional sessions. Pauses for user approval after each small step
|
|
114
|
+
- **Guided Review (`stepReview: "every"`)**: Available for high-risk changes, pair programming, or instructional sessions. Pauses for user approval after each small step. Offer optional checkpoints only if `checkpointCommits: "enabled"`.
|
|
115
115
|
- **Post-Implementation Walkthrough**: After the final review packet, `/implement` always offers an optional read-only walkthrough of the finished code, regardless of review cadence or checkpoint settings.
|
|
116
116
|
- **Independent Review Execution**: Regular and Continuous independent review default to `when-sensitive`, while `review.independentExecution` defaults to `automatic` (spawning an isolated reviewer child when the active adapter supports it). Setting `review.independentExecution: "manual"` produces the fresh-session handoff.
|
|
117
|
-
- **Configuration**: Managed directly in `devflow/config.json`.
|
|
117
|
+
- **Configuration**: Managed directly in `devflow/config.json`. The two workflow keys are independent: `every` does not imply checkpoints are enabled, and `enabled` never grants commit authorization. Use the implementation skill's cadence contract for all four combinations.
|
|
118
118
|
|
|
119
119
|
---
|
|
120
120
|
|
|
@@ -131,16 +131,17 @@ During `/check`:
|
|
|
131
131
|
|
|
132
132
|
Progress lives in persistent files, not in transient chat history:
|
|
133
133
|
|
|
134
|
-
- In
|
|
134
|
+
- In the selected run: `devflow/context/{xxx-slug}/spec.md` maintains ticked checklist boxes `- [x]`.
|
|
135
135
|
- In Git: Commits, branches, and working tree maintain the code history.
|
|
136
|
-
- When starting a fresh session after a context clear, run
|
|
136
|
+
- When starting a fresh session after a context clear, resolve the run from an explicit ID or current branch, then inspect `devflow/context/{xxx-slug}/stage.md` and its spec to pick up immediately from the next pending step.
|
|
137
137
|
|
|
138
138
|
---
|
|
139
139
|
|
|
140
|
-
## 6.
|
|
140
|
+
## 6. Multi-Run Isolation
|
|
141
141
|
|
|
142
|
-
-
|
|
143
|
-
-
|
|
142
|
+
- Multiple specs may be queued in `devflow/context/{xxx-slug}/` without blocking new drafts.
|
|
143
|
+
- Select a run by explicit ID, matching branch, or the sole active candidate. Ask only when the target remains ambiguous.
|
|
144
|
+
- Keep each run's spec, stage, findings, and branch separate. Protect unrelated working-tree changes before switching; use an isolated worktree when concurrent implementation requires it.
|
|
144
145
|
|
|
145
146
|
---
|
|
146
147
|
|
|
@@ -177,14 +178,14 @@ Progress lives in persistent files, not in transient chat history:
|
|
|
177
178
|
Nexus-DevFlow natively supports extending workflow capabilities with **Third-Party Skills** (installed via `nexus-devflow skill add <repo-or-path>`):
|
|
178
179
|
|
|
179
180
|
### 🧩 1. Discovery & Inventory
|
|
180
|
-
-
|
|
181
|
+
- Reuse the available skill catalog. Inspect the active adapter or run `nexus-devflow skill list` only when a required capability is not already known.
|
|
181
182
|
- Installed third-party skills maintain their exact original directory structure, references, assets, scripts, and `SKILL.md`.
|
|
182
183
|
|
|
183
184
|
### 🎯 2. Cross-Command Delegation & Genuine Execution
|
|
184
|
-
- **Verbatim & Original Prompt Fidelity**: When a DevFlow stage requires specialized domain expertise (e.g., editorial diagramming, system mapping, domain modeling, cloud provisioning, UI benchmarking), the AI agent must read the third-party skill's `SKILL.md` (e.g. `.agents/skills/archify/SKILL.md` or `.agents/skills/diagram-design/SKILL.md`) and
|
|
185
|
+
- **Verbatim & Original Prompt Fidelity**: When a DevFlow stage requires specialized domain expertise (e.g., editorial diagramming, system mapping, domain modeling, cloud provisioning, UI benchmarking), the AI agent must read the third-party skill's `SKILL.md` (e.g. `.agents/skills/archify/SKILL.md` or `.agents/skills/diagram-design/SKILL.md`) and apply the relevant workflow within the user's requested scope. Explicit user instructions take precedence over skill guidance; reuse existing authorization rather than adding approval gates.
|
|
185
186
|
- **Workflow Command Integration Map**:
|
|
186
187
|
- **`/discovery`**: When macro roadmap planning or micro pre-flight exploration involves system architecture, IT landscape, data pipelines, sequence flows, or user journeys, check for `archify` (for interactive system maps, data flows, and sequence traces) or `diagram-design` (for editorial and business layouts).
|
|
187
|
-
- **`/feature` & `/fix`**:
|
|
188
|
+
- **`/feature` & `/fix`**: When a diagram materially clarifies Section 2 (`## 📐 2. Technical Spec & Contracts`), use `archify` for interactive component diagrams, state machines, and sequence traces, or `diagram-design` for database ER models.
|
|
188
189
|
- **`/implement`**: Seamlessly consumes Tracer-Bullet Tickets generated by Matt Pocock's `/to-tickets` (`.scratch/<feature>/issues/`, `devflow/context/{xxx-slug}/tickets/`), resolving the unblocked Frontier and executing with Strict TDD.
|
|
189
190
|
- **`/brainstorm` & `/grill`**: Leverage visual trade-off matrices (Quadrant, Radar spider) or domain models (UML class, ER).
|
|
190
191
|
- **`/prototype` & `/report-html`**: Embed standalone HTML/SVG assets seamlessly.
|
|
@@ -131,12 +131,13 @@ nexus-devflow/
|
|
|
131
131
|
|
|
132
132
|
Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
133
133
|
|
|
134
|
-
- **Unit Test Mandate**:
|
|
134
|
+
- **Unit Test Mandate**: Logic or behavior changes must include meaningful automated coverage when the spec's test gate is enabled. Documentation, prompt wording, or formatting-only changes use structural checks and review instead of artificial unit tests.
|
|
135
135
|
- **Strict TDD (Red-Green-Refactor) Protocol**:
|
|
136
136
|
1. **🔴 RED (Test First)**: Always write automated tests *before* writing or modifying functional logic. Run the test command and verify that it fails for the expected reason.
|
|
137
137
|
2. **🟢 GREEN (Minimal Code)**: Write only the minimal production code necessary to make the failing test pass. Run the test command and verify 100% green pass.
|
|
138
138
|
3. **🔵 REFACTOR (Clean & Robust)**: Refactor code for readability, performance, and DRY/YAGNI discipline while ensuring all tests stay green.
|
|
139
139
|
- *Code Deletion / Reversion Rule*: If functional code is created without a prior failing test for behavior changes, it must be reverted or immediately backed by tests before continuing.
|
|
140
|
+
- **Verification Scope**: Run focused checks during edits and required project gates before handoff. Repeat passing checks only after relevant changes, new failures, or unresolved risk.
|
|
140
141
|
- **Test Framework**: Use Node.js native test runner executed via `tsx --test test/*.test.ts` under `packages/create-nexus-devflow/`.
|
|
141
142
|
- **Test Design (AAA Pattern)**:
|
|
142
143
|
- Structure each test case cleanly: **Arrange** (setup fixtures/mock directories), **Act** (execute function), **Assert** (verify invariants).
|
|
@@ -149,7 +150,7 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
|
149
150
|
2. *Interactive AI Visual QA (MCP)*: Live DOM and styling inspection via MCP `browseros-neo` (`http://127.0.0.1:9010/mcp`) during `/check` and `/try`.
|
|
150
151
|
- **Two-Stage Review Pattern (Verification Gate)**:
|
|
151
152
|
- **Stage 1: Spec Fidelity & Acceptance Gate**:
|
|
152
|
-
- Verify 100% conformance against the Single Living Spec (`
|
|
153
|
+
- Verify 100% conformance against the Single Living Spec (`devflow/context/{xxx-slug}/spec.md`).
|
|
153
154
|
- Validate all Acceptance Criteria (ACs) and "Done When" observables without missing requirements or scope creep.
|
|
154
155
|
- Test edge cases and boundary conditions defined in the specification.
|
|
155
156
|
- **Stage 2: Code Quality, Security & Architecture Gate**:
|
|
@@ -157,13 +158,13 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
|
157
158
|
- **Lane 2 (Automated Test Suites & Evals)**: `npm test` (Unit tests 100% pass) + `npm run test:routing` (Skill routing accuracy).
|
|
158
159
|
- **Lane 3 (Scrutinize & Security Audit)**: Edge cases, null-safety, 0 secrets, safe inputs.
|
|
159
160
|
- **Lane 4 (Manual / Scenario Proof)**: Concrete walkthrough steps ("Where to go", "What to run", "What to expect").
|
|
160
|
-
- **Findings Ledger State**: 0 blockers (P0/P1) in `devflow/context/findings.md`.
|
|
161
|
+
- **Findings Ledger State**: 0 blockers (P0/P1) in `devflow/context/{xxx-slug}/findings.md`.
|
|
161
162
|
|
|
162
163
|
---
|
|
163
164
|
|
|
164
165
|
## 8. Findings Ledger & Quality Gates (`findings.md`, `review.md`)
|
|
165
166
|
|
|
166
|
-
- All quality defects, security findings, or regression issues identified during review must be logged in `devflow/context/findings.md`.
|
|
167
|
+
- All quality defects, security findings, or regression issues identified during review must be logged in `devflow/context/{xxx-slug}/findings.md`.
|
|
167
168
|
- **Finding State Machine**:
|
|
168
169
|
- `open`: Confirmed issue waiting to be fixed.
|
|
169
170
|
- `fixed`: Repaired in code, pending QA re-verification.
|
|
@@ -214,7 +215,7 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
|
214
215
|
|
|
215
216
|
## 12. HTML Documentation & Theming Standards (Light Theme Mandate)
|
|
216
217
|
|
|
217
|
-
All generated HTML artifacts across the framework (Contextual Help Playbooks `devflow/
|
|
218
|
+
All generated HTML artifacts across the framework (Contextual Help Playbooks `devflow/reference/playbooks/{skill}.html`, Standalone Reports `report-html`, Architecture & Workflow Diagrams `archify` / `diagram-design`, and UI Prototypes/Mockups) MUST strictly adhere to the **Paper/Ink Light Theme Design System**:
|
|
218
219
|
|
|
219
220
|
- **Mandatory Default `data-theme="light"`**:
|
|
220
221
|
- All HTML documents must start with `<html lang="th" data-theme="light">`.
|
|
@@ -256,6 +257,66 @@ All generated HTML artifacts across the framework (Contextual Help Playbooks `de
|
|
|
256
257
|
- Fonts: Google Sans (`'Google Sans'`, `'Google Sans Text'`) for display headers and body text, `'JetBrains Mono'` for code and monospaced data.
|
|
257
258
|
- Full support for `prefers-reduced-motion: reduce` and clear `:focus-visible` outlines.
|
|
258
259
|
- **Master Reference Template**:
|
|
259
|
-
- Refer to `devflow/
|
|
260
|
+
- Refer to `devflow/reference/playbooks/template.html` as the authoritative, reusable component reference for all playbook and HTML documentation generation.
|
|
260
261
|
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 13. Prompt Token Economy & Mechanical Input Coverage Standards
|
|
265
|
+
|
|
266
|
+
- **Skill Byte Budgets & Prompt Hygiene**:
|
|
267
|
+
- **Size Ceilings**: `SKILL.md` must not exceed **32 KB**, support/reference markdown files must not exceed **24 KB**, and frontmatter `description` must not exceed **400 characters**.
|
|
268
|
+
- **Every Line Must Earn Its Keep**: If an agent naturally behaves correctly by default, avoid adding redundant prose. Instruct directly without philosophical justification.
|
|
269
|
+
- **Completion Summaries (Lead with Essentials)**:
|
|
270
|
+
- **Headline**: One-line summary of what was accomplished.
|
|
271
|
+
- **Next**: Exactly one next recommended command or action.
|
|
272
|
+
- **Heads up**: Active blockers, decision debt, or critical items needing user attention (omitted when empty).
|
|
273
|
+
- **Pointer**: Link to the detailed artifact rather than repeating large text blocks.
|
|
274
|
+
- **No Checklist Spam**: Avoid dumping lists of obvious successes (`Semantic HTML: OK`, `Keyboard: OK`).
|
|
275
|
+
- **Mechanical Input Coverage Principle (Anti-Hallucination Gate)**:
|
|
276
|
+
- Before implementation, enumerate all values and states that the code must produce or display.
|
|
277
|
+
- Each value must have an explicitly named source (Database column, Input argument, Calculated derivation, or Settled architectural decision).
|
|
278
|
+
- Any required value lacking a named source represents an **Owed Decision**; agents are prohibited from making unrecorded architectural choices or guessing implementations under the guise of "just wiring". Stop and route to `/grill` or request user clarification.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 14. Architectural Slicing & Assumed Decision Governance
|
|
283
|
+
|
|
284
|
+
- **4 Slicing Archetypes Framework (`devflow/reference/slicing-archetypes.md`)**:
|
|
285
|
+
- When decomposing large roadmaps or splitting oversized features, select from the 4 standard archetypes:
|
|
286
|
+
- **Skateboard**: Minimal functional loop (prove core logic end-to-end with minimal UI).
|
|
287
|
+
- **Facade**: Rich UI/DX with mock backend (validate user flow & interaction first).
|
|
288
|
+
- **Tracer Bullet**: Deep vertical slice across all layers (DB -> API -> UI) for 1 happy path.
|
|
289
|
+
- **Journey**: Slice along natural user workflow milestones.
|
|
290
|
+
- Avoid purely technical layer slicing (e.g. DB only or backend only) that leaves work unverifiable in a single delivery run.
|
|
291
|
+
- **Assumed Decision Debt Lifecycle (`Status: Assumed`)**:
|
|
292
|
+
- For fast-tracking development when user confirmation is pending, record decisions in ADRs (`devflow/decisions/`) with `Status: Assumed`.
|
|
293
|
+
- Every assumed decision MUST specify `Assumption`, `Risk Level & Blast Radius`, and `Ratification Plan`.
|
|
294
|
+
- Untracked architectural assumptions are strictly prohibited.
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 15. Test File Classification & AC Traceability Standards
|
|
299
|
+
|
|
300
|
+
- **5-Tier Test Classification**:
|
|
301
|
+
- **Tier 1: Pure Logic & Algorithms** (`src/utils/`, `services/`, `lib/`): Fast in-memory Unit Tests, 100% boundary & edge cases coverage. Use TDD.
|
|
302
|
+
- **Tier 2: UI Components** (`src/components/`, `src/pages/`): Component mounting & event interaction, visual verification via Playwright / BrowserOS Neo. Prohibit trivial unit tests for static HTML markup.
|
|
303
|
+
- **Tier 3: API & Data Integration** (`src/api/`, route handlers, DB models): Contract tests, schema validation (Zod), status codes, payload shapes.
|
|
304
|
+
- **Tier 4: Config & Build Tooling** (`*.json`, `*.yaml`, `scripts/`): Static contract validation (`npm run check:static`), budget linters (`npm run check:budgets`), smoke tests.
|
|
305
|
+
- **Tier 5: Documentation & Prose** (`*.md`, `docs/`, `scripts/data/`): Structural checks, markdown contract scans, link integrity verification.
|
|
306
|
+
- **Acceptance Criteria (`AC-N`) Traceability**:
|
|
307
|
+
- All automated test suites and assertion descriptions must explicitly include the target Acceptance Criterion tag (e.g. `it('AC-1: ...')`).
|
|
308
|
+
- During `/check`, verify that 100% of defined acceptance criteria in the active living spec have matching passing empirical proof.
|
|
309
|
+
|
|
310
|
+
---
|
|
261
311
|
|
|
312
|
+
## 16. Token Economy & Cost Optimization Standards
|
|
313
|
+
|
|
314
|
+
- **Token Economics Visibility**:
|
|
315
|
+
- Leverage `npm run analyze:tokens` (or `scripts/analyze-token-usage.ts`) to audit session token usage across Main Thread vs Subagents.
|
|
316
|
+
- Track the 4 token dimensions: **Fresh Input Tokens**, **Prompt Cache Write Tokens**, **Prompt Cache Read Tokens (Hits)**, and **Output Tokens**.
|
|
317
|
+
- **Prompt Caching Optimization**:
|
|
318
|
+
- Structure documentation and context files with immutable headers first so LLM providers can achieve high prompt cache hit rates (>60%).
|
|
319
|
+
- Ensure living specs and references stay compact (under byte budgets) to prevent prompt cache misses and unnecessary token churn.
|
|
320
|
+
- **Cost Metrics & Savings**:
|
|
321
|
+
- Track estimated model costs (USD) against model pricing catalogs (Claude 3.7/3.5 Sonnet, Gemini 2.5 Pro/Flash, GPT-4o).
|
|
322
|
+
- Aim for >50% cost savings through effective prompt caching reuse.
|