16-stripe-payments

16-stripe-payments is a cursor rule for Cursor from bybren-llc/a-safe-pulse. It costs 0 tokens per session (779 once invoked), scanned A, a copy of 16-stripe-payments, MIT.

A set of rules for Stripe payments, including checkout sessions, subscriptions, webhooks, and safe test-mode use. A webhook is a message sent by Stripe to notify an application about a payment event.

In plain words
What is it for?
Use it when implementing or reviewing Stripe checkout, subscriptions, payment webhooks, signature checks, and duplicate-event handling.
Why use it?
It helps prevent common payment errors such as using live keys during development, accepting forged webhook messages, or processing the same event twice.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc). Also seen: reads .claude/ paths.

Good fit Use it when implementing or reviewing Stripe checkout, subscriptions, payment webhooks, signature checks, and duplicate-event handling.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bybren-llc/a-safe-pulse/16-stripe-payments
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/bybren-llc/a-safe-pulse

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 16-stripe-payments

README.md
[![agentmods](https://agentmods.dev/badge/rules/bybren-llc/a-safe-pulse/16-stripe-payments/github.svg)](https://agentmods.dev/rules/bybren-llc/a-safe-pulse/16-stripe-payments)
Your own site
<a href="https://agentmods.dev/rules/bybren-llc/a-safe-pulse/16-stripe-payments"><img src="https://agentmods.dev/badge/rules/bybren-llc/a-safe-pulse/16-stripe-payments/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 16-stripe-payments

Your own site · 80×15
<a href="https://agentmods.dev/rules/bybren-llc/a-safe-pulse/16-stripe-payments"><img src="https://agentmods.dev/badge/rules/bybren-llc/a-safe-pulse/16-stripe-payments.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 779 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00779
Opus 5 $0.00000 $0.00390
Sonnet 5 $0.00000 $0.00156
Haiku 4.5 $0.00000 $0.00078

Measured 6d ago against content hash 257ef238d21b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

16-stripe-payments scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to 16-stripe-payments — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

docs/archive/harness-upstream/cursor-rules/16-stripe-payments.mdc · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Stripe Payment Rules

These rules apply when working on Stripe payment integration, webhooks, checkout flows, or subscription management.

Test Mode Safety (CHECK FIRST)

Before ANY payment work:

  • Verify STRIPE_SECRET_KEY starts with sk_test_
  • Confirm test webhook secret (whsec_... from Stripe CLI)
  • Use test card numbers only (4242 4242 4242 4242)
  • Never use production keys in development

Webhook Handler Pattern

ALWAYS verify webhook signatures and handle idempotency:

import stripe
from fastapi import Request, HTTPException

async def handle_stripe_webhook(request: Request):
    payload = await request.body()
    signature = request.headers.get("stripe-signature")

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

    # Idempotency: check if event already processed
    existing = await get_webhook_event(event.id)
    if existing:
        return {"status": "already_processed"}

    # Process event and record
    await process_event(event)
    await record_webhook_event(event.id, event.type)
    return {"status": "processed"}

Idempotency Checklist

For ALL webhook handlers:

  • Store event ID before processing
  • Check for duplicate events before processing
  • Use database transactions for atomicity
  • Return 200 OK even on idempotency skip (Stripe retries on non-200)

Common Webhook Events

SUBSCRIPTION_EVENTS = [
    "customer.subscription.created",
    "customer.subscription.updated",
    "customer.subscription.deleted",
    "invoice.payment_succeeded",
    "invoice.payment_failed",
]

Local Webhook Testing

Use the Stripe CLI to forward events locally:

# Start webhook forwarding
stripe listen --forward-to localhost:8000/api/v1/webhooks/stripe

# Trigger test events
stripe trigger checkout.session.completed
stripe trigger invoice.payment_succeeded
stripe trigger customer.subscription.deleted

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 118 lines · 0 tokens per session scan A 257ef238d21b

Subscribe to this mod's changes

16-stripe-payments is a cursor rule published in the GitHub repository bybren-llc/a-safe-pulse (9 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 779 tokens. A static security scan graded it A with 0 findings. It is 100% identical to 16-stripe-payments, differing in 0 lines, and is treated as a copy.

Related

Other cursor rules, from other repositories

cursor

You are working on the checkout service. Preserve transaction integrity and auditability.

mrwogu/promptscript · 53 tokens

paddle-integration

Conventions for Paddle integration code.

PaddleHQ/paddle-agent-skills · 380 tokens

faststore-faststore-storefront-ref-project-structure-routes-and-config

FastStore project structure, routes, CLI build pipeline, store configuration (discovery.config.js), and naming conventions. Use when understanding how a FastStore project is organized, how the @faststore/cli works, what files to create or modify, how routing works, or how to configure store settings like SEO, API…

vtex/skills · 70 tokens

vtex-io-vtex-io-storefront-theme-app

Apply when designing or modifying a VTEX IO storefront theme app — the app that owns store/blocks.json, store/routes.json, store/templates/, store/contentSchemas.json, and the storefront page tree assembled from store.home, store.product, store.search, store.custom, and other native page templates. Covers how a theme…

vtex/skills · 3,594 tokens

faststore-faststore-storefront-ref-graphql-types-queries-and-mutations

Complete FastStore GraphQL BFF API reference including all built-in root queries, root mutations, and type definitions. Use when querying product, collection, search, cart, session, shipping, or user order data, when extending existing types with new fields, or when looking up available fields on types like…

vtex/skills · 78 tokens

medusa

Medusa rules and best practices. These rules should be used when building applications with Medusa.

XD3an/awesome-ai-coding-all-in-one · 449 tokens