一键导入
security-review
Security checklist for code review—validates auth, input validation, secrets, database safety, Stripe integration, XSS prevention, and dependencies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Security checklist for code review—validates auth, input validation, secrets, database safety, Stripe integration, XSS prevention, and dependencies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guides Stripe integration decisions across API selection (Checkout Sessions vs PaymentIntents), Connect platform setup (Accounts v2, controller properties), billing/subscriptions, tax and registrations (Stripe Tax, automatic_tax, product tax codes), Treasury financial accounts, integration options (Checkout, Payment Element), migrating from deprecated Stripe APIs, and security best practices (API key management, restricted keys, webhooks, OAuth). Use when building, modifying, or reviewing any Stripe integration, including accepting payments, building marketplaces, integrating Stripe, processing payments, setting up subscriptions, collecting sales tax, VAT, or GST, creating connected accounts, or implementing secure key handling.
Process PR comments systematically—read all, categorize, fix blocking items, batch changes, reply to threads, and re-review
Branch naming, commit messages, and PR process for this project
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
Architecture patterns for Next.js 16 App Router apps. Use when scaffolding a new app, adding a feature, refactoring code into feature folders, deciding where queries/actions/components live, placing Suspense boundaries, choosing the client/server boundary, designing skeletons, preventing CLS, or enabling Cache Components. Also use when the user asks about RSC composition, `params.then()`, `'use cache'`, `cacheTag`, `updateTag`, or static-shell prerendering.
Open a pull request for the current branch in ignite-starter using the repository PR template. Use whenever the user asks to open, create, or raise a PR / pull request, or to prepare a branch for review. Runs the verification gate, writes a Conventional Commit, and fills the template.
| name | security-review |
| description | Security checklist for code review—validates auth, input validation, secrets, database safety, Stripe integration, XSS prevention, and dependencies |
| disable-model-invocation | true |
Audit defensively. Every mutating Server Action authenticates the caller and verifies ownership before it touches data; every external boundary — Stripe webhooks, user input, env access — is validated before it's trusted. Work the checklist top to bottom and treat any unchecked box as a blocker, not a suggestion.
better-auth// ✅ Required pattern in every mutating Server Action
import { auth } from '@/lib/better-auth/auth';
import { headers } from 'next/headers';
const session = await auth.api.getSession({ headers: headers() });
if (!session) return { success: false, error: 'Unauthorized' };
// Ownership check — after auth, before mutation
if (resource.userId !== session.user.id) {
return { success: false, error: 'Forbidden' };
}
stripe-signature header verified on every webhook call.env.local (gitignored)src/env.tsprocess.env.X outside src/env.tssafePromise// ❌ Exposes DB internals
catch (e) { return { success: false, error: e.message }; }
// ✅ Generic client error; log real error server-side
const [error] = await safePromise(db.subscription.delete({ where: { id } }));
if (error) {
console.error('[cancelSubscription]', error);
return { success: false, error: 'Failed to cancel subscription' };
}
stripe-signature using STRIPE_WEBHOOK_SECRETdangerouslySetInnerHTML without explicit sanitisationbun audit run before merging dependency updates| Vulnerability | Mitigation in this project |
|---|---|
| IDOR | Ownership check after session validation |
| Secret exposure | src/env.ts + .env.local (gitignored) |
| Mass assignment | Zod schema whitelists allowed fields |
| XSS | React escapes by default; no dangerouslySetInnerHTML |
| CSRF | Better Auth manages session cookies |
| Webhook spoofing | Stripe signature verification |
| Injection | Prisma parameterised queries |
# Find direct process.env usage (should only be in src/env.ts)
grep -rn "process\.env\." src/ | grep -v "src/env.ts"
# Find dangerouslySetInnerHTML usage
grep -rn "dangerouslySetInnerHTML" src/
# Find unsafe type casts that may mask bad data
grep -rn " as any" src/
# Dependency vulnerability scan
bun audit