@jakkrichm/create-nexus-devflow 2.17.9 → 2.18.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 (89) hide show
  1. package/README.md +6 -7
  2. package/dist/bin/create-nexus-devflow.js +64 -82
  3. package/dist/bin/create-nexus-devflow.js.map +1 -1
  4. package/dist/lib/doctor.js +0 -27
  5. package/dist/lib/doctor.js.map +1 -1
  6. package/dist/lib/history.js +2 -2
  7. package/dist/lib/history.js.map +1 -1
  8. package/dist/lib/project-config.js +1 -1
  9. package/dist/lib/project-config.js.map +1 -1
  10. package/dist/lib/skill-registry-engine.js +3 -3
  11. package/dist/lib/skill-registry-engine.js.map +1 -1
  12. package/dist/lib/tooling/commands/scan-doc-contract.js +1 -0
  13. package/dist/lib/tooling/commands/scan-doc-contract.js.map +1 -1
  14. package/dist/lib/ui.d.ts +0 -23
  15. package/dist/lib/ui.js +0 -85
  16. package/dist/lib/ui.js.map +1 -1
  17. package/dist/lib/update.d.ts +6 -1
  18. package/dist/lib/update.js +80 -8
  19. package/dist/lib/update.js.map +1 -1
  20. package/dist/scripts/prepare-template.js +7 -3
  21. package/dist/scripts/prepare-template.js.map +1 -1
  22. package/package.json +2 -2
  23. package/template/.agents/skills/audit/SKILL.md +1 -4
  24. package/template/.agents/skills/brainstorm/SKILL.md +4 -5
  25. package/template/.agents/skills/bughunter/SKILL.md +1 -1
  26. package/template/.agents/skills/check/SKILL.md +116 -26
  27. package/template/.agents/skills/check/reference/guide.md +17 -53
  28. package/template/.agents/skills/ci/SKILL.md +13 -35
  29. package/template/.agents/skills/complete/SKILL.md +0 -2
  30. package/template/.agents/skills/devflow/SKILL.md +2 -3
  31. package/template/.agents/skills/discovery/SKILL.md +0 -9
  32. package/template/.agents/skills/doctor/SKILL.md +6 -6
  33. package/template/.agents/skills/explore/SKILL.md +9 -5
  34. package/template/.agents/skills/feature/SKILL.md +1 -4
  35. package/template/.agents/skills/feature/reference/feature-spec-template.md +16 -16
  36. package/template/.agents/skills/fix/SKILL.md +3 -3
  37. package/template/.agents/skills/grill/SKILL.md +1 -6
  38. package/template/.agents/skills/idea/SKILL.md +6 -6
  39. package/template/.agents/skills/implement/SKILL.md +119 -45
  40. package/template/.agents/skills/setup-tests/reference/browser.md +95 -0
  41. package/template/.agents/skills/test/SKILL.md +0 -26
  42. package/template/.claude/skills/audit/SKILL.md +1 -4
  43. package/template/.claude/skills/brainstorm/SKILL.md +4 -5
  44. package/template/.claude/skills/bughunter/SKILL.md +1 -1
  45. package/template/.claude/skills/check/SKILL.md +116 -26
  46. package/template/.claude/skills/check/reference/guide.md +17 -53
  47. package/template/.claude/skills/ci/SKILL.md +13 -35
  48. package/template/.claude/skills/complete/SKILL.md +0 -2
  49. package/template/.claude/skills/devflow/SKILL.md +2 -3
  50. package/template/.claude/skills/discovery/SKILL.md +3 -11
  51. package/template/.claude/skills/doctor/SKILL.md +6 -6
  52. package/template/.claude/skills/explore/SKILL.md +9 -5
  53. package/template/.claude/skills/feature/SKILL.md +1 -4
  54. package/template/.claude/skills/feature/reference/feature-spec-template.md +16 -16
  55. package/template/.claude/skills/fix/SKILL.md +3 -3
  56. package/template/.claude/skills/grill/SKILL.md +1 -6
  57. package/template/.claude/skills/idea/SKILL.md +6 -6
  58. package/template/.claude/skills/implement/SKILL.md +119 -45
  59. package/template/.claude/skills/setup-tests/reference/browser.md +95 -0
  60. package/template/.claude/skills/test/SKILL.md +0 -26
  61. package/template/AGENTS.md +39 -17
  62. package/template/devflow/build-plan.md +1 -1
  63. package/template/devflow/config.json +2 -1
  64. package/template/devflow/context/ai-interaction.md +14 -15
  65. package/template/devflow/context/coding-standards.md +19 -68
  66. package/template/devflow/context/glossary.md +6 -26
  67. package/template/devflow/decisions/README.md +1 -15
  68. package/template/devflow/docs/USAGE.md +195 -0
  69. package/template/devflow/docs/diagrams/nexus-devflow-architecture.html +14821 -0
  70. package/template/devflow/docs/diagrams/nexus-devflow-architecture.json +80 -0
  71. package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.html +14860 -0
  72. package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.json +88 -0
  73. package/template/devflow/docs/examples/living-spec/adr.example.md +43 -0
  74. package/template/devflow/docs/examples/living-spec/current-feature.example.md +113 -0
  75. package/template/devflow/docs/examples/living-spec/discovery.example.md +45 -0
  76. package/template/devflow/docs/examples/living-spec/ideas.example.md +22 -0
  77. package/template/devflow/docs/governance-rules.md +39 -0
  78. package/template/devflow/docs/manual-review-workflow-spec.md +116 -0
  79. package/template/devflow/docs/markdown-metadata-contract.md +140 -0
  80. package/template/devflow/docs/quickstart.md +124 -0
  81. package/template/devflow/docs/release-process.md +52 -0
  82. package/template/devflow/docs/skill-selection-policy.md +64 -0
  83. package/template/devflow/docs/workflow-surface-map.md +86 -0
  84. package/template/devflow/reference/feature-spec-template.md +79 -59
  85. package/template/devflow/runs/.gitkeep +1 -0
  86. package/template/.agents/skills/check/reference/verify.md +0 -129
  87. package/template/.claude/skills/check/reference/verify.md +0 -129
  88. package/template/devflow/reference/help-playbook-protocol.md +0 -33
  89. package/template/devflow/reference/slicing-archetypes.md +0 -105
@@ -62,7 +62,19 @@
62
62
 
63
63
  ---
64
64
 
65
- ## 3. Stable API & Interface Design Standards
65
+ ## 3. Proportional Engineering & YAGNI Standards
66
+
67
+ Build for established requirements, not hypothetical scale, threats, or future flexibility. Reuse existing code, the standard library, native platform features, and installed dependencies before adding machinery. Harmonize with DevFlow's `ponytail` skill for operational bloat reduction and YAGNI discipline.
68
+
69
+ - **Proportional Scope**: Build for the immediate task. Unknown scale or extensibility defaults to the smaller reversible design. Do not infer enterprise, multi-tenant, hostile-user, or compliance requirements.
70
+ - **Reachability-Derived Boundaries**: Derive trust and data-integrity boundaries from actual reachability: untrusted input, auth/session/ownership, shared persisted data, destructive operations, payments, secrets, and sensitive data.
71
+ - **Material Unknowns Only**: Ask questions only when an unknown materially changes behavior, architecture, persisted data, interoperability, a real security boundary, or cost. Otherwise choose the simplest repository-native implementation.
72
+ - **Just-In-Time Abstractions**: Add an abstraction, dependency, service, configuration surface, compatibility layer, or security mechanism only for a current requirement.
73
+ - **Non-Negotiable Boundaries**: Simplicity never removes real trust-boundary validation, data-loss prevention, accessibility, explicit security requirements, configured tests, or project rules.
74
+
75
+ ---
76
+
77
+ ## 4. Stable API & Interface Design Standards
66
78
 
67
79
  - **Contract Stability**: Public exports, CLI options, and stage artifact schemas form immutable delivery contracts. Never break contracts without a major version bump.
68
80
  - **Explicit Parameter Objects**: For functions with more than 2 arguments, use an options object interface with descriptive property names.
@@ -119,13 +131,12 @@ nexus-devflow/
119
131
 
120
132
  Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
121
133
 
122
- - **Unit Test Mandate**: Logic or behavior changes must include meaningful automated coverage when the spec's test gate is enabled. Documentation, prompt wording, or formatting-only changes use structural checks and review instead of artificial unit tests.
134
+ - **Unit Test Mandate**: Any new feature, modified logic, parser improvement, or bug fix **MUST ship with automated unit tests** in the same diff.
123
135
  - **Strict TDD (Red-Green-Refactor) Protocol**:
124
136
  1. **🔴 RED (Test First)**: Always write automated tests *before* writing or modifying functional logic. Run the test command and verify that it fails for the expected reason.
125
137
  2. **🟢 GREEN (Minimal Code)**: Write only the minimal production code necessary to make the failing test pass. Run the test command and verify 100% green pass.
126
138
  3. **🔵 REFACTOR (Clean & Robust)**: Refactor code for readability, performance, and DRY/YAGNI discipline while ensuring all tests stay green.
127
139
  - *Code Deletion / Reversion Rule*: If functional code is created without a prior failing test for behavior changes, it must be reverted or immediately backed by tests before continuing.
128
- - **Verification Scope**: Run focused checks during edits and required project gates before handoff. Repeat passing checks only after relevant changes, new failures, or unresolved risk.
129
140
  - **Test Framework**: Use Node.js native test runner executed via `tsx --test test/*.test.ts` under `packages/create-nexus-devflow/`.
130
141
  - **Test Design (AAA Pattern)**:
131
142
  - Structure each test case cleanly: **Arrange** (setup fixtures/mock directories), **Act** (execute function), **Assert** (verify invariants).
@@ -138,7 +149,7 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
138
149
  2. *Interactive AI Visual QA (MCP)*: Live DOM and styling inspection via MCP `browseros-neo` (`http://127.0.0.1:9010/mcp`) during `/check` and `/try`.
139
150
  - **Two-Stage Review Pattern (Verification Gate)**:
140
151
  - **Stage 1: Spec Fidelity & Acceptance Gate**:
141
- - Verify 100% conformance against the Single Living Spec (`devflow/context/{xxx-slug}/spec.md`).
152
+ - Verify 100% conformance against the Single Living Spec (`current-feature.md`).
142
153
  - Validate all Acceptance Criteria (ACs) and "Done When" observables without missing requirements or scope creep.
143
154
  - Test edge cases and boundary conditions defined in the specification.
144
155
  - **Stage 2: Code Quality, Security & Architecture Gate**:
@@ -146,13 +157,13 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
146
157
  - **Lane 2 (Automated Test Suites & Evals)**: `npm test` (Unit tests 100% pass) + `npm run test:routing` (Skill routing accuracy).
147
158
  - **Lane 3 (Scrutinize & Security Audit)**: Edge cases, null-safety, 0 secrets, safe inputs.
148
159
  - **Lane 4 (Manual / Scenario Proof)**: Concrete walkthrough steps ("Where to go", "What to run", "What to expect").
149
- - **Findings Ledger State**: 0 blockers (P0/P1) in `devflow/context/{xxx-slug}/findings.md`.
160
+ - **Findings Ledger State**: 0 blockers (P0/P1) in `devflow/context/findings.md`.
150
161
 
151
162
  ---
152
163
 
153
164
  ## 8. Findings Ledger & Quality Gates (`findings.md`, `review.md`)
154
165
 
155
- - All quality defects, security findings, or regression issues identified during review must be logged in `devflow/context/{xxx-slug}/findings.md`.
166
+ - All quality defects, security findings, or regression issues identified during review must be logged in `devflow/context/findings.md`.
156
167
  - **Finding State Machine**:
157
168
  - `open`: Confirmed issue waiting to be fixed.
158
169
  - `fixed`: Repaired in code, pending QA re-verification.
@@ -203,7 +214,7 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
203
214
 
204
215
  ## 12. HTML Documentation & Theming Standards (Light Theme Mandate)
205
216
 
206
- All generated HTML artifacts across the framework (Contextual Help Playbooks `devflow/reference/playbooks/{skill}.html`, Standalone Reports `report-html`, Architecture & Workflow Diagrams `archify` / `diagram-design`, and UI Prototypes/Mockups) MUST strictly adhere to the **Paper/Ink Light Theme Design System**:
217
+ All generated HTML artifacts across the framework (Contextual Help Playbooks `devflow/docs/playbooks/{skill}.html`, Standalone Reports `report-html`, Architecture & Workflow Diagrams `archify` / `diagram-design`, and UI Prototypes/Mockups) MUST strictly adhere to the **Paper/Ink Light Theme Design System**:
207
218
 
208
219
  - **Mandatory Default `data-theme="light"`**:
209
220
  - All HTML documents must start with `<html lang="th" data-theme="light">`.
@@ -245,66 +256,6 @@ All generated HTML artifacts across the framework (Contextual Help Playbooks `de
245
256
  - Fonts: Google Sans (`'Google Sans'`, `'Google Sans Text'`) for display headers and body text, `'JetBrains Mono'` for code and monospaced data.
246
257
  - Full support for `prefers-reduced-motion: reduce` and clear `:focus-visible` outlines.
247
258
  - **Master Reference Template**:
248
- - Refer to `devflow/reference/playbooks/template.html` as the authoritative, reusable component reference for all playbook and HTML documentation generation.
259
+ - Refer to `devflow/docs/playbooks/template.html` as the authoritative, reusable component reference for all playbook and HTML documentation generation.
249
260
 
250
- ---
251
-
252
- ## 13. Prompt Token Economy & Mechanical Input Coverage Standards
253
-
254
- - **Skill Byte Budgets & Prompt Hygiene**:
255
- - **Size Ceilings**: `SKILL.md` must not exceed **32 KB**, support/reference markdown files must not exceed **24 KB**, and frontmatter `description` must not exceed **400 characters**.
256
- - **Every Line Must Earn Its Keep**: If an agent naturally behaves correctly by default, avoid adding redundant prose. Instruct directly without philosophical justification.
257
- - **Completion Summaries (Lead with Essentials)**:
258
- - **Headline**: One-line summary of what was accomplished.
259
- - **Next**: Exactly one next recommended command or action.
260
- - **Heads up**: Active blockers, decision debt, or critical items needing user attention (omitted when empty).
261
- - **Pointer**: Link to the detailed artifact rather than repeating large text blocks.
262
- - **No Checklist Spam**: Avoid dumping lists of obvious successes (`Semantic HTML: OK`, `Keyboard: OK`).
263
- - **Mechanical Input Coverage Principle (Anti-Hallucination Gate)**:
264
- - Before implementation, enumerate all values and states that the code must produce or display.
265
- - Each value must have an explicitly named source (Database column, Input argument, Calculated derivation, or Settled architectural decision).
266
- - Any required value lacking a named source represents an **Owed Decision**; agents are prohibited from making unrecorded architectural choices or guessing implementations under the guise of "just wiring". Stop and route to `/grill` or request user clarification.
267
-
268
- ---
269
-
270
- ## 14. Architectural Slicing & Assumed Decision Governance
271
-
272
- - **4 Slicing Archetypes Framework (`devflow/reference/slicing-archetypes.md`)**:
273
- - When decomposing large roadmaps or splitting oversized features, select from the 4 standard archetypes:
274
- - **Skateboard**: Minimal functional loop (prove core logic end-to-end with minimal UI).
275
- - **Facade**: Rich UI/DX with mock backend (validate user flow & interaction first).
276
- - **Tracer Bullet**: Deep vertical slice across all layers (DB -> API -> UI) for 1 happy path.
277
- - **Journey**: Slice along natural user workflow milestones.
278
- - Avoid purely technical layer slicing (e.g. DB only or backend only) that leaves work unverifiable in a single delivery run.
279
- - **Assumed Decision Debt Lifecycle (`Status: Assumed`)**:
280
- - For fast-tracking development when user confirmation is pending, record decisions in ADRs (`devflow/decisions/`) with `Status: Assumed`.
281
- - Every assumed decision MUST specify `Assumption`, `Risk Level & Blast Radius`, and `Ratification Plan`.
282
- - Untracked architectural assumptions are strictly prohibited.
283
-
284
- ---
285
-
286
- ## 15. Test File Classification & AC Traceability Standards
287
-
288
- - **5-Tier Test Classification**:
289
- - **Tier 1: Pure Logic & Algorithms** (`src/utils/`, `services/`, `lib/`): Fast in-memory Unit Tests, 100% boundary & edge cases coverage. Use TDD.
290
- - **Tier 2: UI Components** (`src/components/`, `src/pages/`): Component mounting & event interaction, visual verification via Playwright / BrowserOS Neo. Prohibit trivial unit tests for static HTML markup.
291
- - **Tier 3: API & Data Integration** (`src/api/`, route handlers, DB models): Contract tests, schema validation (Zod), status codes, payload shapes.
292
- - **Tier 4: Config & Build Tooling** (`*.json`, `*.yaml`, `scripts/`): Static contract validation (`npm run check:static`), budget linters (`npm run check:budgets`), smoke tests.
293
- - **Tier 5: Documentation & Prose** (`*.md`, `docs/`, `scripts/data/`): Structural checks, markdown contract scans, link integrity verification.
294
- - **Acceptance Criteria (`AC-N`) Traceability**:
295
- - All automated test suites and assertion descriptions must explicitly include the target Acceptance Criterion tag (e.g. `it('AC-1: ...')`).
296
- - During `/check`, verify that 100% of defined acceptance criteria in the active living spec have matching passing empirical proof.
297
-
298
- ---
299
261
 
300
- ## 16. Token Economy & Cost Optimization Standards
301
-
302
- - **Token Economics Visibility**:
303
- - Leverage `npm run analyze:tokens` (or `scripts/analyze-token-usage.ts`) to audit session token usage across Main Thread vs Subagents.
304
- - Track the 4 token dimensions: **Fresh Input Tokens**, **Prompt Cache Write Tokens**, **Prompt Cache Read Tokens (Hits)**, and **Output Tokens**.
305
- - **Prompt Caching Optimization**:
306
- - Structure documentation and context files with immutable headers first so LLM providers can achieve high prompt cache hit rates (>60%).
307
- - Ensure living specs and references stay compact (under byte budgets) to prevent prompt cache misses and unnecessary token churn.
308
- - **Cost Metrics & Savings**:
309
- - Track estimated model costs (USD) against model pricing catalogs (Claude 3.7/3.5 Sonnet, Gemini 2.5 Pro/Flash, GPT-4o).
310
- - Aim for >50% cost savings through effective prompt caching reuse.
@@ -4,15 +4,15 @@
4
4
 
5
5
  ---
6
6
 
7
- ### Task-Isolated Living Spec (`devflow/context/{xxx-slug}/spec.md`)
8
- - **Definition**: เอกสาร Markdown หลักหนึ่งฉบับต่อ runที่ใช้ขับเคลื่อนและบันทึกวงจรชีวิตของงานพัฒนาตั้งแต่ต้นจนจบ (Single Source of Truth during active delivery)
9
- - **Constraints**: ร่างหลาย run ได้พร้อมกัน แต่แต่ละ run แยก spec, stage, findings และ branch; เลือกเป้าหมายก่อน implement
7
+ ### Single Living Spec (`current-feature.md`)
8
+ - **Definition**: เอกสาร Markdown กลางเพียงฉบับเดียวที่ใช้ขับเคลื่อนและบันทึกวงจรชีวิตของงานพัฒนาตั้งแต่ต้นจนจบ (Single Source of Truth during active delivery)
9
+ - **Constraints**: มีได้เพียง 1 งานที่ active ในช่วงเวลาหนึ่งตามหลักการ Single Active Run Guardrail
10
10
  - **Structure**: ครอบคลุม 6 ส่วนหลัก: (1) Define & Boundaries, (2) Technical Spec & Contracts, (3) Execution Plan & TDD Tasks, (4) Implementation Log & Evidence, (5) Multi-Lane Verification Matrix, (6) Release Digest & Retrospective
11
- - **Aliases / Related**: `devflow/context/{xxx-slug}/spec.md`, Living Spec, Feature Spec
11
+ - **Aliases / Related**: `current-feature.md`, Living Spec, Feature Spec
12
12
 
13
13
  ### Unified Fast-Track
14
14
  - **Definition**: รูปแบบการพัฒนาหลักแบบ Single-Track ของ Nexus-DevFlow ที่รวมความสามารถเชิงสถาปัตยกรรมระดับลึก (Deep) และความคล่องตัว (Fast) เข้าด้วยกันผ่าน 4 คำสั่งหลัก: `/feature` (หรือ `/fix`), `/implement`, `/check`, และ `/complete`
15
- - **Constraints**: ขับเคลื่อนผ่านไฟล์ `devflow/context/{xxx-slug}/spec.md` และเมื่อเสร็จสิ้นจะถูก Archive เป็นไฟล์ Markdown เดี่ยวใน `devflow/history/{features|fixes|rollbacks}/{xxx-slug}.md`
15
+ - **Constraints**: ขับเคลื่อนผ่านไฟล์ `current-feature.md` และเมื่อเสร็จสิ้นจะถูก Archive เป็นไฟล์ Markdown เดี่ยวใน `devflow/history/`
16
16
  - **Aliases / Related**: Fast-Track, Unified Track
17
17
 
18
18
  ### Pre-Flight Discovery
@@ -22,30 +22,10 @@
22
22
 
23
23
  ### Multi-Lane Verification Matrix
24
24
  - **Definition**: ตารางตรวจสอบคุณภาพแบบหลายมิติที่ครอบคลุม Typecheck, Linter, Automated Unit/Integration Tests, และ Manual Proof Evidence ในคำสั่ง `/check`
25
- - **Constraints**: ต้องมีหลักฐานผ่านสำหรับทุก Lane ที่ใช้กับงาน ส่วนที่ไม่เกี่ยวข้องให้บันทึก N/A พร้อมเหตุผล และไม่มี P0/P1 Finding ที่ยังค้างอยู่ก่อนที่จะส่งต่อไปยัง `/complete`
25
+ - **Constraints**: ต้องมีผลลัพธ์ผ่าน (PASS) ครบทุก Lane และไม่มี P0/P1 Finding ที่ยังค้างอยู่ก่อนที่จะส่งต่อไปยัง `/complete`
26
26
  - **Aliases / Related**: QA Matrix, Lane Verification
27
27
 
28
28
  ### Release Digest & Retrospective
29
29
  - **Definition**: สรุปผลการเปลี่ยนแปลง, บทเรียนที่ได้รับ (Lessons Learned), และการตัดสินใจสำคัญที่บันทึกไว้ในตอนปิดรอบการพัฒนา
30
30
  - **Constraints**: บันทึกอัตโนมัติใน Living Spec ก่อนที่จะทำการ Squash Merge และ Archive
31
31
  - **Aliases / Related**: Delivery Digest, Retrospective Log
32
-
33
- ### 4 Slicing Archetypes
34
- - **Definition**: รูปแบบมาตรฐาน 4 ประการในการแบ่งย่อยฟีเจอร์ (Skateboard, Facade, Tracer Bullet, Journey) เพื่อให้ได้รอบการส่งมอบที่เล็ก ทดสอบได้จริง และไม่ติดขัด Technical Layer Dependency
35
- - **Constraints**: ใช้งานใน `/discovery`, `/brainstorm`, และ `/feature` (Step 2)
36
- - **Aliases / Related**: `slicing-archetypes.md`, Feature Decomposition, Slicing Strategy
37
-
38
- ### Assumed Decision Debt
39
- - **Definition**: หนี้การตัดสินใจที่เกิดขึ้นจากการตั้งสมมติฐานทางสถาปัตยกรรมชั่วคราว (`Status: Assumed` ใน ADR) เพื่อให้การพัฒนาเดินหน้าได้อย่างรวดเร็ว (Fast-track) โดยไม่สะดุด
40
- - **Constraints**: ต้องระบุ Assumption, Risk Level, และ Ratification Plan กำกับเสมอ และต้องได้รับการตรวจทาน/ยืนยัน (Ratified) ก่อนปล่อยสู่ Production
41
- - **Aliases / Related**: Assumed ADR, Decision Debt, Fast-track Assumption
42
-
43
- ### AC-to-Test Traceability Matrix
44
- - **Definition**: ตารางเชื่อมโยงระหว่างข้อกำหนด Acceptance Criteria (`AC-N`) ใน Living Spec กับ Automated Test Cases และหลักฐานเชิงประจักษ์ เพื่อให้มั่นใจว่าทุกข้อกำหนดได้รับการทดสอบและพิสูจน์จริงแบบ 1-to-1
45
- - **Constraints**: ใช้ระบุใน Living Spec (`spec.md`), ตรวจทานใน `/check`, และกำกับด้วย `AC-N` Tag ในโค้ดทดสอบ
46
- - **Aliases / Related**: Traceability Matrix, AC Mapping, Spec Verification Trace
47
-
48
- ### Prompt Caching Rate & Billed-Equivalent Cost
49
- - **Definition**: ดัชนีวัดประสิทธิภาพการใช้ Token ของ AI Coding Agent โดยแยกแยะระหว่าง Fresh Input Tokens, Cache Creation (Write), Cache Read (Prompt Caching Hits), และ Output Tokens เพื่อคำนวณต้นทุนจริง (USD) และ % ส่วนลดที่ประหยัดได้จาก Prompt Caching
50
- - **Constraints**: วิเคราะห์ผ่าน `scripts/analyze-token-usage.ts` และคำสั่ง `npm run analyze:tokens`
51
- - **Aliases / Related**: Token Economics, Cost Units, Cache Hit Rate
@@ -11,14 +11,10 @@ Each ADR is named `ADR-xxx-{slug}.md` (e.g. `ADR-001-database-schema-migration.m
11
11
  ```markdown
12
12
  # ADR-xxx: {Title}
13
13
 
14
- - **Status**: `Accepted` | `Proposed` | `Assumed` (Fast-tracked Assumption) | `Deprecated` | `Superseded by ADR-yyy`
14
+ - **Status**: Accepted | Proposed | Deprecated | Superseded by ADR-yyy
15
15
  - **Date**: YYYY-MM-DD
16
16
  - **Context**: Problem statement, background, and why this decision was needed.
17
17
  - **Decision**: The selected architectural approach or invariant.
18
- - **Assumption Metadata** *(Mandatory when Status is `Assumed`)*:
19
- - **Assumption**: ข้อสมมติฐานทางเทคนิคที่ตั้งขึ้นเพื่อปลดบล็อกการทำงานชั่วคราว
20
- - **Risk Level & Blast Radius**: ระดับความเสี่ยงและขอบเขตผลกระทบหากข้อสมมติไม่ถูกต้อง
21
- - **Ratification Plan**: เงื่อนไข, วันที่ หรือเหตุการณ์ที่จะทำการทวนสอบ (Ratify) เพื่อเปลี่ยนสถานะเป็น `Accepted` หรือ `Rejected`
22
18
  - **Alternatives Considered**:
23
19
  - *Option 1*: Pros / Cons
24
20
  - *Option 2*: Pros / Cons
@@ -26,13 +22,3 @@ Each ADR is named `ADR-xxx-{slug}.md` (e.g. `ADR-001-database-schema-migration.m
26
22
  - *Positive*: Benefits and capabilities unlocked
27
23
  - *Trade-offs / Risks*: Costs, complexity, or constraints
28
24
  ```
29
-
30
- ---
31
-
32
- ## ⚡ Assumed Decision Debt Policy
33
-
34
- เมื่อทีมหรือ Agent จำเป็นต้องเดินหน้าพัฒนาอย่างรวดเร็ว (Fast-track) โดยที่ข้อสรุปทางสถาปัตยกรรมยังไม่ได้รับการยืนยัน 100% จากผู้ใช้ ให้บันทึก ADR ด้วย `Status: Assumed` พร้อมกรอก **Assumption Metadata** ให้ครบถ้วน
35
-
36
- > [!WARNING]
37
- > **Zero Untracked Decision Debt**: ทุก ADR ที่มีสถานะ `Assumed` จะถูกตรวจสอบโดย `/audit` และ `/complete` เพื่อแจ้งเตือนให้ทีมยืนยัน (Ratify) หรือปรับแก้ก่อนส่งมอบขึ้น Production เสมอ
38
-
@@ -0,0 +1,195 @@
1
+ # Nexus-DevFlow 2.13.0 Comprehensive Usage Guide
2
+
3
+ This guide provides full operating instructions for **Nexus-DevFlow 2.13.0 (The 3-Pillars Workspace Architecture & Pure Task-Isolated Living Spec Model)** across Google Antigravity, OpenAI Codex, Claude Code, Cursor, GitHub Copilot, and related AI development environments.
4
+
5
+ ---
6
+
7
+ ## 1. Core Architecture: The 3-Pillars Model
8
+
9
+ Nexus-DevFlow structures development history and active context into three distinct temporal pillars:
10
+
11
+ 1. **🔮 Future (Backlog)**: [`devflow/ideas.md`](../ideas.md), [`devflow/project-plan.md`](../project-plan.md), [`devflow/build-plan.md`](../build-plan.md)
12
+ - Centralized Idea Inbox with AI feasibility, value scoring, and priority tagging (`[IDEA-xxx]`).
13
+ - Product vision and master build-plan sequencing.
14
+ - Quick idea capture via `/idea {description}`.
15
+ 2. **⚡ Present (Active Context)**: `devflow/context/`
16
+ - Global Shared Source of Truth: `project-overview.md`, `coding-standards.md`, `ai-interaction.md`, `glossary.md`.
17
+ - **Task-Isolated Workspaces**: `devflow/context/{xxx-slug}/`
18
+ - `spec.md`: The Living Spec, task checklist, and empirical proof.
19
+ - `stage.md`: Stage pointer and transition state.
20
+ - `findings.md`: Dedicated quality, security, and Fowler smell findings ledger.
21
+ 3. **📦 Past (History Archive)**: `devflow/history/`
22
+ - Categorized delivery archives: `features/`, `fixes/`, `rollbacks/`.
23
+ - Master Release Ledger: `HISTORY.md`.
24
+
25
+ ---
26
+
27
+ ## 2. The Unified 4-Stage Living Spec Lifecycle
28
+
29
+ All development tasks execute through the progressive 4-stage task-isolated living spec lifecycle:
30
+
31
+ ```text
32
+ /feature (or /fix) ──▶ /implement ──▶ /check ──▶ /complete
33
+ ```
34
+
35
+ | Step | Command | Artifact | Description |
36
+ | :--- | :--- | :--- | :--- |
37
+ | **1. Spec** | `/feature {title}`<br>`/fix {bug}` | `context/{xxx-slug}/spec.md` | Allocates sequential ID (`xxx-slug`), initializes task workspace, writes living spec behind review gate. |
38
+ | **2. Build** | `/implement [id]` | `context/{xxx-slug}/spec.md` | Executes tasks incrementally with strict TDD discipline (Red-Green-Refactor) and evidence recording. |
39
+ | **3. Verify**| `/check [id]` | `context/{xxx-slug}/spec.md` | Dual-Axis review: empirical spec fidelity plus independent standards, architecture, and quality gates. |
40
+ | **4. Deliver** | `/complete [id]` | `history/{cat}/{xxx-slug}.md` | Final safety audit, records Release Digest, archives living spec, cleans active task folder, squash-merges branch. |
41
+
42
+ ---
43
+
44
+ ## 3. Pre-Flight Discovery, SA & Architectural Alignment Suite
45
+
46
+ Before committing to delivery, use specialized companion skills:
47
+
48
+ ```text
49
+ /analyze ──▶ /idea (Inbox) ──▶ /grill (Socratic ADR) ──▶ /discovery (Explore) ──▶ /feature (Deliver)
50
+ ```
51
+
52
+ - **`/analyze`**: Multi-format requirement ingestion (PDF, Word, Excel, Images), Codebase Impact scan & Socratic Gap checklist.
53
+ - **`/idea`**: Capture raw ideas in `devflow/ideas.md` with instant AI feasibility scoring.
54
+ - **`/grill`** (or **`/align`**): Socratic alignment & domain modeling; records Architecture Decision Records (`devflow/decisions/ADR-xxx.md`).
55
+ - **`/brainstorm`**: Structured ideation with trade-off analysis.
56
+ - **`/discovery`**: Deep inception and exploratory discovery (`devflow/discoveries/DISC-xxx.md`).
57
+
58
+ ---
59
+
60
+ ## 4. Core Skills Inventory (33 Skills)
61
+
62
+ DevFlow ships **33 bundled Core Skills** from the ordered `core_skills` inventory
63
+ in `agent-bundle.manifest.json`, synchronized 1:1 across `.agents/skills/`
64
+ (Codex / Antigravity / Copilot) and `.claude/skills/` (Claude Code). Local or
65
+ Personal Skills may coexist in a workspace, but are excluded from the Core count
66
+ and package template until explicitly promoted.
67
+
68
+ ### A. Lifecycle Delivery Skills (8 Skills)
69
+ - `feature`: Turn a build-plan item or new idea into a task-isolated living spec (`devflow/context/{xxx-slug}/spec.md`).
70
+ - `fix`: Document and spec an ad-hoc bug or issue into `devflow/context/{xxx-slug}/spec.md`.
71
+ - `implement`: Step-by-step TDD implementation behind review gates.
72
+ - `check`: Dual-Axis verification of observable spec behavior and independent architecture/standards quality.
73
+ - `complete`: Final safety audit, Conventional Commit, archiving, and branch delivery gate.
74
+ - `autopilot`: Bounded single-pass delivery loop with self-review and safe repair.
75
+ - `continuous`: Autonomous serial multi-feature delivery loop completing build-plan items with quality gates.
76
+ - `rollback`: Plan a safe reversal of a completed feature preserving history.
77
+
78
+ ### B. Pre-Flight Discovery, SA & Alignment Skills (6 Skills)
79
+ - `analyze`: Multi-format requirement ingestion (PDF, Word, Excel, Images), Codebase Impact scan & Socratic Gap checklist.
80
+ - `discovery`: Inception exploration and deep multi-turn planning (`devflow/discoveries/`).
81
+ - `explore`: Read-only codebase exploration to investigate an idea and compare options without changing files or writing a spec.
82
+ - `idea`: Quick idea capture and AI feasibility scoring (`devflow/ideas.md`).
83
+ - `grill` / `align`: Socratic alignment, domain modeling, and ADR recording (`devflow/decisions/`).
84
+ - `brainstorm`: Structured divergent & convergent ideation with trade-off matrices.
85
+
86
+ ### C. Workspace & Governance Skills (19 Skills)
87
+ - `devflow`: Interactive workspace inspector and intent router.
88
+ - `doctor`: Read-only health check for setup, adapters, and workflow drift.
89
+ - `onboard`: Configure freshly scaffolded projects.
90
+ - `adopt`: Bootstrap DevFlow into existing brownfield codebases.
91
+ - `overview`: Compile living source of truth from planning docs.
92
+ - `brief`: Feature scope and dependency briefing before speccing.
93
+ - `audit`: Branch-aware or full-project code and security audit.
94
+ - `bughunter`: Offensive security orchestrator, 83 vulnerability patterns & CVE payloads.
95
+ - `ci`: Set up single Verify command and GitHub Actions.
96
+ - `test`: Test suite runner and coverage analyzer.
97
+ - `setup-tests`: Add or normalize unit test suite.
98
+ - `browser-tests`: Add or normalize Playwright browser test harness & connect with MCP browseros-neo.
99
+ - `release`: Cloud deployment readiness check (Render / Vercel).
100
+ - `prototype`: Static HTML/CSS prototype mockups.
101
+ - `status`: Progress summary and next action inspector.
102
+ - `try`: Manual review testing guide.
103
+ - `debug`: Scientific six-phase diagnosis built around a deterministic red-capable feedback loop.
104
+ - `report-html`: Generate interactive standalone HTML report dashboard.
105
+ - `convert-any-to-md`: Document conversion utility into markdown.
106
+
107
+ ---
108
+
109
+ ## 5. Quality, Governance & Authoring Contracts
110
+
111
+ - [Workflow surface map](workflow-surface-map.md): canonical command taxonomy and artifacts.
112
+ - [Skill selection policy](skill-selection-policy.md): choose the smallest suitable workflow surface.
113
+ - [Governance rules](governance-rules.md): public-surface and documentation placement rules.
114
+ - [Markdown metadata contract](markdown-metadata-contract.md): frontmatter and semantic heading requirements.
115
+ - [Manual review workflow](manual-review-workflow-spec.md): review gates from spec through delivery.
116
+ - [Living Spec examples](examples/living-spec/): reference specs, discoveries, ADRs, and ideas.
117
+
118
+ `/check` applies the Deep Modules standard independently from spec fidelity:
119
+ small public interfaces, hidden complexity, stable seams, and no speculative
120
+ abstraction. `/debug` diagnoses first and hands confirmed repairs to `/fix` or
121
+ `/implement`; it does not edit source during diagnosis.
122
+
123
+ ---
124
+
125
+ ### Debugging, TDD & Review Reference Guides
126
+
127
+ The `debug`, `implement`, and `audit` skills include five English reference guides.
128
+ They are supporting files read when needed, not additional commands. Both
129
+ `.agents/skills/` and `.claude/skills/` contain matching copies; no separate
130
+ Superpowers plugin installation is required.
131
+
132
+ | Situation | Entry point | Reference guide |
133
+ | :--- | :--- | :--- |
134
+ | Error deep in a call stack or unclear input origin | `/debug` Phase 4 | [Root-cause tracing](../../.agents/skills/debug/root-cause-tracing.md) |
135
+ | Confirmed root cause needs protective checks | `/debug` repair planning → `/fix` → `/implement` | [Defense-in-depth](../../.agents/skills/debug/defense-in-depth.md) |
136
+ | Flaky async tests or guessed sleep delays | `/debug` Phase 4 | [Condition-based waiting](../../.agents/skills/debug/condition-based-waiting.md) |
137
+ | Planning RED/GREEN or inspecting test quality | `/implement [id]` | [TDD anti-patterns](../../.agents/skills/implement/tdd-anti-patterns.md) |
138
+ | Preparing an independent review | `/audit independent current` | [Two-stage review template](../../.agents/skills/audit/two-stage-review-template.md) |
139
+
140
+ **Debugging:** Trace the trigger before planning a repair. Use validation layers
141
+ according to actual invariants and risks, and keep diagnostic output redacted.
142
+ The waiting example accepts synchronous predicates only; async I/O needs an
143
+ appropriate async helper with cancellation or timeout. `/debug` remains a
144
+ diagnostic stage. After three unsuccessful repair attempts in the supplied
145
+ history, stop and discuss the architecture before attempting another fix.
146
+
147
+ **Implementation:** Apply the Iron Law to behavior changes according to the
148
+ spec's test decision: observe the intended failing test before production code.
149
+ Confirm that RED reflects missing behavior rather than broken setup, implement
150
+ the minimum change for GREEN, then refactor with tests passing. Preserve existing
151
+ user work; verify documentation or configuration without logic as the spec directs.
152
+
153
+ **Review:** Check spec compliance first, then code quality only after Stage 1
154
+ passes. Use the template alongside the canonical
155
+ [independent-review contract](../../.agents/skills/audit/reference/independent-review.md).
156
+ The configured gate still determines whether review runs, and its request,
157
+ immutable checkpoint, reviewer identity, and receipt requirements remain in force.
158
+ Open or fixed P0/P1 findings continue to block completion.
159
+
160
+ Example prompts (use `$debug` and `$implement` in Codex where appropriate):
161
+
162
+ ```text
163
+ /debug "This async test passes locally but times out in CI; inspect its waiting conditions"
164
+ /implement 085
165
+ /audit independent current
166
+ ```
167
+
168
+ Replace `085` with your active task ID. For the review prompt, ask the reviewer
169
+ to use `audit/two-stage-review-template.md` with the canonical receipt contract;
170
+ the template does not launch a reviewer or authorize a checkpoint commit itself.
171
+
172
+ ---
173
+
174
+ ## 6. Web Dashboard & CLI Management
175
+
176
+ ```bash
177
+ # Launch interactive Local Dashboard (0ms SSR Hydration & Git Cache)
178
+ npx @jakkrichm/create-nexus-devflow dashboard
179
+
180
+ # Check active project status across 3-Pillars
181
+ npx @jakkrichm/create-nexus-devflow status
182
+
183
+ # Automated Quality Gatekeeper
184
+ npx @jakkrichm/create-nexus-devflow gate [--strict]
185
+
186
+ # Model Context Protocol (MCP) Server Hub
187
+ npx @jakkrichm/create-nexus-devflow mcp
188
+
189
+ # Just-In-Time (JIT) Dynamic Context Slicing
190
+ npx @jakkrichm/create-nexus-devflow slice --stage implement
191
+
192
+ # Multi-Agent Swarm & Code Graph RAG
193
+ npx @jakkrichm/create-nexus-devflow swarm
194
+ npx @jakkrichm/create-nexus-devflow graph --file src/index.ts
195
+ ```