Skip to content

Commit 3855674

Browse files
author
薛華慶, james.hsueh
committed
docs: update installation
1 parent be30eed commit 3855674

File tree

2 files changed

+134
-131
lines changed

2 files changed

+134
-131
lines changed

docs/INSTALL.md

Lines changed: 121 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 安裝指南
22

3-
本文件說明如何在您的專案中安裝和使用 SDD Workflow 工具
3+
本文件說明如何在您的專案中安裝和使用 GSI-Protocol 工作流程
44

55
---
66

@@ -12,17 +12,32 @@
1212

1313
---
1414

15-
## 方法一:全域安裝(強烈推薦)✅
15+
## 方法一:一鍵安裝(最推薦)✅
16+
17+
這是最簡單的方式,會自動詢問您是要全域安裝還是專案內安裝。
18+
19+
```bash
20+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/install.sh | bash
21+
```
22+
23+
安裝腳本會詢問您的偏好,然後自動完成設定。
24+
25+
---
26+
27+
## 方法二:手動全域安裝
1628

1729
這是最乾淨的方式,安裝一次後所有專案都能使用,不會污染任何專案目錄。
1830

1931
```bash
20-
# 1. 創建全域 workflows 目錄
21-
mkdir -p ~/.claude/workflows
32+
# 1. 創建全域指令目錄
33+
mkdir -p ~/.claude/commands
2234

23-
# 2. Clone 到全域目錄
24-
cd ~/.claude/workflows
25-
git clone https://github.com/CodeMachine0121/GSI-Protocol.git sdd-workflow
35+
# 2. 下載 SDD 指令檔案
36+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-auto.md -o ~/.claude/commands/sdd-auto.md
37+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-spec.md -o ~/.claude/commands/sdd-spec.md
38+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-arch.md -o ~/.claude/commands/sdd-arch.md
39+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-impl.md -o ~/.claude/commands/sdd-impl.md
40+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-verify.md -o ~/.claude/commands/sdd-verify.md
2641

2742
# 3. 完成!現在在任何專案都能使用
2843
cd ~/your-project
@@ -44,13 +59,13 @@ cd ~/your-project
4459
# 在任何專案目錄中
4560
cd ~/projects/my-python-api
4661

47-
# 使用 SDD workflow
62+
# 使用 GSI-Protocol 工作流程
4863
/sdd-auto Create a user authentication system in Python with JWT tokens
4964
```
5065

5166
---
5267

53-
## 方法二:專案內安裝(只複製指令)
68+
## 方法三:手動專案內安裝
5469

5570
如果您只想在特定專案使用,或需要團隊共享這些指令。
5671

@@ -73,24 +88,12 @@ rm -rf /tmp/sdd-temp
7388

7489
# 5. 提交到 Git(可選)
7590
git add .claude/commands/
76-
git commit -m "Add SDD workflow commands"
91+
git commit -m "Add GSI-Protocol workflow commands"
7792
```
7893

79-
### 使用腳本安裝
80-
81-
#### 選項 A:一鍵 curl 安裝(推薦,需要 Public Repo)
82-
83-
⚠️ **注意**:此方式只在 repo 為 public 時可用
84-
85-
```bash
86-
# 下載並執行安裝腳本
87-
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/install.sh | bash
88-
89-
# 或使用 wget
90-
wget -qO- https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/install.sh | bash
91-
```
94+
### 使用腳本安裝(Clone 方式)
9295

93-
#### 選項 B:Clone 後安裝(Private Repo 也可用)
96+
對於 private repo 或需要更多控制的情況:
9497

9598
```bash
9699
# 1. Clone repo(private repo 會要求 GitHub 認證)
@@ -104,47 +107,18 @@ cd /tmp/gsi-temp
104107
cd ~ && rm -rf /tmp/gsi-temp
105108
```
106109

107-
**如何選擇**
108-
- ✅ Repo 是 **public** → 使用選項 A(最快最方便)
109-
- ✅ Repo 是 **private** → 使用選項 B 或「手動複製」方式
110-
111-
---
112-
113-
## 方法三:使用 Git Sparse Checkout(進階)
114-
115-
只 checkout 需要的目錄,不下載 examples。
116-
117-
```bash
118-
cd ~/your-project
119-
120-
# 初始化 sparse checkout
121-
git clone --no-checkout https://github.com/CodeMachine0121/GSI-Protocol.git .sdd-tools
122-
cd .sdd-tools
123-
124-
# 設定只 checkout .claude/commands
125-
git sparse-checkout init --cone
126-
git sparse-checkout set .claude/commands
127-
128-
# checkout
129-
git checkout main
130-
131-
# 複製到專案根目錄
132-
cd ..
133-
cp -r .sdd-tools/.claude .
134-
135-
# 清理
136-
rm -rf .sdd-tools
137-
```
138-
139110
---
140111

141112
## 驗證安裝成功
142113

143114
### 檢查檔案
144115

145116
```bash
146-
# 在專案目錄中
147-
ls .claude/commands/
117+
# 全域安裝
118+
ls ~/.claude/commands/ | grep sdd
119+
120+
# 或專案內安裝
121+
ls .claude/commands/ | grep sdd
148122

149123
# 應該看到:
150124
# sdd-auto.md
@@ -166,33 +140,58 @@ ls .claude/commands/
166140

167141
## 第一次使用
168142

169-
### 快速模式
143+
### 快速模式(推薦)
170144

171145
```bash
172146
/sdd-auto Create a shopping cart in TypeScript with add, remove, and checkout functions
173147
```
174148

175-
### 手動模式
149+
### 手動模式(逐步執行)
176150

177151
```bash
178-
# 步驟 1
152+
# 步驟 1:定義規格
179153
/sdd-spec Create a shopping cart with add, remove, checkout
180154

181-
# 步驟 2(審查 features/shopping_cart.feature 後)
155+
# 步驟 2:設計架構(審查 features/shopping_cart.feature 後)
182156
/sdd-arch features/shopping_cart.feature
183157

184-
# 步驟 3(審查 structure/ 後)
185-
/sdd-impl features/shopping_cart.feature structure/shopping_cart_structure.ts
158+
# 步驟 3:實作程式碼(審查 docs/ 後)
159+
/sdd-impl features/shopping_cart.feature
186160

187-
# 步驟 4(審查 implementation/ 後)
188-
/sdd-verify features/shopping_cart.feature implementation/shopping_cart_impl.ts
161+
# 步驟 4:驗證實作(審查 src/ 後)
162+
/sdd-verify features/shopping_cart.feature
189163
```
190164

191165
---
192166

193167
## 專案結構
194168

195-
使用 SDD workflow 後,您的專案會新增這些目錄:
169+
使用 GSI-Protocol 工作流程後,您的專案會新增這些內容:
170+
171+
### 全域安裝
172+
173+
```
174+
~/.claude/commands/
175+
├── sdd-auto.md
176+
├── sdd-spec.md
177+
├── sdd-arch.md
178+
├── sdd-impl.md
179+
└── sdd-verify.md
180+
181+
# 您的專案保持乾淨,只有生成的程式碼
182+
your-project/
183+
├── features/
184+
│ └── *.feature
185+
├── docs/
186+
│ └── features/
187+
│ └── {feature}/
188+
│ ├── architecture.md
189+
│ └── conclusion.md
190+
└── src/
191+
└── (您的實作程式碼)
192+
```
193+
194+
### 專案內安裝
196195

197196
```
198197
your-project/
@@ -203,33 +202,36 @@ your-project/
203202
│ ├── sdd-arch.md
204203
│ ├── sdd-impl.md
205204
│ └── sdd-verify.md
206-
├── features/ # 階段 1:Gherkin 規格(自動生成)
205+
├── features/ # 階段 1:Gherkin 規格
207206
│ └── *.feature
208-
├── structure/ # 階段 2:資料模型(自動生成)
209-
│ └── *_structure.*
210-
└── implementation/ # 階段 3:實作程式碼(自動生成)
211-
└── *_impl.*
207+
├── docs/
208+
│ └── features/ # 階段 2:架構設計
209+
│ └── {feature}/
210+
│ ├── architecture.md
211+
│ └── conclusion.md
212+
└── src/ # 階段 3:實作程式碼
213+
└── (您的程式碼)
212214
```
213215

214-
**不會有 examples/ 或 prompts/ 目錄** - 這些只存在於 SDD workflow repo 本身。
216+
**不會有 examples/ 或 prompts/ 目錄** - 這些只存在於 GSI-Protocol repo 本身。
215217

216218
---
217219

218220
## 多專案使用建議
219221

220222
### 推薦配置
221223

222-
-**全域安裝**`~/.claude/workflows/sdd-workflow`(所有專案共用)
223-
-**專案目錄**:只有 `features/``structure/``implementation/`(生成的程式碼)
224-
-**不要**:把整個 SDD repo clone 到專案裡
224+
-**全域安裝**`~/.claude/commands/sdd-*.md`(所有專案共用)
225+
-**專案目錄**:只有 `features/``docs/features/``src/`(生成的程式碼)
226+
-**不要**:把整個 GSI-Protocol repo clone 到專案裡
225227

226228
### 團隊協作
227229

228230
如果團隊需要統一使用:
229231

230232
```bash
231233
# 方式 1:每個開發者自己全域安裝
232-
每人執行:mkdir -p ~/.claude/workflows && cd ~/.claude/workflows && git clone https://github.com/CodeMachine0121/GSI-Protocol.git
234+
每人執行:curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/install.sh | bash
233235

234236
# 方式 2:專案內只包含 commands(Git 管理)
235237
在專案內:mkdir -p .claude/commands && cp <commands>
@@ -238,13 +240,15 @@ your-project/
238240

239241
---
240242

241-
## 更新 SDD Workflow
243+
## 更新 GSI-Protocol
242244

243245
### 全域安裝的更新
244246

247+
如果您是從 GitHub repo 直接下載的指令檔案,只需重新執行 curl 命令下載最新版本即可。
248+
245249
```bash
246-
cd ~/.claude/workflows/sdd-workflow
247-
git pull
250+
# 或簡單方式:重新執行一鍵安裝
251+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/install.sh | bash
248252
```
249253

250254
### 專案內安裝的更新
@@ -258,7 +262,7 @@ git pull
258262
### 全域安裝
259263

260264
```bash
261-
rm -rf ~/.claude/workflows/sdd-workflow
265+
rm -f ~/.claude/commands/sdd-*.md
262266
```
263267

264268
### 專案內安裝
@@ -271,42 +275,49 @@ rm -rf .claude/commands/sdd-*.md
271275

272276
## 常見問題
273277

278+
### Q:推薦用全域安裝還是專案內安裝?
279+
280+
**A:** 全域安裝更方便:
281+
- ✅ 一次安裝,所有專案都能用
282+
- ✅ 專案目錄保持乾淨
283+
- ✅ 容易更新
284+
- 唯一缺點:團隊成員需要各自安裝
285+
286+
如果整個團隊需要使用,建議全域安裝 + 在文檔中說明安裝步驟。
287+
274288
### Q:我的專案裡出現了 examples/ 目錄怎麼辦?
275289

276290
**A:** 這表示您錯誤地 clone 了整個 repo 到專案裡。請:
277-
1. 刪除:`rm -rf .sdd-workflow` 或類似目錄
278-
2. 重新按照「方法二」只複製 commands
291+
1. 刪除:`rm -rf .claude/gsi-protocol` 或類似目錄
292+
2. 改為只複製 `.claude/commands/`
279293
3. 確認 `git status` 沒有 examples 相關檔案
280294

281295
### Q:全域安裝和專案內安裝有什麼區別?
282296

283297
**A:**
284-
- **全域**安裝一次,所有專案都能用,專案目錄保持乾淨
285-
- **專案內**:指令隨專案走,團隊成員 clone 後就有,但需要手動複製
298+
- **全域**`~/.claude/commands/sdd-*.md`,所有專案共用,專案保持乾淨
299+
- **專案內**`.claude/commands/sdd-*.md`指令隨專案走,團隊成員 clone 後就有
286300

287301
### Q:團隊成員需要每個人都安裝嗎?
288302

289303
**A:**
290-
- 如果用全域安裝:是,每人自己裝
304+
- 如果用全域安裝:是,每人自己執行一遍安裝
291305
- 如果用專案內安裝並 commit 到 Git:不用,clone 專案就有
292306

293-
### Q:如何查看 examples 範例
307+
### Q:生成的檔案要 commit 到 Git 嗎
294308

295309
**A:**
296-
```bash
297-
# 訪問 SDD workflow repo
298-
cd ~/.claude/workflows/sdd-workflow/examples
299-
300-
# 或直接在 GitHub 上查看
301-
```
310+
-`features/*.feature` - 建議 commit(需求文件,重要)
311+
-`docs/features/*/architecture.md` - 建議 commit(技術設計)
312+
-`src/` - 建議 commit(實作程式碼)
313+
-`docs/features/*/conclusion.md` - 不建議(臨時驗證報告)
302314

303-
### Q:生成的檔案要 commit 到 Git 嗎
315+
### Q:如何查看 examples 範例
304316

305-
**A:**
306-
-`features/*.feature` - 建議 commit(需求文件)
307-
-`structure/*` - 建議 commit(技術設計)
308-
- ⚠️ `implementation/*` - 視情況(如果是最終程式碼則 commit)
309-
-`verification/*` - 不建議(臨時驗證報告)
317+
**A:** 直接訪問 GitHub repo:
318+
```
319+
https://github.com/CodeMachine0121/GSI-Protocol/tree/main/examples
320+
```
310321

311322
---
312323

@@ -317,18 +328,23 @@ cd ~/.claude/workflows/sdd-workflow/examples
317328
1. 📖 閱讀 [QUICKSTART.md](QUICKSTART.md) - 5 分鐘快速入門
318329
2. 📖 閱讀 [COMMANDS.md](COMMANDS.md) - 完整指令參考
319330
3. 📖 閱讀 [LANGUAGE_GUIDE.md](LANGUAGE_GUIDE.md) - 多語言支援
320-
4. 🔍 查看 examples(在 SDD repo 裡,不在您的專案)
331+
4. 🔍 查看 [expected_workflow.md](expected_workflow.md) - 詳細工作流程說明
321332

322333
---
323334

324335
**快速安裝指令:**
325336

326337
```bash
327-
# 全域安裝(推薦)
328-
mkdir -p ~/.claude/workflows && cd ~/.claude/workflows && git clone https://github.com/CodeMachine0121/GSI-Protocol.git sdd-workflow
338+
# 最簡單:一鍵安裝(推薦)
339+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/install.sh | bash
329340

330-
# 專案內安裝(只複製 commands)
331-
mkdir -p .claude/commands && cd /tmp && git clone https://github.com/CodeMachine0121/GSI-Protocol.git sdd-temp && cp sdd-temp/.claude/commands/* <your-project>/.claude/commands/ && rm -rf sdd-temp
341+
# 或手動全域安裝
342+
mkdir -p ~/.claude/commands
343+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-auto.md -o ~/.claude/commands/sdd-auto.md
344+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-spec.md -o ~/.claude/commands/sdd-spec.md
345+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-arch.md -o ~/.claude/commands/sdd-arch.md
346+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-impl.md -o ~/.claude/commands/sdd-impl.md
347+
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-verify.md -o ~/.claude/commands/sdd-verify.md
332348
```
333349

334-
開始使用 SDD Workflow,讓 AI 幫您寫結構化的程式碼!🚀
350+
開始使用 GSI-Protocol,讓 AI 幫您寫結構化的程式碼!🚀

0 commit comments

Comments
 (0)