@jakkrichm/create-nexus-devflow 2.11.0 → 2.12.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 +3 -3
- package/dist/bin/create-nexus-devflow.d.ts +2 -0
- package/dist/bin/create-nexus-devflow.js +63 -2
- package/dist/bin/create-nexus-devflow.js.map +1 -1
- package/dist/lib/project-config.d.ts +3 -1
- package/dist/lib/project-config.js +3 -1
- package/dist/lib/project-config.js.map +1 -1
- package/dist/lib/skill-manager.d.ts +5 -0
- package/dist/lib/skill-manager.js +30 -0
- package/dist/lib/skill-manager.js.map +1 -1
- package/dist/lib/update.d.ts +4 -2
- package/dist/lib/update.js +12 -6
- package/dist/lib/update.js.map +1 -1
- package/dist/scripts/prepare-template.js +11 -0
- package/dist/scripts/prepare-template.js.map +1 -1
- package/package.json +1 -1
- package/template/.agents/skills/analyze/SKILL.md +113 -0
- package/template/.agents/skills/doctor/SKILL.md +52 -49
- package/template/.agents/skills/doctor/scripts/run-state.mjs +513 -0
- package/template/.agents/skills/feature/SKILL.md +2 -0
- package/template/.agents/skills/feature/reference/feature-spec-template.md +82 -0
- package/template/.agents/skills/implement/SKILL.md +3 -35
- package/template/.agents/skills/implement/reference/rollback-implementation.md +35 -0
- package/template/.agents/skills/report-html/SKILL.md +25 -5
- package/template/.agents/skills/status/SKILL.md +17 -20
- package/template/.claude/skills/analyze/SKILL.md +113 -0
- package/template/.claude/skills/doctor/SKILL.md +52 -49
- package/template/.claude/skills/doctor/scripts/run-state.mjs +513 -0
- package/template/.claude/skills/feature/SKILL.md +2 -0
- package/template/.claude/skills/feature/reference/feature-spec-template.md +82 -0
- package/template/.claude/skills/implement/SKILL.md +3 -35
- package/template/.claude/skills/implement/reference/rollback-implementation.md +35 -0
- package/template/.claude/skills/report-html/SKILL.md +25 -5
- package/template/.claude/skills/status/SKILL.md +17 -20
- package/template/AGENTS.md +19 -11
- package/template/devflow/build-plan.md +31 -0
- package/template/devflow/reference/studio.html +0 -504
|
@@ -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
|
-
|
|
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.
|
|
@@ -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.
|
|
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/
|
|
59
|
+
- Output: `devflow/context/{xxx-slug}/report.html` (or adjacent `{xxx-slug}.html`)
|
|
40
60
|
|
|
41
|
-
###
|
|
61
|
+
### 4. Output
|
|
42
62
|
Provide:
|
|
43
|
-
- Generated HTML file path: `file:///devflow/
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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
|
|
26
|
+
## What it gathers
|
|
30
27
|
|
|
31
|
-
|
|
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`.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: analyze
|
|
3
|
+
description: "[devflow] Unified SA requirement ingestion, multi-format doc parsing (PDF, Word, Excel, images, text), codebase impact scan, and Socratic clarification checklist."
|
|
4
|
+
argument-hint: "[{file-path, raw requirement text, or REQ-ID}]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# analyze - SA Requirement Ingestion & Codebase Impact Analysis
|
|
8
|
+
|
|
9
|
+
$ARGUMENTS
|
|
10
|
+
|
|
11
|
+
**First action:** Before project inspection, preflight, or any other tool call,
|
|
12
|
+
publish `running` to `devflow/.state/run.json` using the dashboard activity
|
|
13
|
+
contract in `AGENTS.md`.
|
|
14
|
+
|
|
15
|
+
`/analyze` is the flagship System Analyst (SA) entry point in Nexus-DevFlow. It ingests messy, multi-format requirements, auto-allocates an isolated Request Workspace, normalizes raw content into structured Markdown, scans codebase impact (for existing systems), and generates a Socratic clarification checklist before system design.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Invocations & Usage
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
# 1. Ingest specific file from any path (PDF, DOCX, XLSX, Image, CSV, Text)
|
|
23
|
+
/analyze C:\Users\...\Downloads\customer-spec.pdf
|
|
24
|
+
/analyze ./mockup.png ./schema.xlsx "ระบบสะสมแต้มสมาชิก"
|
|
25
|
+
|
|
26
|
+
# 2. Ingest raw text or requirement from chat
|
|
27
|
+
/analyze "ลูกค้าต้องการระบบผ่อนชำระ 0% เชื่อมกับ KBank Payment Gateway..."
|
|
28
|
+
|
|
29
|
+
# 3. Scan pending unassigned files in devflow/inbox/
|
|
30
|
+
/analyze
|
|
31
|
+
|
|
32
|
+
# 4. Resume analysis on an existing Request ID
|
|
33
|
+
/analyze REQ-20260903-001
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 4-Step Analysis Execution Pipeline
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
[Multi-format Input] ──▶ 1. Auto-Allocate & Ingest ──▶ 2. Parse & Normalize
|
|
42
|
+
│
|
|
43
|
+
▼
|
|
44
|
+
[Clarification Checklist] ◀── 4. Socratic Gap Scan ◀── 3. Codebase Impact Scan
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### Step 1: Auto-Allocate Workspace & Ingestion (Frictionless Ingest)
|
|
50
|
+
1. **Allocate REQ-ID**: Generate sequential ID format `REQ-YYYYMMDD-NNN` (e.g. `REQ-20260903-001-point-system`).
|
|
51
|
+
2. **Create Request Workspace**:
|
|
52
|
+
```text
|
|
53
|
+
devflow/inbox/{REQ-ID}/
|
|
54
|
+
├── raw/ # เก็บไฟล์ต้นฉบับ (PDF, Word, Excel, Images, Email)
|
|
55
|
+
├── parsed.md # ข้อความ/ตารางที่สกัดออกมาแล้ว (Clean Markdown)
|
|
56
|
+
└── clarifications.md # รายการคำถามที่ต้องไปถาม Stakeholder เพิ่ม
|
|
57
|
+
```
|
|
58
|
+
3. Copy or save incoming files into `devflow/inbox/{REQ-ID}/raw/`.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
### Step 2: Parse & Normalize Requirement (`parsed.md`)
|
|
63
|
+
1. Extract text and tables from all raw files:
|
|
64
|
+
- For Office/PDF docs: Invoke `convert-any-to-md` or document extractor.
|
|
65
|
+
- For Web URLs / Confluence / Notion: Invoke `defuddle`.
|
|
66
|
+
- For Images / Wireframes / Screenshots: Conduct Multimodal Vision OCR and describe layout and fields.
|
|
67
|
+
2. Structure into `devflow/inbox/{REQ-ID}/parsed.md`:
|
|
68
|
+
- **Executive Summary**: วัตถุประสงค์หลักของ Requirement
|
|
69
|
+
- **Target Persona & User Stories**: ใครทำอะไร เพื่ออะไร
|
|
70
|
+
- **Functional Requirements (FR)**: รายการฟังก์ชันและ Business Rules
|
|
71
|
+
- **Non-Functional Requirements (NFR)**: Performance, Security, PDPA, Retention
|
|
72
|
+
- **Data Entities & Fields**: ฟิลด์ข้อมูลและชนิดข้อมูลเบื้องต้น
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### Step 3: Codebase Impact & Blast Radius Analysis (`codebase-impact.md`)
|
|
77
|
+
*(ดำเนินการเมื่อเป็นระบบเดิม / Brownfield Codebase)*
|
|
78
|
+
|
|
79
|
+
1. Search codebase patterns using `grep_search`, `rg`, and AST analysis for affected models, controllers, APIs, and routes.
|
|
80
|
+
2. Calculate **Blast Radius & Complexity Score**:
|
|
81
|
+
- **Affected Files & Modules**: รายการไฟล์ที่ต้องแก้ไขหรือสร้างใหม่
|
|
82
|
+
- **API & Contract Breaking Risk**: ตรวจสอบว่ากระทบกับ API เดิมหรือ Third-Party หรือไม่
|
|
83
|
+
- **Complexity Rating**: `Low` | `Medium` | `High` | `Extreme` พร้อมเหตุผล
|
|
84
|
+
3. Save analysis report to `devflow/analysis/{REQ-ID}/codebase-impact.md`.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### Step 4: Socratic Gap Detection & Clarification Checklist (`clarifications.md`)
|
|
89
|
+
1. Apply `grilling` and `domain-modeling` lenses to detect gaps:
|
|
90
|
+
- **Missing Edge Cases**: เงื่อนไขขอบ, กรณีข้อมูลผิดพลาด, เน็ตหลุด, Concurrent Requests
|
|
91
|
+
- **Ambiguous Business Rules**: กฎที่ยังคลุมเครือ ไม่ระบุ SLA หรือขั้นตอนที่ชัดเจน
|
|
92
|
+
- **Security & Authorization**: การกำหนด Role, สิทธิ์การเข้าถึงข้อมูล, ข้อมูลส่วนบุคคล (PII)
|
|
93
|
+
2. Generate an actionable checklist in `devflow/inbox/{REQ-ID}/clarifications.md` for the SA to take directly into stakeholder meetings.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Output Artifacts Summary
|
|
98
|
+
|
|
99
|
+
| Artifact | Location | Purpose |
|
|
100
|
+
| :--- | :--- | :--- |
|
|
101
|
+
| **Raw Files** | `devflow/inbox/{REQ-ID}/raw/` | Archived original files |
|
|
102
|
+
| **Parsed Spec** | `devflow/inbox/{REQ-ID}/parsed.md` | Clean structured Markdown requirements |
|
|
103
|
+
| **Impact Report** | `devflow/analysis/{REQ-ID}/codebase-impact.md` | Codebase blast radius & complexity score |
|
|
104
|
+
| **Clarifications** | `devflow/inbox/{REQ-ID}/clarifications.md` | Socratic questions for stakeholders |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Next Workflow Step
|
|
109
|
+
|
|
110
|
+
Once analysis is reviewed and gaps are aligned, proceed to **System Design & Acceptance Test Matrix**:
|
|
111
|
+
```bash
|
|
112
|
+
/design {REQ-ID}
|
|
113
|
+
```
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: doctor
|
|
3
|
-
description: "[devflow] Run a
|
|
3
|
+
description: "[devflow] Run a DevFlow health and context check covering setup, adapters, commands, visibility, plans, overview freshness, configuration, dashboard state, and workflow drift. May offer to reset malformed generated dashboard state after approval. Use for /doctor, setup problems, context overhead, or health checks."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# doctor -
|
|
6
|
+
# doctor - DevFlow health check
|
|
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.
|
|
7
9
|
|
|
8
10
|
Where this sits in the workflow:
|
|
9
11
|
|
|
10
12
|
any time -> [doctor] -> reads setup + plans + workflow state + git
|
|
11
|
-
(
|
|
13
|
+
(diagnostic) prints health, warnings, and repair order
|
|
12
14
|
|
|
13
|
-
This skill answers one question: *is this
|
|
15
|
+
This skill answers one question: *is this DevFlow project ready to use?* It is
|
|
14
16
|
the diagnostic pass for setup drift, incomplete onboarding, missing files,
|
|
15
|
-
placeholder plans, stale generated context,
|
|
17
|
+
placeholder plans, stale generated context, DevFlow visibility, and confusing
|
|
16
18
|
workflow state. It never changes anything: no edits, no commits, no installs, no
|
|
17
|
-
builds, no branch changes.
|
|
19
|
+
builds, no branch changes. Its only repair is an approved reset of a malformed
|
|
20
|
+
generated `devflow/.state/run.json` file.
|
|
18
21
|
|
|
19
22
|
Use `/status` when the user mainly wants progress and the next build action. Use
|
|
20
23
|
`/doctor` when the user wants to know whether the workflow itself is healthy.
|
|
@@ -66,6 +69,10 @@ Gather these, then summarize. Do not dump file contents.
|
|
|
66
69
|
logical adapters: Codex, Claude Code, GitHub Copilot, Antigravity, and OpenCode.
|
|
67
70
|
- Confirm at least one compatible skill tree exists. Codex, Antigravity, and
|
|
68
71
|
GitHub Copilot use `.agents/skills/`. Claude Code uses `.claude/skills/`.
|
|
72
|
+
- Confirm each installed adapter tree contains
|
|
73
|
+
`doctor/scripts/run-state.mjs`. This managed helper validates and atomically
|
|
74
|
+
writes dashboard activity. A missing helper needs a DevFlow update before
|
|
75
|
+
tracked commands can record activity safely.
|
|
69
76
|
- If both skill trees are present, say that is healthy when the selected
|
|
70
77
|
tools require both. Compare their skill folder names and warn about missing
|
|
71
78
|
skills on either side.
|
|
@@ -105,39 +112,41 @@ Gather these, then summarize. Do not dump file contents.
|
|
|
105
112
|
- A missing `Verify` command or GitHub workflow is informational. It means the
|
|
106
113
|
optional automatic-check setup was not selected, not that DevFlow is
|
|
107
114
|
unhealthy.
|
|
108
|
-
4. **
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
any `git rm --cached` cleanup separately.
|
|
121
|
-
- Keep this conservative. If uncertain, report "review" instead of failure.
|
|
122
|
-
5. **Planning readiness**
|
|
123
|
-
- Check whether `devflow/project-plan.md` and `devflow/build-plan.md` look
|
|
124
|
-
filled in or still template-like. Treat obvious TODO, TBD, example-only text,
|
|
125
|
-
or empty required sections as not ready.
|
|
126
|
-
- Check whether `devflow/build-plan.md` is a numbered checkbox list. Raw
|
|
127
|
-
bullets are allowed as a first draft, but they should be normalized by
|
|
128
|
-
`/overview` before the build loop starts.
|
|
129
|
-
- Count checked and unchecked leaf items in `devflow/build-plan.md`.
|
|
130
|
-
6. **Overview freshness**
|
|
131
|
-
- Check whether `devflow/context/project-overview.md` exists and looks
|
|
132
|
-
generated from the current plans.
|
|
115
|
+
4. **Visibility and context loading**
|
|
116
|
+
- Confirm whether DevFlow files are public in git or listed in `.gitignore`
|
|
117
|
+
as local-only.
|
|
118
|
+
- When Claude Code is installed, report its startup-context shape. Confirm
|
|
119
|
+
`CLAUDE.md` imports `AGENTS.md` and lets skills load planning context on demand.
|
|
120
|
+
5. **Project and build plans**
|
|
121
|
+
- Read `devflow/project-plan.md` and `devflow/build-plan.md`.
|
|
122
|
+
- Report total features in the build plan, how many are checked off (`- [x]`),
|
|
123
|
+
and which feature is next.
|
|
124
|
+
- Flag placeholder text (e.g. `[Your project name]`, `Feature 1 description`).
|
|
125
|
+
6. **Project overview freshness**
|
|
126
|
+
- Read `devflow/context/project-overview.md` if it exists.
|
|
133
127
|
- Report its byte size. At or above 20,000 bytes, call it oversized and say
|
|
134
128
|
`/feature` should stop until `/overview` regenerates a compact
|
|
135
129
|
consolidation.
|
|
136
130
|
- If either planning file appears newer than the overview by filesystem time,
|
|
137
131
|
call the overview possibly stale and suggest `/overview` before feature work.
|
|
138
132
|
7. **Current workflow state**
|
|
139
|
-
-
|
|
140
|
-
|
|
133
|
+
- Inspect `devflow/.state/run.json` when it exists. Missing means no recorded
|
|
134
|
+
activity and is healthy. Require a regular non-symbolic-link JSON file that
|
|
135
|
+
matches dashboard schema version 1 from `AGENTS.md`.
|
|
136
|
+
- If the path is a symbolic link or not a regular file, do not read, replace,
|
|
137
|
+
or remove it. Report the exact path for manual review.
|
|
138
|
+
- If the regular file is invalid JSON or does not match the schema, report it
|
|
139
|
+
as malformed generated state. Explain that resetting it removes only the
|
|
140
|
+
dashboard's last-command record, not project work, and that the next tracked
|
|
141
|
+
DevFlow command recreates it.
|
|
142
|
+
- Offer this exact repair question: `Reset the malformed dashboard state now?`
|
|
143
|
+
On approval, use the installed dashboard activity helper's `reset` action.
|
|
144
|
+
It confirms the exact path is a regular non-symbolic-link file and removes
|
|
145
|
+
only `devflow/.state/run.json`. Verify the file is absent and report the
|
|
146
|
+
dashboard state as reset. Never remove `devflow/.state/`, its manifest,
|
|
147
|
+
backups, or any project file. Without approval, leave it unchanged and
|
|
148
|
+
include the reset in `Repair order:`.
|
|
149
|
+
- If a spec is active in `devflow/context/{xxx-slug}/`, report checked and unchecked implementation steps.
|
|
141
150
|
- If no active task directory exists in `devflow/context/` but git has source or workflow
|
|
142
151
|
changes, warn that work is happening without an active spec.
|
|
143
152
|
- Flag active spec on `main`, all spec steps checked but no completion, or a
|
|
@@ -168,28 +177,20 @@ steps, in order. Keep it short and practical.
|
|
|
168
177
|
|
|
169
178
|
Choose the repair order in this priority:
|
|
170
179
|
|
|
171
|
-
- Required
|
|
172
|
-
`/adopt` for a brownfield app.
|
|
180
|
+
- Required DevFlow files missing -> overlay DevFlow again, or use `/adopt` for a brownfield app.
|
|
173
181
|
- No git repo -> initialize git before using the build loop.
|
|
174
182
|
- No tool adapter -> restore `.agents/skills/` or `.claude/skills/` for the
|
|
175
183
|
selected tool. OpenCode can use either compatible tree.
|
|
184
|
+
- Installed adapter is missing `doctor/scripts/run-state.mjs` -> update
|
|
185
|
+
DevFlow before relying on dashboard activity.
|
|
176
186
|
- Onboarding incomplete -> run `/onboard`.
|
|
177
|
-
- Root README is still the
|
|
187
|
+
- Root README is still the DevFlow workflow doc -> run `/onboard` to replace
|
|
178
188
|
it with a project README before publishing.
|
|
179
|
-
- Local-only visibility selected but ignored Blueprint files are missing ->
|
|
180
|
-
reinstall or restore the Blueprint files locally.
|
|
181
|
-
- Local-only visibility selected but Blueprint paths are tracked -> ask whether
|
|
182
|
-
to untrack them with `git rm --cached` while keeping local files.
|
|
183
|
-
- Local-only visibility selected but `AGENTS.md` still exposes the workflow ->
|
|
184
|
-
run `/onboard` to make `AGENTS.md` a lightweight public project guide.
|
|
185
|
-
- A documented `Verify` command, project script, and GitHub workflow disagree ->
|
|
186
|
-
run `/ci` to review and align them. Missing optional CI alone does not need
|
|
187
|
-
repair.
|
|
188
|
-
- Commands or ignore rules need review -> update the files or run `/onboard` if
|
|
189
|
-
this is an early project.
|
|
190
189
|
- Plans are placeholders -> fill `devflow/project-plan.md` and
|
|
191
190
|
`devflow/build-plan.md`.
|
|
192
191
|
- Overview missing or stale -> run `/overview`.
|
|
192
|
+
- Malformed regular `devflow/.state/run.json` -> offer to reset that exact
|
|
193
|
+
generated file, then rerun `/doctor` or refresh the dashboard.
|
|
193
194
|
- Active spec has unchecked steps -> run `/status` or `/implement`, depending on
|
|
194
195
|
whether the user wants orientation or action.
|
|
195
196
|
- A P0 or P1 finding is `open` -> repair it through `/implement` while a spec
|
|
@@ -201,8 +202,10 @@ Choose the repair order in this priority:
|
|
|
201
202
|
|
|
202
203
|
## Rules
|
|
203
204
|
|
|
204
|
-
- **
|
|
205
|
-
installs,
|
|
205
|
+
- **Diagnostic by default.** This skill never edits project files, commits, runs
|
|
206
|
+
installs, runs builds or tests, or switches branches. It may remove only a
|
|
207
|
+
malformed regular `devflow/.state/run.json` through the installed helper
|
|
208
|
+
after the user approves the exact reset described above.
|
|
206
209
|
- **Diagnose, then order repairs.** Do not just list problems. End with the
|
|
207
210
|
smallest ordered sequence that gets the project back to a healthy state.
|
|
208
211
|
- **Do not over-police adapters.** Extra adapters are optional clutter, not a
|