A comprehensive collection of Cursor IDE rules for building modern TypeScript applications with Effect-TS, React Router v7, and AWS infrastructure.
- Browse the rules directory to find the patterns you need
- Copy the
.mdcfiles to your project's.cursorrules/rulesdirectory - Cursor will pick them up automatically
- effect-service-architecture.mdc - Service layer patterns with Effect-TS
- effect-store-patterns.mdc - Data access layer patterns
- effect-handler-patterns.mdc - HTTP handler patterns
- effect-usecase-patterns.mdc - Business logic patterns
- effect-testing-patterns.mdc - Testing strategies with Effect-TS
- react-router-v7-patterns.mdc - React Router v7 resource routes
- responsive-design-patterns.mdc - Mobile-first responsive design
- frontend-translation-management.mdc - i18n patterns
- infrastructure-stack-patterns.mdc - AWS CDK patterns
- nx-rules.mdc - Nx monorepo patterns
- api-client-patterns.mdc - API client architecture
- api-client-testing.mdc - API testing strategies
- schema-validation.mdc - Data validation patterns
- code-style.mdc - TypeScript code style guide
- cursor-rule-maintainer.mdc - Maintaining cursor rules
- readme-maintenance.mdc - Documentation patterns
- ai-tools-maintenance.mdc - AI-assisted development
These rules promote:
- Effect-TS First: Functional programming with Effect-TS for type-safe, composable code
- Layered Architecture: Clear separation between handlers, usecases, and stores
- Type Safety: Comprehensive TypeScript patterns with Effect Schema validation
- Testing: Property-based testing and dependency injection for reliable code
- Modern React: React Router v7 with resource routes and server-side rendering
- AWS Native: CDK-based infrastructure with serverless patterns
The rules assume this project structure:
src/
├── components/ # React components (pure, presentational)
├── routes/ # React Router v7 routes
│ ├── api/ # Server-side route handlers
│ └── ui/ # Client-side route components
├── hooks/ # Effect-based React hooks
├── .server/
│ ├── services/ # Effect-TS service implementations
│ ├── stores/ # Effect-based state management
│ ├── config/ # Effect-TS Config management
│ └── errors/ # Tagged error types
├── __types/ # Shared TypeScript types
├── tests/ # Tests co-located with source
└── e2e/ # Playwright E2E tests
export class BlogStore extends Effect.Service<BlogStore>()('BlogStore', {
dependencies: [DynamoDBService, ConfigService],
effect: Effect.gen(function* () {
const dynamodb = yield* DynamoDBService
const config = yield* ConfigService
return {
create: (blogPost: BlogPost) => Effect.gen(function* () {
// Implementation
}),
getById: (id: BlogPostId) => Effect.gen(function* () {
// Implementation
}),
}
}),
}) {}export class NotFoundError extends Data.TaggedError('NotFoundError')<{
readonly resource: string
readonly id: string
}> {}
// Usage
Effect.catchTags({
NotFoundError: (error) => notFoundResponse(error.message),
ConflictError: (error) => conflictResponse(error.message),
})export async function loader({ params }: LoaderFunctionArgs) {
const blogPost = await getBlogPostUsecase(params.id).pipe(
Effect.provide(BlogStore.Default),
Effect.runPromise
)
return json({ blogPost })
}- Unit Tests: Every service with Effect-TS dependency injection
- Property Tests: Pure functions with fast-check
- E2E Tests: Critical paths with Playwright
- Mocking: Effect services with test layers
- Choose Your Rules: Select the
.mdcfiles relevant to your project - Configure Cursor: Place rules in your
.cursorrulesdirectory - Adapt Patterns: Modify rules to match your specific needs
- Contribute Back: Share improvements via pull requests
Each rule file includes:
- ✅ Correct patterns with examples
- ❌ Anti-patterns to avoid
- 📝 Detailed explanations of architectural decisions
- 🔧 Configuration examples
Contributions are welcome! Please:
- Follow the existing pattern format
- Include both positive and negative examples
- Add clear explanations for architectural decisions
- Test rules with real projects before submitting
This project is released under the MIT License. You are free to use, modify, and distribute these rules without any limitations.
These rules are based on real-world experience building production applications with:
- Effect-TS - Functional programming library
- React Router v7 - Full-stack React framework
- AWS CDK - Infrastructure as code
- Cursor IDE - AI-powered code editor
Happy coding! 🎉