
Overview This .cursorrules configuration is designed for a modern TypeScript-based...
This .cursorrules configuration is designed for a modern TypeScript-based development environment, focusing on Next.js, React, and full-stack development best practices. Let's break down each major section and understand the reasoning behind these choices.
"general": {
"language": "typescript",
"formatOnSave": true,
"defaultPromptContext": "..."
}
"typescript": {
"strict": true,
"completions": {
"imports": {
"preferNamed": true,
"preferConst": true
}
}
}
"react": {
"completions": {
"preferArrowFunctions": true,
"preferFunctionComponents": true
}
}
"api": {
"completions": {
"preferAsync": true,
"suggestErrorHandling": true
}
}
"database": {
"sql": {
"suggestIndexes": true,
"suggestConstraints": true
}
}
The custom prompts are organized into categories:
"generateComponent": "Create a TypeScript React component..."
"generateHook": "Create a custom React hook..."
"generateAPI": "Create a RESTful API endpoint..."
"generateMiddleware": "Create an Express/Next.js middleware..."
"generateTest": "Create a comprehensive test suite..."
"generateE2E": "Create an end-to-end test scenario..."
"fileTemplates": {
"component": {
"path": "src/components/${name}/${name}.tsx",
"test": "src/components/${name}/${name}.test.tsx"
}
}
Type Safety
Code Quality
Developer Experience
Performance
Maintainability
This configuration represents a carefully considered balance between:
It's specifically tailored for TypeScript/Next.js development while maintaining flexibility for different project requirements. The extensive custom prompts system allows for rapid development without compromising on quality or consistency.
{
"version": "1.0",
"rules": {
"general": {
"language": "typescript",
"formatOnSave": true,
"defaultPromptContext": "You are working with a TypeScript/Next.js application using modern best practices."
},
"typescript": {
"strict": true,
"completions": {
"imports": {
"preferNamed": true,
"preferConst": true
},
"types": {
"inferFromUsage": true,
"preferInterface": true,
"strictNullChecks": true
}
}
},
"react": {
"completions": {
"preferArrowFunctions": true,
"preferFunctionComponents": true,
"hooks": {
"suggestDependencyArray": true,
"suggestCustomHooks": true
}
}
},
"nextjs": {
"completions": {
"preferServerComponents": true,
"suggestMetadata": true,
"routing": {
"preferAppRouter": true
}
}
},
"api": {
"completions": {
"preferAsync": true,
"suggestErrorHandling": true,
"suggestValidation": true,
"database": {
"suggestTransactions": true,
"suggestPreparedStatements": true
}
}
},
"styling": {
"completions": {
"preferModules": true,
"suggestTailwind": true,
"cssProperties": {
"preferFlexbox": true,
"preferGrid": true
}
}
},
"documentation": {
"completions": {
"jsdoc": {
"required": true,
"style": "typescript",
"requireParams": true,
"requireReturns": true
}
}
},
"infrastructure": {
"docker": {
"suggestMultiStage": true,
"suggestOptimizations": true
},
"github": {
"suggestActions": true,
"cicd": {
"suggestTests": true,
"suggestLinting": true
}
}
},
"database": {
"sql": {
"suggestIndexes": true,
"suggestConstraints": true,
"preferPreparedStatements": true
},
"redis": {
"suggestCaching": true,
"suggestExpiry": true
}
},
"customPrompts": {
// Frontend Development
"generateComponent": "Create a TypeScript React component with proper types, error boundaries, and documentation. Include loading and error states.",
"generateHook": "Create a custom React hook with TypeScript, including proper dependency management, cleanup, and documentation.",
"generateForm": "Create a type-safe form component with validation, error handling, and proper submission states.",
"generateLayout": "Create a responsive layout component with proper CSS Grid/Flexbox implementation.",
// API Development
"generateAPI": "Create a RESTful API endpoint with TypeScript, input validation, error handling, and Swagger documentation.",
"generateMiddleware": "Create an Express/Next.js middleware with proper error handling and typing.",
"optimizeQuery": "Optimize this database query for performance, including proper indexing suggestions and caching strategy.",
"generateSchema": "Create a database schema with proper constraints, indexes, and TypeScript types.",
// Testing
"generateTest": "Create a comprehensive test suite using Jest and React Testing Library, including edge cases and error scenarios.",
"generateE2E": "Create an end-to-end test scenario covering the main user flow.",
"generateMock": "Generate mock data and services for testing purposes.",
// State Management
"generateReducer": "Create a typed reducer with actions and state management.",
"generateContext": "Create a React context with proper TypeScript typing and provider component.",
// Database
"generateMigration": "Create a database migration script with up and down functions.",
"generateCache": "Implement Redis caching strategy for this data access pattern.",
// Infrastructure
"generateDockerfile": "Create a multi-stage Dockerfile optimized for Node.js/TypeScript.",
"generateAction": "Create a GitHub Action workflow for CI/CD.",
"generateEnv": "Generate environment variable documentation and validation.",
// Documentation
"generateDocs": "Create comprehensive documentation including usage examples and type definitions.",
"generateStory": "Create a Storybook story with different component states and documentation.",
// Utilities
"generateUtil": "Create a utility function with proper error handling and documentation.",
"generateConstants": "Create a type-safe constants file with proper naming and documentation.",
"generateValidator": "Create a validation utility using Zod/Yup with proper error messages.",
// Performance
"optimizeComponent": "Analyze and optimize component performance including memoization and lazy loading.",
"optimizeBundle": "Suggest bundle optimization strategies for this component/module.",
// Security
"securityAudit": "Review code for common security vulnerabilities and suggest fixes.",
"generateAuth": "Create authentication middleware/utilities with proper security measures."
},
"fileTemplates": {
"component": {
"path": "src/components/${name}/${name}.tsx",
"test": "src/components/${name}/${name}.test.tsx"
},
"api": {
"path": "src/app/api/${name}.ts"
},
"hook": {
"path": "src/hooks/use${name}.ts",
"test": "src/hooks/use${name}.test.ts"
},
"util": {
"path": "src/utils/${name}.ts",
"test": "src/utils/${name}.test.ts"
},
"context": {
"path": "src/contexts/${name}Context.tsx"
},
"middleware": {
"path": "src/middleware/${name}.ts"
}
}
}
}
cursorCursor Automations in 2026: wire event-triggered coding agents to Slack, CI, and...
aiThe specs exist. The AI just can't see them. I've always been the type who builds hobby...
amazonbedrockConnect Claude Code, Cursor and Codex to Amazon Bedrock's new console (2026) Summary. On 5...
aiThere is a weird uncanny valley with LLM-generated UI right now. The code functions perfectly, but if...
aiI went down a rabbit hole this morning reading the late-2025 Juejin AI roundups side by side, and the...
mcpInstall guide and config at curatedmcp.com Zendesk MCP: Let Claude Handle Your Support...
Workflows from the Neura Market marketplace related to this Cursor resource