spec-lite 1.1.4 → 1.1.5
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
|
@@ -95,7 +95,16 @@ Sau khi confirm, assign F-XXX IDs theo thứ tự tăng dần.
|
|
|
95
95
|
|
|
96
96
|
### Bước 4: Scan sâu từng feature
|
|
97
97
|
|
|
98
|
-
**4a. User
|
|
98
|
+
**4a. User flows — infer từ:**
|
|
99
|
+
- Test file chains nhiều request liên tiếp → detect luồng thao tác có thứ tự
|
|
100
|
+
- Navigation / router config trong UI code (`steps`, `wizard`, `onNext`) → detect bước chuyển màn
|
|
101
|
+
- State machine hoặc status enum (`pending → processing → done`) → detect nhánh edge case
|
|
102
|
+
- Error handling branches trong use case → detect luồng thất bại
|
|
103
|
+
|
|
104
|
+
Đánh dấu source: `(inferred from tests)` hoặc `(inferred from UI navigation)`.
|
|
105
|
+
Nếu không detect được → User Flows section sẽ là NEEDS_CLARIFY.
|
|
106
|
+
|
|
107
|
+
**4b. User stories — infer từ:**
|
|
99
108
|
- Use case class names và public methods → action descriptions
|
|
100
109
|
- Route names + HTTP methods → "As a user, I want to POST /auth/register..."
|
|
101
110
|
- Test `describe` / `it` blocks → `it('should register a new user', ...)` → user story
|
|
@@ -149,11 +158,13 @@ Với mỗi feature, generate 2 files dùng templates tương ứng:
|
|
|
149
158
|
|
|
150
159
|
**`frd.md`** — WHAT (dùng `.claude/templates/main/feature/frd-template.md`):
|
|
151
160
|
- Description và business goal (infer từ feature name + use case, NEEDS_CLARIFY nếu không rõ)
|
|
161
|
+
- User flows: Mermaid flowchart cho happy case và edge cases (infer từ test chains / UI navigation, NEEDS_CLARIFY nếu không detect được)
|
|
152
162
|
- User stories (đánh dấu source)
|
|
153
163
|
- Acceptance criteria (extract từ tests nếu có, NEEDS_CLARIFY nếu không)
|
|
154
164
|
- Scope: In scope từ detected routes/actions; Out of scope → NEEDS_CLARIFY
|
|
155
|
-
-
|
|
156
|
-
- Dependencies: feature-to-feature dependencies nếu detect được
|
|
165
|
+
- Dependencies:
|
|
166
|
+
- Feature Dependencies: feature-to-feature dependencies nếu detect được
|
|
167
|
+
- Components Used: list C-XXX từ Component Index (infer từ import statements)
|
|
157
168
|
|
|
158
169
|
**`fdd.md`** — HOW / inter-component (dùng `.claude/templates/main/feature/fdd-template.md`):
|
|
159
170
|
- Inter-component data flow: sequence diagram từ detected call chain (Mermaid hoặc ASCII)
|
package/skills/spec-new/SKILL.md
CHANGED
|
@@ -65,10 +65,11 @@ frd.md — F-001 Authentication đã tồn tại.
|
|
|
65
65
|
Sections hiện có:
|
|
66
66
|
|
|
67
67
|
[1] Overview
|
|
68
|
-
[2]
|
|
69
|
-
[3]
|
|
70
|
-
[4]
|
|
71
|
-
[5]
|
|
68
|
+
[2] User Flows
|
|
69
|
+
[3] Feature-level Acceptance Criteria
|
|
70
|
+
[4] User Stories
|
|
71
|
+
[5] Scope (In Scope / Out of Scope)
|
|
72
|
+
[6] Dependencies (Feature Dependencies + Components Used)
|
|
72
73
|
[A] All — viết lại toàn bộ từ đầu
|
|
73
74
|
[S] Lên spec từ frd.md hiện tại — frd.md đã đầy đủ, không cần chỉnh
|
|
74
75
|
|
|
@@ -223,11 +224,11 @@ frd.md — F-001 Authentication đã tồn tại.
|
|
|
223
224
|
Sections hiện có:
|
|
224
225
|
|
|
225
226
|
[1] Overview
|
|
226
|
-
[2]
|
|
227
|
+
[2] User Flows
|
|
227
228
|
[3] Feature-level Acceptance Criteria
|
|
228
229
|
[4] User Stories
|
|
229
230
|
[5] Scope (In Scope / Out of Scope)
|
|
230
|
-
[6] Dependencies
|
|
231
|
+
[6] Dependencies (Feature Dependencies + Components Used)
|
|
231
232
|
[A] All — viết lại toàn bộ từ đầu
|
|
232
233
|
|
|
233
234
|
Chọn section cần cập nhật (có thể chọn nhiều, ví dụ: 2 3):
|
|
@@ -15,13 +15,29 @@ referenced_by:
|
|
|
15
15
|
|
|
16
16
|
{Mô tả feature này giải quyết vấn đề gì cho user nào, trong 2-3 câu.}
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## User Flows
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
{Mô tả các luồng thao tác của user để hoàn thành mục tiêu của feature này.}
|
|
21
|
+
{Mỗi flow là một Mermaid flowchart riêng, bao gồm happy case và tất cả edge cases quan trọng.}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
### Flow 1: {Tên luồng chính}
|
|
24
|
+
|
|
25
|
+
```mermaid
|
|
26
|
+
flowchart TD
|
|
27
|
+
A([{Điểm bắt đầu}]) --> B[{Bước 1}]
|
|
28
|
+
B --> C{Điều kiện?}
|
|
29
|
+
C -- Happy case --> D[{Bước 2 — thành công}]
|
|
30
|
+
C -- Edge case --> E[{Xử lý lỗi / nhánh phụ}]
|
|
31
|
+
D --> F([{Kết thúc thành công}])
|
|
32
|
+
E --> G([{Kết thúc thất bại / fallback}])
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Flow 2: {Tên luồng phụ / edge case lớn} *(nếu có)*
|
|
36
|
+
|
|
37
|
+
```mermaid
|
|
38
|
+
flowchart TD
|
|
39
|
+
A([{Điểm bắt đầu}]) --> B[{...}]
|
|
40
|
+
```
|
|
25
41
|
|
|
26
42
|
## Feature-level Acceptance Criteria
|
|
27
43
|
|
|
@@ -83,6 +99,16 @@ US ID format: `US-F{NNN}-{seq}` — đánh số tăng dần toàn feature.
|
|
|
83
99
|
|
|
84
100
|
## Dependencies
|
|
85
101
|
|
|
102
|
+
### Feature Dependencies
|
|
103
|
+
|
|
86
104
|
| Feature | Loại | Ghi chú |
|
|
87
105
|
| --- | --- | --- |
|
|
88
106
|
| {feature-name} | required before / parallel | {lý do} |
|
|
107
|
+
|
|
108
|
+
### Components Used
|
|
109
|
+
|
|
110
|
+
Tham chiếu đến `specs/main/component/{C-XXX}-...`.
|
|
111
|
+
|
|
112
|
+
| Component | Vai trò trong feature |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| `{C-XXX}-{component-name}` | {component này phục vụ cái gì cho feature này} |
|