Github Spec Kit 攻略大解析
Spec-Driven DevelopmentAI CodingWorkflow
Github Spec Kit 攻略大解析
reference: https://github.com/github/spec-kit
1. Install Specify
Initialize your project depending on the coding agent you're using:
uvx --from git+https://github.com/github/spec-kit.git specify init <PROJECT_NAME>
2. Create the spec
Use the /specify command to describe what you want to build. Focus on the what and why, not the tech stack.
/specify Build an application that can help me organize my photos in separate photo albums. Albums are grouped by date and can be re-organized by dragging and dropping on the main page. Albums never other nested albums. Within each album, photos are previewed in a tile-like interface.
3. Create a technical implementation plan
Use the /plan command to provide your tech stack and architecture choices.
/plan The application uses Vite with minimal number of libraries. Use vanilla HTML, CSS, and JavaScript as much as possible. Images are not uploaded anywhere and metadata is stored in a local SQLite database.
4. Break down and implement
Use /tasks to create an actionable task list, then ask your agent to implement the feature.
For detailed step-by-step instructions, see the comprehensive guide.
📚 核心理念(Core philosophy)
Spec-Driven Development 強調:
- Intent-driven development:先定義「要做什麼、為什麼」,再決定「怎麼做」
- Rich specification creation:透過結構化規格與原則,降低溝通落差
- Multi-step refinement:以多輪精煉代替一次到位生成
- 善用模型能力:規格解讀與落地依賴強大的 AI 模型
🌟 發展階段(Development phases)
| 階段 | 目標 | 重點活動 |
|---|---|---|
| 0-to-1(Greenfield) | 從零起步 | 需求→規格→計畫→可上線產物 |
| 創意探索 | 平行多版本 | 多技術棧/多 UX 嘗試與比對 |
| 漸進增強(Brownfield) | 現代化 | 疊代開發、逐步改造與升級 |
🔧 先決條件(Prerequisites)
- Linux/macOS 或 WSL2
- AI coding agent(Claude Code / Copilot / Gemini CLI)
- uv 套件管理、Python 3.11+、Git
筆記(Notes)
- 先安裝進 Project 中,會預先產生結構檔與 MD
/specify:專注用戶旅程與結果,讓 Agent 擴寫規格/plan:定義技術限制與架構邊界/tasks:拆解為可管理、可測試的單元- implement:逐步完成與驗收