/autodev-stack:stripefrom autodev-stack
Provides Stripe integration patterns for API keys, webhooks, checkout sessions, subscriptions, and billing. Loads when working with payments.
Ships in autodev-stack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Based on stripe/ai (MIT). Read the installed SDK,
account/request API version and webhook endpoint version before changing an
integration. Do not treat a date cached in this skill as the latest version.
If package.json has no stripe dependency, add the server SDK with the
project's package manager (npm i stripe). Local webhook testing uses the
Stripe CLI (stripe listen), checked
with stripe --version before use.
See Stripe versioning.
Priority order:
Enable dynamic payment methods in the Stripe Dashboard rather than hardcoding payment_method_types.
# .env.local (never commit)
STRIPE_SECRET_KEY=sk_test_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# .env.example (commit this)
STRIPE_SECRET_KEY=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=
Keep sk_ keys server-side only. Only pk_ keys may be exposed to the browser.
Verify webhook signatures on the raw body. The following is a routing skeleton, not a complete fulfillment handler; its comments must become durable, tested business operations before it can acknowledge a handled event:
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
export async function POST(req: Request) {
const body = await req.text();
const signature = req.headers.get('stripe-signature')!;
let event: Stripe.Event;
try {
event = stripe.webhooks.constructEvent(
body,
signature,
process.env.STRIPE_WEBHOOK_SECRET!
);
} catch (err) {
return new Response('Webhook signature verification failed', { status: 400 });
}
switch (event.type) {
case 'checkout.session.completed':
// Fulfill the order
break;
case 'invoice.payment_succeeded':
// Update subscription status
break;
case 'customer.subscription.deleted':
// Handle cancellation
break;
}
return new Response('OK', { status: 200 });
}
Persist event identity and make each business transition idempotent. Test duplicate deliveries, concurrent handlers, retries after a partial failure and events arriving out of order. Retrieve authoritative object state when required; a timestamp alone is not a deduplication or ordering key. See Stripe webhook guidance.
Separate receipt from fulfillment: acknowledge handled events only after durable acceptance for processing, and verify the resulting order/entitlement state. Cover delayed payment success/failure, cancellation and denied access as relevant to the selected payment methods. A successful checkout page or webhook HTTP 200 alone does not establish payment or fulfillment.
customer.subscription.created, updated, deletedinvoice.payment_failed to handle failed renewalsUse the SetupIntent API to save payment methods for future use:
const setupIntent = await stripe.setupIntents.create({
customer: customerId,
automatic_payment_methods: { enabled: true },
});
on_behalf_ofcontroller propertiestry {
const session = await stripe.checkout.sessions.create({ ... });
} catch (err) {
if (err instanceof Stripe.errors.StripeCardError) {
// Card declined - show user-friendly message
} else if (err instanceof Stripe.errors.StripeInvalidRequestError) {
// Invalid parameters - fix the request
} else {
// Unexpected error - log and alert
}
}
What SKILL.md sets; muted values are Claude Code's defaults
Invoked when the user says "stripe", "payment", "checkout", "subscription", "billing".
opusThree short reads, in order
Other plugins' skills for the same job
3 skills in this plugin
/dopplerConfigure or migrate a project’s environment variables with Doppler. Resolve the intended account and environment, preserve secret scope, and verify application access and recovery./supabaseSupabase CLI, Postgres performance, and schema patterns. Use for database operations, queries, RLS, and migrations.npx claudepluginhub djnsty23/claude-auto-dev --plugin autodev-stack