Skip to content

Commit 8c38e50

Browse files
author
薛華慶, james.hsueh
committed
feat: clean project
1 parent 71d7d8f commit 8c38e50

25 files changed

+1358
-4508
lines changed

.claude/commands/README.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# SDD 指令模板管理
2+
3+
## 目錄結構
4+
5+
```
6+
scripts/templates/ # 📝 主要模板源(唯一編輯處)
7+
├── sdd-spec.md
8+
├── sdd-arch.md
9+
├── sdd-impl.md
10+
├── sdd-integration-test.md
11+
├── sdd-verify.md
12+
└── sdd-auto.md
13+
14+
.claude/commands/ # ⚙️ Claude Code CLI 格式(自動生成)
15+
.codex/prompts/ # ⚙️ Codex 格式(自動生成)
16+
.github/prompts/ # ⚙️ GitHub Prompts 格式(自動生成)
17+
```
18+
19+
## 使用方式
20+
21+
### 📝 編輯指令
22+
23+
**只需編輯這裡:** `scripts/templates/*.md`
24+
25+
使用占位符 `{{prompt}}` 表示參數位置。
26+
27+
### 🔄 同步機制
28+
29+
**方式一:本地開發同步**
30+
31+
```bash
32+
node scripts/sync-commands.js
33+
#
34+
npm run sync:commands
35+
```
36+
37+
這會將模板同步到本地的:
38+
- `.claude/commands/` → 使用 `{{prompt}}`
39+
- `.codex/prompts/` → 使用 `$1` + `argument-hint`
40+
- `.github/prompts/` → 使用 `{{ARG}}` + `@workspace /` 前綴
41+
42+
**方式二:安裝器動態轉換**
43+
44+
`gsi_installer.py` 會在安裝時自動從模板轉換:
45+
-`scripts/templates/` 讀取源模板
46+
- 根據選擇的平台動態轉換格式
47+
- 直接安裝到目標目錄
48+
49+
這意味著 **不需要提交已生成的文件**,只需提交模板即可!
50+
51+
### 🎯 工作流程
52+
53+
**本地開發:**
54+
1. 編輯 `scripts/templates/` 中的模板文件
55+
2. 運行 `npm run sync:commands`(僅用於本地測試)
56+
3. 測試指令
57+
4. 只提交 `scripts/templates/` 的變更
58+
59+
**用戶安裝:**
60+
1. `gsi_installer.py` 從 GitHub 克隆儲存庫
61+
2. 讀取 `scripts/templates/` 中的模板
62+
3. 動態轉換為目標平台格式
63+
4. 安裝到用戶的目錄
64+
65+
## 格式轉換規則
66+
67+
| 工具 | 參數語法 | 命令前綴 | 文件擴展名 |
68+
|------|---------|---------|-----------|
69+
| Claude Code | `{{prompt}}` | `/` | `.md` |
70+
| Codex | `$1` + frontmatter hint | - | `.md` |
71+
| GitHub Prompts | `{{ARG}}` | `@workspace /` | `.prompt.md` |
72+
73+
## 範例
74+
75+
### 模板源 (scripts/templates/sdd-spec.md)
76+
```markdown
77+
---
78+
description: 階段 1 - 從使用者需求生成 Gherkin 行為規格(PM 角色)
79+
---
80+
81+
## 使用者需求
82+
83+
{{prompt}}
84+
```
85+
86+
### 生成結果
87+
88+
**Claude Code** (`.claude/commands/sdd-spec.md`):
89+
```markdown
90+
{{prompt}}
91+
```
92+
93+
**Codex** (`.codex/prompts/sdd-spec.md`):
94+
```markdown
95+
---
96+
description: ...
97+
---
98+
99+
$1
100+
```
101+
102+
**GitHub** (`.github/prompts/sdd-spec.prompt.md`):
103+
```markdown
104+
{{ARG}}
105+
106+
使用 `@workspace /sdd-spec` 呼叫
107+
```
108+
109+
## 注意事項
110+
111+
- ⚠️ **不要直接編輯** `.claude/`, `.codex/`, `.github/` 中的文件
112+
-**只編輯** `scripts/templates/` 中的源模板
113+
- 🔄 本地測試時運行 `npm run sync:commands`
114+
- 📦 **提交時只需提交** `scripts/templates/` 的變更
115+
- 🚀 已生成的文件(`.claude/`, `.codex/`, `.github/`)可選擇性提交,或加入 `.gitignore`

.codex/prompts/README.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# SDD 指令模板管理
2+
3+
## 目錄結構
4+
5+
```
6+
scripts/templates/ # 📝 主要模板源(唯一編輯處)
7+
├── sdd-spec.md
8+
├── sdd-arch.md
9+
├── sdd-impl.md
10+
├── sdd-integration-test.md
11+
├── sdd-verify.md
12+
└── sdd-auto.md
13+
14+
.claude/commands/ # ⚙️ Claude Code CLI 格式(自動生成)
15+
.codex/prompts/ # ⚙️ Codex 格式(自動生成)
16+
.github/prompts/ # ⚙️ GitHub Prompts 格式(自動生成)
17+
```
18+
19+
## 使用方式
20+
21+
### 📝 編輯指令
22+
23+
**只需編輯這裡:** `scripts/templates/*.md`
24+
25+
使用占位符 `$1` 表示參數位置。
26+
27+
### 🔄 同步機制
28+
29+
**方式一:本地開發同步**
30+
31+
```bash
32+
node scripts/sync-commands.js
33+
#
34+
npm run sync:commands
35+
```
36+
37+
這會將模板同步到本地的:
38+
- `.claude/commands/` → 使用 `$1`
39+
- `.codex/prompts/` → 使用 `$1` + `argument-hint`
40+
- `.github/prompts/` → 使用 `{{ARG}}` + `@workspace /` 前綴
41+
42+
**方式二:安裝器動態轉換**
43+
44+
`gsi_installer.py` 會在安裝時自動從模板轉換:
45+
-`scripts/templates/` 讀取源模板
46+
- 根據選擇的平台動態轉換格式
47+
- 直接安裝到目標目錄
48+
49+
這意味著 **不需要提交已生成的文件**,只需提交模板即可!
50+
51+
### 🎯 工作流程
52+
53+
**本地開發:**
54+
1. 編輯 `scripts/templates/` 中的模板文件
55+
2. 運行 `npm run sync:commands`(僅用於本地測試)
56+
3. 測試指令
57+
4. 只提交 `scripts/templates/` 的變更
58+
59+
**用戶安裝:**
60+
1. `gsi_installer.py` 從 GitHub 克隆儲存庫
61+
2. 讀取 `scripts/templates/` 中的模板
62+
3. 動態轉換為目標平台格式
63+
4. 安裝到用戶的目錄
64+
65+
## 格式轉換規則
66+
67+
| 工具 | 參數語法 | 命令前綴 | 文件擴展名 |
68+
|------|---------|---------|-----------|
69+
| Claude Code | `$1` | `/` | `.md` |
70+
| Codex | `$1` + frontmatter hint | - | `.md` |
71+
| GitHub Prompts | `{{ARG}}` | `@workspace /` | `.prompt.md` |
72+
73+
## 範例
74+
75+
### 模板源 (scripts/templates/sdd-spec.md)
76+
```markdown
77+
---
78+
description: 階段 1 - 從使用者需求生成 Gherkin 行為規格(PM 角色)
79+
---
80+
81+
## 使用者需求
82+
83+
$1
84+
```
85+
86+
### 生成結果
87+
88+
**Claude Code** (`.claude/commands/sdd-spec.md`):
89+
```markdown
90+
$1
91+
```
92+
93+
**Codex** (`.codex/prompts/sdd-spec.md`):
94+
```markdown
95+
---
96+
description: ...
97+
---
98+
99+
$1
100+
```
101+
102+
**GitHub** (`.github/prompts/sdd-spec.prompt.md`):
103+
```markdown
104+
{{ARG}}
105+
106+
使用 `@workspace /sdd-spec` 呼叫
107+
```
108+
109+
## 注意事項
110+
111+
- ⚠️ **不要直接編輯** `.claude/`, `.codex/`, `.github/` 中的文件
112+
-**只編輯** `scripts/templates/` 中的源模板
113+
- 🔄 本地測試時運行 `npm run sync:commands`
114+
- 📦 **提交時只需提交** `scripts/templates/` 的變更
115+
- 🚀 已生成的文件(`.claude/`, `.codex/`, `.github/`)可選擇性提交,或加入 `.gitignore`

.codex/prompts/sdd-arch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: Phase 2 - 分析 Gherkin 規格,設計高階架構(資料模型與服務介面),輸出到 docs/features/{feature_name}/
32
argument-hint: <feature_file_path>
3+
description: Phase 2 - 分析 Gherkin 規格,設計高階架構(資料模型與服務介面),輸出到 docs/features/{feature_name}/
44
---
55

66
# SDD Phase 2: 架構設計

.codex/prompts/sdd-impl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: Phase 3 - 根據架構設計實作程式碼,滿足 Gherkin 規格
32
argument-hint: <feature_file_path>
3+
description: Phase 3 - 根據架構設計實作程式碼,滿足 Gherkin 規格
44
---
55

66
# SDD Phase 3: 實作

.codex/prompts/sdd-integration-test.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
2+
argument-hint: <feature_file_path>
23
description: BDD - 從 feature file 和架構文件生成 integration tests(測試先行)
34
---
45

56
# SDD-INTEGRATION-TEST: BDD Integration Tests
67

7-
**輸入:** $1
8-
格式:`<feature_file_path>`
8+
**輸入:** $1
9+
格式:`<feature_file_path>`
910
範例:`features/shopping_cart.feature`
1011

1112
**角色:** 協助開發者實踐 BDD(行為驅動開發)測試先行

.codex/prompts/sdd-spec.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
description: 階段 1 - 從使用者需求生成 Gherkin 行為規格(PM 角色)
3-
argument-hint: <requirement_description>
43
---
54

65
# SDD 階段 1:需求規格(靈魂)

.codex/prompts/sdd-verify.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: Phase 4 - 驗證實作(QA 角色)
32
argument-hint: <feature_file_path>
3+
description: Phase 4 - 驗證實作(QA 角色)
44
---
55

66
# SDD Phase 4: 驗證

.github/prompts/README.prompt.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# SDD 指令模板管理
2+
3+
## 目錄結構
4+
5+
```
6+
scripts/templates/ # 📝 主要模板源(唯一編輯處)
7+
├── sdd-spec.md
8+
├── sdd-arch.md
9+
├── sdd-impl.md
10+
├── sdd-integration-test.md
11+
├── sdd-verify.md
12+
└── sdd-auto.md
13+
14+
.claude/commands/ # ⚙️ Claude Code CLI 格式(自動生成)
15+
.codex/prompts/ # ⚙️ Codex 格式(自動生成)
16+
.github/prompts/ # ⚙️ GitHub Prompts 格式(自動生成)
17+
```
18+
19+
## 使用方式
20+
21+
### 📝 編輯指令
22+
23+
**只需編輯這裡:** `scripts/templates/*.md`
24+
25+
使用占位符 `{{ARG}}` 表示參數位置。
26+
27+
### 🔄 同步機制
28+
29+
**方式一:本地開發同步**
30+
31+
```bash
32+
node scripts/sync-commands.js
33+
#
34+
npm run sync:commands
35+
```
36+
37+
這會將模板同步到本地的:
38+
- `.claude/commands/` → 使用 `{{ARG}}`
39+
- `.codex/prompts/` → 使用 `$1` + `argument-hint`
40+
- `.github/prompts/` → 使用 `{{ARG}}` + `@workspace /` 前綴
41+
42+
**方式二:安裝器動態轉換**
43+
44+
`gsi_installer.py` 會在安裝時自動從模板轉換:
45+
-`scripts/templates/` 讀取源模板
46+
- 根據選擇的平台動態轉換格式
47+
- 直接安裝到目標目錄
48+
49+
這意味著 **不需要提交已生成的文件**,只需提交模板即可!
50+
51+
### 🎯 工作流程
52+
53+
**本地開發:**
54+
1. 編輯 `scripts/templates/` 中的模板文件
55+
2. 運行 `npm run sync:commands`(僅用於本地測試)
56+
3. 測試指令
57+
4. 只提交 `scripts/templates/` 的變更
58+
59+
**用戶安裝:**
60+
1. `gsi_installer.py` 從 GitHub 克隆儲存庫
61+
2. 讀取 `scripts/templates/` 中的模板
62+
3. 動態轉換為目標平台格式
63+
4. 安裝到用戶的目錄
64+
65+
## 格式轉換規則
66+
67+
| 工具 | 參數語法 | 命令前綴 | 文件擴展名 |
68+
|------|---------|---------|-----------|
69+
| Claude Code | `{{ARG}}` | `/` | `.md` |
70+
| Codex | `$1` + frontmatter hint | - | `.md` |
71+
| GitHub Prompts | `{{ARG}}` | `@workspace /` | `.prompt.md` |
72+
73+
## 範例
74+
75+
### 模板源 (scripts/templates/sdd-spec.md)
76+
```markdown
77+
---
78+
description: 階段 1 - 從使用者需求生成 Gherkin 行為規格(PM 角色)
79+
---
80+
81+
## 使用者需求
82+
83+
{{ARG}}
84+
```
85+
86+
### 生成結果
87+
88+
**Claude Code** (`.claude/commands/sdd-spec.md`):
89+
```markdown
90+
{{ARG}}
91+
```
92+
93+
**Codex** (`.codex/prompts/sdd-spec.md`):
94+
```markdown
95+
---
96+
description: ...
97+
---
98+
99+
$1
100+
```
101+
102+
**GitHub** (`.github/prompts/sdd-spec.prompt.md`):
103+
```markdown
104+
{{ARG}}
105+
106+
使用 `@workspace /sdd-spec` 呼叫
107+
```
108+
109+
## 注意事項
110+
111+
- ⚠️ **不要直接編輯** `.claude/`, `.codex/`, `.github/` 中的文件
112+
-**只編輯** `scripts/templates/` 中的源模板
113+
- 🔄 本地測試時運行 `npm run sync:commands`
114+
- 📦 **提交時只需提交** `scripts/templates/` 的變更
115+
- 🚀 已生成的文件(`.claude/`, `.codex/`, `.github/`)可選擇性提交,或加入 `.gitignore`

0 commit comments

Comments
 (0)