Stripe Projectsを使ってインフラストラクチャ(システムを支える基盤)やサードパーティ(外部の)サービスをセットアップしたいとき。 **実行される場合:** 「データベースが必要」「認証をセットアップして」「キャッシング(データの高速化機能)を追加して」「Postgresをくれ」「Redisをプロビジョニングして(リソースを自動配置)」「ホスティングが必要」「ベクトルDB(ベクトル形式のデータベース)を追加して」「XのAPIキー(接続用の鍵)をもらいたい」「Xの認証情報をもらいたい」「サービスに登録して」「監視をセットアップして」「カタログを見せて」「何をセットアップできるの」「プロバイダーを見たい」「LLMプロバイダー(AI言語モデルの提供者)を追加して」「モデルプロバイダーを設定して」「メール送信を追加して」「検索をセットアップして」「メッセージキューを追加して」「オブジェクトストレージ(ファイル保存サービス)をセットアップして」「フィーチャーフラグ(機能の切り替え機能)を追加して」など。 また、サードパーティサービスのAPIキーや認証情報の取得方法を聞かれた場合も対象。ユーザーに手動で登録させるのではなく、まずProjectsのカタログを確認してください。 **その他の対象:** サービスの閲覧、プロジェクトの状態確認、配置済みリソースの一覧表示、環境変数の確認、projects.devの言及、またはクラウドサービスの追加・配置・接続に関する任意の内容。
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.
データベース、認証、ホスティング、分析、キャッシング、AI、監視などのサードパーティサービスをセットアップし、APIキー・トークンを取得するには、Stripe Projects CLI プラグインを使用します。
Stripe CLI が利用可能か確認します:
which stripe && stripe --version
インストールされていない、またはバージョンが 1.40.0 未満の場合:
brew install stripe/stripe-cli/stripe (またはアップグレード時は brew upgrade stripe/stripe-cli/stripe)次に、Projects プラグインがインストールされているか確認します:
stripe plugin install projects
リクエストされたプロバイダー・サービスが存在するか確認します:
stripe projects search <query> --json
result_count が 0 の場合は、ユーザーに見つからなかった旨を伝えて終了します。
ユーザーのリクエストが曖昧な場合(例:「データベースが必要」)は、カタログを参照して選択肢を提案します:
stripe projects catalog --json
プロジェクトがすでに初期化されているか確認します:
stripe projects status --json
初期化されていない場合、まず事前チェックを実行して、すべての問題を一度に把握します:
stripe projects init --preflight --json
すべてのチェックが成功した場合、または唯一の失敗が TOS_ACCEPTANCE_REQUIRED(利用規約への同意が必要)の場合は、先に進みます:
stripe projects init --accept-tos --yes
BROWSER_AUTH_REQUIRED(ブラウザ認証が必要)、PROJECTS_SESSION_UNUSABLE(プロジェクトセッションが使用不可)、ACCOUNT_NOT_ELIGIBLE(アカウントが対象外)のいずれかで失敗した場合は、ここで停止します。そのチェックが表示したメッセージと対応方法を、そのままユーザーに報告し、ユーザーに解決させてください。これらの問題をクリアするにはブラウザでのサインイン、または Dashboard での操作が必要であり、あなたは実行できません。自分で stripe projects init を実行したり、事前チェックを再実行したりしないでください。ユーザーがブラウザでのサインインまたは Dashboard での操作を完了する必要があるため、これらは問題を解決しません。
失敗したチェックが出力した対応方法に従ってください。stripe login が解決策だと無視して進めないでください。すでに Stripe CLI セッションが存在する場合、stripe login は「既にログイン済み」と報告し、終了コード 0 で何も変更されずに終了します。ログインコマンドの終了コードが 0 だからといって、問題がクリアされたわけではありません。
重要: stripe projects init は stripe-projects-cli スキルをローカルに .claude/skills/stripe-projects-cli にインストールします。このスキルには初期化後のコマンド全体のリファレンスが含まれています。
スキルがインストールされたことを確認します:
test -f .claude/skills/stripe-projects-cli/SKILL.md && echo "OK" || echo "MISSING"
MISSING の場合: stripe projects init --accept-tos --yes を1 回だけ再実行してください。スキルは Projects プラグインに含まれており、初期化時にインストールされます。その 1 回の再試行後もファイルが見つからない場合、または init が 0 以外で終了した場合は、init のエラーメッセージをユーザーに報告して停止します。init を繰り返し実行しないでください。
OK の場合: ローカルにインストールされた stripe-projects-cli スキル(スキルツールを使用して名前 stripe-projects-cli で呼び出す)を使用して、ワークフローを続行します。サービスの追加、認証情報の管理、プロジェクト設定を行います。
サービスの追加に成功した後、次の形式で出力を提供します:
| 項目 | 値 |
|---|---|
| プロバイダー | <プロバイダー名> |
| サービス | <サービスタイプ> |
| プラン | <プラン> |
| 環境変数 | <変数名のみ — 値は記載しない> |
次に、カタログからさまざまなカテゴリの補完的なサービスを 3~5 個提案します(例えば、ユーザーがデータベースを追加した場合、認証、ホスティング、監視を提案する)。stripe projects catalog --json の出力に実際に表示されるサービスのみを参照してください。コマンドやプロバイダー名を架空のものとして作成しないでください。
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 セッションがなく、ブラウザでのサインインが必要 | ユーザーにブラウザでのサインインを完了できるターミナルで stripe projects init を自分で実行するよう案内します。あなたは修正できず、自分で再実行しても解決しません |
PROJECTS_SESSION_UNUSABLE |
Stripe CLI セッションは存在しますが、Projects はそれから本番用の認証情報を読み取ることができません | メッセージと対応方法をそのまま報告して停止します。再試行しないでください。stripe login を実行しないでください。既にログイン済みと報告され、終了コード 0 で終了します |
ACCOUNT_NOT_ELIGIBLE |
アカウントが Projects にオンボード(登録開始)されていない | stripe projects switch-account を実行してアカウントを選択するか、このアカウントの設定を続行するようユーザーに案内します。CLI が出力した対応方法を報告して停止します |
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 に従ってインストールします |
Provision third-party services (databases, auth, hosting, analytics, caching, AI, observability) and retrieve API keys/tokens using the Stripe Projects CLI plugin.
Check if the Stripe CLI is available:
which stripe && stripe --version
If not installed or below version 1.40.0:
brew install stripe/stripe-cli/stripe (or brew upgrade stripe/stripe-cli/stripe)Then ensure the Projects plugin is installed:
stripe plugin install projects
Confirm the requested provider/service exists:
stripe projects search <query> --json
If result_count is 0, inform the user the service was not found and stop.
If the user’s request is vague (for example, “I need a database”), browse the catalog to suggest options:
stripe projects catalog --json
Check if a project is already initialized:
stripe projects status --json
If not initialized, run a preflight check first to reveal all blockers at once:
stripe projects init --preflight --json
If all preflight checks pass, or the only failure is TOS_ACCEPTANCE_REQUIRED, proceed:
stripe projects init --accept-tos --yes
If any check fails with BROWSER_AUTH_REQUIRED, PROJECTS_SESSION_UNUSABLE, or ACCOUNT_NOT_ELIGIBLE, stop here. Report that check’s message and remedy to the user verbatim and let them resolve it — clearing these requires a browser sign-in or a Dashboard visit you cannot perform. Do not run stripe projects init yourself and do not re-run the preflight: neither clears the blocker for you, since only the user can complete a browser sign-in or a Dashboard step.
Follow the remedy the failing check prints rather than assuming stripe login is the fix. If a Stripe CLI session already exists, stripe login reports that you are already logged in and exits 0 without changing anything — an exit code of 0 from a login command does not mean the blocker cleared.
Important: stripe projects init installs the stripe-projects-cli skill locally at .claude/skills/stripe-projects-cli. This skill contains the full post-init command reference.
Verify the skill was installed:
test -f .claude/skills/stripe-projects-cli/SKILL.md && echo "OK" || echo "MISSING"
If MISSING: re-run stripe projects init --accept-tos --yes once — the skill is bundled with the Projects plugin and installed during init. If the file is still missing after that single retry, or if init exits non-zero, report init’s error message to the user and stop. Do not keep re-running init.
If OK: use the locally-installed stripe-projects-cli skill (invoke using the Skill tool with name stripe-projects-cli) to continue the workflow — adding services, managing credentials, and configuring the project.
After a successful service addition, provide output in this format:
| Field | Value |
|---|---|
| Provider | <provider name> |
| Service | <service type> |
| Tier | <tier> |
| Env vars | <variable names only — never values> |
Then suggest 3–5 complementary services from different categories in the catalog (for example, if user added a database, suggest auth, hosting, or observability). Only reference services that actually appear in stripe projects catalog --json output — never fabricate commands or provider names.
The CLI manages all state under .projects/ and generates .env files. Don’t hand-edit these files. If you need to inspect project state, use the appropriate CLI command:
| Task | Command |
|---|---|
| View provisioned services | stripe projects status --json |
| List env var names | stripe projects env --json |
| Check project health | stripe projects status --json |
| Browse available services | stripe projects catalog --json |
Only inspect .projects/ or .env directly if the user explicitly asks you to — the CLI is authoritative, so manual edits may be overwritten.
Use project variables when the user wants to store an environment variable that doesn’t come from a provisioned provider resource, such as an app URL, feature flag, or self-managed API key.
Create or update a project variable for the active environment:
stripe projects variables set <name> --env-key <ENV_KEY> --value <value>
A successful variables set syncs the active environment output file immediately. If the user doesn’t provide the value, run the command without --value only in interactive mode so the CLI can prompt securely. Never print secret values in your response.
Bind an existing project variable to the active environment:
stripe projects env add <name> --variable --env-key <ENV_KEY>
Remove a variable binding from the active environment without deleting the stored variable:
stripe projects env remove <name> --variable
List and delete project variables:
stripe projects variables list --json
stripe projects variables delete <name> --yes
| Error code | Cause | Recovery |
|---|---|---|
BROWSER_AUTH_REQUIRED |
No Stripe session and browser sign-in needed | Tell the user to run stripe projects init themselves, in a terminal where they can finish the browser sign-in — you cannot fix this, and re-running it yourself will not clear it |
PROJECTS_SESSION_UNUSABLE |
A Stripe CLI session exists, but Projects cannot read live-mode credentials from it | Report the message and remedy verbatim and stop. Do NOT retry, and do NOT run stripe login — it reports you are already logged in and exits 0 |
ACCOUNT_NOT_ELIGIBLE |
Account not onboarded for Projects | Tell the user to run stripe projects switch-account to choose an account, or continue setup for this account; report the remedy the CLI printed and stop |
TOS_ACCEPTANCE_REQUIRED |
Developer or provider terms not accepted | Re-run with --accept-tos |
PROVIDER_NOT_LINKED |
Provider requires OAuth linking | Run stripe projects link <provider> — may open a browser |
PLAN_REQUIRED |
Deployable needs a plan provisioned first | Provision the plan listed in the error, then retry |
UNKNOWN_ERROR |
Unexpected failure | Show the full error message to the user and suggest running with --debug for diagnostics |
| Service not in catalog | Query returned 0 results | Inform user; suggest stripe projects catalog --json to browse alternatives |
| CLI not found | Stripe CLI not installed | Install using Homebrew (macOS) or follow https://docs.stripe.com/stripe-cli/install |
原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。