Installer for GSI-Protocol workflow commands (Claude Code & Codex)
Project description
GSI-Protocol(中文)
Gherkin → 架構 → 實作
一個語言無關的工作流程,使用 AI 代理和 BDD 原則建立可驗證的軟體功能。
🎯 什麼是 GSI-Protocol?
GSI-Protocol 是一個 AI 驅動的工作流程插件,實作了規格驅動開發(SDD)。它透過嚴格的四階段流程,將模糊的需求轉化為經過驗證、可用於生產環境的程式碼。
支援平台:
- ✅ Claude Code
- ✅ Codex (OpenAI)
- ✅ GitHub Copilot
核心理念
"規格 → 架構 → 實作 → 驗證"
將業務邏輯、技術架構、程式撰寫和品質保證分離到不同階段,以最小化 AI 幻覺並最大化精確度。
主要特性
- 🌍 語言無關:支援 Python、TypeScript、Go、Java、Rust、C# 等等
- 🎯 框架獨立:不綁定任何特定函式庫或框架
- 📝 基於 BDD:使用 Gherkin 撰寫清晰、可測試的規格
- 🏗️ 專案感知:自動掃描並遵循既有專案架構
- ✅ 可驗證:自動根據規格進行驗證
- 🔄 模組化:可獨立執行各階段或完整工作流程
📦 快速開始
安裝
選項 1:使用 uvx(最推薦,無需安裝)
uvx --from gsi-protocol-installer gsi-install
選項 2:使用 pipx
pipx run gsi-protocol-installer
選項 3:直接執行 Python
# 下載並執行
wget https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/gsi_installer.py
python3 gsi_installer.py
# 或使用 curl
curl -O https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/gsi_installer.py
python3 gsi_installer.py
安裝程式會引導您:
- 選擇 AI 平台(Claude Code、Codex、GitHub Copilot 或多個)
- 對於 Claude Code:選擇要安裝的組件
- Commands only(slash 指令)
- Sub-agents only(專業 AI 代理)
- Both(推薦:完整功能)
- 選擇安裝位置(全域或當前專案)
- 自動完成安裝
選項 4:手動全域安裝
Claude Code - Commands(Slash 指令):
mkdir -p ~/.claude/commands
cd ~/.claude/commands
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-auto.md -o sdd-auto.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-spec.md -o sdd-spec.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-arch.md -o sdd-arch.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-integration-test.md -o sdd-integration-test.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-impl.md -o sdd-impl.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/commands/sdd-verify.md -o sdd-verify.md
Claude Code - Sub-Agents(專業 AI 代理):
mkdir -p ~/.claude/agents
cd ~/.claude/agents
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/agents/sdd-orchestrator.md -o sdd-orchestrator.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/agents/pm-spec-writer.md -o pm-spec-writer.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/agents/architect-designer.md -o architect-designer.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/agents/bdd-test-engineer.md -o bdd-test-engineer.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/agents/implementation-engineer.md -o implementation-engineer.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.claude/agents/qa-verifier.md -o qa-verifier.md
Codex (OpenAI):
mkdir -p ~/.codex/prompts
cd ~/.codex/prompts
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.codex/prompts/sdd-auto.md -o sdd-auto.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.codex/prompts/sdd-spec.md -o sdd-spec.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.codex/prompts/sdd-arch.md -o sdd-arch.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.codex/prompts/sdd-integration-test.md -o sdd-integration-test.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.codex/prompts/sdd-impl.md -o sdd-impl.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.codex/prompts/sdd-verify.md -o sdd-verify.md
GitHub Copilot:
mkdir -p ~/.github/prompts
cd ~/.github/prompts
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.github/prompts/sdd-auto.prompt.md -o sdd-auto.prompt.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.github/prompts/sdd-spec.prompt.md -o sdd-spec.prompt.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.github/prompts/sdd-arch.prompt.md -o sdd-arch.prompt.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.github/prompts/sdd-integration-test.prompt.md -o sdd-integration-test.prompt.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.github/prompts/sdd-impl.prompt.md -o sdd-impl.prompt.md
curl -sSL https://raw.githubusercontent.com/CodeMachine0121/GSI-Protocol/main/.github/prompts/sdd-verify.prompt.md -o sdd-verify.prompt.md
完成後,可在任何專案中使用 /sdd-auto、/sdd-spec 等全域指令(Claude/Codex)或 @workspace /sdd-auto、@workspace /sdd-spec(Copilot)。
💡 Claude Code 用戶提示:Commands vs Sub-Agents
Claude Code 支援兩種模式:
- Commands(Slash 指令):簡單直接的工作流程執行,適合快速開發
- Sub-Agents(專業 AI 代理):6 個專業角色代理協同工作,提供更高品質與一致性
- 推薦安裝兩者:獲得完整功能和最佳開發體驗
📖 查看 安裝指南 了解詳細說明
第一次使用(2 分鐘)
# 使用 uvx 安裝
uvx gsi-protocol-installer
# 選擇平台和安裝位置後,進入您的專案
cd your-project
# 自動模式 - 生成所有內容
/sdd-auto Create a shopping cart in TypeScript with add, remove, checkout functions
# 或使用 Copilot
@workspace /sdd-auto Create a shopping cart in TypeScript with add, remove, checkout functions
# 手動模式 - 逐步執行
/sdd-spec Create a shopping cart with add, remove, checkout
/sdd-arch features/shopping_cart.feature
/sdd-impl features/shopping_cart.feature
/sdd-verify features/shopping_cart.feature
# 或使用 Copilot
@workspace /sdd-spec Create a shopping cart with add, remove, checkout
@workspace /sdd-arch features/shopping_cart.feature
@workspace /sdd-impl features/shopping_cart.feature
@workspace /sdd-verify features/shopping_cart.feature
📚 文件
| 文件 | 說明 |
|---|---|
| 快速入門指南 | 5 分鐘教學 |
| 安裝指南 | 詳細安裝說明 |
| Python 安裝器 | uvx 安裝方式(推薦) |
| 平台支援 | Claude Code vs Codex 比較 |
| Sub-Agents 專業代理 | 6 個專業 AI 代理系統說明 |
| 指令參考 | 完整指令文件 |
| 語言指南 | 多語言支援指南 |
| 工作流程定義 | 詳細方法論 |
| 貢獻指南 | 如何貢獻 |
🔄 工作流程概覽
💡 每個階段由專業的 Sub-Agent 執行,確保輸出品質與一致性
核心四階段(必需)
Phase 1:規格(PM)
↓
Gherkin .feature 檔案
↓
Phase 2:架構(架構師)
↓
架構設計文件(繁中 Markdown)
↓
Phase 3:實作(工程師)
↓
可運行的程式碼(依專案架構)
↓
Phase 4:驗證(QA)
↓
✅ 驗證結論報告
選用階段:Integration Tests
Phase 2.5:整合測試(選用)
↓
在實作前生成 Integration Tests
↓
測試先行開發(紅燈 → 綠燈)
何時使用 /sdd-integration-test?
- ✅ 團隊實踐 BDD 測試先行
- ✅ 需要完整的整合測試覆蓋
- ✅ 複雜的業務邏輯需要驗證
- ❌ 簡單的 CRUD 功能
- ❌ 原型開發階段
- ❌ 時程緊迫的專案
指令
| 指令 | 用途 | 何時使用 | 是否必需 |
|---|---|---|---|
/sdd-auto |
自動執行全部 4 個階段 | 快速原型、簡單功能 | - |
/sdd-spec |
生成 Gherkin 規格 | 定義需求 | ✅ 必需 |
/sdd-arch |
設計資料模型與介面 | 審查結構 | ✅ 必需 |
/sdd-integration-test |
生成 Integration Tests(紅燈) | BDD 測試先行開發 | 🔷 選用 |
/sdd-impl |
實作邏輯 | 撰寫程式碼 | ✅ 必需 |
/sdd-verify |
根據規格驗證 | 測試實作 | ✅ 必需 |
💡 範例
輸入
/sdd-auto Implement a VIP discount system in Python where VIP users get 20% off purchases over $100
輸出
階段 1:規格 (features/vip_discount.feature)
Feature: VIP Discount
Scenario: Apply discount to VIP user
Given user is VIP
When user makes a purchase of 1000 USD
Then final price should be 800 USD
Phase 2:架構 (docs/features/vip_discount/architecture.md)
# VIP 折扣系統 - 架構設計
## 1. 專案上下文
- 程式語言:Python
- 架構模式:Service Layer
## 3. 資料模型
- UserType(列舉):VIP, NORMAL
- DiscountResult(實體):final_price, discount
## 4. 服務介面
- calculate_discount(amount, user_type) → DiscountResult
Phase 3:實作 (依 architecture.md 指定位置)
# src/services/discount_service.py
def calculate_discount(amount: float, user_type: UserType) -> DiscountResult:
if user_type == UserType.VIP and amount >= 100:
discount = amount * 0.2
return DiscountResult(amount - discount, discount)
return DiscountResult(amount, 0)
Phase 4:驗證結論 (docs/features/vip_discount/conclusion.md)
## 3. 摘要
- 架構:2/2 通過
- 情境:2/2 通過
- **狀態:** ✅ 完成
🌐 多語言支援
相同的工作流程,不同的語言:
Python
from dataclasses import dataclass
from abc import ABC, abstractmethod
@dataclass
class User:
id: str
type: UserType
class IUserService(ABC):
@abstractmethod
def authenticate(self, credentials: Credentials) -> User:
pass
TypeScript
interface User {
id: string;
type: UserType;
}
interface IUserService {
authenticate(credentials: Credentials): User;
}
Go
type User struct {
ID string
Type UserType
}
type UserService interface {
Authenticate(credentials Credentials) (User, error)
}
更多語言請參閱 語言指南,包含 Rust、Java、C# 等。
🎓 使用案例
1. API 開發
/sdd-spec Design a RESTful API for blog posts (CRUD operations)
/sdd-arch features/blog_api.feature
# 獲得清晰的 API 契約和資料結構
2. 功能實作
/sdd-auto Implement user authentication with JWT tokens in TypeScript
# 幾分鐘內獲得可運行、已測試的程式碼
3. 遺留程式碼重構
/sdd-spec The payment module should support credit card, PayPal, and crypto
# 在重構前定義清晰的需求
4. 團隊協作
# PM:定義需求
/sdd-spec User registration with email verification
# 架構師:審查並設計
/sdd-arch features/user_registration.feature
# 工程師:實作
/sdd-impl features/user_registration.feature
# QA:驗證
/sdd-verify features/user_registration.feature
📁 專案結構
執行 SDD 工作流程後的輸出:
your-project/
├── features/ # Phase 1: Gherkin 規格
│ └── {feature}.feature
├── docs/
│ └── features/
│ └── {feature}/
│ ├── architecture.md # Phase 2: 架構設計(繁中)
│ └── conclusion.md # Phase 4: 驗證結論
└── src/ # Phase 3: 實作程式碼
├── models/ # 依專案既有架構
│ └── {Feature}Model.{ext}
└── services/
└── {Feature}Service.{ext}
GSI-Protocol 儲存庫結構:
GSI-Protocol/
├── README.md # 本檔案
├── CONTRIBUTING.md # 貢獻指南
├── LICENSE # MIT 授權
├── gsi_installer.py # Python 安裝器
├── pyproject.toml # Python 專案配置
├── .claude/
│ ├── commands/ # Claude Code slash 指令
│ │ ├── sdd-auto.md # 自動工作流程
│ │ ├── sdd-spec.md # Phase 1
│ │ ├── sdd-arch.md # Phase 2
│ │ ├── sdd-integration-test.md # BDD Integration Tests
│ │ ├── sdd-impl.md # Phase 3
│ │ └── sdd-verify.md # Phase 4
│ └── agents/ # 專業 Sub-Agents 定義
│ ├── sdd-orchestrator.md # SDD 編排器
│ ├── pm-spec-writer.md # PM 規格撰寫專家
│ ├── architect-designer.md # 系統架構設計師
│ ├── bdd-test-engineer.md # BDD 測試工程師
│ ├── implementation-engineer.md # 實作工程師
│ └── qa-verifier.md # QA 驗證師
├── .codex/
│ └── prompts/ # Codex (OpenAI) prompts
│ ├── sdd-auto.md # 自動工作流程
│ ├── sdd-spec.md # Phase 1
│ ├── sdd-arch.md # Phase 2
│ ├── sdd-integration-test.md # BDD Integration Tests
│ ├── sdd-impl.md # Phase 3
│ └── sdd-verify.md # Phase 4
├── .github/
│ └── prompts/ # GitHub Copilot prompts
│ ├── sdd-auto.prompt.md # 自動工作流程
│ ├── sdd-spec.prompt.md # Phase 1
│ ├── sdd-arch.prompt.md # Phase 2
│ ├── sdd-integration-test.prompt.md # BDD Integration Tests
│ ├── sdd-impl.prompt.md # Phase 3
│ └── sdd-verify.prompt.md # Phase 4
├── docs/ # 文件
│ ├── QUICKSTART.md # 快速入門指南
│ ├── INSTALL.md # 安裝指南
│ ├── PYTHON_INSTALLER.md # Python 安裝器說明
│ ├── PLATFORM_SUPPORT.md # 平台支援說明
│ ├── SUB_AGENTS.md # Sub-Agents 專業代理系統說明
│ ├── COMMANDS.md # 指令參考
│ ├── LANGUAGE_GUIDE.md # 語言支援
│ └── expected_workflow.md # 工作流程細節
└── prompts/ # 代理提示(參考)
├── pm_agent.md
├── architect_agent.md
├── engineer_agent.md
└── qa_agent.md
🚀 優勢
對開發者
- ✅ 更快開發:自動生成樣板程式碼和結構
- ✅ 更高品質:系統化方法減少 bug
- ✅ 清晰需求:Gherkin 規格消除歧義
對團隊
- ✅ 共同語言:所有人都能理解的 BDD 規格
- ✅ 更好溝通:PM、架構師、工程師、QA 各有明確階段
- ✅ 可維護程式碼:每一行都可追溯到需求
對專案
- ✅ 語言彈性:切換語言不需改變方法論
- ✅ 框架無關:使用任何函式庫或框架
- ✅ 可擴展:適用於簡單功能到複雜系統
🔧 需求
- AI 平台(擇一或多個):
- Claude Code CLI,或
- Codex (OpenAI),或
- GitHub Copilot
- 安裝工具:
- Python 3.10+
- uvx/pipx(推薦)或 pip
- Git
- 目標語言執行環境(Python 3.8+、Node.js 16+、Go 1.19+ 等)
📖 了解更多
- 📝 快速入門(5 分鐘)
- 📚 完整文件
- ⚙️ Sub-Agents 專業代理系統
- 🌍 語言支援
- 💬 GitHub 討論
🤝 貢獻
我們歡迎貢獻!請參閱 CONTRIBUTING.md 了解指南。
貢獻方式
- 🐛 回報 bug
- 💡 建議功能
- 📝 改善文件
- 🌍 新增語言範例
- 🔧 提交 pull request
📄 授權
MIT 授權 - 詳見 LICENSE 檔案。
🙏 致謝
使用以下工具建置:
- Claude Code - AI 驅動開發
- Codex (OpenAI) - AI 程式碼生成
- GitHub Copilot - AI 程式輔助
- Gherkin - BDD 規格語言
- 靈感來自測試驅動開發和行為驅動開發原則
📞 支援
- 📖 文件
- 💬 GitHub Issues
- 💡 討論
由開發者打造,為開發者服務 ❤️
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gsi_protocol_installer-1.0.13.tar.gz.
File metadata
- Download URL: gsi_protocol_installer-1.0.13.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
371100d3137a3dab16f9bb6ff44766902e96e722e0b5bdc6242e0c5981cbdde7
|
|
| MD5 |
89f9f579d86bc2aaee61b4f61d6eeb77
|
|
| BLAKE2b-256 |
a06423aa72b1170b74d89daeff2fb92b6d902b79fc82b839e85703b90b66e7e3
|
Provenance
The following attestation bundles were made for gsi_protocol_installer-1.0.13.tar.gz:
Publisher:
publish-to-pypi.yml on CodeMachine0121/GSI-Protocol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsi_protocol_installer-1.0.13.tar.gz -
Subject digest:
371100d3137a3dab16f9bb6ff44766902e96e722e0b5bdc6242e0c5981cbdde7 - Sigstore transparency entry: 764302240
- Sigstore integration time:
-
Permalink:
CodeMachine0121/GSI-Protocol@63f7244fdb38bbb8fbb1393efd05119903d26622 -
Branch / Tag:
refs/tags/v1.0.13 - Owner: https://github.com/CodeMachine0121
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@63f7244fdb38bbb8fbb1393efd05119903d26622 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gsi_protocol_installer-1.0.13-py3-none-any.whl.
File metadata
- Download URL: gsi_protocol_installer-1.0.13-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baad9129dbf64ed50ff8c22ca4c28309e68663e8e6f8aff68ff64b16016dacee
|
|
| MD5 |
0d855c7c0d3b674a9301673782ab6334
|
|
| BLAKE2b-256 |
6b88de0fee6735fea3070cfde5df925d13b85ccbbe95001ee18e3cf75a016d8f
|
Provenance
The following attestation bundles were made for gsi_protocol_installer-1.0.13-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on CodeMachine0121/GSI-Protocol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gsi_protocol_installer-1.0.13-py3-none-any.whl -
Subject digest:
baad9129dbf64ed50ff8c22ca4c28309e68663e8e6f8aff68ff64b16016dacee - Sigstore transparency entry: 764302242
- Sigstore integration time:
-
Permalink:
CodeMachine0121/GSI-Protocol@63f7244fdb38bbb8fbb1393efd05119903d26622 -
Branch / Tag:
refs/tags/v1.0.13 - Owner: https://github.com/CodeMachine0121
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@63f7244fdb38bbb8fbb1393efd05119903d26622 -
Trigger Event:
release
-
Statement type: