๐ŸŽ Get the FREE AI Skills Starter Guide โ€” Subscribe โ†’
BytesAgainBytesAgain
๐Ÿฆ€ ClawHub

OpenGemini Next.js Bestpractice Builder

by @hiromps

Build and document a solo SaaS project using a fixed Next.js/Tailwind/Prisma stack, with FastAPI only for Python workloads and strict architecture rules.

Versionv1.0.1
Downloads291
TERMINAL
clawhub install opengemini-next-js-bestpractice-builder

๐Ÿ“– About This Skill


name: opengemini-nextjs-bestpractice-builder description: Build opinionated SaaS projects for solo developers with OpenClaw as orchestrator and Gemini CLI as planning and generation copilot, using a fixed best-practice stack: Next.js App Router, Tailwind, shadcn/ui, Neon PostgreSQL, Prisma 6, Clerk, Resend, Stripe, Cloudflare R2, PostHog, Sentry, Vercel, and FastAPI only for Python-required workloads. Use when the user wants to brainstorm, define, scaffold, document, structure, or implement a SaaS with this exact stack and project layout.

Purpose

ๅ›บๅฎšใ‚นใ‚ฟใƒƒใ‚ฏใฎๅ€‹ไบบ้–‹็™บSaaSใ‚’ใ€ใƒ–ใƒฌใชใ„่จญ่จˆใจๅฎŸ่ฃ…ใƒซใƒผใƒซใง็ซ‹ใกไธŠใ’ใ‚‹ใ€‚ ๆŠ€่ก“่ชฌๆ˜Žใงใฏใชใใ€ๅฎŸ่ฃ…ๆ™‚ใฎ่กŒๅ‹•ๅŸบๆบ–ใจใƒ—ใƒญใ‚ธใ‚งใ‚ฏใƒˆๆง‹้€ ใ‚’ๅผทๅˆถใ™ใ‚‹ใŸใ‚ใฎ Skillใ€‚

Use when

  • Next.js + FastAPI ๅขƒ็•Œใ‚’ๆŒใค SaaS ใ‚’ๆ–ฐ่ฆใซไฝœใ‚‹ใจใ
  • ๅ›บๅฎšใ‚นใ‚ฟใƒƒใ‚ฏใง่ฆไปถๅฎš็พฉใ‹ใ‚‰ scaffold ใพใงไธ€่ฒซใ—ใฆ้€ฒใ‚ใŸใ„ใจใ
  • Gemini CLI ใ‚’ไฝฟใฃใฆ docsใƒป่จญ่จˆใƒปๅฎŸ่ฃ…่จˆ็”ปใ‚’้ซ˜้€ŸๅŒ–ใ—ใŸใ„ใจใ
  • ๅ€‹ไบบ้–‹็™บๅ‘ใ‘ใซ็พๅฎŸ็š„ใงไฟๅฎˆใ—ใ‚„ใ™ใ„ๆง‹ๆˆใ‚’ๆœ€ๅˆใ‹ใ‚‰ๆ•ทใใŸใ„ใจใ
  • Do not use when

  • ๆŠ€่ก“้ธๅฎšใ‚’่‡ช็”ฑใซๅค‰ใˆใŸใ„ใจใ
  • Python ใŒไธปๅฝนใฎใƒใƒƒใ‚ฏใ‚จใƒณใƒ‰ใ‚’ไฝœใ‚‹ใจใ
  • ๅ˜ใชใ‚‹ๅฐ่ฆๆจกLPใ‚„้™็š„ใ‚ตใ‚คใƒˆใ ใ‘ใ‚’ไฝœใ‚‹ใจใ
  • ใ“ใฎๅ›บๅฎš stack ใ‚’ๅค–ใ™ไบˆๅฎšใŒๅผทใ„ใจใ
  • Project assumptions

  • Frontend ใฏ Next.js App Router
  • UI ใฏ Tailwind + shadcn/ui
  • DB ใฏ Neon PostgreSQL
  • ORM ใฏ Prisma 6
  • Auth ใฏ Clerk
  • Email ใฏ Resend
  • Payments ใฏ Stripe
  • Storage ใฏ Cloudflare R2
  • Analytics ใฏ PostHog
  • Error Monitoring ใฏ Sentry
  • Deploy ใฏ Vercel
  • FastAPI ใฏ Python-required workloads ใฎใฟ
  • Rules

  • docs ใ‚’ๅ…ˆใซไฝœใ‚Šใ€ๅฎŸ่ฃ…ใ‚’ๅพŒ่ฟฝใ„ใ•ใ›ใ‚‹
  • GEMINI.md ใซ source of truth ใ‚’ๆ˜Ž่จ˜ใ™ใ‚‹
  • Next.js ใ‚’ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆ backend ใจใ—ใ€FastAPI ใ‚’ไนฑ็”จใ—ใชใ„
  • Clerk auth ใ‚’ Prisma ใซ่ค‡่ฃฝใ—ใชใ„
  • Stripe ๆˆๅŠŸๅˆคๅฎšใฏ webhook ่ตท็‚นใซใ™ใ‚‹
  • R2 ใซใƒ•ใ‚กใ‚คใƒซๆœฌไฝ“ใ‚’ไฟๅญ˜ใ—ใ€DBใซใฏ metadata ใ ใ‘ใ‚’็ฝฎใ
  • ๅ„ project-level skill ใฏๅ…ฑ้€šใƒ†ใƒณใƒ—ใƒฌใƒผใƒˆใฎๅž‹ใซใใ‚ใˆใ‚‹
  • ๅ„ skill ใฏๆŠ€่ก“่ชฌๆ˜ŽใงใฏใชใๅฎŸ่ฃ…ๆ™‚ใฎ่กŒๅ‹•่ฆ็ฏ„ใจใ—ใฆๆ›ธใ
  • Prisma ใฏ 6 ็ณปใ‚’ๅ›บๅฎšใงไฝฟใ†ใ€‚7 ็ณปใธๅ‹ๆ‰‹ใซไธŠใ’ใชใ„
  • ้–‹็™บDBใฏใƒญใƒผใ‚ซใƒซๅฏใ ใŒใ€ๆœฌ็•ชDBใฏ Neon PostgreSQL ใ‚’ๅ‰ๆใซใ™ใ‚‹
  • Workflow

    1. product goal ใจ MVP ใ‚’ๆ•ด็†ใ™ใ‚‹ 2. references/project-bootstrap-checklist.md ใ‚’็ขบ่ชใ™ใ‚‹ 3. scripts/bootstrap_tree.sh ใง็†ๆƒณๆง‹ๆˆใ‚’ไฝœใ‚‹ 4. scripts/generate_gemini_md.sh ใง GEMINI.md ใ‚’ไฝœใ‚‹ 5. scripts/generate_project_docs.sh ใง docs ใ‚’็”Ÿๆˆใ™ใ‚‹ 6. docs ใ‚’ source of truth ใซใ—ใฆๅฎŸ่ฃ…ใธ้€ฒใ‚€ 7. project-level skills ใ‚’ๅฟ…่ฆใซๅฟœใ˜ใฆ่ฃœๅผทใ™ใ‚‹

    Checklist

  • GEMINI.md ใŒใ‚ใ‚‹ใ‹
  • docs/requirements.md ใ‹ใ‚‰ docs/db-schema.md ใพใงๆƒใฃใฆใ„ใ‚‹ใ‹
  • skills/*/SKILL.md ใŒๅ…ฑ้€šใƒ†ใƒณใƒ—ใƒฌใƒผใƒˆใซๆฒฟใฃใฆใ„ใ‚‹ใ‹
  • FastAPI ใ‚’ไฝฟใ†็†็”ฑใŒ่ชฌๆ˜Žใงใใ‚‹ใ‹
  • Stripe / Clerk / R2 ใฎๅฑ้™บใชใ‚ขใƒณใƒใƒ‘ใ‚ฟใƒผใƒณใ‚’้ฟใ‘ใฆใ„ใ‚‹ใ‹
  • Vercel deploy ๅ‰ๆใฎ env ่จญ่จˆใŒ่ฆ‹ใˆใฆใ„ใ‚‹ใ‹
  • Prisma 6 ใ‚’ๅ›บๅฎšใ—ใฆใ„ใ‚‹ใ‹
  • ๆœฌ็•ชDBใŒ Neon ใ‚’ๅ‰ๆใซ่จญ่จˆใ•ใ‚Œใฆใ„ใ‚‹ใ‹
  • Common pitfalls

  • Next.js ใง่ถณใ‚Šใ‚‹ๅ‡ฆ็†ใพใง FastAPI ใซ้€ƒใŒใ™
  • docs ใ‚’้›‘ใซไฝœใฃใฆ source of truth ใŒๆญปใฌ
  • skill ใ‚’ๆŠ€่ก“ใƒกใƒขๅŒ–ใ—ใฆใ€่กŒๅ‹•ๅŸบๆบ–ใจใ—ใฆไฝฟใˆใชใใ™ใ‚‹
  • Clerk ใจ Prisma ใฎๅฝนๅ‰ฒใ‚’ๆททใœใ‚‹
  • Stripe webhook ใ‚’่ปฝ่ฆ–ใ—ใฆ success redirect ใซไพๅญ˜ใ™ใ‚‹
  • file upload ใ‚’ DB ไธญๅฟƒใง่€ƒใˆใ‚‹
  • Prisma 7 ใซไธŠใ’ใฆๆŽฅ็ถšใƒป่จญๅฎšๅ‘จใ‚Šใงใƒใƒžใ‚‹
  • Output expectations

  • GEMINI.md
  • docs ไธ€ๅผ
  • ็†ๆƒณใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชๆง‹ๆˆ
  • project-level skills ไธ€ๅผ
  • stack ใซๆฒฟใฃใŸๅฎŸ่ฃ… plan ใพใŸใฏ scaffold
  • ๅฟ…่ฆใชใ‚‰ GitHub / Vercel ใพใง้€ฒใ‚ใ‚‹ใŸใ‚ใฎๆบ–ๅ‚™็Šถๆ…‹
  • Source of truth order

    When generating or updating project files, treat these as the source of truth in order: 1. docs/requirements.md 2. docs/scope.md 3. docs/architecture.md 4. docs/conventions.md 5. docs/decisions/*.md 6. docs/notes/brainstorming.md is reference only

    Fixed stack policy

  • Frontend: Next.js App Router
  • UI: Tailwind + shadcn/ui
  • DB: Neon PostgreSQL
  • ORM: Prisma 6
  • Auth: Clerk
  • Email: Resend
  • Payments: Stripe
  • Storage: Cloudflare R2
  • Analytics: PostHog
  • Error Monitoring: Sentry
  • Deploy: Vercel
  • Backend: FastAPI only for Python-required workloads
  • Backend boundary

    Default backend logic lives in Next.js route handlers or server actions. FastAPI exists only for AI, batch jobs, heavy processing, or Python-specific integrations.

    Never do

  • Do not duplicate Clerk auth state into Prisma as a full auth system
  • Do not treat Stripe success redirect as source of truth; use webhook state
  • Do not store uploaded files in PostgreSQL
  • Do not add FastAPI endpoints for simple CRUD unless explicitly required
  • Do not upgrade to Prisma 7 by default
  • Target project structure

    Generate or align toward this structure:

    my-saas/
    โ”œโ”€ GEMINI.md
    โ”œโ”€ src/
    โ”‚ โ”œโ”€ app/
    โ”‚ โ”œโ”€ components/
    โ”‚ โ”œโ”€ features/
    โ”‚ โ”œโ”€ lib/
    โ”‚ โ”œโ”€ server/
    โ”‚ โ”œโ”€ hooks/
    โ”‚ โ””โ”€ types/
    โ”œโ”€ backend/
    โ”‚ โ””โ”€ fastapi/
    โ”‚ โ”œโ”€ app/
    โ”‚ โ”œโ”€ tests/
    โ”‚ โ””โ”€ pyproject.toml
    โ”œโ”€ prisma/
    โ”‚ โ”œโ”€ schema.prisma
    โ”‚ โ”œโ”€ migrations/
    โ”‚ โ””โ”€ seed.ts
    โ”œโ”€ public/
    โ”œโ”€ tests/
    โ”‚ โ”œโ”€ unit/
    โ”‚ โ”œโ”€ integration/
    โ”‚ โ””โ”€ e2e/
    โ”œโ”€ docs/
    โ”‚ โ”œโ”€ requirements.md
    โ”‚ โ”œโ”€ scope.md
    โ”‚ โ”œโ”€ architecture.md
    โ”‚ โ”œโ”€ conventions.md
    โ”‚ โ”œโ”€ integrations.md
    โ”‚ โ”œโ”€ db-schema.md
    โ”‚ โ”œโ”€ decisions/
    โ”‚ โ””โ”€ notes/
    โ”‚   โ””โ”€ brainstorming.md
    โ”œโ”€ .gemini/
    โ”‚ โ””โ”€ commands/
    โ”œโ”€ skills/
    โ”‚ โ”œโ”€ nextjs/SKILL.md
    โ”‚ โ”œโ”€ clerk/SKILL.md
    โ”‚ โ”œโ”€ prisma/SKILL.md
    โ”‚ โ”œโ”€ shadcn/SKILL.md
    โ”‚ โ”œโ”€ stripe/SKILL.md
    โ”‚ โ”œโ”€ resend/SKILL.md
    โ”‚ โ”œโ”€ posthog/SKILL.md
    โ”‚ โ”œโ”€ sentry/SKILL.md
    โ”‚ โ”œโ”€ r2/SKILL.md
    โ”‚ โ”œโ”€ fastapi/SKILL.md
    โ”‚ โ”œโ”€ api-security/SKILL.md
    โ”‚ โ””โ”€ vercel/SKILL.md
    โ””โ”€ scripts/
    

    What this skill should produce

    For a new project, aim to create at least:

  • GEMINI.md
  • docs/requirements.md
  • docs/scope.md
  • docs/architecture.md
  • docs/conventions.md
  • docs/integrations.md
  • docs/db-schema.md
  • docs/notes/brainstorming.md
  • prisma/schema.prisma
  • base app structure under src/
  • base FastAPI structure under backend/fastapi/
  • .env.example
  • integration or implementation plan for Clerk, Stripe, Resend, PostHog, Sentry, and R2
  • References

    Read when needed:

  • references/doc-templates.md
  • references/integration-rules.md
  • references/project-bootstrap-checklist.md
  • references/project-skill-template.md
  • Publish readiness notes

    This skill is strongest when used with Gemini CLI plus OpenClaw file and shell control, and optionally ACP for large implementation loops. The project-level skills/*/SKILL.md files should be implementation policies, not generic framework notes.

    Before publishing or using this for a real project, verify:

  • Gemini CLI is installed and authenticated
  • the generated skills/*/SKILL.md files follow the shared template shape
  • project docs are generated before major implementation starts
  • FastAPI is only introduced when Python is actually required
  • deployment assumptions match Vercel reality for the target project
  • Prisma is pinned to 6.x
  • production DB assumptions match Neon reality