Riligar infra stripe
RiLiGar Agents Kit - Curated collection of AI Agent templates, skills, and rules designed to standardize and supercharge your AI-driven development workflows.
npx -y skills add riligar/agents-kit --skill riligar-infra-stripeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Interactive Stripe setup wizard. Use when implementing payments. The agent will ask for keys, products, and configure everything automatically.
SKILL.md
8.7 KB, as published. Nobody here has run it
Stripe Setup Wizard
Esta skill configura a integração completa do Stripe no seu projeto. O agente vai guiar você através de um setup interativo.
Setup Workflow
Quando o usuário solicitar configurar o Stripe, siga este fluxo OBRIGATÓRIO:
Step 1: Coletar Chaves
Pergunte ao usuário:
Para configurar o Stripe, preciso das suas chaves da API. Você pode encontrá-las em: https://dashboard.stripe.com/apikeys
Por favor, me forneça:
- Publishable Key (pklive... ou pktest...)
- Secret Key (sklive... ou sktest...)
Aguarde as chaves antes de prosseguir.
Step 2: Identificar Produtos
Após receber as chaves, pergunte:
Agora preciso entender seus produtos. Me diga:
- Tipo de cobrança: Assinatura (recorrente) ou pagamento único?
- Quais planos/produtos você quer oferecer?
Exemplo de resposta:
- Assinatura mensal
- Plano Starter: R$ 29/mês (5 projetos, suporte email)
- Plano Pro: R$ 99/mês (ilimitado, suporte prioritário)
- Plano Enterprise: R$ 299/mês (tudo + SLA)
Step 3: Criar Produtos no Stripe
Com as informações coletadas, gere o script para criar os produtos:
// scripts/setup-stripe-products.js
import Stripe from 'stripe'
const stripe = new Stripe('SK_KEY_AQUI')
async function setupProducts() {
const products = [
// Substituir com os produtos do usuário
{
name: 'Plano Starter',
description: '5 projetos, suporte email',
price: 2900, // R$ 29,00 em centavos
interval: 'month',
features: ['5 projetos', 'Suporte email', '1GB storage'],
},
{
name: 'Plano Pro',
description: 'Ilimitado, suporte prioritário',
price: 9900, // R$ 99,00 em centavos
interval: 'month',
features: ['Projetos ilimitados', 'Suporte prioritário', '10GB storage'],
},
]
console.log('Criando produtos no Stripe...\n')
for (const product of products) {
const stripeProduct = await stripe.products.create({
name: product.name,
description: product.description,
metadata: { features: JSON.stringify(product.features) },
})
const stripePrice = await stripe.prices.create({
product: stripeProduct.id,
unit_amount: product.price,
currency: 'brl',
recurring: product.interval ? { interval: product.interval } : undefined,
})
console.log(`✓ ${product.name}`)
console.log(` Product ID: ${stripeProduct.id}`)
console.log(` Price ID: ${stripePrice.id}\n`)
}
console.log('Produtos criados com sucesso!')
}
setupProducts().catch(console.error)
Instrua o usuário a executar: bun run scripts/setup-stripe-products.js
Step 4: Coletar Price IDs
Após executar o script, peça:
O script gerou os Price IDs. Por favor, me envie os IDs gerados. Exemplo: price_1ABC123...
Step 5: Configurar Ambiente
Com as chaves e Price IDs, configure os arquivos de ambiente:
Backend: .env.development e .env.production
# .env.development (chaves de teste)
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# .env.production (chaves de produção)
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
Frontend: .env.development e .env.production
# .env.development
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_...
# .env.production
VITE_STRIPE_PUBLISHABLE_KEY=pk_live_...
Step 6: Configurar database
Gere a migration para adicionar campos do Stripe:
// database/schema.js - adicionar aos users
stripeCustomerId: text('stripe_customer_id').unique(),
stripeSubscriptionId: text('stripe_subscription_id').unique(),
plan: text('plan').default('free'),
subscriptionStatus: text('subscription_status'),
currentPeriodEnd: integer('current_period_end', { mode: 'timestamp' }),
Step 7: Configurar Webhook
Instrua o usuário:
Configure o webhook no Stripe Dashboard:
- Acesse https://dashboard.stripe.com/webhooks
- Clique em "Add endpoint"
- URL:
https://seu-dominio.com/api/webhook- Selecione os eventos:
checkout.session.completedcustomer.subscription.updatedcustomer.subscription.deletedinvoice.paidinvoice.payment_failed- Copie o "Signing secret" (whsec_...)
- Adicione ao
.env.developmente.env.production
Step 8: Gerar Código
Gere todos os arquivos necessários usando os templates de assets/:
| Arquivo | Baseado em |
|---|---|
plugins/stripe.js | stripe-server.js (seção 1) |
routes/billing.js | stripe-server.js (seção 2) |
routes/webhook.js | stripe-server.js (seção 3) |
services/billing.js | stripe-server.js (seção 4) |
config/stripe-prices.js | Price IDs coletados (Step 9) |
config/plans.js | PLAN_MAP + PLAN_LIMITS (Step 9) |
pages/Pricing.jsx | stripe-client.js (seção 3) |
components/BillingSettings.jsx | stripe-client.js (seção 4) |
hooks/useSubscription.js | stripe-client.js (seção 2) |
Step 9: Criar Configs de Planos e Preços
A) Arquivo de preços (config/stripe-prices.js):
// config/stripe-prices.js
export const STRIPE_PRICES = {
starter: {
priceId: 'price_COLETADO_STARTER',
name: 'Starter',
price: 29,
features: ['5 projetos', 'Suporte email', '1GB storage'],
},
pro: {
priceId: 'price_COLETADO_PRO',
name: 'Pro',
price: 99,
features: ['Projetos ilimitados', 'Suporte prioritário', '10GB storage'],
},
enterprise: {
priceId: 'price_COLETADO_ENTERPRISE',
name: 'Enterprise',
price: 299,
features: ['Tudo do Pro', 'Storage ilimitado', 'SLA garantido'],
},
}
export const getPrice = plan => STRIPE_PRICES[plan]
export const getPriceId = plan => STRIPE_PRICES[plan]?.priceId
B) Arquivo de mapeamento e limites (config/plans.js):
// config/plans.js
// Mapeia Price IDs do Stripe para nomes de planos internos
export const PLAN_MAP = {
price_COLETADO_STARTER: 'starter',
price_COLETADO_PRO: 'pro',
price_COLETADO_ENTERPRISE: 'enterprise',
}
// Define limites de features por plano
export const PLAN_LIMITS = {
free: {
maxFlows: 1,
maxContacts: 100,
// Adicione outros limites conforme necessário
},
starter: {
maxFlows: 3,
maxContacts: 500,
},
pro: {
maxFlows: 15,
maxContacts: 5000,
},
enterprise: {
maxFlows: 55,
maxContacts: Infinity,
},
}
Checklist Final
Ao completar o setup, confirme:
- Dependências instaladas (
bun add stripe @stripe/stripe-js @stripe/react-stripe-js) - Chaves no
.env.developmente.env.production(backend e frontend) - Produtos criados no Stripe
- Price IDs configurados em
config/stripe-prices.js -
PLAN_MAPePLAN_LIMITSconfigurados emconfig/plans.js - Schema do database atualizado (campos Stripe na tabela users)
- Webhook endpoint configurado no Stripe Dashboard (
/api/webhook) - Webhook secret nos arquivos de ambiente
- Rotas de billing funcionando (
/api/billing/*) - Página de pricing criada (com token de auth no ky)
-
useSubscriptionhook com header Authorization - Testado com cartão 4242 4242 4242 4242
Testing Local
# Instalar Stripe CLI
brew install stripe/stripe-cli/stripe
# Login
stripe login
# Forward webhooks (ajuste a porta conforme seu backend)
stripe listen --forward-to localhost:3333/api/webhook
# Testar checkout
stripe trigger checkout.session.completed
Specialized Guides
| Guide | Content |
|---|---|
| stripe-elysia.md | Backend routes completas |
| stripe-react.md | Componentes React/Mantine |
| stripe-webhooks.md | Handlers de eventos |
| stripe-database.md | Schema Drizzle |
Related Skills
- @[.agent/skills/riligar-dev-manager]
- @[.agent/skills/riligar-dev-dashboard]
- @[.agent/skills/riligar-dev-auth-elysia]
Gives 1 of the 12 instructions most pricing monetisation skills give
Counted across 366 of the 366 authors here whose files we hold, read 2026-08-06
- verify webhook signaturesin 23 of 366, across 19 files
- differentiate tiers using features, limits, or supportin 15 of 366, across 4 files
- read product marketing context before asking questionsin 14 of 366, across 6 files
- base price on perceived value, not costin 14 of 366, across 3 files
- use Van Westendorp to find acceptable price rangein 14 of 366, across 3 files
- use MaxDiff to identify highly valued featuresin 14 of 366, across 3 files
- choose a value metric that scales with customer valuein 14 of 366, across 9 files
- handle webhook events idempotentlyin 12 of 366, across 6 files
- understand the upgrade context before recommendingin 11 of 366, across 4 files
- align the pricing metric with delivered valuein 10 of 366, across 4 files
- install stripe packagehere, and in 10 of 366, across 5 files
- calculate unit economics metricsin 10 of 366, across 5 files
Said here and by no other author read
- ask for api keys before proceeding
- ask about billing type and offered products
- generate product setup script
- instruct user to run setup script
- ask user for generated price ids
- populate environment files with keys
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.