stripe-best-practices

stripe-best-practices is a skill for Claude Code, Codex from Morningstar202604/awesome-skillkit. It costs 72 tokens per session (1,193 once invoked), scanned A, original, Apache-2.0.

A set of server-side guidelines for adding Stripe payments, subscriptions, and Connect, Stripe’s service for splitting payments between businesses or sellers.

In plain words
What is it for?
Use it when building Checkout, customer portals, subscription updates, refunds, disputes, webhooks, seller payouts, or PCI compliance checks.
Why use it?
It helps prevent missed payment events, duplicate charges, incorrect subscription access, unsafe card handling, and common compliance problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building Checkout, customer portals, subscription updates, refunds, disputes, webhooks, seller payouts, or PCI compliance checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/morningstar202604/awesome-skillkit/stripe-best-practices
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.

Any agent
npx skills add Morningstar202604/awesome-skillkit --skill stripe-best-practices
Clone the repo
git clone --depth 1 https://github.com/Morningstar202604/awesome-skillkit

Made for: Claude Code, Codex.

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 stripe-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/stripe-best-practices/github.svg)](https://agentmods.dev/skills/morningstar202604/awesome-skillkit/stripe-best-practices)
Your own site
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/stripe-best-practices"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/stripe-best-practices/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 stripe-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/morningstar202604/awesome-skillkit/stripe-best-practices"><img src="https://agentmods.dev/badge/skills/morningstar202604/awesome-skillkit/stripe-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,193 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 original No closer match found 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.00072 $0.01193
Opus 5.5 $0.00029 $0.00477
Sonnet 5.5 $0.00014 $0.00239
Haiku 4.5 $0.00007 $0.00119

Measured 27d ago against content hash 0f7de0c7490d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

stripe-best-practices 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 27d 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.

expert-teams/teams/fullstack-web-team/skills/stripe-best-practices/SKILL.md · 77 lines

How it starts

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

Stripe 集成最佳实践

本 skill 面向 fullstack-backend-engineer / fullstack-api-designer,覆盖收款、订阅、Connect 的服务端正确接法。

何时使用

  • 新建付费/订阅/分账业务;
  • 已有 Stripe 集成漏签 webhook、幂等缺失、订阅状态机不完整;
  • 处理退款、争议、对账、PCI 合规审查。

核心原则

  1. 服务端为唯一事实源:价格、订阅状态、 entitlement 全部以 Stripe webhook 回写的数据库为准,前端不可信。
  2. Webhook 必验签:用 Stripe 库验 Stripe-Signature,拒绝任何未验签请求。
  3. 幂等处理:webhook 与退款/创建付款都用幂等键,重复事件不重复入账。
  4. 不在前端算钱:价格在 Stripe Price/Product 上配置,前端只传 priceId。
  5. PCI 最小化:用 Stripe Checkout / Elements,不自己碰卡号。

Checkout 流程

  1. 服务端 stripe.checkout.sessions.create({ mode: 'subscription'|'payment', line_items:[{price: priceId, quantity:1}], success_url, cancel_url, customer: existingCustomerId })。
  2. 前端跳转到 session.url,不自己收集卡号。
  3. 支付完成后 Stripe 触发 checkout.session.completed webhook,服务端据此开通 entitlement。

Webhook 验签与幂等

const sig = req.headers['stripe-signature']
const event = stripe.webhooks.constructEvent(
  req.body, sig, process.env.STRIPE_WEBHOOK_SECRET
)
// 按 event.id 去重,已处理过直接 200
switch (event.type) {
  case 'checkout.session.completed': /* 开通 */ break
  case 'customer.subscription.updated': /* 更新状态 */ break
  case 'customer.subscription.deleted': /* 回收权限 */ break
  case 'invoice.paid': /* 记录续费 */ break
  case 'invoice.payment_failed': /* 通知重试 */ break
}

订阅生命周期必须处理的事件

  • checkout.session.completed:首次开通。
  • customer.subscription.updated:升降级、宽限期、取消日期变更。
  • customer.subscription.deleted:正式取消,回收权限。
  • invoice.paid:每次续费成功。
  • invoice.payment_failed:重试/宽限,提醒用户更新支付方式。
  • 客户自助管理走 Billing Portal(stripe.billingPortal.sessions.create),不自己造取消/改套餐 UI。

Connect 分账

  • 平台向卖家收款后用 Transfer / Destination charge 打款给 Connect 账户。
  • 平台抽成在应用层记录,资金留存与结算周期(Payout)按 Connect 类型(Standard/Express/Custom)配置。
  • 卖家尽调、KYC、退款责任按 Connect 文档落表。

清单(交付前逐项过)

  • 价格配置在 Stripe Product/Price,前端只传 priceId,不前端算金额。
  • webhook 端点已验签,原始 body 传入(不是 json 解析后的对象)。
  • webhook 按 event.id 幂等去重,重放安全。
  • 订阅关键事件全部处理,取消/欠费能正确回收 entitlement。
  • 客户改套餐/取消走 Billing Portal,不自建敏感操作 UI。
  • 密钥分环境(test/live),sk_live_* 不进前端、不进 Git。
  • 退款/争议(dispute)有监控与申诉入口。
  • 对账:本地订单与 Stripe 发票可核对。
  • 不直接处理卡号,符合 PCI SAQ A。

Read the full file on GitHub · 77 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. 27d ago First seen · 77 lines · 72 tokens per session scan A 0f7de0c7490d

Subscribe to this mod's changes

stripe-best-practices is a skill published in the GitHub repository Morningstar202604/awesome-skillkit (0 stars, last pushed 24d ago), licensed Apache-2.0. It adds 72 tokens to every session and 1,193 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-27.

Related

Other skills, from other repositories

x402

Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — "just use it" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing…

browser-use/browser-use · 175 tokens

stripe-best-practices

Guides Stripe integration decisions across development and test environment planning (separate sandboxes vs the shared test mode sandbox), API selection (Checkout Sessions vs PaymentIntents), Connect platform setup (Accounts v2, controller properties), billing/subscriptions, tax and registrations (Stripe Tax…

stripe/ai · 161 tokens

crypto-market-data-service-guide

Guide to the Crypto Market Data TypeScript service — clean market data APIs for token prices, candles, market cap, and volume across multiple chains. Features caching, rate limiting, fallback sources, and WebSocket subscriptions. Built for production DeFi applications.

nirholas/three.ws · 56 tokens

liter-llm-running-the-proxy

Use when running the liter-llm api OpenAI-compatible gateway — virtual keys, per-key rate limits, budgets, cost tracking, and model routing. Covers the TOML config and the 22 REST endpoints.

xberg-io/liter-llm · 45 tokens

mastercard-best-practices

Integration guidance for Mastercard APIs. Covers resolving a service's ID from its name, confirming a service's auth type before writing auth code, routing to the right authentication guide, finding an operation's request and response schema, sandbox versus production base URLs, and what Mastercard's error responses…

Mastercard/developers-agent-toolkit · 148 tokens

dcf-model

Build discounted cash flow valuation workbooks in Excel.

NousResearch/hermes-agent · 14 tokens