Skip to content

Add AGENTS.md — coding-agent guide for the repository#1

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-nextjs-expert-guidelines
Draft

Add AGENTS.md — coding-agent guide for the repository#1
Copilot wants to merge 3 commits intomainfrom
copilot/add-nextjs-expert-guidelines

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 9, 2026

The repo had no machine-readable guidance for AI coding agents, making it easy for agents to violate project conventions (wrong env var names, Pages Router usage, missing rate-limit guards, etc.).

What's in AGENTS.md

  • Commandsdev, build, lint, seed, seed:csv with context ("no test runner; validate with npm run build + npm run lint")
  • Environment variables — correct names (MONGO_URI, not MONGODB_URI), all AUTH_* vars, ADMIN_EMAILS bootstrap escape hatch
  • Next.js architecture rules — App Router only; every user page under [lang]/; Server vs Client component decision table; Route Handler boilerplate (rate-limit + auth guard + Cache-Control); middleware flow; unstable_cache / revalidateTag patterns
  • Database patternsconnectDB() singleton; model registration guard (mongoose.models.X || mongoose.model(...)); multilingual Map field fallback (word[locale] ?? word['en']); aggregation-over-N+1 rule
  • i18n — two arrays to keep in sync (src/proxy.ts + getDictionary.ts); 5-step checklist for adding a new locale
  • Auth — NextAuth v5 JWT; isAdmin() helper (DB flag + ADMIN_EMAILS fallback); auth() is Server-only, use useSession() on the client
  • Styling — Tailwind-only; cn(); src/components/ui/ is shadcn-managed (do not edit)
  • Common pitfalls — table of 8 agent-specific gotchas with correct alternatives

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
impro-generator Ready Ready Preview, Comment Mar 9, 2026 7:57pm

Co-authored-by: Andyrei <106072367+Andyrei@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Next.js expert guidelines to documentation docs: add Next.js expert-level README Mar 9, 2026
Co-authored-by: Andyrei <106072367+Andyrei@users.noreply.github.com>
Copilot AI changed the title docs: add Next.js expert-level README Add AGENTS.md — coding-agent guide for the repository Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants