spec-lite 1.1.2 → 1.1.4

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/bin/cli.js CHANGED
@@ -20,6 +20,10 @@ if (command === 'install') {
20
20
  // Copy templates → .claude/templates/
21
21
  cpSync(join(pkgRoot, 'templates'), join(claudeDir, 'templates'), { recursive: true })
22
22
  console.log('✓ templates → .claude/templates/')
23
+
24
+ // Copy references → .claude/references/
25
+ cpSync(join(pkgRoot, 'references'), join(claudeDir, 'references'), { recursive: true })
26
+ console.log('✓ references → .claude/references/')
23
27
  } else {
24
28
  console.log('Usage: npx spec-lite install')
25
29
  process.exit(1)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-lite",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Spec-driven development kit for Claude Code",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,6 +38,60 @@ Chọn số integration:
38
38
  - Nếu chỉ có 1 integration có task pending → chọn luôn, không hỏi
39
39
  - Nếu tất cả đều done → thông báo: "Tất cả integration đã hoàn thành."
40
40
 
41
+ ### Bước 0b: Tạo branch và chọn chế độ worktree
42
+
43
+ **Tạo branch (bắt buộc):**
44
+
45
+ Luôn tạo branch `build/{integration-slug}` trước khi build, bất kể có dùng worktree hay không. Điều này đảm bảo `/review` luôn có base để diff chính xác.
46
+
47
+ ```bash
48
+ git checkout -b feat/{slug}
49
+ ```
50
+
51
+ Nếu branch đã tồn tại → checkout branch cũ:
52
+
53
+ ```bash
54
+ git checkout feat/{slug}
55
+ ```
56
+
57
+ ---
58
+
59
+ **Chọn worktree (tùy chọn):**
60
+
61
+ Hỏi user:
62
+
63
+ ```
64
+ Bạn muốn build trong worktree riêng cho integration này không? (y/n)
65
+ ```
66
+
67
+ **Nếu chọn "n":** Tiếp tục build trong working directory hiện tại trên branch vừa tạo.
68
+
69
+ **Nếu chọn "y":**
70
+
71
+ 1. **Tạo worktree mới** từ branch vừa tạo
72
+ - Đường dẫn worktree: `../{repo-name}-{integration-slug}` (ví dụ: `../myapp-002-implement-todo`)
73
+ - Lệnh:
74
+ ```bash
75
+ git worktree add ../{repo}-{slug} feat/{slug}
76
+ ```
77
+
78
+ 2. **Detect package manager**
79
+ - Kiểm tra theo thứ tự: `pnpm-lock.yaml` → `yarn.lock` → `package-lock.json` → `package.json`
80
+ - Dùng package manager tương ứng: `pnpm install` / `yarn install` / `npm install`
81
+ - Nếu không có `package.json` → bỏ qua bước install.
82
+
83
+ 3. **Copy env files**
84
+ - Tìm tất cả file `.env*` ở root của working directory gốc (`.env`, `.env.local`, `.env.development`, v.v.)
85
+ - Copy từng file vào worktree mới:
86
+ ```bash
87
+ cp .env* ../{repo}-{slug}/
88
+ ```
89
+ - Bỏ qua nếu không có file `.env*` nào.
90
+
91
+ 4. **Chuyển working context sang worktree mới**
92
+ - Tất cả các bước build tiếp theo đều chạy trong đường dẫn worktree mới.
93
+ - Nhắc user biết đang build tại: `../{repo}-{slug}`
94
+
41
95
  ### Với mỗi task pending
42
96
 
43
97
  **1. Chọn task** (`incremental-implementation` — Increment Cycle)
@@ -114,3 +168,13 @@ Invoke `debugging-and-error-recovery`:
114
168
  - [ ] Mỗi task có atomic commit riêng
115
169
  - [ ] Tất cả task đánh dấu `[x]` trong `todo.md`
116
170
  - [ ] Không còn uncommitted changes
171
+
172
+ ## Sau khi hoàn thành
173
+
174
+ Khi tất cả task trong session này đã done, thông báo:
175
+
176
+ ```
177
+ Tất cả task đã hoàn thành. Bước tiếp theo: chạy /review để kiểm tra toàn bộ implementation trước khi merge.
178
+ ```
179
+
180
+ Không tự động invoke `/review` — để user chủ động gọi.
@@ -16,7 +16,12 @@ Trước khi bắt đầu review, load context từ working integration:
16
16
  3. `specs/integrations/{slug}/plan.md` — task breakdown và acceptance criteria chi tiết
17
17
  4. `specs/integrations/{slug}/todo.md` — task nào đã được implement (`[x]`)
18
18
 
19
- Chạy `git diff main...HEAD` để lấy thay đổi cần review.
19
+ Chạy lệnh sau để lấy thay đổi cần review — diff từ điểm branch tách ra, không phải từ tip của base branch:
20
+
21
+ ```bash
22
+ BASE=$(git rev-parse --abbrev-ref @{upstream} 2>/dev/null | sed 's|origin/||' || echo main)
23
+ git diff $(git merge-base HEAD $BASE)...HEAD
24
+ ```
20
25
 
21
26
  ## Xác định integration
22
27
 
@@ -22,7 +22,7 @@ SAD không chứa: feature-level design, business rules, entity details — nh
22
22
  ## When NOT to Use
23
23
 
24
24
  - `prd.md` chưa có nội dung → chạy `/spec-prd` trước
25
- - Đang muốn thiết kế một feature cụ thể → dùng `/spec-fdd`
25
+ - Đang muốn thiết kế một feature cụ thể → dùng `/spec-tech`
26
26
 
27
27
  ---
28
28
 
@@ -168,7 +168,7 @@ Thông báo kết quả:
168
168
  ✓ specs/main/sad.md đã được cập nhật (status: draft)
169
169
 
170
170
  Bước tiếp theo:
171
- - /spec-frd {feature-name} → định nghĩa requirements của từng feature
171
+ - /spec-new {feature-name} → định nghĩa requirements của từng feature
172
172
  ```
173
173
 
174
174
  ---