AGENTS.md¶
Project rules¶
- Use
pnpmfor all installs, builds, and scripts – notnpmoryarn. - Always run
pnpm lintbefore commits; some lint rules are stricter than defaults. - Database schema changes require running
pnpm db:generateandpnpm db:migrate. - Environment requires
.envvalues for NEXTAUTH, DATABASE_URL, and Google Cloud Storage. - Next.js
src/appuses App Router; no legacypages/folder. - API layer built on tRPC; never create ad-hoc REST endpoints.
- Auth handled by NextAuth in
/app/api/auth/[...nextauth]/route.ts. - Use
src/server/api/routersfor all domain logic; register new routers inroot.ts. - DB queries must go through Drizzle ORM via
@/server/db. - Tailwind uses custom config in
tailwind.config.ts; match design tokens when styling. - Shared types should be colocated in
src/typesand re-used across front + back ends. tsconfig.jsonhas path aliases (e.g.@/server/*); use them instead of relative imports.- Avoid direct access to
windowAPIs without guards – App Router code may run server-side. - Large file uploads must use GCS; backend must stream – never buffer in memory.
- Drizzle migrations are auto-generated; do not hand-edit migration SQL.
- Client components must be explicitly marked with
"use client".
⚠️ Pre-push quality gate (MANDATORY)¶
Every commit must pass CI checks. AI agents bypass Git hooks — run these manually before every push:
CI runs: pnpm lint → pnpm format (Prettier --check) → pnpm run test:ci (Jest) → pnpm next build. A failure in any step blocks the PR. Fix errors before committing — never push code that fails lint, format, test, or build.
Blog authoring (MDX)¶
- Posts live in
src/app/blog/*.mdx; filename (minus.mdx) = slug = route. - Front-matter (YAML):
title(required),dateYYYY-MM-DD (required),excerpt(required),tags(optional array),author(optional, default "Ian Lintner"),image/imageAlt(optional, for hero/social SVG). - First
# H1is auto-skipped byMarkdownRenderer(page header displays it). - Use
```mermaidfence blocks for diagrams — auto-rendered by<Mermaid>client component with dark/light theme support. - Use GFM tables (
remarkGfm), fenced code blocks with explicit language tags, andrehypeHighlightfor syntax highlighting. - Hero images: 1200×630 SVG in
/public/images/<slug>-social.svg. See.github/copilot-instructions.mdfor the full SVG template. - Inline images:
— store in/public/images/. - Never add inline styles; rely on Tailwind Typography prose classes and
src/styles/highlight.css. - Verify:
pnpm dev→ check/blog/<slug>, thenpnpm lint && pnpm build.
Full authoring guide with SVG templates, Mermaid examples, and content structure patterns: .github/copilot-instructions.md.