silasroliver-hue/replica-skill-cursor

アプリクローンのバックエンドを構築します。認証、データベースマイグレーションとアクセスルール、Stripeによる決済、メール、バックグラウンドジョブ、公式APIのみを使用したサードパーティ連携、セキュリティチェックリストを提供します。

replica-skill-cursor とは?

このスキルは、既存アプリのクローン(例:Replicaアプリ)のバックエンド全体を構築するために設計された、Cursor向けのプロフェッショナルなスキルです。主な機能として、メール認証やOAuth(Google、Apple)によるユーザー認証、Supabase上のテーブル単位の行レベルセキュリティポリシーを含むデータベースマイグレーションとアクセス制御、Stripe CheckoutとWebhookを使ったサブスクリプション決済、ResendやPostmarkを使ったトランザクションメール、時間ベースのジョブ処理、そしてセキュリティチェックリストの管理を自動化します。 開発者は公式APIと自身のAPIキーのみを使用し、テストモードで安全に構築を進められます。また、Appleが要求するアカウント削除機能など、プラットフォーム固有の要件にも対応します。

対応~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/silasroliver-hue/replica-skill-cursor/tree/HEAD/.cursor/skills/replica-backend

Installed? Explore more 生産性&コラボレーション skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

replica-backend

replica/architecture.md を読み込みます。マイグレーションとサーバーコードを作成し、replica/backend.md(以下のチェックリスト)を最新の状態に保ちます。

ルール

  • 公式の公開APIのみ、ユーザー自身のキーを使用すること。 元のアプリのプライベートエンドポイントを呼び出したり、そのOAuthクライアントを再利用したり、プロキシを介してアクセスしたりしてはいけません。
  • ユーザーがアカウントとキーを作成します。 エージェントはサービスにサインアップしたり、パスワード、カード番号、ライブキーを入力したりしません。ユーザーはStripe、Supabase、Resend、またはGoogle Cloudプロジェクトを作成し、.env.local にキーを配置します。エージェントはすべての変数名と空の値を持つ .env.example を作成します。
  • 最初はテストモード。 replica-deploy まではStripeのテストキーとテストカードを使用します。

認証

  • 確認付きメールサインアップ、パスワードリセット、マジックリンク(元のアプリにあれば)。OAuth(Google、Apple)はユーザー自身の開発者アプリを使用。
  • セッション:http-onlyのセキュアクッキー。全端末からサインアウト。
  • reconマップにロールとチームがあれば:owner、admin、member。「このユーザーはこのレコードにこの操作ができるか」に答える関数を1つ用意。
  • 実際に削除するアカウント削除機能。Appleはサインアップのあるアプリにこれを要求します。

データベース

  • architecture.md からのマイグレーション。バージョン管理にチェックインされ、スクリプトで実行。
  • すべてのテーブルにアクセスルール:Supabaseでは行レベルセキュリティポリシー、またはすべてのクエリで呼び出される認可関数。テスト:2番目のユーザーは何も取得できないこと。
  • 現実的なダミーデータ(実際の人物は含まない)を投入するシードスクリプト。
  • バックアップ(ホストの日次バックアップ回数、有効になっているか確認)。

決済

  • Stripe Checkout:プランへのサインアップ用。Customer Portal:変更とキャンセル用。カードフォームは作成しない。
  • Webhook:署名を検証、イベントIDを保存、すべてのハンドラーをべき等にする(Stripeはリトライする)。checkout.session.completed、customer.subscription.updated、customer.subscription.deleted、invoice.payment_failed を処理。
  • サブスクリプションのステータスはデータベースに保持し、Webhookで更新され、アプリで読み取ります。クライアントを信頼してはいけません。
  • キャンセルはワンクリック。解約が難しい請求はほとんどのアプリに対するトップの苦情であり、多くの地域で違法です。

メールとジョブ

  • トランザクションメール:ResendまたはPostmark経由で、自身のドメインから送信。テンプレートは新規作成。
  • 時間ベースの処理(リマインダー、ダイジェスト、同期、クリーンアップ)用のジョブ:リトライとデッドレターログ付き。時刻はUTCで保存し、ユーザーのタイムゾーンで表示。

連携

機能マトリックスにある各連携について:公式API、必要なOAuthスコープ(最小限)、プロバイダーのレビュープロセス、レート制限。CalendarのようなGoogleスコープは、公開前にGoogleのOAuth検証が必要で、これには数週間かかります。早めに開始し、backend.md にその旨を記載してください。

セキュリティチェックリスト

  • シークレットは環境変数のみに保存、.env* は .gitignore に追加、クライアントバンドルには含めない
  • すべてのルートでサーバーサイドの入力検証(zodなど)
  • すべての読み取りと書き込みで認可をチェック、2番目のユーザーでテスト
  • 認証、サインアップ、メールやSMSを送信するすべての処理にレート制限
  • Webhookは署名を検証
  • アップロード:サイズとタイプの制限、別のドメインまたはバケットから配信
  • URLやログにユーザーデータを含めない
  • 依存関係の監査(npm audit)
  • プライバシーポリシーにすべての処理事業者(Stripe、Resend、ホスト、分析)を記載

出力

動作する認証、データベース、テストモードの決済、メールと連携、.env.example、チェックリストにチェックが入った replica/backend.md、更新された機能マトリックス行。次:/replica-test。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

silasroliver-hue/replica-skill-cursor

>- Plans the stack, database schema and API for an app clone, from the recon map replica-recon wrote. Picks boring, managed tech, turns the inferred data model into real SQL with indexes and access rules, lists every route by flow, and orders the build as a thin vertical slice first. Use when the user says "plan the clone", "what stack should I use", "design the database", "write the schema", "plan the API", "architecture for my version of X", or after /replica-recon finishes.

silasroliver-hue/replica-skill-cursor

>- Names and rebrands an app clone so it is the user's own: name candidates with the trademark, domain, store and handle checks to run, a new palette checked for contrast, a logo brief, a voice guide, and a sweep tool that finds anything of the original left in the codebase. Use when the user says "name my app", "rebrand the clone", "make it mine", "pick a name and colours", "logo brief", "brand voice", "check for leftovers", or after /replica-entrepreneur. Always runs before /replica-launch.

silasroliver-hue/replica-skill-cursor

>- Rebuilds an app screen by screen from the recon map: app shell first, then the core flow as a vertical slice, then every screen with all its states, ticking off the feature matrix as it goes. Writes every line fresh, never the original's code, assets or copy. Use when the user says "build the clone", "build screen S07", "start building", "rebuild this screen", "implement the booking page", or after /replica-design.

silasroliver-hue/replica-skill-cursor

>- Ships an app clone live on the user's own domain: a preflight gate (tests green, parity must-haves done, rebrand sweep clean, listing linted, legal pages up), production database and env vars, the host, DNS records for the domain and for email, Stripe live mode, OAuth redirects, monitoring, and mobile builds to TestFlight and Play. Use when the user says "deploy it", "ship it", "put it live", "connect my domain", "go to production", "publish the app", or after /replica-launch.

関連スキル