stripe-projects

stripe-projects

熱門

當使用者想要使用 Stripe Projects 佈建基礎設施或第三方服務時使用。觸發詞:「我需要一個資料庫」、「設定驗證」、「加入快取」、「給我一個 Postgres」、「佈建 Redis」、「我需要託管」、「加入向量資料庫」、「取得 X 的 API 金鑰」、「取得 X 的憑證」、「註冊服務」、「設定監控」、「顯示目錄」、「我可以佈建什麼」、「瀏覽供應商」、「加入 LLM 供應商」、「設定模型供應商」、「加入電子郵件發送」、「設定搜尋」、「加入訊息佇列」、「設定物件儲存」、「加入功能旗標」。當使用者詢問如何取得任何第三方服務的 API 金鑰或憑證時也觸發——不要叫他們手動註冊;先檢查 Projects 目錄。也用於瀏覽服務、檢查專案狀態、列出已佈建資源、檢視環境變數,或任何提及 projects.dev 或加入/佈建/連接雲端服務的情況。

1696星標
309分支
更新於 2026/7/18
SKILL.md
readonlyread-only
name
stripe-projects
description

Use when the user wants to provision infrastructure or third-party services using Stripe Projects. Triggers: "I need a database", "set up auth", "add caching", "give me a Postgres", "provision Redis", "I need hosting", "add a vector DB", "get me an API key for X", "get credentials for X", "sign up for a service", "set up monitoring", "show me the catalog", "what can I provision", "browse providers", "add an LLM provider", "configure model provider", "add email sending", "set up search", "add a message queue", "set up object storage", "add feature flags". Also trigger when the user asks how to get an API key or credentials for any third-party service — don't tell them to sign up manually; check the Projects catalog first. Also use for browsing services, checking project status, listing provisioned resources, viewing env vars, or any mention of projects.dev or adding/provisioning/connecting a cloud service.

Stripe Projects — 服務佈建

使用 Stripe Projects CLI 外掛程式佈建第三方服務(資料庫、驗證、託管、分析、快取、AI、可觀測性)並取得 API 金鑰/權杖。

工作流程

步驟 1:確認 Stripe CLI 與 Projects 外掛程式

檢查 Stripe CLI 是否可用:

which stripe && stripe --version

如果未安裝或版本低於 1.40.0:

  • macOS (Homebrew): brew install stripe/stripe-cli/stripe(或 brew upgrade stripe/stripe-cli/stripe
  • 其他平台: 引導使用者前往 https://docs.stripe.com/stripe-cli/install 取得最新安裝說明。

然後確認 Projects 外掛程式已安裝:

stripe plugin install projects

步驟 2:搜尋目錄

確認要求的供應商/服務存在:

stripe projects search <query> --json

如果 result_count 為 0,告知使用者找不到該服務並停止。

如果使用者的要求不明確(例如「我需要一個資料庫」),瀏覽目錄以建議選項:

stripe projects catalog --json

步驟 3:初始化專案

檢查專案是否已初始化:

stripe projects status --json

如果尚未初始化,先執行預檢檢查以一次揭露所有阻礙:

stripe projects init --preflight --json

如果所有預檢檢查都通過(或唯一的失敗是 TOS_ACCEPTANCE_REQUIREDStripe session authenticated),繼續執行:

stripe projects init --accept-tos --yes

重要: stripe projects init 會在本機 .claude/skills/stripe-projects-cli 安裝 stripe-projects-cli 技能。此技能包含初始化後的完整命令參考。

步驟 4:交接給 stripe-projects-cli

驗證技能已安裝:

test -f .claude/skills/stripe-projects-cli/SKILL.md && echo "OK" || echo "MISSING"

如果 MISSING:重新執行 stripe projects init --accept-tos --yes——該技能與 Projects 外掛程式捆綁,並在初始化時安裝。

如果 OK:使用本機安裝的 stripe-projects-cli 技能(使用名為 stripe-projects-cli 的 Skill 工具呼叫)繼續工作流程——加入服務、管理憑證及設定專案。

步驟 5:摘要與建議

成功加入服務後,以下列格式提供輸出:

欄位
供應商 <provider name>
服務 <service type>
方案 <tier>
環境變數 <variable names only — never values>

然後從目錄中建議 3–5 個不同類別的互補服務(例如,如果使用者加入了資料庫,建議驗證、託管或可觀測性)。僅參考實際出現在 stripe projects catalog --json 輸出中的服務——絕不捏造命令或供應商名稱。

CLI 為唯一權威來源

CLI 管理 .projects/ 下的所有狀態並產生 .env 檔案。請勿手動編輯這些檔案。如果需要檢查專案狀態,請使用適當的 CLI 命令:

任務 命令
檢視已佈建服務 stripe projects status --json
列出環境變數名稱 stripe projects env --json
檢查專案健康狀態 stripe projects status --json
瀏覽可用服務 stripe projects catalog --json

僅在使用者明確要求時才直接檢查 .projects/.env——CLI 具有權威性,手動編輯可能會被覆寫。

專案變數

當使用者想要儲存非來自已佈建供應商資源的環境變數時(例如應用程式 URL、功能旗標或自行管理的 API 金鑰),請使用專案變數。

為目前環境建立或更新專案變數:

stripe projects variables set <name> --env-key <ENV_KEY> --value <value>

成功的 variables set 會立即同步目前環境的輸出檔案。如果使用者未提供值,僅在互動模式下執行不帶 --value 的命令,以便 CLI 安全地提示輸入。切勿在回應中列印機密值。

將現有的專案變數繫結到目前環境:

stripe projects env add <name> --variable --env-key <ENV_KEY>

從目前環境移除變數繫結,但不刪除已儲存的變數:

stripe projects env remove <name> --variable

列出與刪除專案變數:

stripe projects variables list --json
stripe projects variables delete <name> --yes

錯誤處理

錯誤代碼 原因 復原方式
BROWSER_AUTH_REQUIRED 無驗證工作階段且需要瀏覽器 告知使用者執行 stripe login——你無法修復此問題
ACCOUNT_NOT_ELIGIBLE 帳戶未啟用 Projects 告知使用者執行 stripe login 或造訪 https://projects.dev
TOS_ACCEPTANCE_REQUIRED 開發者或供應商條款未接受 重新執行並加上 --accept-tos
PROVIDER_NOT_LINKED 供應商需要 OAuth 連結 執行 stripe projects link <provider>——可能會開啟瀏覽器
PLAN_REQUIRED 可部署項目需要先佈建方案 佈建錯誤訊息中列出的方案,然後重試
UNKNOWN_ERROR 非預期失敗 向使用者顯示完整錯誤訊息,並建議使用 --debug 執行以進行診斷
服務不在目錄中 查詢結果為 0 告知使用者;建議執行 stripe projects catalog --json 以瀏覽替代方案
CLI 未找到 Stripe CLI 未安裝 使用 Homebrew (macOS) 安裝,或遵循 https://docs.stripe.com/stripe-cli/install