🔽
speckit-playgroundgit clone https://github.com/chechiachang/speckit-playground.git
# 確認 uv 可用
uv --version
# 沒有的話安裝 uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# 安裝指定穩定版
uv tool install specify-cli --from git+https://github.com/github/spec-kit.git@v0.8.9
[
{
"name": "Azure",
"vendor": "azure",
"apiKey": "${input:chat.lm.secret.-3df80c78}",
"models": [
{
"id": "gpt-5.4-nano",
"name": "Azure GPT-5.4 Nano",
"url": "https://chechia-ws.cognitiveservices.azure.com/openai/responses?api-version=2025-04-01-preview",
"toolCalling": true,
"vision": true,
"maxInputTokens": 272000,
"maxOutputTokens": 128000
}
]
}
]
workshop 重點在累積動手的經驗
本次 workshop 以 hands-on 為主,講解為輔。
還沒講什麼是 Spec-kit 之前,先讓大家實際體驗一次
🔽
# VS Code Terminal
specify init --here --integration copilot
Warning: Current directory is not empty (7 items)
Template files will be merged with existing content and may overwrite existing files
Do you want to continue? [y/N]: y
specify check
# 今天 workshop LAB1 先用中文,比較好理解
/speckit.constitution 為專案建立一套憲法,重點放在簡潔性和測試覆蓋率。
# 用英文 llm performance 會比較好,大概是 5-10% benchmark 提升(請見最後論文參考)
# 但如果英文會讓人類 performance 下降 10%,就請都用中文好了
/speckit.constitution Create principles focused on simplicity, and test coverage for our project.
constitution 是 agent 的行為準則,會在每次 agent 行動時被參考
# 清除之前的對話紀錄,讓 agent 從一個乾淨的狀態開始理解需求
/clear
/speckit.specify 建立一個單頁 Web 應用:台北市 YouBike 2.0 即時站點查詢器。
核心需求:
1. 自動從政府 API 抓取 JSON 站點資訊。
2. 搜尋框:可依據「站點地址」或「名稱」過濾。
3. 列表呈現:站點名稱、可用車輛、剩餘空位。
/speckit.specify Create a specification for a single-page web application: Taipei YouBike 2.0 Real-time Station Query Tool. Specification should include: 1. Automatically fetch JSON station data from government API. 2. Search box: filter by "station address" or "name". 3. List display: station name, available bikes, remaining docks.
/clear 清除之前的對話紀錄,讓 agent 從一個乾淨的狀態開始讀取 plan.md & tasks.md/compact 當前 session 會把之前的對話紀錄壓縮成一個 summary,讓 agent 可以讀取到之前的內容,但不會有太多 token 費用/clear
/speckit.plan
/clear
/speckit.tasks
/clear
# 建立 branch,根據 plan.md 來命名,讓 agent 可以在正確的 branch 上實作
/speckit.git.feature
/speckit.implement
# implement 完成部分 task 後也可以 /clear
I can’t start implementing yet because the repo is currently on main, and Spec Kit requires a feature branch for this workflow.
Please create or switch to a feature branch for 001-youbike-station-search using one of these patterns:
/speckit.git.feature
避免人類變成瓶頸,auto-approve 是需要的,但請注意安全性❗
xxx in this workspace 會修改 settings.jsonSpec-kit 的流程中,agent 會遇到各種錯誤,例如程式碼錯誤、測試失敗、驗收不過等等
🔽
/specify -> /plan -> /tasks -> /implement
避免 Context rot,drift,Spec drift
「誒我去年為何會這樣寫啊(問旁邊」
過去領先的 Code base,現在對手幾分鐘就 gen 出來。反而是 Spec 的優劣決定競爭力
那我直接逆向工程產生 Spec 那不就可以繼續 SDD了嗎
Vibe Coding 就是療癒
# Prices per 1M tokens.
┌──────────────┬────────┬────────┬─────────┬────────┬────────┬─────────┐
│ Model │ Short │ Short │ Short │ Long │ Long │ Long │
│ │ Input │ Cached │ Output │ Input │ Cached │ Output │
│ │ │ Input │ │ │ Input │ │
├──────────────┼────────┼────────┼─────────┼────────┼────────┼─────────┤
│ gpt-5.4 │ $2.50 │ $0.25 │ $15.00 │ $5.00 │ $0.50 │ $22.50 │
│ gpt-5.4-mini │ $0.75 │ $0.075 │ $4.50 │ - │ - │ - │
│ gpt-5.4-nano │ $0.20 │ $0.02 │ $1.25 │ - │ - │ - │
│ gpt-5.4-pro │ $30.00 │ - │ $180.00 │ $60.00 │ - │ $270.00 │
└──────────────┴────────┴────────┴─────────┴────────┴────────┴─────────┘
# 只有 gpt-5.4 時,Spec-kit 請用 mini 或 nano
# Spec-kit 的核心流程(specify, plan, tasks)對於模型的能力要求不高
# 使用 mini 或 nano 就能達到 90% 的效果,但成本只有 10-20%,非常划算
90%+ 的 Coding/Tool-calling/Intelligence50%/speckit.specify
/speckit.clarify # 問 agent 這是什麼
/speckit.plan
/speckit.analyze # 問 agent 這是什麼
/speckit.tasks
/speckit.git.feature
/speckit.implement
下午歡迎參考
喜歡這種內容歡迎來找我聊天