---
name: stripe-projects
description: |
  Use when the user wants to provision infrastructure or third-party services via Stripe Projects.
  Trigger phrases include: "I need a database", "set up auth", "add caching", "give me a Postgres",
  "provision Redis", "add analytics", "set me up with Supabase", "I need hosting",
  "add a vector DB", "connect Sentry", "get me an API key for X", "sign up for a service",
  "set up monitoring", "what services are available", "show me the catalog",
  "what can I provision", "how do I get credentials for X", "browse providers",
  or any mention of projects.dev, the Stripe Projects catalog, or
  adding/provisioning/connecting a cloud service to a project.
user-invocable: true
allowed-tools:
  - Bash(stripe *)
  - Bash(which stripe)
  - Bash(brew install *)
  - Bash(brew upgrade *)
  - Bash(scoop *)
  - Bash(sudo apt *)
  - Bash(sudo yum *)
  - Bash(curl *)
  - Bash(docker run *)
  - Bash(jq *)
  - WebFetch
  - Skill
  - Read
---

# Stripe Projects — Service Provisioning

Provision third-party services (databases, auth, hosting, analytics, caching, AI, observability) and retrieve API keys/tokens using the Stripe Projects CLI plugin.

## Workflow

### Step 1: Ensure Stripe CLI + Projects Plugin

Check if the Stripe CLI is available and at the minimum version:

```bash
which stripe && stripe --version
```

If not installed, install based on the user's platform:

**macOS (Homebrew):**

```bash
brew install stripe/stripe-cli/stripe
```

**Linux (Debian/Ubuntu via APT):**

```bash
curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor | sudo tee /usr/share/keyrings/stripe.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" | sudo tee -a /etc/apt/sources.list.d/stripe.list
sudo apt update
sudo apt install stripe
```

**Linux (RPM-based via YUM):**

```bash
echo -e "[Stripe]\nname=stripe\nbaseurl=https://packages.stripe.dev/stripe-cli-rpm-local/\nenabled=1\ngpgcheck=0" >> /etc/yum.repos.d/stripe.repo
sudo yum install stripe
```

**Windows (Scoop):**

```bash
scoop bucket add stripe https://github.com/stripe/scoop-stripe-cli.git
scoop install stripe
```

**Docker:**

```bash
docker run --rm -it stripe/stripe-cli:latest
```

If installed but the version is below 1.40.0, upgrade:

**macOS (Homebrew):**

```bash
brew upgrade stripe/stripe-cli/stripe
```

For other platforms, follow https://docs.stripe.com/stripe-cli/upgrade.

Then ensure the Projects plugin is installed:

```bash
stripe plugin install projects
```

### Step 2: Search the Catalog

Confirm the requested provider/service exists:

```bash
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 (e.g., "I need a database"), browse the catalog to suggest options:

```bash
stripe projects catalog --json
```

### Step 3: Initialize a Project

Check if a project is already initialized:

```bash
stripe projects status --json
```

If not initialized:

```bash
stripe projects init --yes
```
(don't use '--json' for this command)

**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.

### Step 4: Hand Off to stripe-projects-cli

Verify the skill was installed:

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

If `MISSING`: re-run `stripe projects init --yes` — the skill is bundled with the Projects plugin and installed during init.

If `OK`: use the locally-installed `stripe-projects-cli` skill (invoke via the Skill tool with name `stripe-projects-cli`) to continue the workflow — adding services, managing credentials, and configuring the project.

### Step 5: Summarize and Suggest

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 (e.g., 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.

## CLI as Source of Truth

The CLI manages all state under `.projects/` and generates `.env` files. Do not 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 — and note that the CLI is authoritative, so manual edits may be overwritten.
