@jakkrichm/create-nexus-devflow 2.11.1 → 2.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +3 -3
  2. package/dist/bin/create-nexus-devflow.d.ts +2 -0
  3. package/dist/bin/create-nexus-devflow.js +63 -2
  4. package/dist/bin/create-nexus-devflow.js.map +1 -1
  5. package/dist/lib/project-config.d.ts +3 -1
  6. package/dist/lib/project-config.js +3 -1
  7. package/dist/lib/project-config.js.map +1 -1
  8. package/dist/lib/skill-manager.d.ts +5 -0
  9. package/dist/lib/skill-manager.js +30 -0
  10. package/dist/lib/skill-manager.js.map +1 -1
  11. package/dist/lib/update.d.ts +4 -2
  12. package/dist/lib/update.js +12 -6
  13. package/dist/lib/update.js.map +1 -1
  14. package/dist/scripts/prepare-template.js +11 -0
  15. package/dist/scripts/prepare-template.js.map +1 -1
  16. package/package.json +1 -1
  17. package/template/.agents/skills/analyze/SKILL.md +113 -0
  18. package/template/.agents/skills/doctor/SKILL.md +52 -49
  19. package/template/.agents/skills/doctor/scripts/run-state.mjs +513 -0
  20. package/template/.agents/skills/feature/SKILL.md +2 -0
  21. package/template/.agents/skills/feature/reference/feature-spec-template.md +82 -0
  22. package/template/.agents/skills/implement/SKILL.md +3 -35
  23. package/template/.agents/skills/implement/reference/rollback-implementation.md +35 -0
  24. package/template/.agents/skills/onboard/SKILL.md +43 -2
  25. package/template/.agents/skills/overview/SKILL.md +25 -12
  26. package/template/.agents/skills/report-html/SKILL.md +25 -5
  27. package/template/.agents/skills/status/SKILL.md +17 -20
  28. package/template/.claude/skills/analyze/SKILL.md +113 -0
  29. package/template/.claude/skills/doctor/SKILL.md +52 -49
  30. package/template/.claude/skills/doctor/scripts/run-state.mjs +513 -0
  31. package/template/.claude/skills/feature/SKILL.md +2 -0
  32. package/template/.claude/skills/feature/reference/feature-spec-template.md +82 -0
  33. package/template/.claude/skills/implement/SKILL.md +3 -35
  34. package/template/.claude/skills/implement/reference/rollback-implementation.md +35 -0
  35. package/template/.claude/skills/onboard/SKILL.md +43 -2
  36. package/template/.claude/skills/overview/SKILL.md +25 -12
  37. package/template/.claude/skills/report-html/SKILL.md +25 -5
  38. package/template/.claude/skills/status/SKILL.md +17 -20
  39. package/template/AGENTS.md +19 -11
  40. package/template/devflow/analysis/REQ-20260903-001-sync-upstream-ai-blueprint/codebase-impact.md +46 -0
  41. package/template/devflow/build-plan.md +32 -2
  42. package/template/devflow/context/ai-interaction.md +2 -0
  43. package/template/devflow/inbox/REQ-20260903-001-sync-upstream-ai-blueprint/clarifications.md +34 -0
  44. package/template/devflow/inbox/REQ-20260903-001-sync-upstream-ai-blueprint/parsed.md +66 -0
  45. package/template/devflow/inbox/REQ-20260903-001-sync-upstream-ai-blueprint/raw/upstream-v152-diff.md +16 -0
@@ -0,0 +1,82 @@
1
+ # 📐 [{xxx-slug}] {title}
2
+
3
+ > **Status**: In-Progress
4
+ > **Track**: Fast-Track (Task-Isolated Living Spec Mode - Feature)
5
+ > **Category**: Feature
6
+ > **Source**: `devflow/build-plan.md: Feature {n}` & `devflow/discoveries/{DISC-ID}/discovery.md`
7
+ > **Branch**: `feature/{xxx-slug}`
8
+ > **Started Date**: {YYYY-MM-DD}
9
+ > **Delivered Date**: TBD
10
+ > **Owner**: DevFlow Core Framework Team & AI
11
+
12
+ ---
13
+
14
+ ## 1. Specification & Scope
15
+
16
+ ### 1.1 Problem Statement
17
+ {คำอธิบายปัญหาและที่มาของความจำเป็นในการพัฒนาฟีเจอร์นี้}
18
+
19
+ ### 1.2 In-Scope
20
+ 1. {ขอบเขตการทำงานข้อที่ 1}
21
+ 2. {ขอบเขตการทำงานข้อที่ 2}
22
+
23
+ ### 1.3 Out-of-Scope
24
+ - {สิ่งที่อยู่นอกเหนือขอบเขตหรือไม่ทำในรอบนี้}
25
+
26
+ ### 1.4 Acceptance Criteria (เกณฑ์การยอมรับ)
27
+ - [ ] **AC-1**: {เกณฑ์การตรวจรับข้อที่ 1}
28
+ - [ ] **AC-2**: {เกณฑ์การตรวจรับข้อที่ 2}
29
+
30
+ ---
31
+
32
+ ## 2. Plan & Test Strategy
33
+
34
+ ### 2.1 Files Modified / Created
35
+ - `{file-path}` [NEW | MODIFY | DELETE]
36
+
37
+ ### 2.2 Quality Gates & Sensitivity Check
38
+ - **Quality Gate Policy (`independentReview`)**: `manual` | `always` | `when-sensitive`
39
+ - **UI Evidence / Browser Tests**: {Not applicable | Playwright / BrowserOS Neo}
40
+ - **Review Strategy**: One feature-level review packet at completion
41
+
42
+ ### 2.3 Test Decision: Required (TDD) | Optional
43
+ - **Rationale**: {เหตุผลความจำเป็นในการเขียน Unit Tests / TDD}
44
+
45
+ ---
46
+
47
+ ## 3. Implementation Checklist (Strict TDD)
48
+
49
+ - [ ] **Task 1: {หัวข้องานที่ 1}**
50
+ - [ ] 1.1 `[TDD-Red]`: {เขียน Test เคสล้มเหลว}
51
+ - [ ] 1.2 `[TDD-Green]`: {เขียนโค้ดขั้นต่ำเพื่อให้ Test ผ่าน}
52
+ - [ ] 1.3 `[TDD-Refactor]`: {Refactor และตรวจให้ 100% Tests Green}
53
+
54
+ - [ ] **Task 2: {หัวข้องานที่ 2}**
55
+ - [ ] 2.1 `[TDD-Red]`: ...
56
+ - [ ] 2.2 `[TDD-Green]`: ...
57
+ - [ ] 2.3 `[TDD-Refactor]`: ...
58
+
59
+ ---
60
+
61
+ ## 4. Verification Evidence Matrix
62
+
63
+ ### ⚖️ Axis 1: Standards, Architecture & Quality Gate
64
+ - **Type Safety & Build Integrity**: TBD
65
+ - **Automated Test Matrix**: TBD
66
+ - **Static Contract Verification**: TBD
67
+ - **Package Smoke Test**: TBD
68
+ - **Findings Ledger**: ตรวจสอบ `findings.md` สะอาด 100%
69
+
70
+ ### 🎯 Axis 2: Spec Fidelity & Behavioral Acceptance Gate
71
+ - [ ] **AC-1**: {หลักฐานการผ่านเกณฑ์ข้อที่ 1}
72
+ - [ ] **AC-2**: {หลักฐานการผ่านเกณฑ์ข้อที่ 2}
73
+
74
+ ---
75
+
76
+ ## 5. Delivery Verification & Independent Receipt
77
+
78
+ - **Delivery Date**: TBD
79
+ - **Verification Verdict**: TBD
80
+ - **Framework Tests**: TBD
81
+ - **Static Contract**: TBD
82
+ - **Package Smoke Test**: TBD
@@ -6,6 +6,8 @@ argument-hint: "[{run-id, number, or name}]"
6
6
 
7
7
  # implement - build the target spec, one reviewed step at a time
8
8
 
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
+
9
11
  **First action:** Before project inspection, preflight, or any other tool call,
10
12
  publish `running` to `devflow/.state/run.json` using the dashboard activity
11
13
  contract in `AGENTS.md`.
@@ -81,41 +83,7 @@ instead of creating a new one.
81
83
 
82
84
  ### Type: Rollback safeguard
83
85
 
84
- For a rollback spec, do not hand-delete the old feature and do not run a whole
85
- commit `git revert`. Completed feature commits also contain Blueprint history and
86
- plan bookkeeping, while `devflow/context/{xxx-slug}/spec.md` now contains the active rollback
87
- spec. Reversing the whole commit would damage that state.
88
-
89
- Before the first rollback build step:
90
-
91
- 1. Re-resolve the target archive's introducing commit and confirm it matches the
92
- full Target commit SHA recorded in the approved spec.
93
- 2. Confirm the target is an ancestor of `HEAD`, has the recorded single parent,
94
- and the only dirty path before applying the patch is the approved rollback
95
- spec. Stop on drift.
96
- 3. Preview the target's product diff while excluding `.agents/**`, `.claude/**`,
97
- `devflow/**`, `AGENTS.md`, `CLAUDE.md`, and
98
- `prototypes/**`. Confirm the preview is non-empty and matches the Product
99
- paths in the spec.
100
- 4. Apply that product diff in reverse with three-way conflict detection and
101
- stage it. Substitute the two approved full SHAs before running:
102
-
103
- git diff --binary <target-parent> <target-commit> -- . \
104
- ':(exclude).agents/**' \
105
- ':(exclude).claude/**' ':(exclude)devflow/**' \
106
- ':(exclude)AGENTS.md' ':(exclude)CLAUDE.md' \
107
- ':(exclude)prototypes/**' |
108
- git apply --reverse --3way --index
109
-
110
- Never omit the protected pathspec exclusions for convenience.
111
- 5. Show both `git diff --cached` and `git status`. Confirm no protected path is
112
- staged or modified before presenting the step for review.
113
-
114
- If the reverse patch conflicts, stop and report the exact paths and later commit
115
- that appears involved. Do not auto-resolve, discard, stash, reset, or switch to a
116
- broad checkout. Ask whether to resolve only the conflict allowed by the approved
117
- spec or abandon the attempt. A cascade into another completed feature needs a
118
- new rollback plan.
86
+ When implementing a rollback task, follow the exact safety procedure in `reference/rollback-implementation.md`.
119
87
 
120
88
  ## Step 2 - build one step, review, iterate, checkpoint (Strict TDD)
121
89
 
@@ -0,0 +1,35 @@
1
+ # Rollback implementation safeguard
2
+
3
+ Use this only when `stage.md` / `spec.md` indicates a rollback task.
4
+
5
+ Do not hand-delete the old feature and do not run a whole-commit `git revert`.
6
+ The completed commit also contains DevFlow history and plan bookkeeping.
7
+
8
+ Before the first rollback step:
9
+
10
+ 1. Read `Target commit` and `Target parent`. Stop unless both values match
11
+ `^[0-9a-f]{40}$`.
12
+ 2. Resolve the archive's introducing commit and verify it has exactly one parent.
13
+ Stop on a merge target. Confirm the resolved commit exactly equals `Target
14
+ commit` and the resolved parent exactly equals `Target parent`.
15
+ 3. Confirm the target is an ancestor of `HEAD` and the approved rollback spec is
16
+ the only dirty path. Stop on drift.
17
+ 4. Preview the target's product diff while excluding `.agents/**`,
18
+ `.claude/**`, `devflow/**`, `AGENTS.md`, `CLAUDE.md`, and `prototypes/**`.
19
+ Confirm it is non-empty and matches the Product paths in the spec.
20
+ 5. Apply only the resolved product diff in reverse with three-way conflict
21
+ detection. Use only the resolved full SHA values:
22
+
23
+ git diff --binary <target-parent> <target-commit> -- . \
24
+ ':(exclude).agents/**' \
25
+ ':(exclude).claude/**' ':(exclude)devflow/**' \
26
+ ':(exclude)AGENTS.md' ':(exclude)CLAUDE.md' \
27
+ ':(exclude)prototypes/**' |
28
+ git apply --reverse --3way --index
29
+
30
+ 6. Show the staged diff and status. Stop if any protected path is staged or
31
+ modified.
32
+
33
+ If the reverse patch conflicts, report the exact paths and later commit involved.
34
+ Do not auto-resolve, discard, stash, reset, or broaden the rollback. Ask whether
35
+ to resolve only the approved conflict or abandon the attempt.
@@ -29,7 +29,48 @@ and project behavior already exist and need to be reflected into the plans.
29
29
  No argument is required. If the user provides context about the stack, hosting,
30
30
  database, auth, or preferred tool, use it as a hint and verify against files.
31
31
 
32
- ## Step 0 - confirm this is onboarding, not adoption
32
+ ## Step 0 - confirm Git and make an unborn repository usable
33
+
34
+ Before reading application code or changing setup files, confirm both Git states:
35
+
36
+ ```bash
37
+ git rev-parse --is-inside-work-tree
38
+ git rev-parse --verify HEAD
39
+ ```
40
+
41
+ If this is not a Git repository, stop and ask the user to initialize one, then
42
+ rerun `/onboard`.
43
+
44
+ An existing first commit may contain only the scaffold or may already contain
45
+ DevFlow. Both are valid. Do not ask the user to rewrite either history shape.
46
+
47
+ If Git reports an unborn `HEAD`, handle it here instead of sending the user away
48
+ to run Git commands:
49
+
50
+ 1. Inspect status and build a safe scaffold-only candidate from paths outside
51
+ `AGENTS.md`, `CLAUDE.md`, `.agents/`, `.claude/`, and `devflow/`. Exclude
52
+ secrets, dependencies, caches, build output, generated state, and anything
53
+ else that should not enter source control. Include the existing `.gitignore`
54
+ when it is safe.
55
+ 2. Resolve the intended default branch from a remote default when available,
56
+ then an existing `main` or `master`, then Git's configured initial branch,
57
+ and otherwise `main`. Preserve the current unborn branch name as the setup
58
+ branch when it is not the intended default. If the intended name is genuinely
59
+ ambiguous, ask only that one question.
60
+ 3. Show the exact candidate and the branch result, then ask once:
61
+ `Create the initial scaffold commit and continue Onboard? (Recommended)`
62
+ State that this creates one local commit and never pushes.
63
+ 4. On approval, stage only the reviewed candidate, verify the staged diff, and
64
+ commit it as `chore: scaffold application`. If needed, rename the unborn
65
+ branch before committing so the root commit establishes the intended default
66
+ branch. Then create or return to the named setup branch at that same commit
67
+ and continue Onboard in the same run.
68
+
69
+ If there is no safe scaffold candidate, stop with the exact blocker rather than
70
+ creating an empty or mixed root commit. Never create the commit without explicit
71
+ approval.
72
+
73
+ Then confirm this is onboarding, not adoption.
33
74
 
34
75
  Inspect the repository and the two planning docs:
35
76
 
@@ -41,7 +82,7 @@ Inspect the repository and the two planning docs:
41
82
  Continue only with setup files such as `AGENTS.md`, `coding-standards.md`,
42
83
  `.gitignore`, and optional notes.
43
84
 
44
- Never run a framework scaffolder. The Blueprint is already overlaid.
85
+ Never run a framework scaffolder. DevFlow is already overlaid.
45
86
 
46
87
  ## Step 1 - survey the project facts
47
88
 
@@ -81,8 +81,8 @@ commit. Never create this commit silently.
81
81
  Treat this as the initial pre-feature state only when all of these are true:
82
82
 
83
83
  - the project is a Git repository with an existing `HEAD` commit
84
- - the current branch is the default branch, resolving the remote default when
85
- available and otherwise accepting `main` or `master`
84
+ - the current branch is the default branch, or it is a dedicated setup branch
85
+ whose starting commit exactly matches the current default-branch tip
86
86
  - the version of `devflow/context/project-overview.md` in `HEAD` does not
87
87
  already contain a generated overview baseline
88
88
  - `devflow/context/` has no active task-isolated workspace directories (`devflow/context/{xxx-slug}/`)
@@ -91,11 +91,11 @@ Treat this as the initial pre-feature state only when all of these are true:
91
91
  - `devflow/build-plan.md` contains no checked feature items
92
92
  - the DevFlow workflow is meant to be committed, not kept local-only
93
93
 
94
- If there is no `HEAD` yet, stop and ask the user to commit the app scaffold by
95
- itself before rerunning `/overview`; never create a root commit that mixes the
96
- app and DevFlow. If the initial run is on a non-default branch, stop and ask
97
- the user to return to the default branch first. These are recoverable initial
98
- handoffs, not permission to offer another baseline after one is committed.
94
+ If there is no `HEAD` yet, stop and send the user back to `/onboard`, which owns
95
+ the initial scaffold commit recovery. Overview never creates a root commit. If a
96
+ dedicated setup branch did not start at the current default tip, stop with that
97
+ exact mismatch. These are recoverable initial handoffs, not permission to offer
98
+ another baseline after one is committed.
99
99
 
100
100
  Detect local-only mode with Git, not memory. Use `git check-ignore` on the
101
101
  present workflow paths. If `.agents/`, `.claude/`, `devflow/`, or `CLAUDE.md`
@@ -103,7 +103,7 @@ are ignored as part of the onboarding local-only choice, skip the offer and
103
103
  continue to the normal `/feature` guidance. `AGENTS.md` remaining public does not
104
104
  make a local-only setup eligible.
105
105
 
106
- Before asking:
106
+ Before asking, record the resolved default branch and its exact tip:
107
107
 
108
108
  1. Read `git status`, the staged diff, the unstaged diff, and untracked paths.
109
109
  2. Build a candidate containing only DevFlow installation, adapter,
@@ -111,16 +111,21 @@ Before asking:
111
111
  `CLAUDE.md`, `.agents/`, `.claude/`, and `devflow/`. Include `.gitignore`
112
112
  only when every changed hunk is clearly an onboarding or DevFlow ignore
113
113
  entry.
114
- 3. Exclude generated local state such as `devflow/.state/`, secrets, logs,
115
- caches, dependencies, build output, and application source.
114
+ 3. Include the installer-owned `devflow/.state/manifest.json` and
115
+ `devflow/.state/.gitignore` when present. Exclude transient state such as
116
+ `run.json`, backups, and staging, plus secrets, logs, caches, dependencies,
117
+ build output, and application source.
116
118
  4. Stop if any staged change or dirty path falls outside the candidate, or if an
117
119
  allowed file contains an unrelated hunk. Do not mix app scaffolding or other
118
120
  user work into this commit. Tell the user exactly what must be committed,
119
121
  moved, or restored first, then leave the repository unchanged.
120
122
  5. If the candidate is empty, skip the offer.
121
123
  6. Show the exact candidate paths and their diff before asking:
122
- `Create the initial planning baseline commit now? (Recommended)`
123
- State that accepting creates one local commit and never pushes it.
124
+ `Finalize the DevFlow baseline locally? (Recommended)`
125
+ State that accepting creates one local commit. When running on a dedicated
126
+ setup branch, it also fast-forwards the unchanged default branch to that
127
+ commit, returns to the default branch, and deletes the setup branch. It never
128
+ pushes.
124
129
 
125
130
  If the user accepts, stage only the reviewed candidate, show the staged paths
126
131
  and diff summary, verify no other path is staged, and commit with this exact
@@ -130,6 +135,14 @@ message:
130
135
  chore: establish DevFlow project baseline
131
136
  ```
132
137
 
138
+ For a dedicated setup branch, verify before committing that the default tip is
139
+ still the one shown in the prompt. After the commit, require a clean working
140
+ tree, switch to the default branch, run `git merge --ff-only <setup-branch>`, and
141
+ delete the setup branch locally. The single approval above covers only these
142
+ named local actions. If the default moved or any check fails, stop without
143
+ merging or deleting. Then confirm the final branch and working tree and recommend
144
+ `/feature`.
145
+
133
146
  Then confirm the working tree state and recommend `/feature`. If the user
134
147
  declines, leave the repository untouched and explain that these setup and
135
148
  planning changes will remain uncommitted until they create the baseline later.
@@ -30,16 +30,36 @@ When invoked:
30
30
  - Archived History: `devflow/history/{features|fixes|rollbacks}/{xxx-slug}.md`
31
31
  2. Parse spec sections, checklist steps, QA evidence, and verification logs.
32
32
 
33
- ### 2. Render Interactive HTML Dashboard
33
+ ### 2. Diagram Pre-Check & Skill Auto-Install (Optional)
34
+ If the spec involves architectural design, system topology, sequence flows, or if the user requests diagrams:
35
+ 1. **Inspect Existing Diagrams**:
36
+ Check `devflow/context/{xxx-slug}/diagrams/`. Any `.svg`, `.html`, or image files will be automatically embedded into the **System & Architecture Diagrams** showcase.
37
+ 2. **Auto-Detect & Install Diagram Skills**:
38
+ If diagrams are requested but not yet generated:
39
+ - Check if `.agents/skills/archify/` or `.agents/skills/diagram-design/` exists.
40
+ - If not installed, run CLI installation:
41
+ ```bash
42
+ # For technical architecture, dataflows, sequence traces, interactive motion
43
+ npx create-nexus-devflow skill add archify
44
+
45
+ # For editorial, business, quadrant, timeline, or radar diagrams
46
+ npx create-nexus-devflow skill add diagram-design
47
+ ```
48
+ 3. **Generate Diagram**:
49
+ Use the installed skill to create the diagram artifact in `devflow/context/{xxx-slug}/diagrams/{name}.html` (or `.svg`).
50
+ 4. **Native Mermaid Support**:
51
+ Any ` ```mermaid ` code block inside the document is automatically rendered visually via the dashboard's built-in theme-aware Mermaid.js engine.
52
+
53
+ ### 3. Render Interactive HTML Dashboard
34
54
  Execute the HTML generation engine or script:
35
55
  ```bash
36
56
  npm run report:html -- {RUNNING_ID}
37
57
  ```
38
58
  Or transform Markdown into a styled, standalone HTML document:
39
- - Output: `devflow/reports/{RUNNING_ID}-report.html` (or adjacent `{xxx-slug}.html`)
59
+ - Output: `devflow/context/{xxx-slug}/report.html` (or adjacent `{xxx-slug}.html`)
40
60
 
41
- ### 3. Output
61
+ ### 4. Output
42
62
  Provide:
43
- - Generated HTML file path: `file:///devflow/reports/{RUNNING_ID}-report.html`
44
- - Summary of sections rendered (Spec, Plan, Progress, QA Evidence, Release Notes)
63
+ - Generated HTML file path: `file:///devflow/context/{xxx-slug}/report.html`
64
+ - Summary of sections rendered (Spec, Plan, Progress, QA Evidence, Diagrams Showcase, Release Notes)
45
65
  - Instructions to open the file in any browser
@@ -5,38 +5,32 @@ description: "[devflow] Show where the project stands: build-plan progress, the
5
5
 
6
6
  # status - where the project stands right now
7
7
 
8
+ **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.
9
+
8
10
  Where this sits in the workflow:
9
11
 
10
12
  any time -> [status] -> reads build-plan + current-feature + git
11
13
  (read-only) prints a short "you are here"
12
14
 
13
- This skill answers one question: *where am I?* It reads the files that already
14
- track progress and prints a short orientation. It is the fast way back in after a
15
- break, a context clear, or a day away. It never changes anything: no edits, no
16
- commits, no installs, no builds, no branch changes.
17
-
18
- Progress in this workflow lives in files, not the chat, so everything this skill
19
- reports comes from disk and git. That is the point: a fresh session can run
20
- `/status` and know exactly as much as the last one did.
15
+ `/status` is orientation: where the project stands right now, what's done,
16
+ what's in flight, whether there's drift between plans and reality, and what
17
+ single action makes the most sense next. It is purely read-only: it reads files
18
+ and git, prints a summary, and exits.
21
19
 
22
- For setup problems, missing files, placeholder plans, adapter drift, or questions
23
- about whether the Blueprint is installed correctly, run `/doctor` instead.
20
+ Use `/doctor` instead when the user wants a full setup-and-health check.
24
21
 
25
22
  ## Input
26
23
 
27
24
  None. `/status` takes no argument.
28
25
 
29
- ## What it reads
26
+ ## What it gathers
30
27
 
31
- Gather these, then summarize. Don't dump file contents; report the distilled
32
- state.
28
+ Read these, distill them into a few lines, then stop. Do not dump file contents.
33
29
 
34
- 1. **Build plan** - `devflow/build-plan.md`. Count checked vs unchecked leaf
35
- items. Name the next unchecked leaf, the same target `/feature` would pick,
36
- and note if a parent item was split into sub-items (`4a`, `4b`, ...).
37
- 2. **Current work & Spec Queue** - scan `devflow/context/{xxx-slug}/`. Is something in
38
- progress? If a feature, fix, or rollback spec is
39
- present, report its type, name, running ID, which build steps are checked, and the
30
+ 1. **Build plan progress** - `devflow/build-plan.md`. How many features total, how
31
+ many are checked off (`- [x]`), what's the next unchecked item.
32
+ 2. **Current work** - `devflow/context/{xxx-slug}/spec.md` (Pure Multi-Run support). If active, how
33
+ many build steps total, how many are checked off, what is the description of the
40
34
  first unchecked step where `/implement` resumes. If multiple tasks are queued, list the active spec queue.
41
35
  3. **Findings** - `devflow/context/{xxx-slug}/findings.md`. Count findings by status and
42
36
  report open and fixed counts next to build-plan progress. Call out any P0 or
@@ -54,7 +48,8 @@ state.
54
48
  7. **Dashboard activity** - read `devflow/.state/run.json` when it exists.
55
49
  Report the command, mode, status, progress, boundary, and safe resume command.
56
50
  A missing file simply means no activity has been recorded. Invalid activity
57
- state is a warning, not a blocker for the underlying workflow.
51
+ state is a warning, not a blocker for the underlying workflow; point to
52
+ `/doctor` to inspect and offer the approved generated-state reset.
58
53
  8. **Onboarding check** - Before recommending `/overview`, check whether `AGENTS.md`
59
54
  still contains the `<!-- devflow:onboarding-required -->` marker or standard template commands.
60
55
  When it does, onboarding is incomplete and `/onboard` is the next action.
@@ -84,6 +79,8 @@ A short, scannable summary, not a wall of text. Aim for something like:
84
79
 
85
80
  End with a single suggested next action, chosen in this order:
86
81
 
82
+ - The project configuration is invalid -> `/doctor`.
83
+ - Dashboard activity is malformed -> `/doctor`.
87
84
  - The overview is missing or stale and no feature is in progress -> `/overview`.
88
85
  - A spec is in progress with unchecked steps -> `/implement [id]` and name the step.
89
86
  - A spec is in progress and all implementation steps are checked -> `/check [id]` if
@@ -40,10 +40,10 @@ Unused adapter families can be removed. Codex, Antigravity, GitHub Copilot, and
40
40
 
41
41
  ### Universal Invocation & Agent Directives:
42
42
 
43
- 1. **Canonical Command Names & AI Provider Invocation**: Each workflow stage and companion tool has exactly **one Canonical Name** (e.g. `feature`, `fix`, `implement`, `check`, `complete`, `continuous`, `discovery`, `idea`, `grill`, `brainstorm`, `devflow`, `doctor`, `overview`, `debug`, `onboard`, `adopt`, `try`, `rollback`, `ci`, `test`, `setup-tests`, `browser-tests`, `autopilot`, `prototype`, `report-html`, `brief`, `audit`, `release`, `convert-any-to-md`, `publish-devflow`). The way you invoke commands depends on your AI Provider / Tool:
44
- - **Canonical Name (Plain text)**: Directly invoke or prompt the command by its standard name (e.g., `feature`, `implement`, `continuous`, `devflow`, `discovery`).
45
- - **Slash Prefix (`/`)**: For tools supporting slash commands (Claude Code, Google Antigravity, Gemini CLI), e.g., `/feature`, `/fix`, `/implement`, `/continuous`, `/devflow`, `/discovery`.
46
- - **Dollar Prefix (`$`)**: For OpenAI Codex CLI or skill-invocation tools, e.g., `$feature`, `$fix`, `$continuous`, `$devflow`, `$discovery`.
43
+ 1. **Canonical Command Names & AI Provider Invocation**: Each workflow stage and companion tool has exactly **one Canonical Name** (e.g. `feature`, `fix`, `implement`, `check`, `complete`, `continuous`, `analyze`, `discovery`, `idea`, `grill`, `brainstorm`, `bughunter`, `devflow`, `doctor`, `overview`, `debug`, `onboard`, `adopt`, `try`, `rollback`, `ci`, `test`, `setup-tests`, `browser-tests`, `autopilot`, `prototype`, `report-html`, `brief`, `audit`, `release`, `convert-any-to-md`, `publish-devflow`). The way you invoke commands depends on your AI Provider / Tool:
44
+ - **Canonical Name (Plain text)**: Directly invoke or prompt the command by its standard name (e.g., `feature`, `implement`, `continuous`, `devflow`, `discovery`, `analyze`).
45
+ - **Slash Prefix (`/`)**: For tools supporting slash commands (Claude Code, Google Antigravity, Gemini CLI), e.g., `/feature`, `/fix`, `/implement`, `/continuous`, `/devflow`, `/discovery`, `/analyze`.
46
+ - **Dollar Prefix (`$`)**: For OpenAI Codex CLI or skill-invocation tools, e.g., `$feature`, `$fix`, `$continuous`, `$devflow`, `$discovery`, `$analyze`.
47
47
  2. **OpenAI Codex & Non-Native CLI Tools**: In environments without automatic background skill discovery (such as OpenAI Codex CLI, Aider, or generic terminals), **you MUST use your file reading tool to inspect `.agents/skills/<skill>/SKILL.md` before executing the stage** to strictly follow its schema, artifact contract, and quality gates.
48
48
  3. **Google Antigravity & Claude Code**: Native skill engines automatically discover and surface `.agents/skills/` and `.claude/skills/`.
49
49
  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`.
@@ -71,8 +71,9 @@ All development tasks execute through the 4-step progressive lifecycle:
71
71
 
72
72
  ---
73
73
 
74
- ## 🔮 Pre-Flight Discovery & Architectural Alignment (Companions)
74
+ ## 🔮 Pre-Flight Discovery, SA & Architectural Alignment (Companions)
75
75
 
76
+ - `analyze`: Unified SA requirement ingestion, multi-format doc parsing (PDF, Word, Excel, images, text), codebase impact scan (`devflow/inbox/`, `devflow/analysis/`).
76
77
  - `discovery`: Unified pre-delivery discovery & exploration (`devflow/discoveries/{DISC-ID}/discovery.md`).
77
78
  - `idea`: Quick idea capture and AI feasibility scoring (`devflow/ideas.md`).
78
79
  - `grill` (or `align`): Socratic alignment, domain modeling, and ADR recording (`devflow/decisions/`).
@@ -84,13 +85,20 @@ All development tasks execute through the 4-step progressive lifecycle:
84
85
 
85
86
  The dashboard and status reporting can show the active or most recent substantial DevFlow command from `devflow/.state/run.json`. This file is generated local state, ignored by Git, and never part of a feature commit.
86
87
 
87
- <<<<<<< HEAD
88
- Commands with meaningful progress or a durable handoff should write it when the state directory exists: `onboard`, `adopt`, `discovery`, `overview`, `feature`, `fix`, `rollback`, `implement`, `debug`, `check`, `audit`, `tests`, `browser-tests`, `ci`, `prototype`, `autopilot`, `continuous`, `complete`, and `release`. Short read-only orientation commands such as `brief`, `try`, `status`, and `doctor` do not need activity state.
89
- =======
90
- Commands with meaningful progress or a durable handoff should write it when the state directory exists: `onboard`, `adopt`, `discovery`, `overview`, `feature`, `fix`, `rollback`, `implement`, `debug`, `check`, `audit`, `setup-tests`, `ci`, `prototype`, `autopilot`, `continuous`, `complete`, and `release`. Short read-only orientation commands such as `brief`, `try`, `status`, and `doctor` do not need activity state.
91
- >>>>>>> feature/064-bughunter-master-skill-and-sync-engine
88
+ Commands with meaningful progress or a durable handoff should write it when the state directory exists: `onboard`, `adopt`, `analyze`, `discovery`, `overview`, `feature`, `fix`, `rollback`, `implement`, `debug`, `check`, `audit`, `bughunter`, `setup-tests`, `browser-tests`, `test`, `ci`, `prototype`, `autopilot`, `continuous`, `complete`, and `release`. Short read-only orientation commands such as `brief`, `try`, `status`, and `doctor` do not need activity state. Doctor's optional approved reset removes malformed activity instead of recording another run.
92
89
 
93
- Writing the initial activity record is the first action of a tracked command, before project inspection, preflight, or other tool calls. This one generated state write does not authorize product changes or bypass any safety check. Set status to `running`, use the command name and a truthful initial summary, then replace the record at meaningful milestones. On a preflight stop or another blocker, set it to `blocked` with the exact recovery command. Leave the final state in place for the next session; the next tracked command replaces it. Use this schema:
90
+ Writing the initial activity record is the first action of a tracked command, before project inspection, preflight, or other tool calls. This one generated state write does not authorize product changes or bypass any safety check.
91
+
92
+ Never create or edit `run.json` directly. From the project root, use the first helper that exists:
93
+
94
+ ```text
95
+ node .agents/skills/doctor/scripts/run-state.mjs <action> <options>
96
+ node .claude/skills/doctor/scripts/run-state.mjs <action> <options>
97
+ ```
98
+
99
+ Start with `start --command <skill> --summary <truthful-summary> --boundary <boundary>`. Use `update` at meaningful milestones or for a blocker, with `--status blocked` and `--resume <exact-command>` when recovery is needed. End with `finish --status ready|completed --summary <truthful-summary>`. The helper validates every field before atomically replacing the generated file. If it is missing or fails, report the activity warning and continue the workflow without writing a manual fallback.
100
+
101
+ The helper writes this schema:
94
102
 
95
103
  ```json
96
104
  {
@@ -0,0 +1,46 @@
1
+ # Codebase Impact & Blast Radius Analysis
2
+
3
+ > **Requirement ID**: `REQ-20260903-001-sync-upstream-ai-blueprint`
4
+ > **Date**: 2026-09-03
5
+ > **Complexity Score**: `Low-to-Medium (Controlled Enhancement)`
6
+ > **Risk Level**: `Low (No Breaking Changes, Backward-Compatible)`
7
+
8
+ ---
9
+
10
+ ## 1. Blast Radius Map (ขอบเขตผลกระทบ)
11
+
12
+ ```mermaid
13
+ graph TD
14
+ Upstream["Upstream AI Blueprint v1.5.2"] --> Onboard[".agents & .claude /skills/onboard/SKILL.md"]
15
+ Upstream --> Overview[".agents & .claude /skills/overview/SKILL.md"]
16
+ Upstream --> Context["devflow/context/ai-interaction.md"]
17
+ Upstream --> E2E["scripts/e2e/scenarios/unborn-onboarding.ts"]
18
+ Upstream --> Validator["scripts/validate-framework.ts"]
19
+
20
+ Onboard --> TemplateOnboard["packages/create-nexus-devflow template"]
21
+ Overview --> TemplateOverview["packages/create-nexus-devflow template"]
22
+ Context --> TemplateContext["packages/create-nexus-devflow template"]
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 2. Affected Files & Modules (รายการไฟล์ที่ได้รับผลกระทบ)
28
+
29
+ | File Path | Action | Description |
30
+ | :--- | :--- | :--- |
31
+ | `.agents/skills/onboard/SKILL.md` | `MODIFY` | เพิ่ม Step 0 ตรวจจับ Unborn repository และเสนอกระบวนการ Root scaffold commit |
32
+ | `.claude/skills/onboard/SKILL.md` | `MODIFY` | ปรับปรุงพฤติกรรมให้ตรงกับ `.agents/` |
33
+ | `.agents/skills/overview/SKILL.md` | `MODIFY` | เพิ่มความสามารถ Setup branch baseline finalization (`git merge --ff-only`) |
34
+ | `.claude/skills/overview/SKILL.md` | `MODIFY` | ปรับปรุงพฤติกรรมให้ตรงกับ `.agents/` |
35
+ | `devflow/context/ai-interaction.md` | `MODIFY` | อัปเดตระเบียบการ baseline commit บน setup branch |
36
+ | `scripts/e2e/scenarios/unborn-onboarding.ts` | `NEW` | เพิ่มชุดทดสอบ E2E scenario ตัวที่ 9 สำหรับ unborn repo & fast-forward baseline |
37
+ | `scripts/validate-framework.ts` | `MODIFY` | เพิ่ม verification contracts สำหรับ onboard unborn check และ overview finalization prompt |
38
+ | `packages/create-nexus-devflow/template/` | `SYNC` | ซิงก์ template ผ่าน `npm run check` |
39
+
40
+ ---
41
+
42
+ ## 3. Risk & Breaking Change Assessment
43
+
44
+ - **Contract Breaking Risk**: `None` — ไม่มีการเปลี่ยนแปลงโครงสร้างคำสั่งหรือโฟลเดอร์หลัก ทุกการเปลี่ยนแปลงเป็นส่วนขยายเพื่อรองรับ Edge Case ที่ยังไม่มี commit
45
+ - **Git Safety Risk**: `Zero Remote Exposure` — มีการล็อกกฎความปลอดภัยไม่ให้มีการ push ไปยัง remote ในระหว่าง Onboard และ Overview อย่างเข้มงวด
46
+ - **Test Coverage Impact**: เพิ่ม Coverage โดยมี scenario ใหม่ `unborn-onboarding.ts` ในชุด E2E Agent Runner
@@ -174,11 +174,41 @@
174
174
 
175
175
  ---
176
176
 
177
- ## 🧹 Phase 22: Reference Artifacts Housekeeping
177
+ ## 🎨 Phase 22: Visual Dashboard & Diagram Integration
178
178
 
179
- - [x] **22. Prune Studio Reference Artifacts (`069-prune-studio-reference-artifacts`)** `[Size: S]`
179
+ - [x] **22. Standalone HTML Report Diagram Integration (`DISC-20260902-003`, `069-report-html-diagram-integration`)** `[Size: S]`
180
+ - *Dependencies*: Feature 17 (`055`), DISC-20260902-003
181
+ - *Scope*: ปรับปรุง `md2html-report.mjs` รองรับการเรนเดอร์ native Mermaid block (`.mermaid`), เพิ่มการสแกนและ embed ไฟล์ไดอะแกรมจาก `devflow/context/{xxx-slug}/diagrams/` (`.svg` และ `.html`), อัปเดต `report-html` skill ให้ตรวจจับและ auto-install `archify` / `diagram-design` ผ่าน `nexus-devflow skill add` และเขียนชุดทดสอบครอบคลุม
182
+
183
+ ---
184
+
185
+ ## 🧹 Phase 23: Reference Artifacts Housekeeping
186
+
187
+ - [x] **23. Prune Studio Reference Artifacts (`069-prune-studio-reference-artifacts`)** `[Size: S]`
180
188
  - *Dependencies*: None
181
189
  - *Scope*: ลบไฟล์ Static HTML Snapshot ตกค้าง `devflow/reference/studio.html` และสคริปต์ `scripts/export-studio.ts` โดยยังคงรักษา Webview Studio Engine (`webview-studio.ts`), MCP tool (`devflow_get_studio_html`), CLI Command (`nexus-devflow studio`) และชุดทดสอบทั้งหมดให้ทำงานได้สมบูรณ์ 100%
182
190
 
191
+ ---
192
+
193
+ ## 📐 Phase 24: Role-Based Profiles & SA Command Suite Engine
194
+
195
+ - [x] **24. Role-Based Profiles & SA Analyze Command Engine (`DISC-20260903-001`, `070-role-based-profile-and-sa-analyze-engine`)** `[Size: M]`
196
+ - *Dependencies*: None
197
+ - *Scope*: เพิ่มตัวเลือก `--role [sa|dev|full]` ใน CLI Installer (`create-nexus-devflow`), ระบบจำแนกชุด Skill Profiles ใน `skill-manager.ts`, โฟลเดอร์ Template สำหรับ SA (`devflow/inbox/`, `devflow/analysis/`, `devflow/blueprints/`), พัฒนาสคิล `/analyze` สำหรับสกัดเอกสารหลายรูปแบบ (PDF, Word, Excel, รูปภาพ, ข้อความ) และวิเคราะห์ Codebase Impact พร้อมชุดทดสอบ Automated Tests
198
+
199
+ ---
200
+
201
+ ## 🔄 Phase 25: Upstream AI Blueprint v1.5.0 – v1.5.1 Synchronization
202
+
203
+ - [x] **25. Sync Upstream v1.5.0 & v1.5.1 (Hardened Run-State Engine & On-Demand Context Loading) (`DISC-20260903-001`, `070-sync-upstream-ai-blueprint-v150-v151`)** `[Size: M]`
204
+ - *Dependencies*: Feature 20, Feature 21, DISC-20260903-001
205
+ - *Scope*: พอร์ตและปรับแต่ง Hardened Dashboard Activity State Helper (`.agents/skills/doctor/scripts/run-state.mjs` และ `.claude/`), บังคับใช้ Zero-Manual Writes กับ `devflow/.state/run.json`, ปรับใช้ On-Demand Context Loading Protocol พร้อมแยก Reference Templates ย่อย (`reference/`), เพิ่ม Unit Tests `run-state-helper.test.ts`, อัปเดต `scripts/validate-framework.ts`, `AGENTS.md`, `CLAUDE.md` และยืนยันการผ่าน 100%
206
+
207
+ ---
208
+
209
+ ## 🔄 Phase 26: Upstream AI Blueprint v1.5.2 Synchronization
183
210
 
211
+ - [x] **26. Sync Upstream v1.5.2 (Unborn Repository Onboarding & Branch Baseline Finalization) (`REQ-20260903-001`, `071-sync-upstream-ai-blueprint-v152`)** `[Size: S]`
212
+ - *Dependencies*: Feature 25, REQ-20260903-001
213
+ - *Scope*: เพิ่มการตรวจจับและกู้คืน Unborn Git repository ใน `/onboard` ด้วย Scaffold Initial Commit (`chore: scaffold application`), รองรับการ Finalize DevFlow Baseline บน Dedicated Setup Branch ด้วย `git merge --ff-only` ใน `/overview`, เพิ่มชุดทดสอบ E2E Scenario `scripts/e2e/scenarios/unborn-onboarding.ts`, อัปเดต `devflow/context/ai-interaction.md` และอัปเดต Framework Static Contracts ผ่าน 100%
184
214
 
@@ -52,6 +52,8 @@ devflow/
52
52
  ### ⚡ The Unified 4-Stage Task-Isolated Living Spec Lifecycle
53
53
  *ขับเคลื่อนการพัฒนาทุกระดับด้วย **Task-Isolated Living Spec (`devflow/context/{xxx-slug}/spec.md`)** ที่รวมความลึกระดับ Architect Mode เข้ากับความคล่องตัวระดับ Lean Velocity โดยแยก Workspace ของแต่ละงานออกจากกัน 100%:*
54
54
 
55
+ After the first successful `/overview`, DevFlow offers a reviewed local commit for the initial workflow setup and plans before Feature 1. It shows the exact candidate diff and asks first. It skips local-only installations and stops rather than mixing app source or unrelated work into the baseline. When setup work is on a dedicated branch, the same approval can finalize the local baseline and fast-forward it into the unchanged default branch. It never pushes.
56
+
55
57
  ```text
56
58
  /feature (หรือ /fix) ──▶ /implement ──▶ /check ──▶ /complete
57
59
  ```
@@ -0,0 +1,34 @@
1
+ # Socratic Clarification Checklist (REQ-20260903-001)
2
+
3
+ > **Requirement ID**: `REQ-20260903-001-sync-upstream-ai-blueprint`
4
+ > **Audience**: System Analyst, Tech Lead, Framework Maintainer
5
+ > **Status**: `Ready for Review`
6
+
7
+ ---
8
+
9
+ ## 🔍 Socratic Review & Alignment Questions
10
+
11
+ ### 1. Root Scaffold Commit Convention
12
+ - [x] **Question**: รูปแบบ Commit Message สำหรับ Scaffold แรกใน Unborn Repo ควรใช้รูปแบบใด?
13
+ - **Proposed Decision**: `chore: scaffold application` (มาตรฐานเดียวกับ Upstream AI Blueprint และ Conventional Commits)
14
+ - **Safety Check**: ต้องไม่รวมโฟลเดอร์ `devflow/`, `AGENTS.md`, `CLAUDE.md`, `.agents/`, `.claude/` เข้าไปใน Root Commit นี้เด็ดขาด
15
+
16
+ ### 2. Setup-Branch Fast-Forward Merge Rule
17
+ - [x] **Question**: ใน `/overview` หากผู้ใช้วางแผนบน dedicated branch (เช่น `feature/devflow-plans`) การรวมกลับเข้า `main` ต้องทำอย่างไร?
18
+ - **Proposed Decision**: บังคับใช้ `git merge --ff-only` เท่านั้นเพื่อรักษา Linear Git History หากมีการแตก branch ออกไปแบบ non-fast-forward จะต้องหยุดและรายงาน mismatch ทันที
19
+ - **Safety Check**: ยืนยันการลบ local setup branch หลัง merge สำเร็จ เพื่อไม่ให้มี branch ขยะค้าง
20
+
21
+ ### 3. Local-Only & Remote Push Guard
22
+ - [x] **Question**: การทำ Finalize Baseline มีโอกาสหลุดรัน `git push` หรือไม่?
23
+ - **Proposed Decision**: ล็อกกฎชัดเจนใน `SKILL.md` ว่าทุกคำสั่งใน Onboard และ Overview ทำงานในระดับ Local Git เท่านั้น (No Push)
24
+
25
+ ---
26
+
27
+ ## 📋 Actionable Checklist for Implementation
28
+
29
+ - [ ] ปรับปรุง `.agents/skills/onboard/SKILL.md` และ `.claude/skills/onboard/SKILL.md` เพื่อตรวจจับ Unborn `HEAD` และเสนอ Scaffold Root Commit
30
+ - [ ] ปรับปรุง `.agents/skills/overview/SKILL.md` และ `.claude/skills/overview/SKILL.md` สำหรับ Setup-Branch Baseline Finalization (`git merge --ff-only`)
31
+ - [ ] อัปเดต `devflow/context/ai-interaction.md` ให้ระบุสิทธิการทำ Baseline Finalization บน Setup Branch
32
+ - [ ] พอร์ต E2E Scenario `scripts/e2e/scenarios/unborn-onboarding.ts` ให้เข้ากับโครงสร้างและชื่อคำสั่งของ Nexus-DevFlow
33
+ - [ ] เพิ่ม static verification contract ใน `scripts/validate-framework.ts`
34
+ - [ ] รันการตรวจสอบความถูกต้องของระบบครบทุก Lane (`npm run check:static`, `npm test`, `npm run check`)