Agent skill

Stripe Payments

by cohen-liel in cohen-liel/hivemind

Stripe payments integration patterns. An agent skill from cohen-liel/hivemind.

Apache-2.0Auto-check passedBackend & APIs

Install Stripe Payments

skills CLI
$ npx skills add cohen-liel/hivemind --skill stripe-payments -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cohen-liel/hivemind stripe-payments --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cohen-liel/hivemind.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/stripe-payments .claude/skills/stripe-payments && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
stripe-payments
GitHub stars
110
Token cost
~1.8k tokens
SKILL.md length
109 words
Files
1
Skills in repo
33
Repo updated
First seen
Licence
Apache-2.0

At a glance

Stripe payments integration patterns. An agent skill from cohen-liel/hivemind.

  • Implementing payments
  • SKILL.md covers Setup, One-Time Payment (Checkout…, Subscriptions and Webhooks (CRITICAL — always…, plus 4 more sections
  • Calls stripe; needs STRIPE_SECRET_KEY and WEBHOOK_SECRET
  • Checkout sessions

What it does

Stripe Payments is an agent skill from cohen-liel/hivemind. Stripe payments integration patterns. Use when implementing payments, subscriptions, webhooks, checkout sessions, or any payment processing with Stripe.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Webhooks and Third-party API integration. It works with Stripe. The repository describes itself as: One prompt. A full AI engineering team. Go lie on the couch. 🧠. The licence is Apache-2.0.

When your agent uses it

  • Implementing payments
  • Checkout sessions
  • Any payment processing with Stripe

Example prompts

  • “/stripe-payments”

Requirements

  • Python 3
  • A credential in STRIPE_SECRET_KEY
  • A credential in WEBHOOK_SECRET

What it can do on your machine

Read from SKILL.md and the folder at commit 918dd9b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • stripe

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • STRIPE_SECRET_KEY
    • WEBHOOK_SECRET
    • STRIPE_WEBHOOK_SECRET
    • NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Stripe Payments loads about 1.8k tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 109 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cohen-liel/hivemind at commit 918dd9b, republished under its Apache-2.0 licence (© cohen-liel). 109 words, ~1,827 tokens.

Download SKILL.mdSave it as .claude/skills/stripe-payments/SKILL.md (or your agent's skills folder).
name
stripe-payments
description
Stripe payments integration patterns. Use when implementing payments, subscriptions, webhooks, checkout sessions, or any payment processing with Stripe.

Stripe Payments Patterns

Setup

python
# payments.py
import stripe
from fastapi import HTTPException

stripe.api_key = settings.STRIPE_SECRET_KEY
WEBHOOK_SECRET = settings.STRIPE_WEBHOOK_SECRET
typescript
// lib/stripe.ts
import Stripe from 'stripe'
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
  apiVersion: '2024-06-20',
})

One-Time Payment (Checkout Session)

python
@router.post("/create-checkout-session")
async def create_checkout_session(user: User = Depends(get_current_user)):
    session = stripe.checkout.Session.create(
        payment_method_types=["card"],
        line_items=[{
            "price": "price_xyz123",  # Price ID from Stripe dashboard
            "quantity": 1,
        }],
        mode="payment",
        success_url=f"{BASE_URL}/success?session_id={{CHECKOUT_SESSION_ID}}",
        cancel_url=f"{BASE_URL}/cancel",
        customer_email=user.email,
        metadata={"user_id": str(user.id)},
    )
    return {"checkout_url": session.url}
typescript
// Next.js API route
export async function POST(req: Request) {
  const session = await stripe.checkout.sessions.create({
    payment_method_types: ['card'],
    line_items: [{ price: 'price_xyz123', quantity: 1 }],
    mode: 'payment',
    success_url: `${process.env.NEXT_PUBLIC_URL}/success`,
    cancel_url: `${process.env.NEXT_PUBLIC_URL}/cancel`,
  })
  return Response.json({ url: session.url })
}

Subscriptions

python
@router.post("/create-subscription")
async def create_subscription(
    price_id: str,
    user: User = Depends(get_current_user),
):
    # Create or retrieve Stripe customer
    if not user.stripe_customer_id:
        customer = stripe.Customer.create(
            email=user.email,
            metadata={"user_id": str(user.id)},
        )
        await db.user.update(user.id, stripe_customer_id=customer.id)
        customer_id = customer.id
    else:
        customer_id = user.stripe_customer_id

    session = stripe.checkout.Session.create(
        customer=customer_id,
        payment_method_types=["card"],
        line_items=[{"price": price_id, "quantity": 1}],
        mode="subscription",
        success_url=f"{BASE_URL}/dashboard?upgraded=1",
        cancel_url=f"{BASE_URL}/pricing",
    )
    return {"checkout_url": session.url}

@router.post("/cancel-subscription")
async def cancel_subscription(user: User = Depends(get_current_user)):
    subscription = stripe.Subscription.retrieve(user.stripe_subscription_id)
    # Cancel at period end (not immediately)
    stripe.Subscription.modify(
        user.stripe_subscription_id,
        cancel_at_period_end=True,
    )
    return {"message": "Subscription will cancel at end of billing period"}

Webhooks (CRITICAL — always verify signature)

python
@router.post("/webhooks/stripe")
async def stripe_webhook(request: Request):
    payload = await request.body()
    sig_header = request.headers.get("stripe-signature")

    try:
        event = stripe.Webhook.construct_event(
            payload, sig_header, WEBHOOK_SECRET
        )
    except stripe.error.SignatureVerificationError:
        raise HTTPException(status_code=400, detail="Invalid signature")

    # Handle events
    if event["type"] == "checkout.session.completed":
        session = event["data"]["object"]
        await handle_checkout_complete(session)

    elif event["type"] == "customer.subscription.updated":
        subscription = event["data"]["object"]
        await handle_subscription_update(subscription)

    elif event["type"] == "customer.subscription.deleted":
        subscription = event["data"]["object"]
        await handle_subscription_cancel(subscription)

    elif event["type"] == "invoice.payment_failed":
        invoice = event["data"]["object"]
        await handle_payment_failed(invoice)

    return {"status": "ok"}

async def handle_checkout_complete(session: dict):
    user_id = session["metadata"]["user_id"]
    if session["mode"] == "subscription":
        sub_id = session["subscription"]
        subscription = stripe.Subscription.retrieve(sub_id)
        await db.user.update(
            user_id,
            stripe_subscription_id=sub_id,
            subscription_status="active",
            plan_expires_at=datetime.fromtimestamp(subscription["current_period_end"]),
        )
    elif session["mode"] == "payment":
        await db.order.create(user_id=user_id, amount=session["amount_total"])

Customer Portal (self-service billing)

python
@router.post("/billing-portal")
async def create_billing_portal(user: User = Depends(get_current_user)):
    session = stripe.billing_portal.Session.create(
        customer=user.stripe_customer_id,
        return_url=f"{BASE_URL}/dashboard",
    )
    return {"portal_url": session.url}

Payment Intent (custom checkout UI)

python
@router.post("/create-payment-intent")
async def create_payment_intent(amount: int, currency: str = "usd"):
    intent = stripe.PaymentIntent.create(
        amount=amount,  # In cents (e.g., 1999 = $19.99)
        currency=currency,
        automatic_payment_methods={"enabled": True},
    )
    return {"client_secret": intent.client_secret}
typescript
// React + Stripe Elements
import { loadStripe } from '@stripe/stripe-js'
import { Elements, PaymentElement, useStripe, useElements } from '@stripe/react-stripe-js'

const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!)

function CheckoutForm() {
  const stripe = useStripe()
  const elements = useElements()

  const handleSubmit = async (e: React.FormEvent) => {
    e.preventDefault()
    if (!stripe || !elements) return

    const { error } = await stripe.confirmPayment({
      elements,
      confirmParams: { return_url: `${window.location.origin}/success` },
    })

    if (error) console.error(error.message)
  }

  return (
    <form onSubmit={handleSubmit}>
      <PaymentElement />
      <button type="submit" disabled={!stripe}>Pay</button>
    </form>
  )
}

function PaymentPage({ clientSecret }: { clientSecret: string }) {
  return (
    <Elements stripe={stripePromise} options={{ clientSecret }}>
      <CheckoutForm />
    </Elements>
  )
}

Testing

python
# Use Stripe test cards:
# 4242 4242 4242 4242 — success
# 4000 0000 0000 0002 — declined
# 4000 0025 0000 3155 — 3D Secure required

# Test webhooks locally:
# stripe listen --forward-to localhost:8000/webhooks/stripe

Rules

  • ALWAYS verify webhook signatures — never trust events without verification
  • Store Stripe IDs (customer_id, subscription_id) in your DB — never call Stripe to look them up by email
  • Use idempotency keys for payment creation to prevent double-charges
  • Handle webhook retries — make handlers idempotent (check if already processed)
  • Never log full card data — Stripe handles PCI compliance, you just handle IDs
  • Use cancel_at_period_end=True not immediate cancellation (better UX)
  • Test with Stripe CLI (stripe listen) before deploying webhooks
  • Keep STRIPE_SECRET_KEY server-side only — publishable key is safe for client

© cohen-liel, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/stripe-payments of cohen-liel/hivemind.

Open the folder on GitHubat commit 918dd9b

Compare with similar skills

Stripe Payments next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Stripe Payments compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Stripe Payments this skillcohen-liel/hivemind110—~1.8kAutomated safety check: PassApache-2.0
API ForgeEliasOulkadi/shokunin114—~2.9kAutomated safety check: PassMIT
Firecrawl Build Onboardingfirecrawl/firecrawl190k1 repos~1.4kAutomated safety check: NotesISC
Stripe Appsfossasia/eventyay1.7k1 repos~3.6kAutomated safety check: PassApache-2.0
Dinero Currency Patternsdinerojs/dinero.js6.8k—~650Automated safety check: PassMIT
Stripe Best Practiceskanchengw/cnllm1732 repos~925Automated safety check: PassApache-2.0

Similar skills

  • API Forge

    EliasOulkadi/shokunin

    Design REST/GraphQL APIs with OpenAPI 3.1, error handling, pagination, rate limiting, webhooks, and idempotency.

    114 GitHub stars~2.9k tokensUpdated 6 days ago
    Backend & APIsAuto-check passed
  • Firecrawl Build Onboarding

    firecrawl/firecrawl

    Gets Firecrawl working in a project: signs you in through the browser, saves FIRECRAWL_API_KEY to .env and picks the first SDK or REST path.

    190k GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check: notes
  • Stripe Apps

    fossasia/eventyay

    A skill your agent uses when building, modifying, or reviewing a Stripe App — or when the user describes something that implies one (e.g.

    1.7k GitHub starsUsed in 1 repo~3.6k tokens
    Backend & APIsAuto-check passed
  • Dinero Currency Patterns

    dinerojs/dinero.js

    Currency handling patterns for the Dinero.js money library. An agent skill from dinerojs/dinero.js.

    6.8k GitHub stars~650 tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Stripe Best Practices

    kanchengw/cnllm

    Guides Stripe integration decisions — API selection (Checkout Sessions vs PaymentIntents), Connect platform setup (Accounts v2, controller properties), billing/subscriptions, Treasury financial…

    173 GitHub starsUsed in 2 repos~925 tokens
    Backend & APIsAuto-check passed
  • Handles Laravel Cashier Stripe integration including subscriptions, webhooks, Stripe Checkout, invoices, charges, refunds, trials, coupons, metered billing, and payment failure handling.

    343 GitHub starsUsed in 1 repo~1.2k tokens
    Backend & APIsAuto-check passed

More from cohen-liel/hivemind

All 33 skills in this repo
  • API Design

    cohen-liel/hivemind

    REST API design principles and best practices. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~857 tokensUpdated 5 mo ago
    Auto-check passed
  • Async Python

    cohen-liel/hivemind

    Python asyncio patterns for high-performance async code. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~992 tokensUpdated 5 mo ago
    Auto-check passed
  • Celery Tasks

    cohen-liel/hivemind

    Celery background task patterns for Python apps. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • Docker Deployment

    cohen-liel/hivemind

    Docker, docker-compose, and deployment configuration best practices.

    110 GitHub stars~674 tokensUpdated 5 mo ago
    Auto-check passed
  • E2E Testing

    cohen-liel/hivemind

    End-to-end testing patterns with Playwright. An agent skill from cohen-liel/hivemind.

    110 GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Email Service

    cohen-liel/hivemind

    Email sending patterns for transactional and marketing emails.

    110 GitHub stars~1.8k tokensUpdated 5 mo ago
    Auto-check passed

Works with

Categories

Questions about Stripe Payments

What does Stripe Payments do?

Stripe payments integration patterns. An agent skill from cohen-liel/hivemind. Stripe Payments is an agent skill from cohen-liel/hivemind. Stripe payments integration patterns.

When should I use Stripe Payments?

Stripe Payments fits situations like: implementing payments; checkout sessions; any payment processing with Stripe.

How do I install Stripe Payments in Claude Code?

Run `npx skills add cohen-liel/hivemind --skill stripe-payments -a claude-code`. Or copy the skill folder (.claude/skills/stripe-payments in cohen-liel/hivemind) into .claude/skills/stripe-payments in your project. Claude Code loads it when a task matches its description.

How do I install Stripe Payments in Codex?

Run `npx skills add cohen-liel/hivemind --skill stripe-payments -a codex`. Or copy the skill folder (.claude/skills/stripe-payments in cohen-liel/hivemind) into .agents/skills/stripe-payments in your project. Codex loads it when a task matches its description.

Can I use Stripe Payments in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cohen-liel/hivemind --skill stripe-payments -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/stripe-payments, .gemini/skills/stripe-payments, .github/skills/stripe-payments and .opencode/skills/stripe-payments in your project.

What does Stripe Payments need to run?

Going by SKILL.md and its folder, Stripe Payments needs the command-line tools its instructions call (stripe) and credentials named STRIPE_SECRET_KEY, WEBHOOK_SECRET, STRIPE_WEBHOOK_SECRET and NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY. Our summary lists: Python 3; A credential in STRIPE_SECRET_KEY; A credential in WEBHOOK_SECRET.

Does Stripe Payments access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Stripe Payments safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Stripe Payments use?

Stripe Payments is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Stripe Payments use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Stripe Payments?

Skills that share tags, products or a category with Stripe Payments: API Forge (EliasOulkadi/shokunin, 114 stars), Firecrawl Build Onboarding (firecrawl/firecrawl, 190k stars), Stripe Apps (fossasia/eventyay, 1.7k stars) and Dinero Currency Patterns (dinerojs/dinero.js, 6.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Stripe Payments?

cohen-liel (a GitHub user) maintains it in cohen-liel/hivemind, which has 110 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on April 18, 2026.

Source: cohen-liel/hivemind on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.