{"name":"copilot-instructions","title":"copilot-instructions.md template","description":"A copilot-instructions.md example for GitHub Copilot with build commands, layout, code style and PR rules, plus a path-specific instructions file.","category":"agents","updated":"2026-11-30","url":"https://sniptide.com/templates/copilot-instructions","files":[{"name":".github/copilot-instructions.md","language":"markdown","content":"# Copilot instructions\n\nThis repository is a Next.js app with a Postgres database. It uses TypeScript, React Server\nComponents and Tailwind CSS. Packages are managed with pnpm.\n\n## Build and test\n\n- Install: `pnpm install --frozen-lockfile`\n- Start the database: `docker compose up -d --wait`\n- Run the app: `pnpm dev`, then open `http://localhost:3000`\n- Before you finish, run `pnpm lint`, `pnpm typecheck` and `pnpm test`. All three must pass.\n\n## Project layout\n\n- `app/` holds routes. A folder is a URL segment, and `page.tsx` renders it.\n- `components/ui/` holds shared components. Use them before writing new markup.\n- `lib/db/` holds the schema and queries. Every query goes through these functions.\n- `lib/db/migrations/` holds SQL migrations. Never edit one that has been merged.\n\n## Code style\n\n- Write server components by default. Add `\"use client\"` only for state, effects or browser APIs.\n- Validate every request body and form input with the Zod schemas in `lib/validation`.\n- Name files in kebab-case and components in PascalCase.\n- Use Tailwind classes and theme tokens. Do not write hex colors in components.\n\n## Testing\n\n- Put a test next to the code it covers, as `name.test.ts`.\n- Test behavior through public functions, not private helpers.\n- A bug fix starts with a test that fails without the fix.\n\n## Pull requests\n\n- Keep one change per pull request, and describe what changed and how you checked it.\n- Do not add dependencies without saying why in the pull request description.\n- Never commit secrets. Configuration comes from environment variables listed in `.env.example`.\n"},{"name":".github/instructions/tests.instructions.md","language":"markdown","content":"---\napplyTo: \"**/*.test.ts,**/*.test.tsx\"\n---\n\n# Tests\n\n- Use Vitest with `describe` and `test`. Do not use `it`.\n- Build test data with the factories in `test/factories.ts` instead of inline objects.\n- Tests that touch the database run against the Compose Postgres and clean up their own rows.\n- Assert on what a user or caller sees, such as returned values and rendered text.\n- Do not mock modules from this repository. Mock only network calls to other services.\n"}]}