|
1 | | -# GSI-Protocol 開發工作流程 |
| 1 | +# GSI-Protocol Development Workflow |
2 | 2 |
|
3 | | -## 問題 |
4 | | -修改 GSI command 內容時,需要同時維護三個位置: |
| 3 | +[中文版本](./README.zh-TW.md) | **English** |
| 4 | + |
| 5 | +## Problem |
| 6 | +When modifying GSI command content, you need to maintain three locations: |
5 | 7 | - `.claude/commands/` (Claude Code) |
6 | 8 | - `.codex/prompts/` (Codex) |
7 | 9 | - `.github/prompts/` (GitHub Copilot) |
8 | 10 |
|
9 | | -## 解決方案 |
10 | | -使用單一來源 + 自動同步腳本 |
| 11 | +## Solution |
| 12 | +Single source + automatic sync script |
11 | 13 |
|
12 | | -## 目錄結構 |
| 14 | +## Directory Structure |
13 | 15 | ``` |
14 | 16 | scripts/ |
15 | | - ├── templates/ # 📝 唯一需要維護的模板來源 |
| 17 | + ├── templates/ # 📝 Single source of truth for templates |
16 | 18 | │ ├── sdd-spec.md |
17 | 19 | │ ├── sdd-arch.md |
18 | 20 | │ ├── sdd-impl.md |
19 | 21 | │ ├── sdd-verify.md |
20 | 22 | │ ├── sdd-integration-test.md |
21 | 23 | │ └── sdd-auto.md |
22 | | - ├── sync_commands.py # 🔄 同步腳本 |
23 | | - └── README.md # 📖 本文件 |
| 24 | + ├── dev_sync.py # 🔧 Local development testing tool (for developers only) |
| 25 | + └── README.md # 📖 This file |
24 | 26 | ``` |
25 | 27 |
|
26 | | -## 開發工作流程 |
| 28 | +## Development Workflow |
27 | 29 |
|
28 | | -### 1. 修改模板 |
29 | | -只需要修改 `scripts/templates/` 中的檔案,使用通用佔位符: |
| 30 | +### 1. Edit Templates |
| 31 | +Only need to modify files in `scripts/templates/`, using generic placeholders: |
30 | 32 |
|
31 | 33 | ```markdown |
32 | | -## 使用者需求 |
| 34 | +## User Requirements |
33 | 35 |
|
34 | 36 | __PROMPT__ |
35 | 37 |
|
36 | | -## 下一步 |
37 | | -- 使用指令:`__CMD_PREFIX__sdd-arch features/xxx.feature` |
| 38 | +## Next Steps |
| 39 | +- Use command: `__CMD_PREFIX__sdd-arch features/xxx.feature` |
38 | 40 | ``` |
39 | 41 |
|
40 | | -**佔位符說明:** |
41 | | -- `__PROMPT__` - 用戶輸入的參數 |
42 | | -- `__CMD_PREFIX__` - 命令前綴(會根據平台自動轉換) |
| 42 | +**Placeholder Explanation:** |
| 43 | +- `__PROMPT__` - User input parameter |
| 44 | +- `__CMD_PREFIX__` - Command prefix (automatically converted per platform) |
43 | 45 |
|
44 | | -### 2. 同步到三個平台 |
45 | | -運行同步腳本: |
| 46 | +### 2. Sync to Three Platforms |
| 47 | +Run the development sync tool: |
46 | 48 |
|
47 | 49 | ```bash |
48 | | -python3 scripts/sync_commands.py |
| 50 | +python3 scripts/dev_sync.py |
49 | 51 | ``` |
50 | 52 |
|
51 | | -這會自動轉換佔位符並同步: |
52 | | -- 轉換並同步到 `.claude/commands/`:`__PROMPT__` → `{{prompt}}`,`__CMD_PREFIX__` → `/` |
53 | | -- 轉換並同步到 `.codex/prompts/`:`__PROMPT__` → `$1`,`__CMD_PREFIX__` → `/` |
54 | | -- 轉換並同步到 `.github/prompts/`:`__PROMPT__` → `{{ARG}}`,`__CMD_PREFIX__` → `@workspace /` |
| 53 | +⚠️ **Note**: This tool is for development testing only, end users don't need it |
| 54 | + |
| 55 | +This will automatically convert placeholders and sync: |
| 56 | +- Convert and sync to `.claude/commands/`: `__PROMPT__` → `{{prompt}}`, `__CMD_PREFIX__` → `/` |
| 57 | +- Convert and sync to `.codex/prompts/`: `__PROMPT__` → `$1`, `__CMD_PREFIX__` → `/` |
| 58 | +- Convert and sync to `.github/prompts/`: `__PROMPT__` → `{{ARG}}`, `__CMD_PREFIX__` → `@workspace /` |
55 | 59 |
|
56 | | -### 3. 測試 |
57 | | -在本地測試各平台的命令是否正常運作 |
| 60 | +### 3. Test |
| 61 | +Test commands on each platform locally |
58 | 62 |
|
59 | | -### 4. 提交 |
60 | | -提交所有變更到 Git |
| 63 | +### 4. Commit |
| 64 | +Commit all changes to Git |
61 | 65 |
|
62 | | -## 用戶安裝流程 |
| 66 | +## User Installation Flow |
63 | 67 |
|
64 | | -當用戶執行: |
| 68 | +When users run: |
65 | 69 | ```bash |
66 | 70 | uvx --from gsi-protocol-installer gsi-install |
67 | 71 | ``` |
68 | 72 |
|
69 | | -`gsi_installer.py` 會: |
70 | | -1. 從 GitHub 下載 repo |
71 | | -2. 讀取 `scripts/templates/` 中的模板 |
72 | | -3. 根據用戶選擇的平台自動轉換並安裝 |
| 73 | +`gsi_installer.py` will: |
| 74 | +1. Download the repo from GitHub |
| 75 | +2. Read templates from `scripts/templates/` |
| 76 | +3. Automatically convert and install based on user's platform choice |
73 | 77 |
|
74 | | -## 佔位符轉換對照表 |
| 78 | +## Placeholder Conversion Table |
75 | 79 |
|
76 | | -| 平台 | `__PROMPT__` 轉換為 | `__CMD_PREFIX__` 轉換為 | 檔案副檔名 | |
77 | | -|------|-------------------|----------------------|-----------| |
78 | | -| 模板 | `__PROMPT__` | `__CMD_PREFIX__` | `.md` | |
| 80 | +| Platform | `__PROMPT__` converts to | `__CMD_PREFIX__` converts to | File Extension | |
| 81 | +|----------|-------------------------|------------------------------|----------------| |
| 82 | +| Template | `__PROMPT__` | `__CMD_PREFIX__` | `.md` | |
79 | 83 | | Claude Code | `{{prompt}}` | `/` | `.md` | |
80 | 84 | | Codex | `$1` | `/` | `.md` | |
81 | 85 | | GitHub Copilot | `{{ARG}}` | `@workspace /` | `.prompt.md` | |
82 | 86 |
|
83 | | -## 優點 |
| 87 | +## Benefits |
84 | 88 |
|
85 | | -✅ 只需維護一個地方 (`scripts/templates/`) |
86 | | -✅ 自動處理平台差異 |
87 | | -✅ 降低維護成本 |
88 | | -✅ 減少人為錯誤 |
| 89 | +✅ Only maintain one location (`scripts/templates/`) |
| 90 | +✅ Automatically handle platform differences |
| 91 | +✅ Reduce maintenance cost |
| 92 | +✅ Minimize human errors |
0 commit comments