@jakkrichm/create-nexus-devflow 2.2.2 → 2.6.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.
Files changed (71) hide show
  1. package/README.md +58 -45
  2. package/dist/bin/create-nexus-devflow.js +9 -1
  3. package/dist/bin/create-nexus-devflow.js.map +1 -1
  4. package/dist/lib/command-catalog.js +1 -1
  5. package/dist/lib/command-catalog.js.map +1 -1
  6. package/dist/lib/core-skill-inventory.d.ts +16 -0
  7. package/dist/lib/core-skill-inventory.js +96 -0
  8. package/dist/lib/core-skill-inventory.js.map +1 -0
  9. package/dist/lib/dashboard-page.d.ts +1 -1
  10. package/dist/lib/dashboard-page.js +42 -20
  11. package/dist/lib/dashboard-page.js.map +1 -1
  12. package/dist/lib/dashboard-snapshot.js +16 -12
  13. package/dist/lib/dashboard-snapshot.js.map +1 -1
  14. package/dist/lib/dashboard.js +10 -1
  15. package/dist/lib/dashboard.js.map +1 -1
  16. package/dist/lib/doctor.js +14 -11
  17. package/dist/lib/doctor.js.map +1 -1
  18. package/dist/lib/gatekeeper.d.ts +4 -0
  19. package/dist/lib/gatekeeper.js +2 -2
  20. package/dist/lib/gatekeeper.js.map +1 -1
  21. package/dist/lib/git-status.d.ts +10 -2
  22. package/dist/lib/git-status.js +57 -29
  23. package/dist/lib/git-status.js.map +1 -1
  24. package/dist/lib/swarm-orchestrator.d.ts +4 -1
  25. package/dist/lib/swarm-orchestrator.js +2 -2
  26. package/dist/lib/swarm-orchestrator.js.map +1 -1
  27. package/dist/lib/update.js +5 -8
  28. package/dist/lib/update.js.map +1 -1
  29. package/dist/lib/version-check.js +1 -1
  30. package/dist/lib/workflow-state.js +19 -32
  31. package/dist/lib/workflow-state.js.map +1 -1
  32. package/dist/scripts/prepare-template.js +19 -16
  33. package/dist/scripts/prepare-template.js.map +1 -1
  34. package/package.json +1 -1
  35. package/template/.agents/skills/check/SKILL.md +78 -75
  36. package/template/.agents/skills/complete/SKILL.md +47 -36
  37. package/template/.agents/skills/debug/SKILL.md +76 -94
  38. package/template/.agents/skills/devflow/SKILL.md +51 -79
  39. package/template/.agents/skills/discovery/SKILL.md +7 -9
  40. package/template/.claude/skills/check/SKILL.md +78 -75
  41. package/template/.claude/skills/complete/SKILL.md +47 -36
  42. package/template/.claude/skills/debug/SKILL.md +76 -94
  43. package/template/.claude/skills/devflow/SKILL.md +51 -79
  44. package/template/.claude/skills/discovery/SKILL.md +7 -9
  45. package/template/AGENTS.md +21 -30
  46. package/template/devflow/build-plan.md +9 -0
  47. package/template/devflow/context/ai-interaction.md +43 -45
  48. package/template/devflow/context/coding-standards.md +31 -6
  49. package/template/devflow/context/current-stage.md +10 -7
  50. package/template/devflow/context/findings.md +8 -11
  51. package/template/devflow/context/glossary.md +31 -0
  52. package/template/devflow/history/HISTORY.md +1 -1
  53. package/template/devflow/project-plan.md +2 -2
  54. package/template/devflow/reference/build-plan-template.md +65 -0
  55. package/template/devflow/reference/feature-spec-template.md +110 -0
  56. package/template/devflow/reference/project-plan-template.md +128 -0
  57. package/template/devflow/reference/running-id-contract.md +12 -11
  58. package/template/.agents/skills/10-define/SKILL.md +0 -54
  59. package/template/.agents/skills/20-spec/SKILL.md +0 -155
  60. package/template/.agents/skills/30-plan/SKILL.md +0 -226
  61. package/template/.agents/skills/40-execute/SKILL.md +0 -158
  62. package/template/.agents/skills/50-verify/SKILL.md +0 -62
  63. package/template/.agents/skills/60-report/SKILL.md +0 -57
  64. package/template/.agents/skills/70-deliver/SKILL.md +0 -72
  65. package/template/.claude/skills/10-define/SKILL.md +0 -54
  66. package/template/.claude/skills/20-spec/SKILL.md +0 -155
  67. package/template/.claude/skills/30-plan/SKILL.md +0 -226
  68. package/template/.claude/skills/40-execute/SKILL.md +0 -158
  69. package/template/.claude/skills/50-verify/SKILL.md +0 -62
  70. package/template/.claude/skills/60-report/SKILL.md +0 -57
  71. package/template/.claude/skills/70-deliver/SKILL.md +0 -72
@@ -5,26 +5,19 @@ description: "[devflow][B] Flagship interactive guide, state inspector, and inte
5
5
 
6
6
  # devflow - Interactive Workflow Guide & Intent Router for Nexus-DevFlow
7
7
 
8
- ## Command Track Policy
9
- - [F] Fast-Track only
10
- - [D] Deep-Track only
11
- - [B] Available in both tracks (Track-agnostic)
12
-
13
-
14
- Use this skill to guide the user on what to do next, inspect current workspace state, map their natural language intent to the right Nexus-DevFlow track (Fast-Track or Deep-Track) or companion command, or display a sitemap of available DevFlow skills.
8
+ Use this skill to guide the user on what to do next, inspect current workspace state, map their natural language intent to the matching Nexus-DevFlow stage or companion command, or display a sitemap of available DevFlow skills.
15
9
 
16
10
  ## Input
17
11
 
18
- - **No argument (`devflow`, `devflow`, `$devflow`, or `status`)**: Inspect current workspace state (active run in `devflow/runs/` or `devflow/context/current-stage.md`, active discovery in `devflow/discoveries/`, pending ideas in `devflow/ideas.md`, open findings in `devflow/context/findings.md`, and project overview in `devflow/context/project-overview.md`) and recommend the exact next action.
19
- - **With user request (`devflow "<request>"`)**: Classify the user's intent and guide them to the matching DevFlow workflow track or companion command path.
12
+ - **No argument (`devflow`, `/devflow`, `$devflow`, or `status`)**: Inspect current workspace state (active run in `devflow/context/current-stage.md`, active living spec in `devflow/context/current-feature.md`, active discovery in `devflow/discoveries/`, pending ideas in `devflow/ideas.md`, open findings in `devflow/context/findings.md`, and project overview in `devflow/context/project-overview.md`) and recommend the exact next action.
13
+ - **With user request (`devflow "<request>"`)**: Classify the user's intent and guide them to the matching DevFlow workflow stage or companion command path.
20
14
 
21
- ## Dual-Track Architecture
15
+ ## The Unified Living Spec Architecture (DevFlow 2.5.0)
22
16
 
23
- Nexus-DevFlow supports two seamless workflow tracks:
24
- 1. **🏎️ Fast-Track (Blueprint Mode - 4 Steps)**: `/spec` ➔ `/implement` ➔ `/check` ➔ `/complete`
25
- *Driven by a **Single Living Spec (`current-feature.md`)** for fast, high-velocity daily development and bugfixes (85% of tasks).*
26
- 2. **🏗️ Deep-Track (Architect Mode - 8 Steps)**: `discovery` `10-define` `20-spec` `30-plan` `40-execute` `50-verify` ➔ `60-report` ➔ `70-deliver`
27
- *Driven by modular separate stage files for large, high-stakes architectural epics and multi-agent coordination.*
17
+ Nexus-DevFlow uses a **Single Unified Living Spec Model**:
18
+ - **The 4-Stage Lifecycle**: `/feature` (or `/fix`) ➔ `/implement` ➔ `/check` ➔ `/complete`
19
+ - Driven by a **Single Living Spec (`devflow/context/current-feature.md`)** that integrates architectural depth (Define, Spec, Plan, Execution Log, Multi-Lane QA, and Release Digest) into one clear living document.
20
+ - **Pre-Flight Inception Engine**: Companion skills (`/discovery`, `/idea`, `/grill`, `/brainstorm`) feed directly into `/feature`.
28
21
 
29
22
  ---
30
23
 
@@ -33,93 +26,72 @@ Nexus-DevFlow supports two seamless workflow tracks:
33
26
  When invoked without an argument (or when determining the next step), inspect:
34
27
 
35
28
  1. **Project Setup Baseline**: Read `devflow/context/project-overview.md` and `devflow/context/coding-standards.md`. If empty or default placeholders, recommend `onboard` (for fresh projects) or `adopt` (for existing codebases).
36
- 2. **Active Delivery Run**: Read `devflow/context/current-stage.md` and check `devflow/runs/{RUNNING_ID}/`.
37
- - **If Fast-Track (`current-feature.md`, `spec.md`, or `blueprint.md` present)**:
38
- - If `current-feature.md` (or `spec.md`) has incomplete checklist items -> Recommend `/implement` (or `implement {RUNNING_ID}`).
39
- - If all tasks done but no passing verification evidence -> Recommend `/check` (or `check {RUNNING_ID}`).
40
- - If verification evidence passed -> Recommend `/complete` (or `complete {RUNNING_ID}`).
41
- - **If Deep-Track (numbered stage files present)**:
42
- - If at `10-define.md` -> Recommend `20-spec {RUNNING_ID}`.
43
- - If at `20-spec.md` -> Recommend `30-plan {RUNNING_ID}`.
44
- - If at `30-plan.md` -> Recommend `40-execute {RUNNING_ID}`.
45
- - If at `40-execute.md` with all tasks done -> Recommend `50-verify {RUNNING_ID}`.
46
- - If passed `50-verify.md` -> Recommend `60-report {RUNNING_ID}` then `70-deliver {RUNNING_ID}`.
29
+ 2. **Active Delivery Run**: Read `devflow/context/current-stage.md` and `devflow/context/current-feature.md`.
30
+ - If `current-feature.md` has incomplete checklist tasks (`- [ ]`) -> Recommend `/implement`.
31
+ - If all tasks are completed (`- [x]`) but no passing verification evidence in Section 5 -> Recommend `/check`.
32
+ - If verification evidence passed in Section 5 -> Recommend `/complete`.
47
33
  3. **Active Discovery**: Check `devflow/discoveries/` for open discovery notes.
48
- 4. **Pending Ideas Inbox**: Check `devflow/ideas.md`. If items exist under `## 📌 Pending Ideas`, summarize them in a **💡 Pending Ideas (Inbox)** list with their IDs (`[IDEA-xxx]`), feasibility, and mention that they can be started with `/spec IDEA-xxx` or `/discovery IDEA-xxx`.
34
+ 4. **Pending Ideas Inbox**: Check `devflow/ideas.md`. If items exist under `## 📌 Pending Ideas`, summarize them in a **💡 Pending Ideas (Inbox)** list with their IDs (`[IDEA-xxx]`), feasibility, and mention that they can be started with `/feature IDEA-xxx` or `/discovery IDEA-xxx`.
49
35
  5. **Audit Findings Ledger**: Check `devflow/context/findings.md` for open high-severity findings.
50
36
 
51
37
  ### Default State Recommendations
52
- - if no run is active and user wants to start a feature -> Recommend `/feature <name>`.
38
+ - If no run is active and user wants to start a feature -> Recommend `/feature <name>`.
53
39
  - If no run is active and user wants to fix a bug -> Recommend `/fix <bug>`.
54
- - If no run is active and user has pending ideas in `devflow/ideas.md` -> Highlight `/spec IDEA-xxx` or `/discovery IDEA-xxx`.
55
- - If no run is active and user wants deep architectural exploration -> Recommend `discovery`.
40
+ - If no run is active and user has pending ideas in `devflow/ideas.md` -> Highlight `/feature IDEA-xxx` or `/discovery IDEA-xxx`.
41
+ - If no run is active and user wants deep architectural exploration -> Recommend `/discovery`.
56
42
  - If user asks to check system health -> Recommend `doctor`.
57
43
 
58
44
  ---
59
45
 
60
46
  ## Intent Classification & Skill Routing
61
47
 
62
- | User Intent / Request Type | Recommended Skill | Normal Name / Alias | Track / Lifecycle Path |
48
+ | User Intent / Request Type | Recommended Skill | Normal Name / Alias | Lifecycle Path |
63
49
  | :--- | :--- | :--- | :--- |
64
- | **"Spec new feature / lean workflow"** | `spec` | `/spec` / `/feature` | **Fast-Track**: `/spec` -> `/implement` -> `/check` -> `/complete` |
65
- | **"Quick bugfix / ad-hoc change"** | `spec` | `/fix` | **Fast-Track**: `/fix` -> `/implement` -> `/check` -> `/complete` |
50
+ | **"Spec new feature / living spec"** | `feature` | `/feature` / `/spec` | **Unified**: `/feature` -> `/implement` -> `/check` -> `/complete` |
51
+ | **"Quick bugfix / ad-hoc change"** | `fix` | `/fix` | **Unified**: `/fix` -> `/implement` -> `/check` -> `/complete` |
66
52
  | **"Capture quick idea / thought"** | `idea` | `/idea` | **Companion**: Enriches & saves to `devflow/ideas.md` |
67
- | **"Execute implementation tasks"** | `implement` | `/implement` | **Fast-Track**: `/implement` -> `/check` |
68
- | **"Run QA verification & check"** | `check` | `/check` | **Fast-Track**: `/check` -> `/complete` |
69
- | **"Complete run & git merge"** | `complete` | `/complete` | **Fast-Track**: `/complete` |
70
- | **"Generate HTML dashboard report"**| `report-html` | `/report:html` | **Standalone**: Converts `current-feature.md` / `60-report.md` to HTML |
71
- | "Setup DevFlow on fresh/new project" | `onboard` | `onboard` / `setup` | `onboard` -> `/spec` or `10-define` |
72
- | "Adopt DevFlow on existing codebase" | `adopt` | `adopt` / `bootstrap` | `adopt` -> `/spec` or `10-define` |
53
+ | **"Pre-delivery exploration / research"**| `discovery`| `/discovery` | **Pre-Flight**: `discovery` -> `/feature` |
54
+ | **"Socratic alignment / ADR / glossary"**| `grill` | `/grill` / `/align` | **Pre-Flight**: `grill` -> `/feature` |
55
+ | **"Execute implementation tasks"** | `implement` | `/implement` | **Core Loop**: `/implement` -> `/check` |
56
+ | **"Run QA verification & check"** | `check` | `/check` | **Core Loop**: `/check` -> `/complete` |
57
+ | **"Complete run & git merge"** | `complete` | `/complete` | **Core Loop**: `/complete` |
58
+ | **"Generate HTML dashboard report"**| `report-html` | `/report:html` | **Standalone**: Converts `current-feature.md` or archive to HTML |
59
+ | "Setup DevFlow on fresh/new project" | `onboard` | `onboard` / `setup` | `onboard` -> `/feature` |
60
+ | "Adopt DevFlow on existing codebase" | `adopt` | `adopt` / `bootstrap` | `adopt` -> `/feature` |
73
61
  | "Check setup health & diagnostics" | `doctor` | `doctor` / `health` | `doctor` |
74
- | "Explore a new request / deep idea" | `discovery` | `discovery` / `/discovery` | **Deep-Track**: `discovery` -> `10` -> `20` -> ... |
75
- | "Define delivery boundaries and ID" | `10-define` | `define` | **Deep-Track**: `10` -> `20` -> `30` |
76
- | "Break down spec into plan (Deep)" | `30-plan` | `plan` | **Deep-Track**: `30` -> `40` -> `50` |
77
- | "Deep code implementation" | `40-execute` | `implement` | **Deep-Track**: `40` -> `50` |
78
- | "Deep QA verification" | `50-verify` | `verify` | **Deep-Track**: `50` -> `60` -> `70` |
79
- | "Deep markdown digest report" | `60-report` | `report` | **Deep-Track**: `60` -> `70` |
80
- | "Deep release packaging & merge" | `70-deliver` | `release` | **Deep-Track**: `70-deliver` |
81
62
  | "Human manual QA walkthrough guide" | `try` | `try` | Companion (after implement or check) |
82
- | "Safely plan feature or run reversal" | `rollback` | `rollback` | Companion |
63
+ | "Safely plan feature or run reversal"| `rollback` | `rollback` | Companion |
83
64
  | "Set up automatic GitHub Actions CI" | `ci` | `ci` | Companion |
84
- | "Pre-check scope & risks before spec" | `brief` | `brief` | Companion |
65
+ | "Pre-check scope & risks before spec"| `brief` | `brief` | Companion |
85
66
  | "Run autonomous bounded delivery loop"| `autopilot` | `autopilot` | Companion |
86
67
  | "Brainstorm ideas without ID" | `brainstorm` | `brainstorm` | Companion |
87
- | "Socratic alignment / ADR / glossary" | `grill` | `/grill` / `align` | Companion (pre-spec / domain modeling) |
88
68
  | "Investigate failure or root cause" | `debug` | `debug` | Companion |
89
69
 
90
70
  ---
91
71
 
92
72
  ## Available Skills Sitemap
93
73
 
94
- ### 1. Fast-Track (Blueprint Mode - 4 Steps)
95
- - `spec` (`/spec`, `/feature`, `/fix`, `$spec`) - Define, spec, plan, and create `current-feature.md`
96
- - `implement` (`/implement`, `$implement`) - Execute planned checklist tasks with TDD
97
- - `check` (`/check`, `$check`) - Senior QA review, multi-lane verification, record evidence
98
- - `complete` (`/complete`, `$complete`) - Safety pass, release digest, git merge, close run
74
+ ### 1. Mainline Living Spec Loop (4 Steps)
75
+ - `feature` (`/feature`, `/spec`) - Define, spec, and plan in `current-feature.md`
76
+ - `fix` (`/fix`) - Document an ad-hoc bug or change in `current-feature.md`
77
+ - `implement` (`/implement`) - Execute planned checklist tasks with TDD
78
+ - `check` (`/check`) - Senior QA review, multi-lane verification, record evidence
79
+ - `complete` (`/complete`) - Safety pass, release digest, git merge, close run
99
80
 
100
- ### 2. Deep-Track (Architect Mode - 8 Steps)
81
+ ### 2. Pre-Flight Discovery Engine
101
82
  - `discovery` - Project roadmap planning or feature exploration before delivery commitment
102
- - `10-define` - Lock delivery boundaries and allocate Running ID
103
- - `20-spec` - Formalize markdown delivery contract
104
- - `30-plan` - Breakdown spec into phased tasks with test decisions
105
- - `40-execute` - Incremental task implementation
106
- - `50-verify` - Senior QA review and multi-lane validation
107
- - `60-report` - Generate standardized markdown digest report
108
- - `70-deliver` - Release packaging, release notes, and merge
109
-
110
- ### 3. Public Companion Commands
111
- - `devflow` (`status`, `/devflow`) - Interactive guide, state inspector, and router
112
- - `idea` (`/idea`) - Quick idea capture and AI feasibility enrichment into `devflow/ideas.md`
113
- - `grill` (`/grill`, `align`) - Codebase-grounded Socratic alignment, domain glossary, and ADR recorder
114
- - `brainstorm` - Ideate and compare trade-off options without allocating running IDs
115
- - `report-html` (`/report:html`) - Standalone interactive HTML report dashboard generator
116
- - `onboard` - Baseline stack setup for freshly scaffolded projects
117
- - `adopt` - Bootstrap DevFlow into existing brownfield projects
118
- - `doctor` - Read-only health check for setup and drift
119
- - `try` - Step-by-step human manual QA review guide
120
- - `rollback` - Safe feature/run reversal planner
121
- - `ci` - Automatic GitHub Actions workflow setup
122
- - `brief` - Read-only scope and risk pre-briefing
123
- - `autopilot` - Autonomous bounded delivery loop
124
- - `debug` - Root cause investigation before or during implementation
125
- - `overview` - Living context synchronization into project-overview.md
83
+ - `idea` - Quick idea capture with AI feasibility scoring
84
+ - `grill` (or `align`) - Socratic alignment, domain modeling, and ADR recording
85
+ - `brainstorm` - Multi-option ideation with trade-off analysis
86
+
87
+ ### 3. Verification & Diagnostic Companions
88
+ - `doctor` - Health check for setup, adapters, and workspace state
89
+ - `audit` - Branch-aware or full-project code, security, and quality review
90
+ - `test` / `tests` - Test suite runner and unit test scaffolding
91
+ - `ci` - Set up or normalize GitHub Actions checks
92
+ - `status` - Read-only progress summary and next action suggestion
93
+ - `try` - Human manual QA walkthrough guide
94
+ - `report-html` - Standalone interactive HTML report dashboard
95
+ - `debug` - Root-cause investigation without editing code
96
+ - `rollback` - Safe reversal of completed features
97
+ - `release` - Deployment readiness check
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: discovery
3
- description: "[devflow][D] Unified discovery and exploration stage in DevFlow 2.0 - conducts project-level roadmap discovery (project-plan.md/build-plan.md) or feature-level exploration (Stage 00) before delivery commitment."
3
+ description: "[devflow][D] Unified discovery and exploration stage in DevFlow 2.5.0 - conducts project-level roadmap discovery (project-plan.md/build-plan.md) or feature-level pre-delivery exploration before the Single Living Spec lifecycle."
4
4
  argument-hint: "[{title, request, IDEA-xxx, or discovery-id}]"
5
5
  ---
6
6
 
@@ -10,7 +10,7 @@ $ARGUMENTS
10
10
 
11
11
  `/discovery` is the central discovery entry point in Nexus-DevFlow. It operates in two adaptive modes based on input scope:
12
12
  1. **🗺️ Macro Project Discovery**: Develops high-level product and build roadmap plans (`devflow/project-plan.md` & `devflow/build-plan.md`) through an adaptive conversation before `/overview`.
13
- 2. **🔍 Micro Feature Exploration (Stage 00)**: Explores a specific feature, request, or idea before committing to delivery, routes through supporting lenses, and finishes with a visible `Proceed`, `Defer`, or `Reject` decision before `10-define`.
13
+ 2. **🔍 Micro Feature Exploration (Pre-Flight)**: Explores a specific feature, request, or idea before committing to delivery, routes through supporting lenses, and finishes with a visible `Proceed`, `Defer`, or `Reject` decision before `/feature` or `/fix`.
14
14
 
15
15
  ---
16
16
 
@@ -21,7 +21,7 @@ $ARGUMENTS
21
21
  /discovery
22
22
  /discovery --project
23
23
 
24
- # 2. Micro Feature Exploration Mode (Stage 00 of Deep-Track)
24
+ # 2. Micro Feature Exploration Mode (Pre-Flight)
25
25
  /discovery {title or request}
26
26
  /discovery IDEA-xxx
27
27
  /discovery {discovery-id}
@@ -44,7 +44,7 @@ Use when:
44
44
 
45
45
  ---
46
46
 
47
- ## Mode 2: Micro Feature Exploration (Stage 00 of Deep-Track)
47
+ ## Mode 2: Micro Feature Exploration (Pre-Flight)
48
48
 
49
49
  Use when:
50
50
  - Exploring a specific feature, complex architectural change, or pending idea (`/discovery IDEA-xxx`).
@@ -76,8 +76,7 @@ devflow/discoveries/{DISCOVERY_ID}-{slug}/discovery.md
76
76
  ### Decision & Approval Gate:
77
77
  Set one visible decision:
78
78
  - `Proceed`: Enough value and evidence exist to define delivery work:
79
- - **🏎️ Fast-Track (Recommended for 85% of standard features/fixes)**: Handoff to `/feature {discovery_id}` or `/fix {discovery_id}` (writes `devflow/context/current-feature.md`).
80
- - **🏗️ Deep-Track (For large architectural epics/migrations)**: Handoff to `10-define {discovery_id}` (writes `devflow/context/current-run/10-define.md`).
79
+ - Handoff to `/feature {discovery_id}` or `/fix {discovery_id}` to create the Single Living Spec in `devflow/context/current-feature.md`.
81
80
  - `Defer`: The idea remains relevant but timing or evidence is not ready.
82
81
  - `Reject`: The idea should not proceed under current framing.
83
82
 
@@ -86,6 +85,5 @@ Set one visible decision:
86
85
  ## Next Workflow Recommendations
87
86
 
88
87
  - **From Macro Project Mode**: Run `/overview` to compile context into `devflow/context/project-overview.md`.
89
- - **From Micro Stage 00 (Approved Proceed ➔ Fast-Track)**: Run `/feature {discovery_id}` to start lean living spec.
90
- - **From Micro Stage 00 (Approved Proceed ➔ Deep-Track)**: Run `10-define {discovery_id}` to allocate a Running ID.
91
- - **From Micro Stage 00 (Defer / Reject)**: No next command needed.
88
+ - **From Micro Pre-Flight (Approved Proceed)**: Run `/feature {discovery_id}` or `/fix {discovery_id}` to start the Single Living Spec lifecycle.
89
+ - **From Micro Pre-Flight (Defer / Reject)**: No next command needed.
@@ -1,12 +1,12 @@
1
- # Nexus-DevFlow 2.0 (The 3-Pillars & Dual-Track Model)
1
+ # Nexus-DevFlow 2.6.0 (The 3-Pillars & Single Living Spec Model)
2
2
 
3
3
  Instructions for AI coding agents working in this project. This is the cross-tool entry point: Codex, Google Antigravity, Cursor, GitHub Copilot, Gemini CLI, Aider, Zed, Windsurf, and others read `AGENTS.md`. Claude Code reads `CLAUDE.md`, which imports this file (`@AGENTS.md`), so there is a single source of truth.
4
4
 
5
5
  ## What this is
6
6
 
7
- This project uses **Nexus-DevFlow**, an agentic workflow layer supporting **The 3-Pillars Workspace Architecture & Dual-Track Delivery**:
7
+ This project uses **Nexus-DevFlow**, an agentic workflow layer supporting **The 3-Pillars Workspace Architecture & Single Living Spec Model**:
8
8
  1. **🔮 Future (Backlog)**: `devflow/ideas.md` — Centralized Idea Inbox with AI scoring.
9
- 2. **⚡ Present (Active Context)**: `devflow/context/` — Living Source of Truth & Active Work (`current-feature.md` for Fast-Track, `current-run/` for Deep-Track).
9
+ 2. **⚡ Present (Active Context)**: `devflow/context/` — Living Source of Truth & Active Work (`current-feature.md` Single Living Spec).
10
10
  3. **📦 Past (History Archive)**: `devflow/history/` — Categorized delivery archives (`features/`, `fixes/`, `rollbacks/`, and `HISTORY.md`).
11
11
 
12
12
  To start a new project, scaffold the application first in an empty folder, then run `npx @jakkrichm/create-nexus-devflow` to overlay DevFlow onto your codebase.
@@ -18,6 +18,7 @@ To start a new project, scaffold the application first in an empty folder, then
18
18
  - `devflow/context/ai-interaction.md` - how to interact with the user on this project
19
19
  - `devflow/context/current-stage.md` - active discovery or running delivery state
20
20
  - `devflow/context/findings.md` - quality, security, and verification ledger
21
+ - `devflow/context/glossary.md` - domain terms & architecture definitions
21
22
 
22
23
  ## Tool-Specific Adapters & Execution Rules
23
24
 
@@ -31,60 +32,50 @@ Unused adapter families can be removed. Codex, Antigravity, GitHub Copilot, and
31
32
 
32
33
  ### Universal Invocation & Agent Directives:
33
34
 
34
- 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`, `discovery`, `10-define`, `20-spec`, `30-plan`, `40-execute`, `50-verify`, `60-report`, `70-deliver`, `devflow`, `doctor`, `overview`, `debug`, `onboard`, `adopt`, `try`, `rollback`, `idea`, `ci`, `test`, `autopilot`, `prototype`, `report-html`, `brief`, `audit`, `release`, `brainstorm`, `grill`). The way you invoke commands depends on your AI Provider / Tool:
35
- - **Canonical Name (Plain text)**: Directly invoke or prompt the command by its standard name (e.g., `feature`, `40-execute`, `devflow`, `discovery`).
36
- - **Slash Prefix (`/`)**: For tools supporting slash commands (Claude Code, Google Antigravity, Gemini CLI), e.g., `/feature`, `/fix`, `/implement`, `/40-execute`, `/devflow`, `/discovery`.
37
- - **Dollar Prefix (`$`)**: For OpenAI Codex CLI or skill-invocation tools, e.g., `$feature`, `$fix`, `$40-execute`, `$devflow`, `$discovery`.
35
+ 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`, `discovery`, `idea`, `grill`, `brainstorm`, `devflow`, `doctor`, `overview`, `debug`, `onboard`, `adopt`, `try`, `rollback`, `ci`, `test`, `tests`, `autopilot`, `prototype`, `report-html`, `brief`, `audit`, `release`). The way you invoke commands depends on your AI Provider / Tool:
36
+ - **Canonical Name (Plain text)**: Directly invoke or prompt the command by its standard name (e.g., `feature`, `implement`, `devflow`, `discovery`).
37
+ - **Slash Prefix (`/`)**: For tools supporting slash commands (Claude Code, Google Antigravity, Gemini CLI), e.g., `/feature`, `/fix`, `/implement`, `/devflow`, `/discovery`.
38
+ - **Dollar Prefix (`$`)**: For OpenAI Codex CLI or skill-invocation tools, e.g., `$feature`, `$fix`, `$devflow`, `$discovery`.
38
39
  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.
39
40
  3. **Google Antigravity & Claude Code**: Native skill engines automatically discover and surface `.agents/skills/` and `.claude/skills/`.
40
41
  4. **State-Aware Inspection**: When unsure what to do next, invoke `devflow` to automatically inspect `devflow/context/current-stage.md` and active context in `devflow/context/`.
41
- 5. **Default Artifact & Communication Language (Thai)**: All generated markdown stage artifacts (`current-feature.md`, `00-explore.md`...`70-deliver.md`) and user communication MUST default to **Thai (`th`)**, while code, technical terms, file paths, and identifiers remain in English.
42
+ 5. **Default Artifact & Communication Language (Thai)**: All generated markdown stage artifacts (`current-feature.md`, `discovery.md`, etc.) and user communication MUST default to **Thai (`th`)**, while code, technical terms, file paths, and identifiers remain in English.
42
43
 
43
44
  ---
44
45
 
45
- ## 🏎️ Track 1: Fast-Track (Blueprint Mode - 4 Steps)
46
+ ## The Unified 4-Stage Living Spec Lifecycle
46
47
 
47
- Recommended for 85% of daily work (features, bug fixes, UI improvements, iterative tasks):
48
+ All development tasks (from lean UI fixes to deep architectural epics) execute through the 4-step progressive lifecycle:
48
49
 
49
50
  ```text
50
51
  /feature (หรือ /fix) ──▶ /implement ──▶ /check ──▶ /complete
51
52
  ```
52
53
 
53
54
  1. **`feature` / `fix` (`/feature`, `/fix`, `/spec`)**:
54
- - **Purpose**: Combines Discover, Define, Spec, and Plan into one unified step. Checks Single Active Run Guardrail, allocates sequential ID (`xxx-slug`), and creates the **Single Living Spec (`devflow/context/current-feature.md`)**.
55
+ - **Purpose**: Combines Discover, Define, Spec, and Plan into one unified step. Checks Single Active Run Guardrail, allocates sequential ID (`xxx-slug`), and creates the **Single Living Spec (`devflow/context/current-feature.md`)** with 6 structured sections.
55
56
  - **Artifact**: `devflow/context/current-feature.md`
56
57
  2. **`implement` (`/implement`)**:
57
- - **Purpose**: Incrementally executes checklist tasks with TDD discipline and appends progress to `devflow/context/current-feature.md`.
58
+ - **Purpose**: Incrementally executes checklist tasks with TDD discipline (Red-Green-Refactor) and appends diff evidence to `current-feature.md`.
58
59
  3. **`check` (`/check`)**:
59
- - **Purpose**: Senior QA review, multi-lane verification matrix (Typecheck, Lint, Test suites, manual proof), and records evidence into `devflow/context/current-feature.md`.
60
+ - **Purpose**: Senior QA review, multi-lane verification matrix (Typecheck, Lint, Test suites, manual proof), and records empirical proof into `current-feature.md`.
60
61
  4. **`complete` (`/complete`)**:
61
- - **Purpose**: Final safety pass, records Release Digest, automatically archives to `devflow/history/{features|fixes|rollbacks}/{xxx-slug}.md`, resets the stub, performs git merge, and closes the run without auto HTML generation.
62
+ - **Purpose**: Final safety pass, records Release Digest, automatically archives to `devflow/history/{features|fixes|rollbacks}/{xxx-slug}.md`, resets the stub, and performs git squash-merge.
62
63
 
63
64
  ---
64
65
 
65
- ## 🏗️ Track 2: Deep-Track (Architect Mode - 8 Steps)
66
+ ## 🔮 Pre-Flight Discovery & Architectural Alignment (Companions)
66
67
 
67
- Recommended for large architectural epics, database migrations, and multi-agent coordination:
68
-
69
- ```text
70
- discovery ──▶ 10-define ──▶ 20-spec ──▶ 30-plan ──▶ 40-execute ──▶ 50-verify ──▶ 60-report ──▶ 70-deliver
71
- ```
72
-
73
- 1. `discovery`: Unified pre-delivery discovery & exploration (project-level roadmap planning or feature-level exploration with 5 lenses: Brainstorm, Research, PRD, Bug Triage, Grill) before delivery commitment (`devflow/discoveries/{DISC-ID}/discovery.md`).
74
- 2. `10-define`: Turn approved discovery into bounded delivery run in `devflow/context/current-run/10-define.md`.
75
- 3. `20-spec`: Formalize markdown-first delivery contract & acceptance criteria (`20-spec.md`).
76
- 4. `30-plan`: Breakdown spec into executable tasks with test decisions (`30-plan.md` + checklists).
77
- 5. `40-execute`: Incremental task execution behind review gates (`40-execute.md`).
78
- 6. `50-verify`: Senior QA review & multi-lane verification checks (`50-verify.md`).
79
- 7. `60-report`: Standardized markdown delivery digest (`60-report.md`).
80
- 8. `70-deliver`: Release packaging, git merge, archives `devflow/context/current-run/` ➔ `devflow/history/{category}/{xxx-slug}/`, and closes run.
68
+ - `discovery`: Unified pre-delivery discovery & exploration (`devflow/discoveries/{DISC-ID}/discovery.md`).
69
+ - `idea`: Quick idea capture and AI feasibility scoring (`devflow/ideas.md`).
70
+ - `grill` (or `align`): Socratic alignment, domain modeling, and ADR recording (`devflow/decisions/`).
71
+ - `brainstorm`: Divergent/convergent ideation with trade-off analysis.
81
72
 
82
73
  ---
83
74
 
84
75
  ## 🌐 Standalone HTML Reporting Policy
85
76
 
86
77
  > [!IMPORTANT]
87
- > **No Auto-Generated HTML**: Mainline flows (`/complete` and `60-report`) strictly output Markdown only.
78
+ > **No Auto-Generated HTML**: Mainline flows (`/complete`) strictly output Markdown only.
88
79
  > When an interactive web dashboard is desired for presentation or sharing, invoke the standalone companion command:
89
80
  > `/report:html` (or `npm run report:html -- {ID}`).
90
81
 
@@ -76,5 +76,14 @@
76
76
  - *Dependencies*: None
77
77
  - *Scope*: นำ Strict TDD (Red-Green-Refactor) Sub-Tasks และ Two-Stage Review Pattern (Stage 1: Spec Fidelity, Stage 2: Quality & Security Gate) ผสานเข้าสู่ Prompt Rules, Coding Standards, AI Interaction และ Stage Skills (`30-plan`, `40-execute`, `50-verify`, `feature`, `implement`, `check`, `debug`) พร้อมอัปเดต Template และ Unit Tests
78
78
 
79
+ ---
80
+
81
+ ## ⚡ Phase 10: Nexus-DevFlow 2.5.0 (Unified Living Spec Model)
82
+
83
+ - [x] **10. Unify Deep-Track and Fast-Track into Single Living Spec Model** `[Size: L]`
84
+ - *Dependencies*: ADR-001
85
+ - *Scope*: รวมความสามารถเชิงสถาปัตยกรรมระดับลึกของ Deep-Track เข้าสู่ 4 ขั้นตอนหลักของ Fast-Track บนเอกสาร Single Living Spec (`current-feature.md`) จัดเก็บประวัติแบบ Single Archive (`.md`), ปลดระวาง stage skills 10-70 ที่ซ้ำซ้อน, และปรับปรุงเอกสาร & Schemas ทั้งหมด
86
+
87
+
79
88
 
80
89
 
@@ -27,69 +27,68 @@ Format every response for fast scanning and readability:
27
27
 
28
28
  ---
29
29
 
30
- ## 3. Dual-Track Workflow Lifecycle (The 3-Pillars Model)
30
+ ## 3. The 3-Pillars Unified Architecture (DevFlow 2.5.0)
31
31
 
32
32
  ```text
33
33
  devflow/
34
- ├── 🔮 ideas.md # [Future] Idea Inbox
35
- ├── ⚡ context/ # [Present] Living Spec (current-feature.md) & Active State
34
+ ├── 🔮 ideas.md # [Future] Idea Inbox with AI Feasibility Scoring
35
+ ├── ⚡ context/ # [Present] Single Living Spec (current-feature.md) & Active State
36
36
  └── 📦 history/ # [Past] features/, fixes/, rollbacks/, and HISTORY.md
37
37
  ```
38
38
 
39
- ### 🏎️ Track 1: Fast-Track (Blueprint Mode — 4 Steps)
40
- *Recommended for 85% of daily engineering work (features, bug fixes, UI improvements, iterative refactoring).*
41
-
42
- The entire lifecycle is driven by the **Single Living Spec (`devflow/context/current-feature.md`)**:
43
-
44
- 1. **Spec (`/feature` or `/fix`)**:
45
- - Checks **Single Active Run Guardrail** (rejects if an uncompleted task is still active).
46
- - Analyzes request (or consumes `IDEA-xxx` from `devflow/ideas.md`).
47
- - Allocates sequential ID without prefix (e.g. `022-{slug}`) and creates branch `feature/{xxx-slug}` or `fix/{xxx-slug}`.
48
- - Generates `devflow/context/current-feature.md` containing **Section 1 (Scope & AC)**, **Section 2 (Plan & Test Strategy)**, and **Section 3 (Checklist)**.
49
- 2. **Implement (`/implement`)**:
50
- - Executes checklist tasks incrementally one small diff at a time using **TDD (Red-Green-Refactor)**.
51
- - Updates `## 4. Implementation Record` and marks tasks `- [x]` in `current-feature.md`.
52
- 3. **Check (`/check`)**:
53
- - Senior QA multi-lane verification (Lane 1: Typecheck/Lint, Lane 2: Test Suites, Lane 3: Manual Proof).
54
- - Records empirical proof under `## 5. Verification Evidence` in `current-feature.md`.
55
- 4. **Complete (`/complete`)**:
56
- - Final safety pass, updates `## 6. Release & Handoff` digest in `current-feature.md`.
57
- - Automatically archives `current-feature.md` ➔ `devflow/history/{features|fixes|rollbacks}/{xxx-slug}.md`.
58
- - Appends resolved findings and cleans `findings.md`.
59
- - Resets `current-feature.md` back to the idle stub.
60
- - Performs Git squash-merge into `main`, updates `devflow/history/HISTORY.md`, and sets workspace to Idle.
61
-
62
- ---
63
-
64
- ### 🏗️ Track 2: Deep-Track (Architect Mode — 8 Steps)
65
- *Recommended for large architectural epics, database migrations, security audits, and multi-agent coordination.*
39
+ ### The Unified 4-Stage Living Spec Lifecycle
40
+ *ขับเคลื่อนการพัฒนาทุกระดับ (ตั้งแต่ Fast Fix จนถึง Architectural Epic) ด้วยเอกสารฉบับเดียว **Single Living Spec (`devflow/context/current-feature.md`)** ที่รวมความลึกระดับ Architect Mode เข้ากับความคล่องตัวระดับ Lean Velocity:*
66
41
 
67
42
  ```text
68
- discovery 10-define 20-spec 30-plan 40-execute ➔ 50-verify ➔ 60-report ➔ 70-deliver
43
+ /feature (หรือ /fix) ──▶ /implement ──▶ /check ──▶ /complete
69
44
  ```
70
45
 
71
- 1. `discovery`: Unified pre-delivery discovery & Socratic alignment (`DISC-YYYYMMDD-NNN` or project roadmap).
72
- 2. `10-define`: Turn approved discovery into bounded delivery run in `devflow/context/current-run/10-define.md`.
73
- 3. `20-spec`: Formalize markdown delivery contract & acceptance criteria (`20-spec.md`).
74
- 4. `30-plan`: Breakdown spec into atomic 2-5 min tasks with explicit TDD decisions (`30-plan.md` + checklists).
75
- 5. `40-execute`: Strict Red-Green-Refactor task execution behind review gates (`40-execute.md`).
76
- 6. `50-verify`: Senior QA Two-Stage Review (Spec Fidelity + Quality/Security Gate) (`50-verify.md`).
77
- 7. `60-report`: Standardized markdown delivery digest (`60-report.md`).
78
- 8. `70-deliver`: Release packaging, git merge, archives `devflow/context/current-run/` `devflow/history/{category}/{xxx-slug}/`, and closes the run.
46
+ 1. **Stage 1: Spec (`/feature` หรือ `/fix`)**:
47
+ - ตรวจสอบ **Single Active Run Guardrail** (บล็อกการเปิดงานซ้อนถ้ามีงานที่ยังไม่เสร็จ)
48
+ - ดึงบริบทจาก `devflow/discoveries/`, `devflow/ideas.md`, หรือคำขอของผู้ใช้
49
+ - จัดสรร Running ID (`xxx-slug`) และสร้าง Branch `feature/{xxx-slug}` หรือ `fix/{xxx-slug}`
50
+ - เขียน **Single Living Spec (`current-feature.md`)** ครอบคลุม:
51
+ - `## 🎯 1. Define & Boundaries` (Problem, In/Out Scope, Risks, Success Criteria)
52
+ - `## 📐 2. Technical Spec & Contracts` (Architecture, Models, Interface Contracts, Non-functional, ACs)
53
+ - `## 📋 3. Execution Plan & TDD Checklist` (Atomic tasks, `[TDD-Red/Green/Refactor]` Triplets)
54
+
55
+ 2. **Stage 2: Implement (`/implement`)**:
56
+ - ดำเนินการ Task-by-task ตาม Checklist อย่างเคร่งครัดด้วย **TDD (Red-Green-Refactor)**
57
+ - ติ๊กเครื่องหมาย `- [x]` และบันทึก `## ⚡ 4. Implementation Log & Evidence` (Diff summary, Checkpoints) ลงใน `current-feature.md`
58
+
59
+ 3. **Stage 3: Check (`/check`)**:
60
+ - Senior QA Multi-Lane Verification (Typecheck, Lint, Test Suites, Manual Proof)
61
+ - บันทึกผลการพิสูจน์เชิงประจักษ์ลงใน `## 🧪 5. Multi-Lane Verification Matrix` ใน `current-feature.md`
62
+
63
+ 4. **Stage 4: Complete (`/complete`)**:
64
+ - สรุปผล `## 📦 6. Release Digest & Retrospective` (Changelog, Lessons Learned, ADRs)
65
+ - ทำการ Archive `current-feature.md` ไปเป็นไฟล์เดี่ยวที่ `devflow/history/{features|fixes|rollbacks}/{xxx-slug}.md`
66
+ - **Mandatory Delivery Gate**: บังคับถามผู้ใช้ก่อนเสมอว่าต้องการ Delivery รูปแบบใด:
67
+ - **Option 1 (Team MR/PR Flow)**: Pull master/main ล่าสุดมารวมกับ Feature/Dev Branch แล้ว push branch ขึ้นไปเพื่อเปิด MR/PR (ไม่ merge เข้า main/master ในเครื่อง และไม่แตะ protected branch)
68
+ - **Option 2 (Direct Squash-Merge)**: ทำการ Squash-merge เข้า main/master ในเครื่องเฉพาะเมื่อผู้ใช้สั่งโดยตรงเท่านั้น
69
+ - รีเซ็ต `current-feature.md` กลับเป็น Idle stub เมื่อปิดรอบงานเรียบร้อย
79
70
 
80
71
  ---
81
72
 
73
+ ### 🔮 Pre-Flight Discovery & Architectural Alignment (Companion Tools)
74
+ สำหรับงานที่ต้องการสำรวจไอเดีย, ค้นคว้าทางเทคนิค, หรือการออกแบบสถาปัตยกรรมก่อนเริ่มสร้าง Spec:
75
+ - `/discovery`: Unified Pre-delivery Discovery & Research (บันทึกใน `devflow/discoveries/`)
76
+ - `/idea`: วิเคราะห์และบันทึกไอเดียลงใน `devflow/ideas.md`
77
+ - `/grill` (หรือ `/align`): Socratic Alignment, Domain Modeling & บันทึก ADRs ลงใน `devflow/decisions/`
78
+ - `/brainstorm`: เครื่องมือระดมความคิดทางเลือก 2-3 Options พร้อมเปรียบเทียบ Trade-offs
79
+
80
+
82
81
  ## 4. Strict TDD & Two-Stage Review Interaction Rules
83
82
 
84
83
  ### 🔴🟢 Strict TDD Execution Discipline
85
- During implementation in `/implement` and `40-execute`:
84
+ During implementation in `/implement`:
86
85
  - **Show Red Phase**: First execute tests to demonstrate expected failure *before* adding production code.
87
86
  - **Show Green Phase**: Add minimal production code, re-run tests, and report pass rate.
88
87
  - **Show Refactor Phase**: Polish and clean up with zero test regression.
89
88
  - **Forbidden**: Never present functional code changes without matching test execution evidence.
90
89
 
91
90
  ### 🛡️ Two-Stage Verification Reporting
92
- During `/check` and `50-verify`:
91
+ During `/check`:
93
92
  - **Stage 1 (Spec Fidelity Gate)**: Report each Acceptance Criterion and "Done When" status.
94
93
  - **Stage 2 (Code Quality & Security Gate)**: Report Typecheck, Lint, Test Suites, Security checks, and Findings Ledger (0 blockers).
95
94
 
@@ -98,7 +97,7 @@ During `/check` and `50-verify`:
98
97
  ## 5. Standalone HTML Reporting Policy
99
98
 
100
99
  > [!IMPORTANT]
101
- > **No Auto-Generated HTML**: Mainline stages (`/complete` and `60-report`) strictly output Markdown only.
100
+ > **No Auto-Generated HTML**: The mainline `/complete` stage strictly outputs Markdown only.
102
101
  > When an interactive web dashboard is desired for presentation or sharing, invoke the standalone companion command:
103
102
  > `/report:html` (or `npm run report:html -- {ID}`).
104
103
 
@@ -109,7 +108,6 @@ During `/check` and `50-verify`:
109
108
  Progress lives in persistent files, not in transient chat history:
110
109
 
111
110
  - In Fast-Track: `devflow/context/current-feature.md` maintains ticked checklist boxes `- [x]`.
112
- - In Deep-Track: `devflow/context/current-run/` maintains stage markdown files.
113
111
  - In Git: Commits, branches, and working tree maintain the code history.
114
112
  - When starting a fresh session after a context clear, run `devflow` or inspect `current-stage.md` to pick up immediately from the next pending step.
115
113
 
@@ -117,8 +115,8 @@ Progress lives in persistent files, not in transient chat history:
117
115
 
118
116
  ## 6. Single Active Run Guardrail (One Thing at a Time)
119
117
 
120
- - Only one active run is allowed at a time across both Fast-Track and Deep-Track.
121
- - The AI will actively block opening a new feature or fix until the current one is completed with `/complete` or `70-deliver` (or explicitly rolled back/cancelled).
118
+ - Only one active Single Living Spec run is allowed at a time.
119
+ - The AI will actively block opening a new feature or fix until the current one is completed with `/complete` (or explicitly rolled back/cancelled).
122
120
 
123
121
  ---
124
122
 
@@ -14,16 +14,40 @@
14
14
 
15
15
  ---
16
16
 
17
- ## 2. CLI Architecture & Engineering Principles
18
-
19
- - **Separation of Concerns (Deep Modules & Information Hiding)**:
17
+ ## 2. CLI Architecture & Deep Modules Philosophy
18
+
19
+ - **Deep Modules Principles (John Ousterhout Philosophy)**:
20
+ - **Module**: Anything with an interface and an implementation (function, class, package, or subsystem).
21
+ - **Interface**: Everything a caller must know to use the module correctly (types, invariants, ordering, error modes, configuration).
22
+ - **Implementation**: The hidden body of code inside the module.
23
+ - **Depth (High Leverage)**: A module is **Deep** when a large amount of complex behavior sits behind a small, simple interface. A module is **Shallow** (to be avoided) when its interface is nearly as complex as its implementation.
24
+ - **Seam**: The clean architectural location where an interface lives.
25
+ - **Adapter**: A concrete implementer satisfying the interface at a seam.
26
+ - **The Deletion Test**: Imagine deleting the module. If complexity concentrates across N callers, it was earning its keep (Deep). If complexity simply vanishes or moves, it was a pass-through (Shallow).
27
+ - **Designing for Testability**:
28
+ - *Accept dependencies, don't instantiate them inside.*
29
+ - *Return results, minimize unobservable side effects.*
30
+ - *Small surface area: fewer methods and simple parameter objects.*
31
+ - **Separation of Concerns (Information Hiding)**:
20
32
  - Keep CLI entry points (`bin/create-nexus-devflow.ts`) thin: handle argument parsing, option normalization, and terminal formatting.
21
33
  - Encapsulate all core business logic, filesystem operations, and parsing inside modular libraries (`lib/current-work.ts`, `lib/findings.ts`, `lib/git.ts`, `lib/uninstall.ts`, `lib/update.ts`).
22
- - **Deep Modules**: Strive for simple, narrow interfaces that hide extensive implementation complexity internally.
23
34
  - **Refactoring & Code Simplification (Simplify Discipline)**:
24
35
  - **Early Returns**: Guard conditions should exit early to eliminate deep nesting.
25
36
  - **Single Responsibility (SRP)**: Functions should do one cohesive thing and stay under 50 lines whenever possible.
26
37
  - **Pure Functions**: Favor deterministic functions without side effects for data transformation and parsing.
38
+ - **Baseline 12 Fowler Code Smells (Continuous Refactoring)**:
39
+ - **Mysterious Name**: Names that don't reveal what they do -> Rename with clear intention.
40
+ - **Duplicated Code**: Identical or similar logic shapes -> Extract shared helper.
41
+ - **Feature Envy**: Method reaching into another object's data -> Move method onto that data.
42
+ - **Data Clumps**: Same 3+ fields traveling together -> Bundle into a cohesive type.
43
+ - **Primitive Obsession**: Raw string/number representing a domain concept -> Define a branded/domain type.
44
+ - **Repeated Switches**: Duplicate `switch`/`if` cascades -> Use polymorphism or lookup map.
45
+ - **Shotgun Surgery**: One change forcing scattered edits in many files -> Unify into one deep module.
46
+ - **Divergent Change**: One file edited for multiple unrelated reasons -> Split responsibilities.
47
+ - **Speculative Generality**: Hooks/params added for hypothetical needs -> Delete and inline until needed.
48
+ - **Message Chains**: Long `a.b().c().d()` navigation -> Hide behind a method on the root object.
49
+ - **Middle Man**: Class/function that only delegates -> Remove and call target directly.
50
+ - **Refused Bequest**: Subclass ignoring inherited methods -> Replace inheritance with composition.
27
51
  - **Safety Flags & Idempotency**:
28
52
  - Destructive or mutating operations (e.g. `uninstall`, `update`, `install`) must support safety flags:
29
53
  - `--dry-run`: Preview actions and affected files without modifying the disk.
@@ -109,7 +133,7 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
109
133
  - Never claim a task is "working", "tested", or "verified" without providing concrete empirical proof (exact command executed, terminal output, pass/fail counts, exit code).
110
134
  - **Two-Stage Review Pattern (Verification Gate)**:
111
135
  - **Stage 1: Spec Fidelity & Acceptance Gate**:
112
- - Verify 100% conformance against the living spec (`current-feature.md` or `20-spec.md`).
136
+ - Verify 100% conformance against the Single Living Spec (`current-feature.md`).
113
137
  - Validate all Acceptance Criteria (ACs) and "Done When" observables without missing requirements or scope creep.
114
138
  - Test edge cases and boundary conditions defined in the specification.
115
139
  - **Stage 2: Code Quality, Security & Architecture Gate**:
@@ -129,7 +153,8 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
129
153
  - `fixed`: Repaired in code, pending QA re-verification.
130
154
  - `closed`: Verified by QA as completely resolved without regressions.
131
155
  - `accepted`: Formally waived with recorded user justification.
132
- - **P0/P1 Blockers**: Any P0 or P1 finding in `open` or `fixed` status unconditionally blocks `/complete` and `70-deliver`.
156
+ - **P0/P1 Blockers**: Any P0 or P1 finding in `open` or `fixed` status unconditionally blocks `/complete`.
157
+ - **Allowed Waivers**: A P0 or P1 finding may only be bypassed if marked `accepted` (with explicit user justification recorded) or `invalid` (with evidence recorded by `/audit`).
133
158
 
134
159
  ---
135
160
 
@@ -1,8 +1,11 @@
1
- # Current DevFlow Run Status
1
+ # Current Stage
2
2
 
3
- - **Active Discovery ID**: `None`
4
- - **Active Running ID**: `None`
5
- - **Current Stage**: `Idle (Ready for new /feature, /fix, /discovery, or /10-define)`
6
- - **Living Spec**: `None`
7
- - **Last Completed Run**: `None`
8
- - **Last Updated**: `None`
3
+ - Active Discovery ID: `None`
4
+ - Active Running ID: `None`
5
+ - Track: `idle`
6
+ - Current Stage: `idle`
7
+ - Active Branch: `main`
8
+ - Living Spec: `devflow/context/current-feature.md`
9
+ - Next Action: `Run /feature, /fix, or /discovery to start new work.`
10
+ - Last Completed Run: `None`
11
+ - Last Updated: `None`