Skip to content

Latest commit

 

History

History
44 lines (39 loc) · 1.78 KB

File metadata and controls

44 lines (39 loc) · 1.78 KB

ForgeArc Copilot Instructions

Stack

  • Runtime: Node.js 20 (LTS), pnpm 9
  • Framework: Next.js 15 (App Router) or SvelteKit — check the repo's package.json
  • Language: TypeScript (strict mode)
  • Styling: Tailwind CSS v4
  • Database: PostgreSQL via Neon (serverless), Drizzle ORM
  • Auth: Lucia v3 or Auth.js v5
  • Payments: Stripe
  • Email: SendGrid
  • SMS: Twilio
  • AI: OpenAI SDK + Google Gemini SDK
  • Queue/Cache: QStash (jobs), Upstash Redis (cache/session)
  • Storage: Tigris (S3-compatible object storage)
  • Deploy: Vercel
  • CI: GitHub Actions

Code style

  • TypeScript strict — no any, prefer unknown
  • Named exports over default exports
  • Conventional commits: feat:, fix:, chore:, refactor:, docs:
  • No comments unless explaining why, not what
  • Prefer async/await over .then()
  • Server Actions for mutations in Next.js
  • Zod for all external input validation

Secrets

  • All credentials are in GitHub org secrets — never hardcode
  • Access via process.env.SECRET_NAME — always check for undefined at the boundary
  • Use the canonical names: DATABASE_URL, OPENAI_API_KEY, STRIPE_SECRET_KEY, etc.

Patterns to follow

  • Error handling: throw typed errors, catch at the route/action boundary
  • API routes: validate request body with Zod before any business logic
  • Database: use transactions for multi-step writes
  • Migrations: Drizzle Kit (pnpm drizzle-kit push for dev, generate migrations for prod)

What NOT to do

  • Don't use console.log in production code — use a logger or remove
  • Don't commit .env files — use org secrets
  • Don't bypass TypeScript with @ts-ignore unless absolutely necessary with a comment
  • Don't use var — use const/let
  • Don't write tests that rely on global state