spec-lite 1.5.0 → 1.5.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.
- package/README.md +5 -5
- package/package.json +1 -1
- package/skills/artifact-audit/SKILL.md +21 -27
- package/skills/artifact-migrate/SKILL.md +12 -9
- package/skills/plan/SKILL.md +3 -3
- package/skills/spec-new/SKILL.md +2 -2
- package/skills/spec-tech/SKILL.md +2 -2
- package/skills/spec-test/SKILL.md +2 -2
- package/skills-overview.md +7 -7
- package/templates/integrations/plan-template.md +0 -4
- package/templates/integrations/spec-template.md +0 -4
- package/templates/integrations/tech-template.md +0 -4
- package/templates/integrations/techdebt-template.md +0 -4
- package/templates/integrations/test-template.md +0 -4
- package/templates/integrations/todo-template.md +0 -4
package/README.md
CHANGED
|
@@ -151,13 +151,13 @@ Sau khi có findings, hỏi user severity tier muốn xử lý (Critical / Criti
|
|
|
151
151
|
|
|
152
152
|
Skill ad-hoc dùng khi template đã được update và artifacts hiện có cần migrate. Không phải pipeline — chạy khi cần.
|
|
153
153
|
|
|
154
|
-
Mỗi template mang `template_version` (số nguyên) trong frontmatter; artifact copy nó lúc được tạo. Khi template đổi structure, artifact cũ thành "lỗi thời" — hai skill dưới phát hiện và migrate. Quy ước đầy đủ: [conventions.md](conventions.md) §7.
|
|
154
|
+
Mỗi **main** template mang `template_version` (số nguyên) trong frontmatter; main artifact copy nó lúc được tạo. Khi template đổi structure, main artifact cũ thành "lỗi thời" — hai skill dưới phát hiện và migrate. **Chỉ áp dụng cho main artifacts** (integration artifacts ephemeral nên không versioned). Quy ước đầy đủ: [conventions.md](conventions.md) §7.
|
|
155
155
|
|
|
156
156
|
#### `/artifact-audit [type]`
|
|
157
|
-
Phát hiện artifact lỗi thời. So `template_version` của artifact với version đọc thẳng từ template. Versioned: `==` → up-to-date; `!=` → out-dated `(vX → vY)` → migrate. Legacy thiếu version → presence-check (đủ required `##` headings + không còn section đã `migrations.remove`): conform → stamp version; lệch → out-dated. Chỉ phát hiện + stamp, KHÔNG migrate. Scope theo arg (1 type / list) hoặc
|
|
157
|
+
Phát hiện **main artifact** lỗi thời. So `template_version` của artifact với version đọc thẳng từ template. Versioned: `==` → up-to-date; `!=` → out-dated `(vX → vY)` → migrate. Legacy thiếu version → presence-check (đủ required `##` headings + không còn section đã `migrations.remove`): conform → stamp version; lệch → out-dated. Chỉ phát hiện + stamp, KHÔNG migrate. Scope theo arg (1 main type / list) hoặc mọi main type.
|
|
158
158
|
|
|
159
159
|
#### `/artifact-migrate [path]`
|
|
160
|
-
Migrate artifact lỗi thời lên structure mới (
|
|
160
|
+
Migrate **main artifact** lỗi thời lên structure mới (mọi main type). Tự chạy `/artifact-audit` (classify-only) để phát hiện, rồi áp delta từ block `migrations` của template: **add** required section thiếu (skeleton từ template; nội dung mới → interview hoặc `NEEDS_CLARIFY`, không bịa), **remove** section đã `migrations.remove` (có confirm; giữ content tác giả khác), **update** section đổi format (giữ section + ngữ nghĩa, vd ASCII → Mermaid; show cũ + đề xuất mới, không bịa). Rename = remove+add → hỏi carry-over. Single-artifact, không cascade. Pre-flight git clean — rollback dùng git, không `.bak`. No-op nếu đã up-to-date.
|
|
161
161
|
|
|
162
162
|
---
|
|
163
163
|
|
|
@@ -172,8 +172,8 @@ Migrate artifact lỗi thời lên structure mới (generic mọi type). Tự ch
|
|
|
172
172
|
| `/spec-brownfield-component` | `.specs/main/component/{C-XXX}-*/crd.md + cdd.md` |
|
|
173
173
|
| `/spec-brownfield-feature` | `.specs/main/feature/{F-XXX}-*/frd.md + fdd.md` |
|
|
174
174
|
| `/spec-tsd` | `.specs/main/feature/{F-XXX}-*/tsd.md` |
|
|
175
|
-
| `/artifact-audit` | *(báo cáo out-dated; + stamp `template_version` cho artifact legacy conform)* |
|
|
176
|
-
| `/artifact-migrate` | *(modify in-place artifact lỗi thời lên structure mới + set `template_version`)* |
|
|
175
|
+
| `/artifact-audit` | *(báo cáo out-dated; + stamp `template_version` cho main artifact legacy conform)* |
|
|
176
|
+
| `/artifact-migrate` | *(modify in-place main artifact lỗi thời lên structure mới + set `template_version`)* |
|
|
177
177
|
| `/spec-new` | `.specs/integrations/{slug}/spec.md` |
|
|
178
178
|
| `/spec-tech` | `.specs/integrations/{slug}/tech.md` |
|
|
179
179
|
| `/spec-test` | `.specs/integrations/{slug}/test.md`, cascade: `feature/{F-XXX}/tsd.md` |
|
package/package.json
CHANGED
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: artifact-audit
|
|
3
|
-
description: Audit artifacts trong .specs/ xem có lỗi thời so với template không. So `template_version` của artifact với `template_version` hiện tại đọc thẳng từ template (.claude/templates/). Versioned khớp → up-to-date, lệch → out-dated (in vX → vY). Artifact thiếu version (sinh trước versioning) → đối chiếu structure với template: khớp thì stamp version, lệch thì flag out-dated. KHÔNG tự migrate — chỉ stamp khi chắc chắn khớp + báo cáo. Nhận tùy chọn 1 hay nhiều type làm scope (vd `frd`, `frd,
|
|
3
|
+
description: Audit MAIN artifacts trong .specs/main/ xem có lỗi thời so với template không (chỉ main artifacts — prd/domain/sad/frd/fdd/tsd/crd/cdd; integration artifacts ngoài scope). So `template_version` của artifact với `template_version` hiện tại đọc thẳng từ template (.claude/templates/). Versioned khớp → up-to-date, lệch → out-dated (in vX → vY). Artifact thiếu version (sinh trước versioning) → đối chiếu structure với template: khớp thì stamp version, lệch thì flag out-dated. KHÔNG tự migrate — chỉ stamp khi chắc chắn khớp + báo cáo. Nhận tùy chọn 1 hay nhiều main type làm scope (vd `frd`, `frd,crd`); không có arg → audit mọi main type.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# artifact-audit
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
Trả lời một câu hỏi: **artifact nào trong `.specs/` đã lỗi thời so với template mới nhất?**
|
|
10
|
+
Trả lời một câu hỏi: **main artifact nào trong `.specs/main/` đã lỗi thời so với template mới nhất?**
|
|
11
|
+
|
|
12
|
+
> **Scope = chỉ main artifacts** (`prd`, `domain`, `sad`, `frd`, `fdd`, `tsd`, `crd`, `cdd` — đều nằm dưới `.specs/main/`). Integration artifacts (`spec`, `tech`, `test`, `plan`, `todo`, `techdebt` dưới `.specs/integrations/`) **không** thuộc scope của skill này — chúng là ephemeral và immutable sau khi `done`, không audit/migrate theo version.
|
|
11
13
|
|
|
12
14
|
Cơ chế (xem `conventions.md` §7 Template Versioning):
|
|
13
15
|
- **Nguồn sự thật** = `template_version` trong frontmatter template đang cài (`.claude/templates/...`). Đọc thẳng lúc chạy — không manifest, không cache.
|
|
14
16
|
- Mỗi artifact mang `template_version` (copy lúc CREATE bởi skill sinh nó). Audit so số artifact với số template.
|
|
15
17
|
|
|
16
|
-
Skill này **chỉ phát hiện + stamp legacy**, **KHÔNG migrate**. Việc đưa structure artifact lên format mới là của `/artifact-migrate` (
|
|
18
|
+
Skill này **chỉ phát hiện + stamp legacy**, **KHÔNG migrate**. Việc đưa structure artifact lên format mới là của `/artifact-migrate` (cho mọi main type).
|
|
17
19
|
|
|
18
20
|
## When to Use
|
|
19
21
|
|
|
20
22
|
- Sau khi `git pull` kit mới (template có thể đã bump version) → xem artifact nào cần migrate.
|
|
21
|
-
- Audit định kỳ một type cụ thể (`/artifact-audit frd`) hoặc
|
|
22
|
-
- Sau khi bump `template_version` của một template → tìm mọi artifact giờ thành `out-dated`.
|
|
23
|
-
- Onboarding repo cũ → stamp version cho artifact legacy khớp structure, lọc ra cái cần migrate.
|
|
23
|
+
- Audit định kỳ một main type cụ thể (`/artifact-audit frd`) hoặc mọi main type (`/artifact-audit`).
|
|
24
|
+
- Sau khi bump `template_version` của một template → tìm mọi main artifact giờ thành `out-dated`.
|
|
25
|
+
- Onboarding repo cũ → stamp version cho main artifact legacy khớp structure, lọc ra cái cần migrate.
|
|
24
26
|
|
|
25
27
|
## When NOT to Use
|
|
26
28
|
|
|
@@ -32,7 +34,7 @@ Skill này **chỉ phát hiện + stamp legacy**, **KHÔNG migrate**. Việc đ
|
|
|
32
34
|
|
|
33
35
|
## Type → template map
|
|
34
36
|
|
|
35
|
-
Type của artifact resolve theo **filename
|
|
37
|
+
Type của main artifact resolve theo **filename**. Mỗi type map tới đúng một template:
|
|
36
38
|
|
|
37
39
|
| Filename | type | Template (`.claude/templates/...`) |
|
|
38
40
|
| --- | --- | --- |
|
|
@@ -44,14 +46,8 @@ Type của artifact resolve theo **filename** (integration artifact không có f
|
|
|
44
46
|
| `tsd.md` | tsd | `main/feature/tsd-template.md` |
|
|
45
47
|
| `crd.md` | crd | `main/component/crd-template.md` |
|
|
46
48
|
| `cdd.md` | cdd | `main/component/cdd-template.md` |
|
|
47
|
-
| `spec.md` | spec | `integrations/spec-template.md` |
|
|
48
|
-
| `tech.md` | tech | `integrations/tech-template.md` |
|
|
49
|
-
| `test.md` | test | `integrations/test-template.md` |
|
|
50
|
-
| `plan.md` | plan | `integrations/plan-template.md` |
|
|
51
|
-
| `todo.md` | todo | `integrations/todo-template.md` |
|
|
52
|
-
| `techdebt.md` | techdebt | `integrations/techdebt-template.md` |
|
|
53
49
|
|
|
54
|
-
File không khớp bảng (vd `notes.md`, `*.bak`) → bỏ qua
|
|
50
|
+
**Chỉ main artifacts.** Integration artifacts (`spec`, `tech`, `test`, `plan`, `todo`, `techdebt`) **không** thuộc scope — gặp file integration thì bỏ qua. File không khớp bảng (vd `notes.md`, `*.bak`) → cũng bỏ qua.
|
|
55
51
|
|
|
56
52
|
---
|
|
57
53
|
|
|
@@ -59,8 +55,8 @@ File không khớp bảng (vd `notes.md`, `*.bak`) → bỏ qua, không phải a
|
|
|
59
55
|
|
|
60
56
|
### Bước 0: Resolve scope
|
|
61
57
|
|
|
62
|
-
- **ARGUMENT là 1 type hoặc list** (vd `frd`, `frd,
|
|
63
|
-
- **Không có ARGUMENT** → audit **mọi** type trong map.
|
|
58
|
+
- **ARGUMENT là 1 main type hoặc list** (vd `frd`, `frd,crd`) → chỉ audit các type đó. Type lạ hoặc type integration (`spec`/`tech`/`test`/`plan`/`todo`/`techdebt`, không có trong map) → cảnh báo và bỏ qua type đó.
|
|
59
|
+
- **Không có ARGUMENT** → audit **mọi** main type trong map.
|
|
64
60
|
|
|
65
61
|
### Bước 1: Đọc current version của template
|
|
66
62
|
|
|
@@ -73,13 +69,11 @@ Lưu bảng `currentVersion[type]`.
|
|
|
73
69
|
|
|
74
70
|
### Bước 2: Discover artifacts
|
|
75
71
|
|
|
76
|
-
Quét artifacts trong
|
|
77
|
-
- `.specs/main/**` (prd, domain, sad, và feature/component artifacts)
|
|
78
|
-
- `.specs/integrations/**` (spec, tech, test, plan, todo, techdebt)
|
|
72
|
+
Quét **chỉ** main artifacts trong `.specs/main/**` (prd, domain, sad, và feature/component artifacts).
|
|
79
73
|
|
|
80
|
-
**Bỏ qua
|
|
74
|
+
**Bỏ qua:**
|
|
75
|
+
- Toàn bộ `.specs/integrations/**` — integration artifacts ngoài scope skill này (ephemeral + immutable sau `done`; không audit/migrate theo version).
|
|
81
76
|
- `.specs/archive/**`, `.specs/removed/**`, file `*.bak.*`, file không khớp type map.
|
|
82
|
-
- **Integration folder đã `done`**: nếu `.specs/integrations/{X}/spec.md` có `status: done` → bỏ qua **toàn bộ folder đó** (spec/tech/test/plan/todo/techdebt). Integration artifacts là **immutable sau khi done** (conventions §7 Versioning) — không migrate record bất biến. Folder integration đang active (spec chưa `done`) và mọi **main artifact** thì vẫn audit/migrate bình thường.
|
|
83
77
|
|
|
84
78
|
Với mỗi file khớp: resolve type theo filename, đọc frontmatter để lấy `template_version` (có thể thiếu).
|
|
85
79
|
|
|
@@ -140,8 +134,8 @@ In bảng phân nhóm (xem Output Format). Skill **không** migrate, **không**
|
|
|
140
134
|
## Output Format
|
|
141
135
|
|
|
142
136
|
```
|
|
143
|
-
ARTIFACT AUDIT — scope: {all | frd,
|
|
144
|
-
Current template versions: prd v1 · domain v1 · sad v1 · frd v2 ·
|
|
137
|
+
ARTIFACT AUDIT — scope: {all main | frd, crd}
|
|
138
|
+
Current template versions: prd v1 · domain v1 · sad v1 · frd v2 · crd v1 · ...
|
|
145
139
|
|
|
146
140
|
OUT-DATED ({n}) — cần migrate:
|
|
147
141
|
feature/F-002-payment/frd.md frd v1 → v2 → /artifact-migrate
|
|
@@ -149,7 +143,7 @@ OUT-DATED ({n}) — cần migrate:
|
|
|
149
143
|
|
|
150
144
|
STAMPED ({n}) — legacy khớp structure, vừa ghi template_version:
|
|
151
145
|
feature/F-001-auth/frd.md frd → v2
|
|
152
|
-
|
|
146
|
+
component/C-001-core/crd.md crd → v1
|
|
153
147
|
|
|
154
148
|
UP-TO-DATE ({n}): {đếm, liệt kê path ngắn gọn hoặc gập lại nếu nhiều}
|
|
155
149
|
|
|
@@ -173,14 +167,14 @@ Bước tiếp theo (nếu có out-dated):
|
|
|
173
167
|
- Stamp `template_version` cho artifact mà chưa đối chiếu structure với template.
|
|
174
168
|
- Tự sửa structure / nội dung artifact (vượt phạm vi — đó là migration skill).
|
|
175
169
|
- Flag out-dated chỉ vì artifact có thêm sub-section / nội dung ngoài template (thừa ≠ lỗi thời; chỉ thiếu/đổi-tên/đổi-format mới tính).
|
|
176
|
-
- Audit/stamp artifact
|
|
170
|
+
- Audit/stamp artifact ngoài scope: bất kỳ file nào trong `.specs/integrations/` (integration artifacts ngoài scope), `.specs/archive/`, `.specs/removed/` — bỏ qua hết.
|
|
177
171
|
- Đọc version từ một manifest/cache thay vì đọc thẳng frontmatter template.
|
|
178
172
|
|
|
179
173
|
## Verification
|
|
180
174
|
|
|
181
|
-
- [ ] Scope resolve đúng từ argument (1 type / list / mọi type)
|
|
175
|
+
- [ ] Scope = **chỉ main artifacts** (`.specs/main/**`); resolve đúng từ argument (1 main type / list / mọi main type)
|
|
182
176
|
- [ ] Current version đọc thẳng từ frontmatter template tại `.claude/templates/...` (không manifest)
|
|
183
|
-
- [ ] Bỏ qua `.specs/archive/`, `.specs/removed/`, `*.bak.*`, file không khớp type map
|
|
177
|
+
- [ ] Bỏ qua toàn bộ `.specs/integrations/`, `.specs/archive/`, `.specs/removed/`, `*.bak.*`, và file không khớp type map
|
|
184
178
|
- [ ] Versioned: `==` → up-to-date; `!=` → out-dated `(vX → vY)` → migrate
|
|
185
179
|
- [ ] Unversioned: conformance là quan hệ bao hàm (artifact chứa đủ structure bắt buộc; thừa sub-section/nội dung không khai báo remove KHÔNG phải lỗi thời); 2 dấu hiệu out-dated = thiếu required heading / section `migrations.remove` còn sót
|
|
186
180
|
- [ ] Conform → stamp; out-dated → tóm tắt đúng dấu hiệu (thiếu required heading gì / section deprecated nào còn sót). Lưu ý: presence-check KHÔNG bắt format-update (blind spot unversioned)
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: artifact-migrate
|
|
3
|
-
description: Migrate artifact trong .specs/ lên structure template mới nhất
|
|
3
|
+
description: Migrate MAIN artifact trong .specs/main/ lên structure template mới nhất (chỉ main artifacts — prd/domain/sad/frd/fdd/tsd/crd/cdd; integration artifacts ngoài scope). Tự chạy /artifact-audit (classify-only, scoped) để phát hiện out-dated, rồi áp delta từ block `migrations` của template — add section thiếu, remove section deprecated, update format section (vd ASCII→Mermaid) — set template_version = current. Tương tác: confirm add/remove/update, hỏi carry-over khi rename, section nội dung mới thì interview hoặc NEEDS_CLARIFY (không bịa). Single-artifact, KHÔNG cascade. Nhận tùy chọn 1 main artifact (path); không có arg → quét mọi main artifact, migrate từng cái có confirm + skip.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# artifact-migrate
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
Đưa một artifact (hoặc toàn bộ) **lỗi thời** lên đúng structure của template mới nhất, rồi cập nhật `template_version`. Đây là vế **fix** đối xứng với `/artifact-audit` (vế **detect**).
|
|
10
|
+
Đưa một main artifact (hoặc toàn bộ main artifacts) **lỗi thời** lên đúng structure của template mới nhất, rồi cập nhật `template_version`. Đây là vế **fix** đối xứng với `/artifact-audit` (vế **detect**).
|
|
11
|
+
|
|
12
|
+
> **Scope = chỉ main artifacts** (`prd`, `domain`, `sad`, `frd`, `fdd`, `tsd`, `crd`, `cdd` — đều dưới `.specs/main/`). Integration artifacts (`spec`, `tech`, `test`, `plan`, `todo`, `techdebt`) **không** thuộc scope — ephemeral + immutable sau `done`, không migrate theo version.
|
|
11
13
|
|
|
12
14
|
Cơ chế (xem `conventions.md` §7 Template Versioning):
|
|
13
15
|
- **Required section hiện tại** = body `##` headings của template (deterministic theo level; `###` = instance).
|
|
@@ -30,11 +32,11 @@ Cơ chế (xem `conventions.md` §7 Template Versioning):
|
|
|
30
32
|
|
|
31
33
|
## Type → template map
|
|
32
34
|
|
|
33
|
-
Resolve type theo **filename** (giống `/artifact-audit`
|
|
35
|
+
Resolve type của main artifact theo **filename** (giống `/artifact-audit`). Mỗi type map tới đúng một template tại `.claude/templates/...`:
|
|
34
36
|
|
|
35
|
-
`prd.md`→`main/prd-template.md` · `domain.md`→`main/domain-template.md` · `sad.md`→`main/sad-template.md` · `frd.md`→`main/feature/frd-template.md` · `fdd.md`→`main/feature/fdd-template.md` · `tsd.md`→`main/feature/tsd-template.md` · `crd.md`→`main/component/crd-template.md` · `cdd.md`→`main/component/cdd-template.md`
|
|
37
|
+
`prd.md`→`main/prd-template.md` · `domain.md`→`main/domain-template.md` · `sad.md`→`main/sad-template.md` · `frd.md`→`main/feature/frd-template.md` · `fdd.md`→`main/feature/fdd-template.md` · `tsd.md`→`main/feature/tsd-template.md` · `crd.md`→`main/component/crd-template.md` · `cdd.md`→`main/component/cdd-template.md`
|
|
36
38
|
|
|
37
|
-
File không khớp map → bỏ qua.
|
|
39
|
+
**Chỉ main artifacts.** Integration artifacts (`spec`/`tech`/`test`/`plan`/`todo`/`techdebt`) ngoài scope → bỏ qua. File không khớp map → cũng bỏ qua.
|
|
38
40
|
|
|
39
41
|
---
|
|
40
42
|
|
|
@@ -42,8 +44,8 @@ File không khớp map → bỏ qua.
|
|
|
42
44
|
|
|
43
45
|
### Bước 0: Resolve scope
|
|
44
46
|
|
|
45
|
-
- **ARGUMENT là path tới 1 artifact** → migrate riêng nó. Nếu artifact
|
|
46
|
-
- **Không có ARGUMENT** → quét `.specs/main
|
|
47
|
+
- **ARGUMENT là path tới 1 main artifact** → migrate riêng nó. Nếu path là integration artifact (`.specs/integrations/...`) → **DỪNG**, báo "integration artifact ngoài scope — chỉ migrate main artifacts". Nếu nằm trong `.specs/archive`/`.specs/removed` → **DỪNG**, báo "artifact đóng băng (immutable record) — không migrate".
|
|
48
|
+
- **Không có ARGUMENT** → quét **chỉ** `.specs/main/**`, áp **đúng skip list của `/artifact-audit`** (bỏ toàn bộ `.specs/integrations/`, archive/removed, `*.bak.*`).
|
|
47
49
|
|
|
48
50
|
### Bước 1: Pre-flight — working tree clean
|
|
49
51
|
|
|
@@ -94,7 +96,7 @@ User confirm (toàn bộ / từng item / skip artifact). **Section nội dung m
|
|
|
94
96
|
- Áp UPDATE format: thay nội dung section bằng bản chuyển format đã confirm (giữ section + ngữ nghĩa).
|
|
95
97
|
- **Giữ nguyên** mọi sub-section / content tác giả **không nằm trong `remove`/`update`** (superset rule).
|
|
96
98
|
- Set frontmatter `template_version` = current.
|
|
97
|
-
-
|
|
99
|
+
- Main artifact có `## Change History` ở cuối → append entry, operation = `manual`:
|
|
98
100
|
```markdown
|
|
99
101
|
### {YYYY-MM-DD} — manual — migrate
|
|
100
102
|
|
|
@@ -138,12 +140,13 @@ SKIPPED / up-to-date ({n})
|
|
|
138
140
|
- Xóa section không nằm trong `migrations.remove` (vi phạm superset).
|
|
139
141
|
- Tự remap ID / đụng tới artifact khác (migrate là single-artifact, không cascade).
|
|
140
142
|
- Chạy khi working tree dirty (mất đường rollback).
|
|
141
|
-
- Migrate artifact
|
|
143
|
+
- Migrate artifact ngoài scope: bất kỳ file nào trong `.specs/integrations/` (integration artifacts ngoài scope), `.specs/archive`, `.specs/removed` (phải skip / DỪNG).
|
|
142
144
|
- Migrate artifact đã up-to-date (phải no-op sớm).
|
|
143
145
|
- Tự cài lại logic detect thay vì dùng audit classify-only.
|
|
144
146
|
|
|
145
147
|
## Verification
|
|
146
148
|
|
|
149
|
+
- [ ] Scope = **chỉ main artifacts** (`.specs/main/**`); arg là integration artifact → DỪNG, no-arg chỉ quét `.specs/main/**`
|
|
147
150
|
- [ ] Pre-flight: working tree clean (hoặc user confirm khi không phải git repo)
|
|
148
151
|
- [ ] Detect bằng `/artifact-audit` classify-only, scoped theo target; version `==` → up-to-date → no-op sớm; `!=` → migrate
|
|
149
152
|
- [ ] Required `##` thiếu → ADD (skeleton từ body template); section `migrations.remove` còn sót → REMOVE (confirm)
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -118,7 +118,7 @@ Invoke `planning-and-task-breakdown` với context đã load. Skill đó sẽ th
|
|
|
118
118
|
|
|
119
119
|
### plan.md
|
|
120
120
|
|
|
121
|
-
Dùng `.claude/templates/integrations/plan-template.md` làm skeleton, điền nội dung từ breakdown vào từng section. Frontmatter
|
|
121
|
+
Dùng `.claude/templates/integrations/plan-template.md` làm skeleton, điền nội dung từ breakdown vào từng section. Frontmatter copy từ template (plan.md là integration artifact — **không** mang `template_version`; versioning chỉ áp dụng cho main artifacts, xem `conventions.md` §7).
|
|
122
122
|
|
|
123
123
|
**Lưu ý format:**
|
|
124
124
|
- Task ID dùng `·` (middle dot), không dùng `—`
|
|
@@ -128,7 +128,7 @@ Dùng `.claude/templates/integrations/plan-template.md` làm skeleton, điền n
|
|
|
128
128
|
|
|
129
129
|
### todo.md
|
|
130
130
|
|
|
131
|
-
Dùng `.claude/templates/integrations/todo-template.md` làm skeleton, điền nội dung từ breakdown vào từng section. Frontmatter
|
|
131
|
+
Dùng `.claude/templates/integrations/todo-template.md` làm skeleton, điền nội dung từ breakdown vào từng section. Frontmatter copy từ template (todo.md là integration artifact — không mang `template_version`).
|
|
132
132
|
|
|
133
133
|
---
|
|
134
134
|
|
|
@@ -146,4 +146,4 @@ Nếu trong quá trình breakdown phát hiện delta cần cập nhật `sad.md`
|
|
|
146
146
|
- [ ] plan.md có section **Dependency Graph**
|
|
147
147
|
- [ ] Mỗi task có đủ: Mục tiêu / depends / Các bước / Verification
|
|
148
148
|
- [ ] Không viết code trong suốt quá trình
|
|
149
|
-
- [ ] plan.md + todo.md
|
|
149
|
+
- [ ] plan.md + todo.md (integration) KHÔNG mang `template_version` (versioning chỉ cho main artifacts)
|
package/skills/spec-new/SKILL.md
CHANGED
|
@@ -343,7 +343,7 @@ Chỉ tiến hành Bước 7 sau khi user confirm. Nếu user yêu cầu chỉnh
|
|
|
343
343
|
|
|
344
344
|
Tạo thư mục `.specs/integrations/{NNN}-{slug}/` nếu chưa có.
|
|
345
345
|
|
|
346
|
-
**[7.1] Ghi spec.md** với status `approved` (không phải `draft` — human đã confirm ở Bước 6 chính là approval). Frontmatter `features` và `components` phải được điền theo những gì đã nhận diện ở Bước 2
|
|
346
|
+
**[7.1] Ghi spec.md** với status `approved` (không phải `draft` — human đã confirm ở Bước 6 chính là approval). Frontmatter `features` và `components` phải được điền theo những gì đã nhận diện ở Bước 2. (spec.md là integration artifact — **không** mang `template_version`; versioning chỉ áp dụng cho main artifacts, xem `conventions.md` §7.)
|
|
347
347
|
|
|
348
348
|
**[7.2] Auto-apply mỗi Changes block** vào main artifact tương ứng. Thứ tự apply (để tránh forward reference): `prd.md` → `domain.md` → `sad.md` → `component/*/crd.md` → `feature/*/frd.md`.
|
|
349
349
|
|
|
@@ -443,4 +443,4 @@ Sau khi user confirm (Bước 7):
|
|
|
443
443
|
- [ ] Auto-apply chạy theo thứ tự prd → domain → sad → crd → frd
|
|
444
444
|
- [ ] Mỗi artifact bị touched có entry mới được append vào `## Change History` (xem `conventions.md` §5.5)
|
|
445
445
|
- [ ] Fail-safe: nếu apply fail thì không ghi spec.md (rollback luôn Change History entries)
|
|
446
|
-
- [ ]
|
|
446
|
+
- [ ] Main artifact create (frd/crd mới) có `template_version` copy từ template; artifact update giữ nguyên version cũ. spec.md (integration) KHÔNG mang `template_version`
|
|
@@ -216,7 +216,7 @@ Chỉ ghi file sau khi user confirm. Nếu user yêu cầu chỉnh sửa → c
|
|
|
216
216
|
|
|
217
217
|
### Bước 6: Save + Auto-cascade
|
|
218
218
|
|
|
219
|
-
**[6.1] Ghi `.specs/integrations/{slug}/tech.md`** với status `approved` (không phải `draft` — human đã confirm ở Bước 5 chính là approval). Frontmatter `features` và `components` mirror từ `spec.md
|
|
219
|
+
**[6.1] Ghi `.specs/integrations/{slug}/tech.md`** với status `approved` (không phải `draft` — human đã confirm ở Bước 5 chính là approval). Frontmatter `features` và `components` mirror từ `spec.md`. (tech.md là integration artifact — **không** mang `template_version`; versioning chỉ áp dụng cho main artifacts, xem `conventions.md` §7.)
|
|
220
220
|
|
|
221
221
|
**[6.2] Auto-apply mỗi Changes block** vào main artifact tương ứng. Thứ tự apply (để tránh forward reference): `sad.md` → `domain.md` → `component/*/cdd.md` → `feature/*/fdd.md`.
|
|
222
222
|
|
|
@@ -315,4 +315,4 @@ Sau khi user confirm (Bước 6):
|
|
|
315
315
|
- [ ] Auto-apply chạy theo thứ tự sad → domain → cdd → fdd
|
|
316
316
|
- [ ] Mỗi artifact bị touched có entry mới được append vào `## Change History` (conventions §5.5)
|
|
317
317
|
- [ ] Fail-safe: nếu apply fail thì không ghi tech.md (rollback luôn Change History entries)
|
|
318
|
-
- [ ]
|
|
318
|
+
- [ ] Main artifact create (cdd/fdd mới) có `template_version` copy từ template; artifact update giữ nguyên version cũ. tech.md (integration) KHÔNG mang `template_version`
|
|
@@ -284,7 +284,7 @@ Chỉ tiến hành Bước 6 sau khi QC confirm.
|
|
|
284
284
|
|
|
285
285
|
### Bước 6: Save + Auto-cascade
|
|
286
286
|
|
|
287
|
-
**[6.1] Ghi `.specs/integrations/{slug}/test.md`** với status `approved` (không phải `draft` — human đã confirm ở Bước 5 chính là approval). Frontmatter `features` mirror từ `spec.md
|
|
287
|
+
**[6.1] Ghi `.specs/integrations/{slug}/test.md`** với status `approved` (không phải `draft` — human đã confirm ở Bước 5 chính là approval). Frontmatter `features` mirror từ `spec.md`. (test.md là integration artifact — **không** mang `template_version`; versioning chỉ áp dụng cho main artifacts, xem `conventions.md` §7.)
|
|
288
288
|
|
|
289
289
|
**[6.2] Auto-apply mỗi Changes block** vào `feature/{F-XXX}/tsd.md` tương ứng. Thứ tự apply: theo thứ tự xuất hiện trong frontmatter `features` (deterministic, không có forward reference giữa các feature tsd.md). Bỏ qua feature có operation `no-op` trong Cascade Summary.
|
|
290
290
|
|
|
@@ -381,4 +381,4 @@ Sau khi QC confirm (Bước 6):
|
|
|
381
381
|
- [ ] Mỗi tsd.md bị touched có entry mới trong `## Change History` (conventions §5.5)
|
|
382
382
|
- [ ] Fail-safe: nếu apply fail thì không ghi integration test.md (rollback luôn Change History entries)
|
|
383
383
|
- [ ] Mỗi feature tsd.md mới có status `draft` (separate lifecycle)
|
|
384
|
-
- [ ]
|
|
384
|
+
- [ ] Main artifact tsd.md create có `template_version` copy từ template; tsd.md update giữ nguyên version cũ. test.md (integration) KHÔNG mang `template_version`
|
package/skills-overview.md
CHANGED
|
@@ -220,26 +220,26 @@ Nhóm skill dọn dẹp / migrate artifacts hiện có sau khi template được
|
|
|
220
220
|
|
|
221
221
|
| Command | Reads | Writes |
|
|
222
222
|
| --- | --- | --- |
|
|
223
|
-
| `/artifact-audit [type]` | `.specs/**` artifacts, `.claude/templates/*-template.md` | *(báo cáo; + stamp `template_version` cho artifact legacy conform)* |
|
|
224
|
-
| `/artifact-migrate [path]` | `.specs/**` artifacts, `.claude/templates/*-template.md` (block `migrations`) | artifact được migrate (structure + `template_version`) |
|
|
223
|
+
| `/artifact-audit [type]` | `.specs/main/**` artifacts, `.claude/templates/main/*-template.md` | *(báo cáo; + stamp `template_version` cho main artifact legacy conform)* |
|
|
224
|
+
| `/artifact-migrate [path]` | `.specs/main/**` artifacts, `.claude/templates/main/*-template.md` (block `migrations`) | main artifact được migrate (structure + `template_version`) |
|
|
225
225
|
|
|
226
226
|
### `/artifact-audit [type]`
|
|
227
227
|
|
|
228
|
-
Phát hiện artifact lỗi thời so với template (xem `conventions.md` §7 Template Versioning). So `template_version` của artifact với `template_version` đọc thẳng từ template tại `.claude/templates/` — không manifest, không cache.
|
|
228
|
+
Phát hiện **main artifact** lỗi thời so với template (xem `conventions.md` §7 Template Versioning). So `template_version` của artifact với `template_version` đọc thẳng từ template tại `.claude/templates/main/` — không manifest, không cache. **Chỉ main artifacts** (`prd`/`domain`/`sad`/`frd`/`fdd`/`tsd`/`crd`/`cdd`); integration artifacts ngoài scope.
|
|
229
229
|
|
|
230
|
-
**Scope:** argument là 1 type (`/artifact-audit frd`) hoặc list (`frd,
|
|
230
|
+
**Scope:** argument là 1 main type (`/artifact-audit frd`) hoặc list (`frd,crd`); không có arg → audit mọi main type. Type resolve theo **filename**.
|
|
231
231
|
|
|
232
232
|
**Phân loại mỗi artifact:**
|
|
233
233
|
- Có `template_version` → `==`: **up-to-date**; `!=`: **out-dated** `(vX → vY)` → migrate.
|
|
234
234
|
- Thiếu version (legacy) → presence-check (đủ required `##` + không còn section `migrations.remove`): conform → **stamp** `template_version` (có confirm); lệch → **out-dated** + tóm tắt phần thiếu.
|
|
235
235
|
|
|
236
|
-
**Ranh giới:** chỉ phát hiện + stamp legacy conform. **KHÔNG migrate** — đổi structure là việc của `/artifact-migrate`. Bỏ qua `.specs/archive
|
|
236
|
+
**Ranh giới:** chỉ phát hiện + stamp legacy conform. **KHÔNG migrate** — đổi structure là việc của `/artifact-migrate`. Bỏ qua toàn bộ `.specs/integrations/`, `.specs/archive/`, `.specs/removed/`.
|
|
237
237
|
|
|
238
238
|
### `/artifact-migrate [path]`
|
|
239
239
|
|
|
240
|
-
Migrate artifact lỗi thời lên structure template mới nhất,
|
|
240
|
+
Migrate **main artifact** lỗi thời lên structure template mới nhất, cho mọi main type (vế **fix** đối xứng với `/artifact-audit` vế **detect**). Integration artifacts ngoài scope.
|
|
241
241
|
|
|
242
|
-
**Scope:** arg = 1 artifact (path) → migrate riêng nó; không arg → quét
|
|
242
|
+
**Scope:** arg = 1 main artifact (path) → migrate riêng nó; không arg → quét mọi main artifact trong `.specs/main/`, migrate từng cái có confirm + skip.
|
|
243
243
|
|
|
244
244
|
**Quy trình:** pre-flight git clean → **tự chạy `/artifact-audit` classify-only (scoped)** để phát hiện out-dated (up-to-date → no-op sớm) → đọc block `migrations` của template lấy delta `add`/`remove`/`update` → dry-run + confirm → apply (set `template_version` = current; main artifact thêm Change History `manual`/migrate).
|
|
245
245
|
|
|
@@ -6,10 +6,6 @@ features: []
|
|
|
6
6
|
components: []
|
|
7
7
|
status: draft
|
|
8
8
|
created: {YYYY-MM-DD}
|
|
9
|
-
template_version: 1
|
|
10
|
-
migrations:
|
|
11
|
-
- to: 1
|
|
12
|
-
note: "baseline"
|
|
13
9
|
referenced_by:
|
|
14
10
|
- conventions.md > 4. Integration Artifacts > 4.5 plan.md > Cấu trúc
|
|
15
11
|
- skills/plan/SKILL.md > Output Format > plan.md
|
|
@@ -6,10 +6,6 @@ features: []
|
|
|
6
6
|
components: []
|
|
7
7
|
status: draft
|
|
8
8
|
created: {YYYY-MM-DD}
|
|
9
|
-
template_version: 1
|
|
10
|
-
migrations:
|
|
11
|
-
- to: 1
|
|
12
|
-
note: "baseline"
|
|
13
9
|
referenced_by:
|
|
14
10
|
- conventions.md > 4. Integration Artifacts > 4.3 spec.md > Cấu trúc
|
|
15
11
|
- skills/spec-new/SKILL.md > Process > Bước 5: Write — sinh draft
|
|
@@ -6,10 +6,6 @@ features: []
|
|
|
6
6
|
components: []
|
|
7
7
|
status: draft
|
|
8
8
|
created: {YYYY-MM-DD}
|
|
9
|
-
template_version: 1
|
|
10
|
-
migrations:
|
|
11
|
-
- to: 1
|
|
12
|
-
note: "baseline"
|
|
13
9
|
referenced_by:
|
|
14
10
|
- conventions.md > 4. Integration Artifacts > 4.4 tech.md > Cấu trúc
|
|
15
11
|
- skills/spec-tech/SKILL.md > Process > Bước 4: Write — sinh draft
|
|
@@ -5,10 +5,6 @@ title: "{title}"
|
|
|
5
5
|
features: []
|
|
6
6
|
status: draft
|
|
7
7
|
created: {YYYY-MM-DD}
|
|
8
|
-
template_version: 1
|
|
9
|
-
migrations:
|
|
10
|
-
- to: 1
|
|
11
|
-
note: "baseline"
|
|
12
8
|
referenced_by:
|
|
13
9
|
- conventions.md > 4. Integration Artifacts > 4.7 test.md > Cấu trúc
|
|
14
10
|
- skills/spec-test/SKILL.md > Process > Bước 4: Write — sinh draft
|
|
@@ -5,10 +5,6 @@ title: "{title}"
|
|
|
5
5
|
features: []
|
|
6
6
|
components: []
|
|
7
7
|
created: {YYYY-MM-DD}
|
|
8
|
-
template_version: 1
|
|
9
|
-
migrations:
|
|
10
|
-
- to: 1
|
|
11
|
-
note: "baseline"
|
|
12
8
|
referenced_by:
|
|
13
9
|
- conventions.md > 4. Integration Artifacts > 4.6 todo.md > Cấu trúc
|
|
14
10
|
- skills/plan/SKILL.md > Output Format > todo.md
|