spec-lite 1.0.1 → 1.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-lite",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Spec-driven development kit for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,10 +13,35 @@ Invoke `incremental-implementation` và `test-driven-development` cùng nhau cho
13
13
 
14
14
  ## Quy trình
15
15
 
16
+ ### Bước 0: Xác định integration
17
+
18
+ **Nếu có ARGUMENT:**
19
+ - Parse argument: có thể là số thứ tự (`2`, `002`) hoặc slug (`002-implement-todo`)
20
+ - Quét `specs/integrations/*/todo.md`, tìm integration khớp với argument
21
+ - Nếu không tìm thấy → báo lỗi:
22
+ > Không tìm thấy integration khớp với "{argument}". Kiểm tra lại tên hoặc số thứ tự.
23
+ - Nếu tìm thấy → dùng `specs/integrations/{slug}/` làm working integration, bắt đầu luôn
24
+
25
+ **Nếu không có ARGUMENT:**
26
+ - Quét `specs/integrations/*/todo.md`, liệt kê tất cả integrations có todo.md, đánh dấu tiến độ:
27
+
28
+ ```
29
+ Integrations:
30
+
31
+ [1] 001-implement-auth — Implement Auth (8/8 done) ✓
32
+ [2] 002-implement-todo — Implement Todo Management (0/10 pending)
33
+
34
+ Chọn số integration:
35
+ ```
36
+
37
+ Format: `({done}/{total} done)` hoặc `({pending} pending)` — đếm từ todo.md
38
+ - Nếu chỉ có 1 integration có task pending → chọn luôn, không hỏi
39
+ - Nếu tất cả đều done → thông báo: "Tất cả integration đã hoàn thành."
40
+
16
41
  ### Với mỗi task pending
17
42
 
18
43
  **1. Chọn task** (`incremental-implementation` — Increment Cycle)
19
- Lấy task `[ ]` tiếp theo trong `todo.md`. Đọc acceptance criteria trong `plan.md`.
44
+ Lấy task `[ ]` tiếp theo trong `todo.md` của integration đã chọn. Đọc acceptance criteria trong `plan.md` tương ứng.
20
45
 
21
46
  **2. Load context** (`incremental-implementation` — Rule 0: Simplicity First)
22
47
  Đọc code, types, patterns liên quan. Hỏi: "Cách đơn giản nhất có thể làm việc là gì?"
@@ -50,7 +75,7 @@ Build phải thành công trước khi commit. Nếu fail → invoke `debugging-
50
75
  Commit với message mô tả rõ, giới hạn trong phạm vi task này. Một thay đổi logic mỗi commit.
51
76
 
52
77
  **8. Đánh dấu hoàn thành và tiếp tục**
53
- Check `[x]` trong `todo.md`. Lặp lại từ bước 1 cho task tiếp theo.
78
+ Check `[x]` trong `todo.md` của integration đang build. Lặp lại từ bước 1 cho task tiếp theo.
54
79
 
55
80
  ## Dấu hiệu task UI/UX
56
81
 
@@ -27,22 +27,28 @@ Mọi quyết định về sizing, slicing đều thuộc về `planning-and-tas
27
27
 
28
28
  ### Bước 1: Xác định integration
29
29
 
30
+ **Nếu có ARGUMENT:**
31
+ - Parse argument: có thể là số thứ tự (`2`, `002`) hoặc slug (`002-implement-todo`)
32
+ - Quét `specs/integrations/*/`, tìm integration khớp với argument
33
+ - Nếu không tìm thấy → báo lỗi:
34
+ > Không tìm thấy integration khớp với "{argument}". Kiểm tra lại tên hoặc số thứ tự.
35
+ - Nếu tìm thấy → dùng integration đó, bắt đầu luôn
36
+
37
+ **Nếu không có ARGUMENT:**
38
+
30
39
  Quét `specs/integrations/`. Liệt kê tất cả integrations:
31
40
 
32
41
  ```
33
42
  Integrations:
34
43
 
35
- [1] f001-authentication User Authentication spec✓ tech✓ plan
36
- [2] f003-app-browsing App Browsing & Opt-in spec✓ tech—
37
- [3] f004-credit-system — Credit System spec—
44
+ [1] 001-implement-auth Implement Auth spec✓ tech✓ plan
45
+ [2] 002-implement-todo Implement Todo Management spec✓ tech✓ plan
38
46
 
39
47
  Chọn số integration:
40
48
  ```
41
49
 
42
50
  Legend: `✓` = có, `—` = chưa có
43
51
 
44
- Nếu có ARGUMENT → chọn luôn, không hiển thị danh sách.
45
-
46
52
  Nếu plan.md / todo.md đã tồn tại → hỏi trước khi ghi đè.
47
53
 
48
54
  ---
@@ -84,77 +90,7 @@ Invoke `planning-and-task-breakdown` với context đã load. Skill đó sẽ th
84
90
 
85
91
  ### plan.md
86
92
 
87
- ```markdown
88
- ---
89
- id: "{slug}"
90
- slug: "{slug}"
91
- title: "{title} — Implementation Plan"
92
- features: ["{F-XXX}"]
93
- status: draft
94
- created: {YYYY-MM-DD}
95
- ---
96
-
97
- ## Summary
98
-
99
- [2-3 sentences on what will be implemented]
100
-
101
- ## Dependency Graph
102
-
103
- [ASCII diagram — bottom = foundations, top = UI. Ví dụ:]
104
-
105
- UI Components
106
-
107
- API Routes ──── Middleware
108
-
109
- Services
110
-
111
- Prisma Schema
112
-
113
- ## Tasks
114
-
115
- ### Phase 1: [Phase name]
116
-
117
- #### T001 · [task title — starts with a verb]
118
-
119
- **Mục tiêu:** [One sentence: what this task delivers]
120
-
121
- **depends:** — (hoặc T-IDs)
122
-
123
- **Các bước:**
124
- 1. [Concrete implementation step]
125
- 2. [Concrete implementation step]
126
-
127
- **Verification:**
128
- - [ ] [AC-F-001] [specific test case]
129
- - [ ] [smoke check or observable result]
130
-
131
- ---
132
-
133
- ### Phase N: Verification
134
-
135
- #### T00N · Integration tests — [flow name]
136
-
137
- **Mục tiêu:** [End-to-end flow being tested]
138
-
139
- **depends:** T001, T002, ...
140
-
141
- **Các bước:**
142
- 1. [Test setup / seed data]
143
- 2. [Execute happy path]
144
- 3. [Execute error cases]
145
-
146
- **Verification:**
147
- - [ ] Happy path: [description]
148
- - [ ] Error case: [description]
149
-
150
- ---
151
-
152
- ## Definition of Done
153
-
154
- - [ ] [AC-F-001 / AC-S-001] [AC description — concise, preserve intent]
155
- - [ ] All unit tests pass
156
- - [ ] All integration tests pass
157
- ```
93
+ Dùng `.claude/templates/integrations/plan-template.md` làm skeleton, điền nội dung từ breakdown vào từng section.
158
94
 
159
95
  **Lưu ý format:**
160
96
  - Task ID dùng `·` (middle dot), không dùng `—`
@@ -164,16 +100,7 @@ created: {YYYY-MM-DD}
164
100
 
165
101
  ### todo.md
166
102
 
167
- ```markdown
168
- # [title] — Todo
169
-
170
- ### Phase 1: [Phase name]
171
- - [ ] T001 · [task title]
172
- - [ ] T002 · [task title]
173
-
174
- ### Phase N: Verification
175
- - [ ] T00N · Integration tests — [flow name]
176
- ```
103
+ Dùng `.claude/templates/integrations/todo-template.md` làm skeleton, điền nội dung từ breakdown vào từng section.
177
104
 
178
105
  ---
179
106
 
@@ -41,15 +41,19 @@ Map what depends on what:
41
41
  ```
42
42
  Database schema
43
43
 
44
- ├── API models/types
44
+ ├── Domain models
45
45
  │ │
46
- ├── API endpoints
47
-
48
- │ └── Frontend API client
49
-
50
- └── UI components
51
-
52
- └── Validation logic
46
+ └── Services
47
+
48
+ ├── Validation logic
49
+ │ │
50
+ │ └── API endpoints
51
+
52
+ ├── Middleware
53
+ │ │
54
+ │ └── Frontend API client
55
+ │ │
56
+ │ └── UI components
53
57
 
54
58
  └── Seed data / migrations
55
59
  ```
@@ -28,14 +28,22 @@ Tạo `tech.md` cho một integration trong `specs/integrations/{slug}/`.
28
28
 
29
29
  ### Bước 1: Xác định integration
30
30
 
31
- Quét thư mục `specs/integrations/`. Liệt kê **tất cả** integrations `spec.md`, đánh dấu những cái đã có `tech.md`:
31
+ **NếuARGUMENT:**
32
+ - Parse argument: có thể là số thứ tự (`2`, `002`) hoặc slug (`002-implement-todo`)
33
+ - Quét `specs/integrations/*/spec.md`, tìm integration khớp với argument
34
+ - Nếu không tìm thấy → báo lỗi:
35
+ > Không tìm thấy integration khớp với "{argument}". Kiểm tra lại tên hoặc số thứ tự.
36
+ - Nếu tìm thấy → dùng integration đó, bắt đầu luôn
37
+
38
+ **Nếu không có ARGUMENT:**
39
+
40
+ Quét `specs/integrations/`. Liệt kê **tất cả** integrations có `spec.md`, đánh dấu những cái đã có `tech.md`:
32
41
 
33
42
  ```
34
43
  Integrations:
35
44
 
36
- [1] f001-authentication User Authentication
37
- [2] f003-app-browsing App Browsing & Opt-in tech.md
38
- [3] f004-credit-system — Credit System
45
+ [1] 001-implement-auth Implement Auth spec✓ tech✓
46
+ [2] 002-implement-todo Implement Todo Management spec✓ tech
39
47
 
40
48
  Chọn số integration:
41
49
  ```
@@ -43,8 +51,6 @@ Chọn số integration:
43
51
  Nếu không có integration nào → thông báo:
44
52
  > Chưa có integration nào. Hãy chạy `/spec-new` trước.
45
53
 
46
- **Nếu có ARGUMENT** → đây là số thứ tự trong danh sách trên (ví dụ `1`, `2`, hoặc `001`). Parse thành số nguyên, bỏ qua leading zeros, map vào integration tương ứng — không cần hiển thị danh sách, chọn luôn.
47
-
48
54
  Nếu integration đã có `tech.md` → hỏi trước khi tiếp tục:
49
55
  > `tech.md` đã tồn tại cho integration này. Tiếp tục sẽ ghi đè. Tiếp tục không?
50
56
 
@@ -162,7 +168,7 @@ Thông báo kết quả:
162
168
 
163
169
  Bước tiếp theo:
164
170
  - Review và approve tech.md
165
- - Implement theo tech.md
171
+ - /plan tạo plan.md và todo.md cho integration này
166
172
  - Sau khi done: đổi status F-XXX trong prd.md thành DONE
167
173
  - Nếu Cascade Proposals có thay đổi → chạy /spec-domain hoặc /spec-sad
168
174
  ```
@@ -14,25 +14,74 @@ referenced_by:
14
14
 
15
15
  <!-- Mô tả ngắn những gì sẽ được implement trong integration này -->
16
16
 
17
+ ## Dependency Graph
18
+
19
+ ```
20
+ <!-- ASCII diagram — bottom = foundations, top = UI. Ví dụ:
21
+
22
+ Database schema
23
+
24
+ ├── Domain models
25
+ │ │
26
+ │ └── Services
27
+ │ │
28
+ │ └── API endpoints
29
+ │ │
30
+ │ └── UI components
31
+ -->
32
+ ```
33
+
17
34
  ## Tasks
18
35
 
19
36
  ### Phase 1: {tên phase}
20
37
 
21
- - [ ] T001{mô tả task}
22
- - [ ] T002 — {mô tả task}
23
- - [ ] T003 — {mô tả task} (depends: T001)
38
+ #### T001 · {task title bắt đầu bằng động từ}
24
39
 
25
- ### Phase 2: {tên phase}
40
+ **Mục tiêu:** {One sentence: what this task delivers}
26
41
 
27
- - [ ] T004 {mô tả task} (depends: T001, T002)
28
- - [ ] T005 — {mô tả task}
42
+ **depends:**
29
43
 
30
- <!-- Convention:
31
- - ID tăng dần trong phạm vi integration: T001, T002...
32
- - Dependency ghi rõ: (depends: T001, T003)
33
- - Tasks trong cùng phase không có dependency → có thể xử lý song song
34
- - Tasks across phases có dependency tuần tự
35
- -->
44
+ **Các bước:**
45
+ 1. {Concrete implementation step}
46
+ 2. {Concrete implementation step}
47
+
48
+ **Verification:**
49
+ - [ ] {specific test case hoặc observable result}
50
+
51
+ ---
52
+
53
+ #### T002 · {task title}
54
+
55
+ **Mục tiêu:** {One sentence}
56
+
57
+ **depends:** T001
58
+
59
+ **Các bước:**
60
+ 1. {Concrete implementation step}
61
+
62
+ **Verification:**
63
+ - [ ] {specific test case hoặc observable result}
64
+
65
+ ---
66
+
67
+ ### Phase N: Verification
68
+
69
+ #### T00N · Integration tests — {flow name}
70
+
71
+ **Mục tiêu:** {End-to-end flow being tested}
72
+
73
+ **depends:** T001, T002, ...
74
+
75
+ **Các bước:**
76
+ 1. {Test setup / seed data}
77
+ 2. {Execute happy path}
78
+ 3. {Execute error cases}
79
+
80
+ **Verification:**
81
+ - [ ] Happy path: {description}
82
+ - [ ] Error case: {description}
83
+
84
+ ---
36
85
 
37
86
  ## Definition of Done
38
87
 
@@ -24,21 +24,27 @@ referenced_by:
24
24
 
25
25
  ### Feature: {feature-name}
26
26
 
27
- **Feature-level AC:**
27
+ **Feature-level Acceptance Criteria:**
28
28
 
29
- - [ ] AC-F-001: GIVEN {precondition}
30
- WHEN {action}
31
- THEN {expected outcome}
29
+ - [ ] AC-F-001
30
+ - **Given** {precondition}
31
+ - **When** {action}
32
+ - **Then** {expected outcome}
32
33
 
33
34
  <!-- Lặp lại block Story bên dưới cho mỗi user story thuộc feature này -->
34
35
 
35
- **Story: {story-title}**
36
+ #### US-001: {Story title}
36
37
 
37
- > { tả user story — As a {role}, I want to {action} so that {benefit}}
38
+ **{Persona}** muốn **{hành động}** để **{mục tiêu}**.
38
39
 
39
- - [ ] AC-S-001: GIVEN {precondition}
40
- WHEN {action}
41
- THEN {expected outcome}
40
+ **Priority:** Must / Should / Could
41
+
42
+ **Acceptance Criteria:**
43
+
44
+ - [ ] AC-S-001
45
+ - **Given** {precondition}
46
+ - **When** {action}
47
+ - **Then** {expected outcome}
42
48
 
43
49
  ## Out of Scope
44
50
 
@@ -19,40 +19,44 @@ referenced_by:
19
19
 
20
20
  Criteria áp dụng cho toàn bộ feature — không gắn với story cụ thể (ví dụ: performance, security, accessibility).
21
21
 
22
- - [ ] GIVEN {precondition}
23
- WHEN {action}
24
- THEN {expected outcome}
22
+ - [ ]
23
+ - **Given** {precondition}
24
+ - **When** {action}
25
+ - **Then** {expected outcome}
25
26
 
26
27
  ## User Stories
27
28
 
28
29
  ### US-001: {Story title}
29
30
 
30
- As a {persona}, I want to {action} so that {value}.
31
+ **{Persona}** muốn **{hành động}** để **{mục tiêu}**.
31
32
 
32
33
  **Priority:** Must / Should / Could
33
34
 
34
35
  **Acceptance Criteria:**
35
36
 
36
- - [ ] GIVEN {precondition}
37
- WHEN {action}
38
- THEN {expected outcome}
39
- - [ ] GIVEN {precondition}
40
- WHEN {action}
41
- THEN {expected outcome}
37
+ - [ ]
38
+ - **Given** {precondition}
39
+ - **When** {action}
40
+ - **Then** {expected outcome}
41
+ - [ ]
42
+ - **Given** {precondition}
43
+ - **When** {action}
44
+ - **Then** {expected outcome}
42
45
 
43
46
  ---
44
47
 
45
48
  ### US-002: {Story title}
46
49
 
47
- As a {persona}, I want to {action} so that {value}.
50
+ **{Persona}** muốn **{hành động}** để **{mục tiêu}**.
48
51
 
49
52
  **Priority:** Must / Should / Could
50
53
 
51
54
  **Acceptance Criteria:**
52
55
 
53
- - [ ] GIVEN {precondition}
54
- WHEN {action}
55
- THEN {expected outcome}
56
+ - [ ]
57
+ - **Given** {precondition}
58
+ - **When** {action}
59
+ - **Then** {expected outcome}
56
60
 
57
61
  ---
58
62