@jakkrichm/create-nexus-devflow 2.5.0 → 2.6.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 (81) hide show
  1. package/README.md +58 -45
  2. package/dist/lib/branch-context.d.ts +61 -8
  3. package/dist/lib/branch-context.js +362 -125
  4. package/dist/lib/branch-context.js.map +1 -1
  5. package/dist/lib/core-skill-inventory.d.ts +16 -0
  6. package/dist/lib/core-skill-inventory.js +96 -0
  7. package/dist/lib/core-skill-inventory.js.map +1 -0
  8. package/dist/lib/doctor.js +13 -10
  9. package/dist/lib/doctor.js.map +1 -1
  10. package/dist/lib/status.d.ts +2 -0
  11. package/dist/lib/status.js +7 -2
  12. package/dist/lib/status.js.map +1 -1
  13. package/dist/lib/update.js +5 -8
  14. package/dist/lib/update.js.map +1 -1
  15. package/dist/scripts/prepare-template.js +19 -16
  16. package/dist/scripts/prepare-template.js.map +1 -1
  17. package/package.json +1 -1
  18. package/template/.agents/skills/adopt/SKILL.md +1 -1
  19. package/template/.agents/skills/audit/SKILL.md +1 -1
  20. package/template/.agents/skills/autopilot/SKILL.md +1 -1
  21. package/template/.agents/skills/brainstorm/SKILL.md +1 -1
  22. package/template/.agents/skills/brief/SKILL.md +1 -1
  23. package/template/.agents/skills/check/SKILL.md +80 -75
  24. package/template/.agents/skills/ci/SKILL.md +1 -1
  25. package/template/.agents/skills/complete/SKILL.md +9 -3
  26. package/template/.agents/skills/convert-any-to-md/SKILL.md +1 -1
  27. package/template/.agents/skills/debug/SKILL.md +76 -94
  28. package/template/.agents/skills/devflow/SKILL.md +1 -1
  29. package/template/.agents/skills/discovery/SKILL.md +7 -9
  30. package/template/.agents/skills/doctor/SKILL.md +1 -1
  31. package/template/.agents/skills/feature/SKILL.md +10 -5
  32. package/template/.agents/skills/fix/SKILL.md +6 -8
  33. package/template/.agents/skills/grill/SKILL.md +1 -1
  34. package/template/.agents/skills/idea/SKILL.md +1 -1
  35. package/template/.agents/skills/implement/SKILL.md +10 -4
  36. package/template/.agents/skills/onboard/SKILL.md +1 -1
  37. package/template/.agents/skills/overview/SKILL.md +1 -1
  38. package/template/.agents/skills/prototype/SKILL.md +1 -1
  39. package/template/.agents/skills/release/SKILL.md +1 -1
  40. package/template/.agents/skills/report-html/SKILL.md +1 -1
  41. package/template/.agents/skills/rollback/SKILL.md +1 -1
  42. package/template/.agents/skills/status/SKILL.md +1 -1
  43. package/template/.agents/skills/test/SKILL.md +1 -1
  44. package/template/.agents/skills/tests/SKILL.md +1 -1
  45. package/template/.agents/skills/try/SKILL.md +1 -1
  46. package/template/.claude/skills/adopt/SKILL.md +1 -1
  47. package/template/.claude/skills/audit/SKILL.md +1 -1
  48. package/template/.claude/skills/autopilot/SKILL.md +1 -1
  49. package/template/.claude/skills/brainstorm/SKILL.md +1 -1
  50. package/template/.claude/skills/brief/SKILL.md +1 -1
  51. package/template/.claude/skills/check/SKILL.md +80 -75
  52. package/template/.claude/skills/ci/SKILL.md +1 -1
  53. package/template/.claude/skills/complete/SKILL.md +9 -3
  54. package/template/.claude/skills/convert-any-to-md/SKILL.md +1 -1
  55. package/template/.claude/skills/debug/SKILL.md +76 -94
  56. package/template/.claude/skills/devflow/SKILL.md +1 -1
  57. package/template/.claude/skills/discovery/SKILL.md +7 -9
  58. package/template/.claude/skills/doctor/SKILL.md +1 -1
  59. package/template/.claude/skills/feature/SKILL.md +10 -5
  60. package/template/.claude/skills/fix/SKILL.md +6 -8
  61. package/template/.claude/skills/grill/SKILL.md +1 -1
  62. package/template/.claude/skills/idea/SKILL.md +1 -1
  63. package/template/.claude/skills/implement/SKILL.md +10 -4
  64. package/template/.claude/skills/onboard/SKILL.md +1 -1
  65. package/template/.claude/skills/overview/SKILL.md +1 -1
  66. package/template/.claude/skills/prototype/SKILL.md +1 -1
  67. package/template/.claude/skills/release/SKILL.md +1 -1
  68. package/template/.claude/skills/report-html/SKILL.md +1 -1
  69. package/template/.claude/skills/rollback/SKILL.md +1 -1
  70. package/template/.claude/skills/status/SKILL.md +1 -1
  71. package/template/.claude/skills/test/SKILL.md +1 -1
  72. package/template/.claude/skills/tests/SKILL.md +1 -1
  73. package/template/.claude/skills/try/SKILL.md +1 -1
  74. package/template/AGENTS.md +1 -1
  75. package/template/devflow/build-plan.md +10 -0
  76. package/template/devflow/context/ai-interaction.md +5 -6
  77. package/template/devflow/context/coding-standards.md +31 -6
  78. package/template/devflow/context/current-stage.md +10 -7
  79. package/template/devflow/history/HISTORY.md +1 -1
  80. package/template/devflow/project-plan.md +2 -2
  81. package/template/devflow/reference/running-id-contract.md +24 -20
@@ -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`
@@ -1,6 +1,6 @@
1
1
  # Master Release History Ledger
2
2
 
3
- This master ledger tracks all released delivery runs, milestones, and rollbacks in chronological order. Each entry is recorded during `/complete` or `70-deliver` and links to its exact Git commit hash, release status, category, and archived delivery artifacts.
3
+ This master ledger tracks all released delivery runs, milestones, and rollbacks in chronological order. Each entry is recorded during `/complete` and links to its exact Git commit hash, release status, category, and archived delivery artifacts.
4
4
 
5
5
  ---
6
6
 
@@ -13,7 +13,7 @@
13
13
  - ทีมพัฒนาและองค์กร (Engineering Teams & Tech Leads) ที่ต้องการมาตรฐานการส่งมอบโค้ดที่ตรวจสอบได้ (Traceable), ตรวจสอบย้อนหลังได้ (Auditable) และไม่มีปัญหาโค้ดตีกัน (Zero Merge Conflict)
14
14
  - **Core Value Proposition**:
15
15
  - **The 3-Pillars Model**: จัดระเบียบบริบทเป็น 3 เสาหลักอย่างชัดเจน — *🔮 Future (Inbox `ideas.md`)* ➔ *⚡ Present (Living Context `devflow/context/`)* ➔ *📦 Past (Categorized History `devflow/history/`)*
16
- - **Dual-Track Delivery Model**: เลือกความเร็วให้เหมาะกับขนาดงาน *Fast-Track (4 ขั้นตอน)* สำหรับ 85% ของงานประจำวัน และ *Deep-Track (8 ขั้นตอน)* สำหรับ 15% ของงานสถาปัตยกรรม
16
+ - **Single Living Spec Delivery Model**: งานทุกขนาดใช้วงจรเดียว `/feature` (หรือ `/fix`) `/implement` `/check` `/complete` โดยเพิ่มความลึกของสเปกและหลักฐานตามความซับซ้อนของงาน
17
17
  - **Hard Quality Gates**: ระบบปฏิเสธการปล่อยงานเมื่อไม่ผ่านเกณฑ์การทดสอบ หรือมีข้อบกพร่องความปลอดภัยค้างอยู่
18
18
 
19
19
  ---
@@ -27,7 +27,7 @@
27
27
  - Local State Management & Backup Snapshots (`.nexus/`)
28
28
  - **Key Modules & Subsystems**:
29
29
  - **Distribution CLI & Package**: `packages/create-nexus-devflow` (Scaffolding, Doctor, Status, Update, Gatekeeper)
30
- - **Interactive Web Dashboard**: Embedded Local Webview Dashboard (`/dashboard`) พร้อม Dual-Track Visualizer และ Real-time Snapshot
30
+ - **Interactive Web Dashboard**: Embedded Local Webview Dashboard (`/dashboard`) พร้อม Living Spec Visualizer และ Real-time Snapshot
31
31
  - **Gatekeeper Engine**: ระบบตรวจสอบคุณภาพโค้ดและ Finding Blockers (`nexus-devflow check-gate`)
32
32
  - **Model Context Protocol (MCP) Server**: JSON-RPC Hub สำหรับเชื่อมต่อ AI Agents แบบ Type-Safe
33
33
  - **Dynamic Context Slicer**: ระบบจัดสรรและตัดตอนบริบทแบบ Just-In-Time (JIT) เพื่อประหยัด Token
@@ -1,4 +1,4 @@
1
- # DevFlow 2.5.0 Running ID & 3-Pillars Workspace Contract
1
+ # DevFlow 2.6.0 Running ID & 3-Pillars Multi-Run Context Contract
2
2
 
3
3
  ## The 3-Pillars Workspace Architecture
4
4
 
@@ -7,15 +7,23 @@ All DevFlow framework assets are organized into three clean pillars representing
7
7
  ```text
8
8
  devflow/
9
9
  ├── 🔮 ideas.md # [1. Future / Backlog] Centralized Idea Inbox with AI scoring
10
+ ├── 🗺️ project-plan.md # [1. Future] Master product roadmap and system vision
11
+ ├── 📋 build-plan.md # [1. Future] User-owned feature queue and sizing
10
12
 
11
- ├── ⚡ context/ # [2. Present / Active] Living Source of Truth & Active Work
13
+ ├── ⚡ context/ # [2. Present / Active] Living Source of Truth & Multi-Run Contexts
12
14
  │ ├── project-overview.md # Primary source of truth for project architecture and tech stack
13
15
  │ ├── coding-standards.md # Engineering, code quality, TDD, and testing standards
14
16
  │ ├── ai-interaction.md # AI agent interaction rules, unified living spec flow, and Thai defaults
15
- │ ├── findings.md # Open and resolved audit findings ledger (P0-P3)
16
17
  │ ├── glossary.md # Domain glossary and architecture vocabulary
18
+ │ ├── current-feature.md # Active Living Spec pointer / legacy fallback
17
19
  │ ├── current-stage.md # Active state pointer and run tracker
18
- └── current-feature.md # Single Living Spec (Active work / stub when idle)
20
+ ├── findings.md # Shared/default audit findings ledger (P0-P3)
21
+ │ │
22
+ │ ├── {xxx-slug}/ # Active Run Workspace & Spec Queue (Multi-Run Active Task)
23
+ │ │ ├── spec.md # Living Spec + Checklist for this run
24
+ │ │ ├── stage.md # Runtime stage, track, and branch pointer
25
+ │ │ └── findings.md # Dedicated audit findings ledger for this run
26
+ │ └── ...
19
27
 
20
28
  ├── 📦 history/ # [3. Past / Completed] Permanent Delivery & Release Archives
21
29
  │ ├── features/ # Completed features, architecture migrations, tooling (xxx-slug.md)
@@ -32,9 +40,9 @@ devflow/
32
40
  ## Running ID Naming Convention
33
41
 
34
42
  ### 1. Standard Running IDs
35
- - **Format**: `xxx-slug` (e.g. `001-setup-auth`, `053-unify-deep-and-fast-track-model`)
43
+ - **Format**: `xxx-slug` (e.g. `001-setup-auth`, `058-multi-run-context-architecture`)
36
44
  - **Prefix Removal**: The legacy `RUN-` prefix is discontinued in favor of clean 3-digit sequential numbering.
37
- - **Git Branch Standard**: `feature/{xxx-slug}` or `fix/{xxx-slug}` (or specific release branches such as `2.5.0`).
45
+ - **Git Branch Standard**: `feature/{xxx-slug}` or `fix/{xxx-slug}` (or specific release branches such as `2.6.0`).
38
46
 
39
47
  ### 2. Sub-Feature Running IDs (`xxx[a-z]-slug`)
40
48
  - **Format**: `xxx[a-z]-slug` (e.g. `038a-backend-schema-and-api`, `038b-frontend-ui-and-state`)
@@ -44,19 +52,15 @@ devflow/
44
52
 
45
53
  ---
46
54
 
47
- ## Multi-Factor Sizing Heuristic & Splitting Engine
55
+ ## Multi-Run Spec Queue & Selective Execution Rule
48
56
 
49
- A feature is considered **Oversized (`L` or `XL`)** and recommended for sub-feature splitting when any of the following conditions are met:
50
- 1. **Files Touched**: Predicted to modify or create $\ge 6$ files.
51
- 2. **Architectural Layers**: Crosses $\ge 3$ distinct layers (e.g. Database Migrations + Backend APIs + Frontend UI + State Store).
52
- 3. **Task Complexity**: Contains $\ge 6$ checklist tasks or involves heavy multi-service integrations.
57
+ 1. **Spec-Ahead & Non-blocking Drafting**:
58
+ - `/feature [id / title]` and `/fix [title]` create dedicated run folders at `devflow/context/{xxx-slug}/`.
59
+ - Creating a spec does **not block** drafting additional specs. Multiple specs can reside in `devflow/context/` simultaneously.
60
+ 2. **Selective Execution (`/implement [id]`)**:
61
+ - Spec execution can be invoked targeting a specific ID (e.g. `/implement 12`, `/implement 012`, or `/implement kanban`).
62
+ - The AI checks out the matching git branch `feature/{xxx-slug}`, loads only that run's `spec.md` and global context, and executes tasks with Strict TDD.
63
+ 3. **Dedicated Quality Ledger & Safe Archival (`/complete [id]`)**:
64
+ - Each run maintains its own `findings.md` within `devflow/context/{xxx-slug}/`.
65
+ - `/complete` compiles the living spec, archives it to `devflow/history/{features|fixes|rollbacks}/{xxx-slug}.md`, removes `devflow/context/{xxx-slug}/`, updates `HISTORY.md` and `build-plan.md`, and prompts for squash-merge/PR.
53
66
 
54
- When detected during `/feature` or `/brief`, the AI triggers the **Interactive Split Gate**, proposing a clean `4a`, `4b` sub-feature breakdown before opening the first spec.
55
-
56
- ---
57
-
58
- ## Single Active Run Rule (One Thing at a Time)
59
-
60
- 1. Only **one active run** is permitted at any given time in `current-feature.md`.
61
- 2. Before opening a new run (`/feature` or `/fix`), the AI checks `current-stage.md` and `current-feature.md`.
62
- 3. If an active run is in progress, the AI **blocks** starting a new task and requires closing the active run via `/complete` (or explicitly cancelling/rolling back).