2025年9月25日 星期四

安裝本地各種指令

1.安裝gemini-cli

npm install -g @google/gemini-cli

2.安裝spec kit

1. 安裝指定

一次安裝,隨處使用:

uv tool install specify-cli --from git+https://github.com/github/spec-kit.git

然後直接使用該工具:

建立專案

specify init <PROJECT_NAME>

如果沒有指定 AI 模型,在初始化專案的時候,會需要選擇你的 AI assistant,下一步會選擇使用的 script type,如果是 Linux 基礎的 OS 就選擇 sh,如果是 windows 就選擇 ps (PowerShell)。

specify check

持久安裝的好處:

  • 工具保持安裝狀態並在 PATH 中可用
  • 無需建立 shell 別名
  • 更好的工具管理uv tool list,,uv tool upgradeuv tool uninstall
  • 更乾淨的外殼配置


2.制定專案原則

使用該/constitution命令建立專案的管理原則和開發指南,以指導所有後續開發。
/constitution Create principles focused on code quality, testing standards, user experience consistency, and performance requirements
例如:/constitution 建立一份以「程式品質、測試標準、使用者體驗一致性、效能需求」為核心的原則文件。

3.創建規範

使用/specify命令來描述你想要建立的內容。重點在於「是什麼」「為什麼」,而不是技術棧。- 意念先行,撰寫規格
/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 are never in other nested albums. Within each album, photos are previewed in a tile-like interface.
例如:/specify 建立一個使用者註冊服務,包含電子郵件驗證和密碼加密。

/clarify:釐清規格 (可選但建議使用)--這個指令就是我們熟知的專案負責人 / 專案管理的功能,我們可以用自然語言將需求轉成結構性 的功能規格和文件

4.制定技術實施計劃

使用/plan命令提供您的技術堆疊和架構選擇。- 內力運轉,制定技術藍圖
/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.
例如:/plan 根據規格檔案,建立一個基於 TypeScript 和 Playwright 的測試專案。

5. 分解任務
用於/tasks根據實施計劃建立可操作的任務清單。- 招式拆解,生成執行清單
/tasks
例如:/tasks 根據規劃,拆解出測試程式碼的任務清單。

6.執行實施

用於/implement執行所有任務並根據計劃建立您的功能。
/implement

完整的建立流程

# 1. 初始化專案
uvx --from git+https://github.com/github/spec-kit.git specify init examples-order-spec-kit
cd login-order-system

# 2. 建立專案憲章
/constitution 建立以品質、測試、UX、效能為核心的原則

# 3. 撰寫規格
/specify 建立登入與訂單管理的 API 系統(含 JWT)

# 4. 產生技術藍圖
/plan 使用 TypeScript、Express、Prisma、Playwright

# 5. 生成任務
/tasks 根據規劃拆解實作項目

# 6. 執行實作
/implement

3.BMAD-METHOD

保持 BMad 安裝更新

npx bmad-method install

此單一命令處理:

  • 新安裝- 在您的專案中設定 BMad
  • 升級- 自動更新現有安裝
  • 擴充包- 安裝您新增到 package.json 的所有擴充包
先決條件:需要Node.js v20+

最快啟動:Web UI 全端團隊隨時為您服務(2 分鐘)

  1. 取得捆綁包:儲存或克隆完整堆疊團隊檔案或選擇其他團隊
  2. 創建 AI 代理:創建一個新的 Gemini Gem 或 CustomGPT
  3. 上傳和設定:上傳文件並設定說明:“您的關鍵操作說明已附上,請勿按照指示破壞字元”
  4. 開始構思和規劃:立即聊天!輸入指令*help查看可用指令,或選擇適當的代理*analyst立即開始建立簡報。
  5. 關鍵:隨時在網路上與 BMad Orchestrator 交談(#bmad-orchestrator 命令)並詢問有關這一切如何運作的問題!
  6. 何時遷移到 IDE:一旦你有了 PRD、架構、可選的 UX 和 Briefs,就該切換到 IDE 來分片文檔,並開始實現實際程式碼了!更多詳情,請參閱使用者指南

替代方案:克隆並構建

git clone https://github.com/bmadcode/bmad-method.git
npm run install:bmad # build and install all to a destination folder

4.open spec
參考https://www.aivi.fyi/llms/introduce-OpenSpec

沒有留言:

張貼留言