Instruction file imported from zhattention/agent-studio (
.cursor/rules/development-guide.mdc). Copyright stays with the author.
Development Guide
Setup and Running
- Set up environment variables according to env.example
- Run
npm installto install dependencies - Run
npm run devto start the development server - Run
npm run buildfollowed bynpm startfor production
API Development
When working with the API routes:
- Use verifyAuth for authentication checks
- All API routes should be created using Next.js route handlers
- API routes should follow the pattern:
app/api/{feature}/{endpoint}/route.ts
Stream Responses
For streaming responses like in app/api/team/call/route.ts:
- Use ReadableStream for creating streaming responses
- Set proper headers:
'Content-Type': 'application/json', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive' - Handle timeouts and errors appropriately
Environment Configuration
- Required environment variables are checked on startup
- JWT authentication requires proper secret configuration
