Agent skill

chat-context

Skill: chat-context

Stars 1,162
Forks 105

Install this agent skill to your Project

npx add-skill https://github.com/FranciscoMoretti/chat-js/tree/main/apps/chat/.cursor/skills/chat-context

SKILL.md

Repo Context

  • Vercel AI SDK for AI framework and frontend-backend interactions
  • Next.js with app directory
  • ORM is Drizzle with the schema at lib/db/schema.ts
  • DB queries and mutations are at lib/db/queries.ts
  • To test your changes through compilation. Don't run a build. But do bun test:types
  • This repo uses Tailwind 4.
  • Shadcn UI is used for the UI components and the components are in components/ui folder. The config is in components.json.

App structure

  • People interact with the AI through the app/(chat)/api/chat/route.ts by sending a message. It responds by creating a new message.

Database Migrations

  • To perform database migrations follow Drizzle conventions. First make the desired changes to the schema in lib/db/schema.ts. Then run bun db:generate to generate the migration file. Then run bun db:migrate to apply the migration to the database.

Environment Variables

  • All env vars are managed in lib/env.ts using @t3-oss/env-nextjs
  • Add new vars to the server object with zod schema
  • Use env.VAR_NAME instead of process.env.VAR_NAME
  • Feature flags live in lib/config.ts (integrations, authentication)
  • When a feature is enabled in config, its required env vars must be validated in scripts/check-env.ts
  • Pattern: check siteConfig.feature && !env.REQUIRED_VAR then push to errors array

Browser Testing

  • To test authenticated features in the browser, navigate to /api/dev-login first
  • This creates a dev session and redirects to / with valid auth cookies
  • Only works in development (NODE_ENV=development)

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results