@jakkrichm/create-nexus-devflow 2.18.1 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/bin/create-nexus-devflow.js +80 -47
- package/dist/bin/create-nexus-devflow.js.map +1 -1
- package/dist/lib/doctor.js +27 -0
- package/dist/lib/doctor.js.map +1 -1
- package/dist/lib/skill-manager.d.ts +2 -2
- package/dist/lib/skill-manager.js +2 -2
- package/dist/lib/skill-manager.js.map +1 -1
- package/dist/lib/skill-registry-engine.d.ts +5 -0
- package/dist/lib/skill-registry-engine.js +39 -5
- package/dist/lib/skill-registry-engine.js.map +1 -1
- package/dist/lib/tooling/commands/scan-doc-contract.js +0 -1
- package/dist/lib/tooling/commands/scan-doc-contract.js.map +1 -1
- package/dist/lib/ui.d.ts +23 -0
- package/dist/lib/ui.js +85 -0
- package/dist/lib/ui.js.map +1 -1
- package/dist/lib/update.js +1 -1
- package/dist/lib/update.js.map +1 -1
- package/dist/scripts/prepare-template.js +3 -7
- package/dist/scripts/prepare-template.js.map +1 -1
- package/package.json +2 -2
- package/template/.agents/skills/audit/SKILL.md +4 -1
- package/template/.agents/skills/brainstorm/SKILL.md +5 -4
- package/template/.agents/skills/bughunter/SKILL.md +1 -1
- package/template/.agents/skills/check/SKILL.md +26 -116
- package/template/.agents/skills/check/reference/guide.md +36 -4
- package/template/.agents/skills/check/reference/verify.md +129 -0
- package/template/.agents/skills/ci/SKILL.md +35 -13
- package/template/.agents/skills/complete/SKILL.md +2 -0
- package/template/.agents/skills/devflow/SKILL.md +3 -2
- package/template/.agents/skills/discovery/SKILL.md +9 -0
- package/template/.agents/skills/doctor/SKILL.md +2 -0
- package/template/.agents/skills/explore/SKILL.md +2 -1
- package/template/.agents/skills/feature/SKILL.md +4 -1
- package/template/.agents/skills/feature/reference/feature-spec-template.md +16 -16
- package/template/.agents/skills/fix/SKILL.md +3 -3
- package/template/.agents/skills/grill/SKILL.md +6 -1
- package/template/.agents/skills/idea/SKILL.md +6 -6
- package/template/.agents/skills/implement/SKILL.md +45 -119
- package/template/.agents/skills/test/SKILL.md +26 -0
- package/template/.claude/skills/audit/SKILL.md +4 -1
- package/template/.claude/skills/brainstorm/SKILL.md +5 -4
- package/template/.claude/skills/bughunter/SKILL.md +1 -1
- package/template/.claude/skills/check/SKILL.md +26 -116
- package/template/.claude/skills/check/reference/guide.md +36 -4
- package/template/.claude/skills/check/reference/verify.md +129 -0
- package/template/.claude/skills/ci/SKILL.md +35 -13
- package/template/.claude/skills/complete/SKILL.md +2 -0
- package/template/.claude/skills/devflow/SKILL.md +3 -2
- package/template/.claude/skills/discovery/SKILL.md +11 -3
- package/template/.claude/skills/doctor/SKILL.md +2 -0
- package/template/.claude/skills/explore/SKILL.md +2 -1
- package/template/.claude/skills/feature/SKILL.md +4 -1
- package/template/.claude/skills/feature/reference/feature-spec-template.md +16 -16
- package/template/.claude/skills/fix/SKILL.md +3 -3
- package/template/.claude/skills/grill/SKILL.md +6 -1
- package/template/.claude/skills/idea/SKILL.md +6 -6
- package/template/.claude/skills/implement/SKILL.md +45 -119
- package/template/.claude/skills/test/SKILL.md +26 -0
- package/template/AGENTS.md +27 -38
- package/template/devflow/context/ai-interaction.md +15 -14
- package/template/devflow/context/coding-standards.md +67 -6
- package/template/devflow/context/glossary.md +26 -6
- package/template/devflow/decisions/README.md +15 -1
- package/template/devflow/reference/feature-spec-template.md +59 -79
- package/template/devflow/reference/help-playbook-protocol.md +33 -0
- package/template/devflow/reference/slicing-archetypes.md +105 -0
- package/template/devflow/docs/USAGE.md +0 -195
- package/template/devflow/docs/diagrams/nexus-devflow-architecture.html +0 -14821
- package/template/devflow/docs/diagrams/nexus-devflow-architecture.json +0 -80
- package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.html +0 -14860
- package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.json +0 -88
- package/template/devflow/docs/examples/living-spec/adr.example.md +0 -43
- package/template/devflow/docs/examples/living-spec/current-feature.example.md +0 -113
- package/template/devflow/docs/examples/living-spec/discovery.example.md +0 -45
- package/template/devflow/docs/examples/living-spec/ideas.example.md +0 -22
- package/template/devflow/docs/governance-rules.md +0 -39
- package/template/devflow/docs/manual-review-workflow-spec.md +0 -116
- package/template/devflow/docs/markdown-metadata-contract.md +0 -140
- package/template/devflow/docs/quickstart.md +0 -124
- package/template/devflow/docs/release-process.md +0 -52
- package/template/devflow/docs/skill-selection-policy.md +0 -64
- package/template/devflow/docs/workflow-surface-map.md +0 -86
- package/template/devflow/runs/.gitkeep +0 -1
|
@@ -131,12 +131,13 @@ nexus-devflow/
|
|
|
131
131
|
|
|
132
132
|
Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
133
133
|
|
|
134
|
-
- **Unit Test Mandate**:
|
|
134
|
+
- **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.
|
|
135
135
|
- **Strict TDD (Red-Green-Refactor) Protocol**:
|
|
136
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.
|
|
137
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.
|
|
138
138
|
3. **🔵 REFACTOR (Clean & Robust)**: Refactor code for readability, performance, and DRY/YAGNI discipline while ensuring all tests stay green.
|
|
139
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.
|
|
140
|
+
- **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.
|
|
140
141
|
- **Test Framework**: Use Node.js native test runner executed via `tsx --test test/*.test.ts` under `packages/create-nexus-devflow/`.
|
|
141
142
|
- **Test Design (AAA Pattern)**:
|
|
142
143
|
- Structure each test case cleanly: **Arrange** (setup fixtures/mock directories), **Act** (execute function), **Assert** (verify invariants).
|
|
@@ -149,7 +150,7 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
|
149
150
|
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`.
|
|
150
151
|
- **Two-Stage Review Pattern (Verification Gate)**:
|
|
151
152
|
- **Stage 1: Spec Fidelity & Acceptance Gate**:
|
|
152
|
-
- Verify 100% conformance against the Single Living Spec (`
|
|
153
|
+
- Verify 100% conformance against the Single Living Spec (`devflow/context/{xxx-slug}/spec.md`).
|
|
153
154
|
- Validate all Acceptance Criteria (ACs) and "Done When" observables without missing requirements or scope creep.
|
|
154
155
|
- Test edge cases and boundary conditions defined in the specification.
|
|
155
156
|
- **Stage 2: Code Quality, Security & Architecture Gate**:
|
|
@@ -157,13 +158,13 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
|
157
158
|
- **Lane 2 (Automated Test Suites & Evals)**: `npm test` (Unit tests 100% pass) + `npm run test:routing` (Skill routing accuracy).
|
|
158
159
|
- **Lane 3 (Scrutinize & Security Audit)**: Edge cases, null-safety, 0 secrets, safe inputs.
|
|
159
160
|
- **Lane 4 (Manual / Scenario Proof)**: Concrete walkthrough steps ("Where to go", "What to run", "What to expect").
|
|
160
|
-
- **Findings Ledger State**: 0 blockers (P0/P1) in `devflow/context/findings.md`.
|
|
161
|
+
- **Findings Ledger State**: 0 blockers (P0/P1) in `devflow/context/{xxx-slug}/findings.md`.
|
|
161
162
|
|
|
162
163
|
---
|
|
163
164
|
|
|
164
165
|
## 8. Findings Ledger & Quality Gates (`findings.md`, `review.md`)
|
|
165
166
|
|
|
166
|
-
- All quality defects, security findings, or regression issues identified during review must be logged in `devflow/context/findings.md`.
|
|
167
|
+
- All quality defects, security findings, or regression issues identified during review must be logged in `devflow/context/{xxx-slug}/findings.md`.
|
|
167
168
|
- **Finding State Machine**:
|
|
168
169
|
- `open`: Confirmed issue waiting to be fixed.
|
|
169
170
|
- `fixed`: Repaired in code, pending QA re-verification.
|
|
@@ -214,7 +215,7 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
|
214
215
|
|
|
215
216
|
## 12. HTML Documentation & Theming Standards (Light Theme Mandate)
|
|
216
217
|
|
|
217
|
-
All generated HTML artifacts across the framework (Contextual Help Playbooks `devflow/
|
|
218
|
+
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**:
|
|
218
219
|
|
|
219
220
|
- **Mandatory Default `data-theme="light"`**:
|
|
220
221
|
- All HTML documents must start with `<html lang="th" data-theme="light">`.
|
|
@@ -256,6 +257,66 @@ All generated HTML artifacts across the framework (Contextual Help Playbooks `de
|
|
|
256
257
|
- Fonts: Google Sans (`'Google Sans'`, `'Google Sans Text'`) for display headers and body text, `'JetBrains Mono'` for code and monospaced data.
|
|
257
258
|
- Full support for `prefers-reduced-motion: reduce` and clear `:focus-visible` outlines.
|
|
258
259
|
- **Master Reference Template**:
|
|
259
|
-
- Refer to `devflow/
|
|
260
|
+
- Refer to `devflow/reference/playbooks/template.html` as the authoritative, reusable component reference for all playbook and HTML documentation generation.
|
|
260
261
|
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 13. Prompt Token Economy & Mechanical Input Coverage Standards
|
|
265
|
+
|
|
266
|
+
- **Skill Byte Budgets & Prompt Hygiene**:
|
|
267
|
+
- **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**.
|
|
268
|
+
- **Every Line Must Earn Its Keep**: If an agent naturally behaves correctly by default, avoid adding redundant prose. Instruct directly without philosophical justification.
|
|
269
|
+
- **Completion Summaries (Lead with Essentials)**:
|
|
270
|
+
- **Headline**: One-line summary of what was accomplished.
|
|
271
|
+
- **Next**: Exactly one next recommended command or action.
|
|
272
|
+
- **Heads up**: Active blockers, decision debt, or critical items needing user attention (omitted when empty).
|
|
273
|
+
- **Pointer**: Link to the detailed artifact rather than repeating large text blocks.
|
|
274
|
+
- **No Checklist Spam**: Avoid dumping lists of obvious successes (`Semantic HTML: OK`, `Keyboard: OK`).
|
|
275
|
+
- **Mechanical Input Coverage Principle (Anti-Hallucination Gate)**:
|
|
276
|
+
- Before implementation, enumerate all values and states that the code must produce or display.
|
|
277
|
+
- Each value must have an explicitly named source (Database column, Input argument, Calculated derivation, or Settled architectural decision).
|
|
278
|
+
- 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.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## 14. Architectural Slicing & Assumed Decision Governance
|
|
283
|
+
|
|
284
|
+
- **4 Slicing Archetypes Framework (`devflow/reference/slicing-archetypes.md`)**:
|
|
285
|
+
- When decomposing large roadmaps or splitting oversized features, select from the 4 standard archetypes:
|
|
286
|
+
- **Skateboard**: Minimal functional loop (prove core logic end-to-end with minimal UI).
|
|
287
|
+
- **Facade**: Rich UI/DX with mock backend (validate user flow & interaction first).
|
|
288
|
+
- **Tracer Bullet**: Deep vertical slice across all layers (DB -> API -> UI) for 1 happy path.
|
|
289
|
+
- **Journey**: Slice along natural user workflow milestones.
|
|
290
|
+
- Avoid purely technical layer slicing (e.g. DB only or backend only) that leaves work unverifiable in a single delivery run.
|
|
291
|
+
- **Assumed Decision Debt Lifecycle (`Status: Assumed`)**:
|
|
292
|
+
- For fast-tracking development when user confirmation is pending, record decisions in ADRs (`devflow/decisions/`) with `Status: Assumed`.
|
|
293
|
+
- Every assumed decision MUST specify `Assumption`, `Risk Level & Blast Radius`, and `Ratification Plan`.
|
|
294
|
+
- Untracked architectural assumptions are strictly prohibited.
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 15. Test File Classification & AC Traceability Standards
|
|
299
|
+
|
|
300
|
+
- **5-Tier Test Classification**:
|
|
301
|
+
- **Tier 1: Pure Logic & Algorithms** (`src/utils/`, `services/`, `lib/`): Fast in-memory Unit Tests, 100% boundary & edge cases coverage. Use TDD.
|
|
302
|
+
- **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.
|
|
303
|
+
- **Tier 3: API & Data Integration** (`src/api/`, route handlers, DB models): Contract tests, schema validation (Zod), status codes, payload shapes.
|
|
304
|
+
- **Tier 4: Config & Build Tooling** (`*.json`, `*.yaml`, `scripts/`): Static contract validation (`npm run check:static`), budget linters (`npm run check:budgets`), smoke tests.
|
|
305
|
+
- **Tier 5: Documentation & Prose** (`*.md`, `docs/`, `scripts/data/`): Structural checks, markdown contract scans, link integrity verification.
|
|
306
|
+
- **Acceptance Criteria (`AC-N`) Traceability**:
|
|
307
|
+
- All automated test suites and assertion descriptions must explicitly include the target Acceptance Criterion tag (e.g. `it('AC-1: ...')`).
|
|
308
|
+
- During `/check`, verify that 100% of defined acceptance criteria in the active living spec have matching passing empirical proof.
|
|
309
|
+
|
|
310
|
+
---
|
|
261
311
|
|
|
312
|
+
## 16. Token Economy & Cost Optimization Standards
|
|
313
|
+
|
|
314
|
+
- **Token Economics Visibility**:
|
|
315
|
+
- Leverage `npm run analyze:tokens` (or `scripts/analyze-token-usage.ts`) to audit session token usage across Main Thread vs Subagents.
|
|
316
|
+
- Track the 4 token dimensions: **Fresh Input Tokens**, **Prompt Cache Write Tokens**, **Prompt Cache Read Tokens (Hits)**, and **Output Tokens**.
|
|
317
|
+
- **Prompt Caching Optimization**:
|
|
318
|
+
- Structure documentation and context files with immutable headers first so LLM providers can achieve high prompt cache hit rates (>60%).
|
|
319
|
+
- Ensure living specs and references stay compact (under byte budgets) to prevent prompt cache misses and unnecessary token churn.
|
|
320
|
+
- **Cost Metrics & Savings**:
|
|
321
|
+
- Track estimated model costs (USD) against model pricing catalogs (Claude 3.7/3.5 Sonnet, Gemini 2.5 Pro/Flash, GPT-4o).
|
|
322
|
+
- Aim for >50% cost savings through effective prompt caching reuse.
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
###
|
|
8
|
-
- **Definition**: เอกสาร Markdown
|
|
9
|
-
- **Constraints**:
|
|
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
|
|
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**: `
|
|
11
|
+
- **Aliases / Related**: `devflow/context/{xxx-slug}/spec.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**: ขับเคลื่อนผ่านไฟล์ `
|
|
15
|
+
- **Constraints**: ขับเคลื่อนผ่านไฟล์ `devflow/context/{xxx-slug}/spec.md` และเมื่อเสร็จสิ้นจะถูก Archive เป็นไฟล์ Markdown เดี่ยวใน `devflow/history/{features|fixes|rollbacks}/{xxx-slug}.md`
|
|
16
16
|
- **Aliases / Related**: Fast-Track, Unified Track
|
|
17
17
|
|
|
18
18
|
### Pre-Flight Discovery
|
|
@@ -22,10 +22,30 @@
|
|
|
22
22
|
|
|
23
23
|
### Multi-Lane Verification Matrix
|
|
24
24
|
- **Definition**: ตารางตรวจสอบคุณภาพแบบหลายมิติที่ครอบคลุม Typecheck, Linter, Automated Unit/Integration Tests, และ Manual Proof Evidence ในคำสั่ง `/check`
|
|
25
|
-
- **Constraints**:
|
|
25
|
+
- **Constraints**: ต้องมีหลักฐานผ่านสำหรับทุก Lane ที่ใช้กับงาน ส่วนที่ไม่เกี่ยวข้องให้บันทึก N/A พร้อมเหตุผล และไม่มี 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,10 +11,14 @@ 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 | Deprecated | Superseded by ADR-yyy
|
|
14
|
+
- **Status**: `Accepted` | `Proposed` | `Assumed` (Fast-tracked Assumption) | `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`
|
|
18
22
|
- **Alternatives Considered**:
|
|
19
23
|
- *Option 1*: Pros / Cons
|
|
20
24
|
- *Option 2*: Pros / Cons
|
|
@@ -22,3 +26,13 @@ Each ADR is named `ADR-xxx-{slug}.md` (e.g. `ADR-001-database-schema-migration.m
|
|
|
22
26
|
- *Positive*: Benefits and capabilities unlocked
|
|
23
27
|
- *Trade-offs / Risks*: Costs, complexity, or constraints
|
|
24
28
|
```
|
|
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
|
+
|
|
@@ -1,110 +1,90 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# 📐 [{xxx-slug}] {title}
|
|
2
2
|
|
|
3
|
-
> **
|
|
4
|
-
> **
|
|
5
|
-
> **
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- **Track**: `Unified Fast-Track`
|
|
12
|
-
- **Discovery Ref**: `devflow/discoveries/DISC-xxx.md` (Optional)
|
|
13
|
-
- **ADR Ref**: `devflow/decisions/ADR-xxx.md` (Optional)
|
|
3
|
+
> **Status**: In-Progress
|
|
4
|
+
> **Track**: Fast-Track (Task-Isolated Living Spec Mode - Feature)
|
|
5
|
+
> **Category**: Feature
|
|
6
|
+
> **Source**: `devflow/build-plan.md: Feature {n}` & `devflow/discoveries/{DISC-ID}/discovery.md`
|
|
7
|
+
> **Branch**: `feature/{xxx-slug}`
|
|
8
|
+
> **Started Date**: {YYYY-MM-DD}
|
|
9
|
+
> **Delivered Date**: TBD
|
|
10
|
+
> **Owner**: DevFlow Core Framework Team & AI
|
|
14
11
|
|
|
15
12
|
---
|
|
16
13
|
|
|
17
|
-
##
|
|
14
|
+
## 1. Specification & Scope
|
|
18
15
|
|
|
19
|
-
### Problem Statement
|
|
20
|
-
|
|
21
|
-
- **Goal**: ผลลัพธ์หรือเป้าหมายที่ต้องการให้เกิดขึ้น
|
|
16
|
+
### 1.1 Problem Statement
|
|
17
|
+
{Description of the problem, background, and rationale for developing this feature}
|
|
22
18
|
|
|
23
|
-
### In-Scope
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- **Out-of-Scope**:
|
|
27
|
-
- สิ่งที่ไม่ทำในรอบนี้ หรือยกยอดไปทำในเฟสถัดไป
|
|
19
|
+
### 1.2 In-Scope
|
|
20
|
+
1. {In-scope item 1}
|
|
21
|
+
2. {In-scope item 2}
|
|
28
22
|
|
|
29
|
-
###
|
|
30
|
-
|
|
31
|
-
| :--- | :--- | :--- |
|
|
32
|
-
| ความเสี่ยงที่อาจเกิดขึ้น | Low/Medium/High | แนวทางป้องกันหรือรับมือ |
|
|
23
|
+
### 1.3 Out-of-Scope
|
|
24
|
+
- {Items deliberately excluded or deferred to future features}
|
|
33
25
|
|
|
34
|
-
###
|
|
35
|
-
1
|
|
36
|
-
2
|
|
26
|
+
### 1.4 Acceptance Criteria
|
|
27
|
+
- [ ] **AC-1**: {Acceptance criterion 1}
|
|
28
|
+
- [ ] **AC-2**: {Acceptance criterion 2}
|
|
37
29
|
|
|
38
30
|
---
|
|
39
31
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
### Architecture & Component Design
|
|
43
|
-
- อธิบายโครงสร้างหรือ Flow การทำงานของ Component/Module
|
|
32
|
+
## 2. Plan & Test Strategy
|
|
44
33
|
|
|
45
|
-
###
|
|
46
|
-
|
|
47
|
-
// Interface หรือ Type Definition
|
|
48
|
-
```
|
|
34
|
+
### 2.1 Files Modified / Created
|
|
35
|
+
- `{file-path}` [NEW | MODIFY | DELETE]
|
|
49
36
|
|
|
50
|
-
###
|
|
51
|
-
- **
|
|
52
|
-
- **
|
|
37
|
+
### 2.2 Quality Gates & Sensitivity Check
|
|
38
|
+
- **Quality Gate Policy (`independentReview`)**: `manual` | `always` | `when-sensitive`
|
|
39
|
+
- **UI Evidence / Browser Tests**: {Not applicable | Playwright / BrowserOS Neo}
|
|
40
|
+
- **Review Strategy**: One feature-level review packet at completion
|
|
53
41
|
|
|
54
|
-
###
|
|
55
|
-
- **
|
|
56
|
-
- **Performance**: ข้อจำกัดเรื่องความเร็ว หรือ Resource Usage
|
|
57
|
-
|
|
58
|
-
### Acceptance Criteria (AC)
|
|
59
|
-
- [ ] **AC-1**: เงื่อนไขการยอมรับข้อที่ 1
|
|
60
|
-
- [ ] **AC-2**: เงื่อนไขการยอมรับข้อที่ 2
|
|
42
|
+
### 2.3 Test Decision: Required (TDD) | Optional
|
|
43
|
+
- **Rationale**: {Reason for requiring Unit Tests / TDD}
|
|
61
44
|
|
|
62
45
|
---
|
|
63
46
|
|
|
64
|
-
##
|
|
65
|
-
|
|
66
|
-
- [ ] **Task 1: Core Foundation & Types**
|
|
67
|
-
- [ ] 1.1 `[TDD-Red]` เขียน Unit Test สำหรับ Logic ส่วนที่ 1
|
|
68
|
-
- [ ] 1.2 `[TDD-Green]` Implement Logic ให้ผ่าน Test
|
|
69
|
-
- [ ] 1.3 `[TDD-Refactor]` Clean up และ Optimize โค้ด
|
|
47
|
+
## 3. Implementation Checklist (Strict TDD)
|
|
70
48
|
|
|
71
|
-
- [ ] **Task
|
|
72
|
-
- [ ]
|
|
73
|
-
- [ ]
|
|
74
|
-
- [ ]
|
|
49
|
+
- [ ] **Task 1: {Task 1 title}**
|
|
50
|
+
- [ ] 1.1 `[TDD-Red]`: {Write failing unit or behavioral test}
|
|
51
|
+
- [ ] 1.2 `[TDD-Green]`: {Write minimal implementation to pass test}
|
|
52
|
+
- [ ] 1.3 `[TDD-Refactor]`: {Refactor and ensure 100% tests green}
|
|
75
53
|
|
|
76
|
-
- [ ] **Task
|
|
77
|
-
- [ ]
|
|
54
|
+
- [ ] **Task 2: {Task 2 title}**
|
|
55
|
+
- [ ] 2.1 `[TDD-Red]`: ...
|
|
56
|
+
- [ ] 2.2 `[TDD-Green]`: ...
|
|
57
|
+
- [ ] 2.3 `[TDD-Refactor]`: ...
|
|
78
58
|
|
|
79
59
|
---
|
|
80
60
|
|
|
81
|
-
##
|
|
61
|
+
## 4. Verification Evidence Matrix
|
|
82
62
|
|
|
83
|
-
|
|
63
|
+
### ⚖️ Axis 1: Standards, Architecture & Quality Gate
|
|
64
|
+
- **Type Safety & Build Integrity**: TBD
|
|
65
|
+
- **Automated Test Matrix**: TBD
|
|
66
|
+
- **Static Contract Verification**: TBD
|
|
67
|
+
- **Package Smoke Test**: TBD
|
|
68
|
+
- **Findings Ledger**: Verify `findings.md` is 100% clean
|
|
84
69
|
|
|
85
|
-
|
|
86
|
-
- **
|
|
70
|
+
### 🎯 Axis 2: Spec Fidelity & Behavioral Acceptance Gate
|
|
71
|
+
- [ ] **AC-1**: {Empirical proof for AC-1}
|
|
72
|
+
- [ ] **AC-2**: {Empirical proof for AC-2}
|
|
87
73
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## 🧪 5. Multi-Lane Verification Matrix
|
|
74
|
+
### 🔗 Axis 3: AC-to-Test Traceability Matrix
|
|
91
75
|
|
|
92
|
-
|
|
76
|
+
| Acceptance Criterion | File Tier | Automated Test Case / Assertion | Verification Command | Status |
|
|
77
|
+
| :--- | :--- | :--- | :--- | :---: |
|
|
78
|
+
| **AC-1** | Tier 1 (Logic) / Tier 2 (UI) | `it('AC-1: ...')` | `npm test` | ⏳ Pending |
|
|
79
|
+
| **AC-2** | Tier 3 (API) / Tier 4 (Tooling) | `it('AC-2: ...')` | `npm run check:static` | ⏳ Pending |
|
|
93
80
|
|
|
94
|
-
| Lane | Command / Verification Target | Result | Notes / Proof |
|
|
95
|
-
| :--- | :--- | :--- | :--- |
|
|
96
|
-
| **Typecheck** | `npm run typecheck` | ⏳ PENDING | |
|
|
97
|
-
| **Lint** | `npm run lint` | ⏳ PENDING | |
|
|
98
|
-
| **Unit Tests** | `npm test` | ⏳ PENDING | |
|
|
99
|
-
| **Manual Proof** | UI / CLI Behavioral Verification | ⏳ PENDING | |
|
|
100
81
|
|
|
101
82
|
---
|
|
102
83
|
|
|
103
|
-
##
|
|
104
|
-
|
|
105
|
-
*(จะถูกสรุปและบันทึกอัตโนมัติก่อนทำการ Squash Merge ในคำสั่ง `/complete`)*
|
|
84
|
+
## 5. Delivery Verification & Independent Receipt
|
|
106
85
|
|
|
107
|
-
- **
|
|
108
|
-
- **
|
|
109
|
-
- **
|
|
110
|
-
- **
|
|
86
|
+
- **Delivery Date**: TBD
|
|
87
|
+
- **Verification Verdict**: TBD
|
|
88
|
+
- **Framework Tests**: TBD
|
|
89
|
+
- **Static Contract**: TBD
|
|
90
|
+
- **Package Smoke Test**: TBD
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Contextual Help Playbook
|
|
2
|
+
|
|
3
|
+
**Universal Contextual Help & Playbook Protocol (`help`, `--help`, `-h`, `?`)**:
|
|
4
|
+
Whenever any skill or command is invoked with a help keyword or flag (e.g., `/bughunter help`, `bughunter --help`, `/archify -h`, `/check ?`, `/feature help`):
|
|
5
|
+
- **Execution Safety Gate**: DO NOT execute the skill's primary or mutating actions (do not launch scans/attacks, do not modify source code, and do not initialize new task runs).
|
|
6
|
+
- **Dynamic Workspace Inspection**: Read the target skill in the active adapter. Inspect only workspace files and selected references needed to tailor its examples; reuse current context.
|
|
7
|
+
- **Persistent HTML Playbook & Token-Saving Cache**:
|
|
8
|
+
- **Output Location & Light Theme Mandate**: Compile and persist the tailored playbook as a standalone, styled HTML report at `devflow/reference/playbooks/{skill}.html` adhering to the **Paper/Ink Light Theme Standard** (`data-theme="light"`, teal accent, ruler corner, terminal mockup UI, and a real diagram). Build the standalone page using these conventions.
|
|
9
|
+
- **First Run**: Render the comprehensive 5W1H playbook in chat and write the complete HTML report to `devflow/reference/playbooks/{skill}.html`.
|
|
10
|
+
- **Subsequent Invocations (Delta Updates & Zero Token Bloat)**: If `devflow/reference/playbooks/{skill}.html` already exists:
|
|
11
|
+
- Inspect the existing HTML file and compute the diff/delta against the current repository state (e.g., new file paths, modified endpoints, or newly installed vendor assets).
|
|
12
|
+
- DO NOT repeat unchanged boilerplate or full static content in chat.
|
|
13
|
+
- Provide a concise **Delta Summary** in chat (highlighting what changed, new recommendations, or newly available commands).
|
|
14
|
+
- In-place update `devflow/reference/playbooks/{skill}.html` with the fresh timestamp and state.
|
|
15
|
+
- Provide a clickable link to the actual resolved output file using the active client's supported local-file link format.
|
|
16
|
+
- **Render the User-Friendly 5W1H Playbook**: Emit an easy-to-read, practical guide organized around the **5W 1H Framework** (rendered on initial run or updated in the HTML playbook):
|
|
17
|
+
1. **What (Concept & Capabilities)**: Clear, jargon-free summary of what this skill does, its core concept, and its bundled tools/capabilities.
|
|
18
|
+
2. **Why (Problems Solved & Key Benefits)**: The problems it solves, key advantages, and why you should use it instead of ad-hoc manual work.
|
|
19
|
+
3. **Who (Target Roles & Personas)**: Target audience or engineering role (e.g., Feature Developer, Senior QA, Security Auditor, Solo Dev, or Tech Lead).
|
|
20
|
+
4. **Where (Boundaries & Artifact Locations)**: Target workspace boundaries, affected directories, and generated artifact locations (e.g., `devflow/context/`, `devflow/discoveries/`, `findings.md`).
|
|
21
|
+
5. **When (Timing & Prerequisites/Next Steps)**:
|
|
22
|
+
- **Timing & Triggers**: Practical situations or milestones when this skill should be invoked.
|
|
23
|
+
- **Run Before (Prerequisites)**: What to check, prepare, or run beforehand to get the best result.
|
|
24
|
+
- **Run After (Next Steps)**: What DevFlow command or lifecycle stage should follow next (e.g., handing off to `/fix`, `/feature`, or `/complete`).
|
|
25
|
+
6. **How (Execution Lifecycle & Real Command Examples)**:
|
|
26
|
+
- **How It Works (Lifecycle)**: Simple, plain-language breakdown of the execution steps or phases.
|
|
27
|
+
- **Available Commands & Options**: Common sub-commands, arguments, and flags with brief explanations.
|
|
28
|
+
- **Safety, Guardrails & Precautions**: Operational boundaries, credential hygiene, read-only vs. mutating constraints, and explicit special safety constraints / precautions.
|
|
29
|
+
7. **Diagram Slot & Architecture Flow**:
|
|
30
|
+
- **Real Diagram Mandate**: MUST embed a real, verified vector SVG or interactive diagram reflecting actual skill lifecycle, state transitions, or threat models in Light Theme (`data-theme="light"`).
|
|
31
|
+
- **Thai Language & Legible Typography**: Architecture and flow diagrams must describe workflows and nodes in Thai language while preserving technical identifiers, paths, and commands in English. Typography must be sufficiently sized and legible for Thai script (Headers 13–14px, box content/descriptions 11–12px, line spacing 18–22px) to prevent tone marks and vowels from clipping or overlapping.
|
|
32
|
+
- **Strictly No Placeholders**: NEVER output empty placeholder cards, generic instruction text, or phrases like *"when invoking archify..."*. Every playbook must ship with a real visual architectural diagram.
|
|
33
|
+
- Always conclude the response with: `"Help menu displayed successfully"`.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# 🧩 4 Slicing Archetypes Framework
|
|
2
|
+
|
|
3
|
+
> คู่มือมาตรฐานการแบ่งขนาดฟีเจอร์ (Feature Slicing & Decomposition) ใน Nexus-DevFlow เพื่อให้แต่ละรอบการส่งมอบ (Feature Run) มีขนาดเล็ก ส่งมอบคุณค่าได้จริง และทดสอบได้รอบด้าน
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🎯 ทำไมต้องมี Slicing Archetypes?
|
|
8
|
+
|
|
9
|
+
ในการพัฒนาซอฟต์แวร์และการทำงานร่วมกับ AI Coding Agents ปัญหาคลาสสิก 2 ประการคือ:
|
|
10
|
+
1. **Slicing by Technical Layer** (เช่น ทำเฉพาะ Database หรือทำเฉพาะ Backend API ก่อน): ทำให้ในรอบนั้นไม่มี UI ให้ทดสอบ หรือไม่สามารถทดสอบแบบ End-to-End ได้
|
|
11
|
+
2. **Oversized Features** (ก้อนใหญ่เกินไป): ทำให้ Context Window เต็มเร็ว AI เริ่มเพี้ยน และการ Review ทำได้ยาก
|
|
12
|
+
|
|
13
|
+
**4 Slicing Archetypes** ช่วยให้คุณและ Agent เลือกกลยุทธ์การหั่นงานที่เหมาะสมที่สุดตามเป้าหมายของแต่ละ Milestone:
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🛹 1. Skateboard Archetype (Minimal Functional Loop)
|
|
18
|
+
|
|
19
|
+
> *"อย่าเริ่มสร้างรถยนต์ด้วยการทำล้อ แต่ให้เริ่มด้วยการทำสเก็ตบอร์ดที่พาผู้ใช้เคลื่อนที่ได้จริง"*
|
|
20
|
+
|
|
21
|
+
### นิยาม & วัตถุประสงค์:
|
|
22
|
+
- สร้าง Core Business Logic & State Machine ที่ทำงานได้จริงครบ Loop แม้ UI จะเรียบง่ายที่สุด (Minimal UI หรือ Single Route / Basic Form / CLI interface)
|
|
23
|
+
- เน้นความถูกต้องของ Logic, Validation, Edge Cases และ Data Flow
|
|
24
|
+
|
|
25
|
+
### เหมาะสำหรับ:
|
|
26
|
+
- ฟีเจอร์ที่ Logic ซับซ้อน มีการคำนวณ การแปลงข้อมูล หรือ State transitions หลายขั้นตอน
|
|
27
|
+
- ต้องการพิสูจน์ว่าแนวคิดหลัก (Core Mechanism) ทำงานได้จริงก่อนลงทุนตกแต่งหน้าจอ
|
|
28
|
+
|
|
29
|
+
### ตัวอย่าง:
|
|
30
|
+
- **Search & Filter**: สร้างหน้าค้นหาที่มี Search Input เรียบๆ และแสดงผลลัพธ์แบบ Text List เพื่อทดสอบ Search Query, Debounce, Pagination และ Filter Logic
|
|
31
|
+
- **Payment Processing**: ระบบคำนวณราคาสินค้า ส่วนลด ภาษี และสร้าง Transaction Record โดยยังไม่ต้องมี UI สวยหรู
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🎭 2. Facade Archetype (Rich UI / Mock-Backed DX)
|
|
36
|
+
|
|
37
|
+
> *"สร้างประสบการณ์ใช้งานจริงที่สวยงามและจับต้องได้ โดยเชื่อมต่อกับ Mock Data ก่อนพัฒนา Backend จริง"*
|
|
38
|
+
|
|
39
|
+
### นิยาม & วัตถุประสงค์:
|
|
40
|
+
- สร้าง Full Rich Interactive UI, Component Interactions, Micro-animations และ Design System สมบูรณ์แบบ
|
|
41
|
+
- จำลอง Data Source ด้วย In-Memory Mock หรือ JSON Fixtures เพื่อเก็บ Feedback เรื่อง UX/DX ทันที
|
|
42
|
+
|
|
43
|
+
### เหมาะสำหรับ:
|
|
44
|
+
- ฟีเจอร์ที่เน้นประสบการณ์ผู้ใช้ (UI/UX Heavy), Dashboard, Data Visualization, Complex Multi-step Wizards
|
|
45
|
+
- ต้องการให้ Stakeholders / ผู้ใช้เห็นหน้าตาและสัมผัส Flow การกดจริงเพื่อสรุป Design ก่อนลงมือทำ Backend
|
|
46
|
+
|
|
47
|
+
### ตัวอย่าง:
|
|
48
|
+
- **Analytics Dashboard**: สร้างชาร์ต กราฟ และ Card KPIs สวยงาม Interactive เต็มรูปแบบโดยอ่านข้อมูลจาก Mock Dataset
|
|
49
|
+
- **Interactive Kanban Board**: Drag & drop การ์ด ย้ายคอลัมน์ ปรับแท็กแบบ Real-time บน Local State ก่อนเชื่อมต่อ Database จริง
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 🎯 3. Tracer Bullet Archetype (End-to-End Vertical Slice)
|
|
54
|
+
|
|
55
|
+
> *"ยิงกระสุนส่องวิถี ทะลวงผ่านทุกเลเยอร์ของระบบจากบนลงล่าง สำหรับ 1 Happy Path ที่สมบูรณ์"*
|
|
56
|
+
|
|
57
|
+
### นิยาม & วัตถุประสงค์:
|
|
58
|
+
- สร้าง Full-Stack Vertical Slice ตั้งแต่ UI -> API Controller -> Service/Logic -> Database Model & Migration สำหรับ **1 Single Happy Path**
|
|
59
|
+
- พิสูจน์ Contract, Network Protocol, Serialization, Type Safety และ Infrastructure ทั้งหมดว่าเชื่อมต่อกันได้จริง
|
|
60
|
+
|
|
61
|
+
### เหมาะสำหรับ:
|
|
62
|
+
- สถาปัตยกรรมใหม่ หรือเมื่อต้องต่อเชื่อม Third-Party Service, DB ใหม่, หรือ Auth Flow ใหม่
|
|
63
|
+
- ต้องการลดความเสี่ยงด้าน Integration Risk ในช่วงต้นของโปรเจกต์
|
|
64
|
+
|
|
65
|
+
### ตัวอย่าง:
|
|
66
|
+
- **User Authentication**: สร้าง Registration Form -> Submit API -> Hash Password -> บันทึกลง PostgreSQL DB -> Issue JWT Token -> Redirect ไปหน้า Profile สำหรับกรณีข้อมูลถูกต้อง 1 กรณี
|
|
67
|
+
- **Report Export**: กดปุ่ม Export -> Backend Query ข้อมูล -> สร้าง PDF Stream -> Browser ดาวน์โหลดไฟล์สำเร็จ
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🧭 4. Journey Archetype (Slice by User Workflow / Milestones)
|
|
72
|
+
|
|
73
|
+
> *"แบ่งฟีเจอร์ตามขั้นตอนการเดินทางของผู้ใช้งาน (User Journey Steps)"*
|
|
74
|
+
|
|
75
|
+
### นิยาม & วัตถุประสงค์:
|
|
76
|
+
- หั่นงานตามลำดับขั้นตอนธรรมชาติของ Business Process (เช่น Stage 1: Onboarding -> Stage 2: Core Activity -> Stage 3: Summary & Export)
|
|
77
|
+
- แต่ละชิ้นงานจบในตัว และปลดล็อคขั้นตอนถัดไปใน Journey ของผู้ใช้
|
|
78
|
+
|
|
79
|
+
### เหมาะสำหรับ:
|
|
80
|
+
- Workflow ขนาดใหญ่ที่มีหลายสเตจ, Checkout Flows, Multi-step Form Wizard, Approval Pipeline
|
|
81
|
+
|
|
82
|
+
### ตัวอย่าง:
|
|
83
|
+
- **E-Commerce Checkout**:
|
|
84
|
+
- *Slice 1 (Cart Review)*: หน้าสรุปรายการสินค้าและปรับจำนวน
|
|
85
|
+
- *Slice 2 (Shipping & Address)*: แบบฟอร์มกรอกที่อยู่จัดส่งและคำนวณค่าส่ง
|
|
86
|
+
- *Slice 3 (Payment & Order Confirmation)*: เลือกวิธีชำระเงินและสรุปใบสั่งซื้อ
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 📊 ตารางเปรียบเทียบและการเลือกใช้งาน (Selection Matrix)
|
|
91
|
+
|
|
92
|
+
| Archetype | จุดเน้นหลัก (Focus) | UI Level | Backend / DB | เมื่อไหร่ควรเลือก? |
|
|
93
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
94
|
+
| 🛹 **Skateboard** | Core Logic & Flow | Minimal | Real | Logic ซับซ้อน ต้องการความถูกต้องก่อนตกแต่ง |
|
|
95
|
+
| 🎭 **Facade** | UX, DX & Interaction | Rich / Complete | Mocked | ต้องการทดสอบ UX / รับ Feedback จากผู้ใช้เร็ว |
|
|
96
|
+
| 🎯 **Tracer Bullet** | Full Architecture Path | Functional | Real | ต้องการทดสอบ Integration & Pipeline ทะลุทุกชั้น |
|
|
97
|
+
| 🧭 **Journey** | Step-by-Step Workflow | Balanced | Real | Workflow ยาว แบ่งทำทีละสเตจตามลำดับ |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 💡 แนวทางปฏิบัติใน DevFlow Workflow
|
|
102
|
+
|
|
103
|
+
1. **ใน `/discovery` หรือ `/brainstorm`**: เมื่อวิเคราะห์ฟีเจอร์ใหญ่ ให้เสนอ Archetype ที่แนะนำในการแบ่ง Sub-features
|
|
104
|
+
2. **ใน `/feature` (Step 2 Sizing & Splitting)**: หากต้องแยกฟีเจอร์ย่อย (เช่น 4a, 4b, 4c) ให้ระบุ Archetype กำกับ เช่น `4a. (Tracer Bullet) Core Export Engine` -> `4b. (Facade) Interactive Export Modal & Template Preview`
|
|
105
|
+
3. **ใน Living Spec (`spec.md`)**: ระบุ Archetype ในส่วนหัวของ Spec เพื่อให้ Agent ในขั้นตอน `/implement` ทราบความคาดหวังเรื่องระดับ UI และ Data Source อย่างชัดเจน
|