@jakkrichm/create-nexus-devflow 2.17.5 → 2.17.7
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 +8 -8
- package/dist/lib/doctor.js +27 -0
- package/dist/lib/doctor.js.map +1 -1
- package/dist/lib/history.js +2 -2
- package/dist/lib/history.js.map +1 -1
- package/dist/lib/skill-registry-engine.js +3 -3
- 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/scripts/prepare-template.js +1 -1
- package/dist/scripts/prepare-template.js.map +1 -1
- package/package.json +1 -1
- package/template/.agents/skills/audit/SKILL.md +4 -1
- package/template/.agents/skills/brainstorm/SKILL.md +5 -4
- package/template/.agents/skills/check/SKILL.md +26 -116
- package/template/.agents/skills/check/reference/guide.md +126 -0
- package/template/.agents/skills/check/reference/verify.md +129 -0
- package/template/.agents/skills/ci/SKILL.md +42 -8
- package/template/.agents/skills/complete/SKILL.md +2 -0
- package/template/.agents/skills/discovery/SKILL.md +9 -0
- package/template/.agents/skills/doctor/SKILL.md +6 -0
- package/template/.agents/skills/explore/SKILL.md +78 -0
- 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/grill/SKILL.md +6 -1
- package/template/.agents/skills/idea/SKILL.md +6 -6
- package/template/.agents/skills/implement/SKILL.md +9 -1
- 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/check/SKILL.md +26 -116
- package/template/.claude/skills/check/reference/guide.md +126 -0
- package/template/.claude/skills/check/reference/verify.md +129 -0
- package/template/.claude/skills/ci/SKILL.md +42 -8
- package/template/.claude/skills/complete/SKILL.md +2 -0
- package/template/.claude/skills/discovery/SKILL.md +11 -3
- package/template/.claude/skills/doctor/SKILL.md +6 -0
- package/template/.claude/skills/explore/SKILL.md +78 -0
- 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/grill/SKILL.md +6 -1
- package/template/.claude/skills/idea/SKILL.md +6 -6
- package/template/.claude/skills/implement/SKILL.md +9 -1
- package/template/.claude/skills/test/SKILL.md +26 -0
- package/template/AGENTS.md +12 -1
- package/template/devflow/context/coding-standards.md +62 -2
- package/template/devflow/context/glossary.md +20 -0
- 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 +8 -8
- package/template/devflow/reference/slicing-archetypes.md +105 -0
- package/template/devflow/docs/USAGE.md +0 -194
- 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 -85
|
@@ -203,7 +203,7 @@ Testing is a core quality gate in Nexus-DevFlow, not an afterthought:
|
|
|
203
203
|
|
|
204
204
|
## 12. HTML Documentation & Theming Standards (Light Theme Mandate)
|
|
205
205
|
|
|
206
|
-
All generated HTML artifacts across the framework (Contextual Help Playbooks `devflow/
|
|
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**:
|
|
207
207
|
|
|
208
208
|
- **Mandatory Default `data-theme="light"`**:
|
|
209
209
|
- All HTML documents must start with `<html lang="th" data-theme="light">`.
|
|
@@ -245,6 +245,66 @@ All generated HTML artifacts across the framework (Contextual Help Playbooks `de
|
|
|
245
245
|
- Fonts: Google Sans (`'Google Sans'`, `'Google Sans Text'`) for display headers and body text, `'JetBrains Mono'` for code and monospaced data.
|
|
246
246
|
- Full support for `prefers-reduced-motion: reduce` and clear `:focus-visible` outlines.
|
|
247
247
|
- **Master Reference Template**:
|
|
248
|
-
- Refer to `devflow/
|
|
248
|
+
- Refer to `devflow/reference/playbooks/template.html` as the authoritative, reusable component reference for all playbook and HTML documentation generation.
|
|
249
249
|
|
|
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
|
+
---
|
|
250
299
|
|
|
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.
|
|
@@ -29,3 +29,23 @@
|
|
|
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
|
|
@@ -5,14 +5,14 @@
|
|
|
5
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
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
7
|
- **Persistent HTML Playbook & Token-Saving Cache**:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
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
17
|
1. **What (Concept & Capabilities)**: Clear, jargon-free summary of what this skill does, its core concept, and its bundled tools/capabilities.
|
|
18
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.
|
|
@@ -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 อย่างชัดเจน
|