replica-backend
它能做什么
这个技能为新应用构建后端,包括注册、访问规则、支付和邮件。适合正在开发产品、希望获得安全默认设置和上线检查清单的开发者。
适用场景
- ✓当你需要为应用添加登录、密码重置或 OAuth 登录时。
- ✓当你想设置数据库迁移和行级访问规则时。
- ✓当你想使用自己的密钥连接 Stripe 支付或发送事务性邮件时。
技能链接
https://github.com/Jakeschincariol/replica-skill/blob/main/replica-backend/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能为我的应用设置带邮箱验证的注册、密码重置,以及 Stripe 测试支付吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会编写数据库迁移、服务端代码和访问检查,并保持后端检查清单为最新。账户和密钥需要由你自己创建,智能体会编写一个示例环境变量文件,其中只有变量名,没有具体值。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
replica-backend
Reads replica/architecture.md. Writes migrations and server code, and keeps
replica/backend.md (checklist below) up to date.
The rules
- Official, public APIs only, with the user's own keys. Never call the original app's private endpoints, never reuse its OAuth client, never proxy through it.
- The user creates accounts and keys. Claude never signs up for services,
never types a password, card or live key. The user creates the Stripe,
Supabase, Resend or Google Cloud project and puts keys in
.env.local. Claude writes.env.examplewith every variable name and no values. - Test mode first. Stripe test keys and test cards until replica-deploy.
Auth
- Email sign up with verification, password reset, magic link if the original has it. OAuth (Google, Apple) with the user's own developer apps.
- Sessions: http-only secure cookies. Sign out everywhere.
- Roles and teams if the recon map has them: owner, admin, member, with one function that answers "can this user do this to this record".
- Account deletion that actually deletes. Apple requires it for apps with sign up.
Database
- Migrations from
architecture.md, checked in, run by a script. - Access rules on every table: row level security policies on Supabase, or the authorisation function called in every query. Test it: a second user must get nothing back.
- Seed script with realistic fake data (no real people).
- Backups on (the host's daily backups count, check they are enabled).
Payments
- Stripe Checkout for sign up to a plan, the Customer Portal for changes and cancelling. Do not build card forms.
- Webhooks: verify the signature, store the event id, make every handler
idempotent (Stripe retries). Handle
checkout.session.completed,customer.subscription.updated,customer.subscription.deleted,invoice.payment_failed. - Subscription status lives in your database, updated by webhooks, read by your app. Never trust the client.
- Cancelling is one click. Hard-to-cancel billing is a top complaint about most apps, and in many places it is illegal.
Email and jobs
- Transactional email through Resend or Postmark from your own domain. Templates written fresh.
- Jobs for anything time-based (reminders, digests, sync, cleanup) with retries and a dead-letter log. Times in UTC, shown in the user's zone.
Integrations
For each integration in the feature matrix: the official API, the OAuth
scopes needed (fewest possible), the provider's review process, rate limits.
Google scopes like Calendar need Google's OAuth verification before public
launch, which takes weeks. Start it early and write that in backend.md.
Security checklist
- secrets only in env vars,
.env*in.gitignore, nothing in client bundles - input validated on the server (zod or similar) on every route
- authorisation checked on every read and write, tested with a second user
- rate limits on auth, sign up, and anything that sends email or SMS
- webhooks verify signatures
- uploads: size and type limits, served from a separate domain or bucket
- no user data in URLs or logs
- dependencies audited (
npm audit) - privacy policy lists every processor (Stripe, Resend, host, analytics)
Output
Working auth, database, payments in test mode, email and the integrations,
.env.example, replica/backend.md with the checklist ticked, feature
matrix rows updated. Next: /replica-test.
常见问题
账户是由智能体替我创建的吗?
不是。该技能说明,你需要自己创建 Stripe、Supabase 或邮件服务的账户,并添加自己的密钥。
它会先使用测试支付吗?
会。在部署步骤之前,它使用 Stripe 测试密钥和测试卡。
它涵盖账户删除吗?
涵盖。它包括真正删除数据的账户删除功能,这是 Apple 对带有注册功能的应用的要求。
详情
作者的原始描述
Builds the backend of an app clone: auth, database migrations and access rules, payments with Stripe, email, background jobs and third-party integrations through official APIs only, plus a security checklist. Use when the user says "add login", "set up auth", "wire up the database", "add payments", "connect Stripe", "add Google Calendar", "send emails", "backend for my clone", or when /replica-build is running on fake data.
热度
- GitHub 星标
- 7.1k
- 排名
- #13576
- 许可证
- MIT
- 更新时间
- 2026/10/3
评论
- …
同一仓库的更多技能
replica-architect
7.1k帮你的智能体根据功能地图,为新应用规划技术栈、数据库和 API,并先从一个可工作的薄切片开始安排构建顺序。
replica-brand
7.1k帮你的智能体为应用命名并重新塑造品牌,使其与众不同,包括需要进行的名称检查、新的配色、标识简报,以及对残留名称的全面扫描。
replica-build
7.1k帮你的智能体根据功能地图,从外壳开始、再到核心流程,逐屏构建新应用,所有内容都重新编写。
replica-deploy
7.1k帮你的智能体把新应用部署到你自己的域名上线,包括部署前检查清单、DNS 记录、生产环境设置以及应用商店构建。