Skip to content

Commit efd3819

Browse files
nikgrafCopilot
andauthored
adding cursor rules (#424)
Co-authored-by: Copilot <[email protected]>
1 parent f4fd295 commit efd3819

File tree

12 files changed

+661
-0
lines changed

12 files changed

+661
-0
lines changed

.cursor/rules/project-wide.mdc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
description: Project-Wide Rules for the Hypergraph monorepo and its packages
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
# Hypergraph Project-Wide Rules
8+
9+
## Monorepo Structure
10+
- Use pnpm workspaces for package management
11+
- Follow consistent package naming conventions
12+
- Use workspace dependencies where appropriate
13+
- Maintain proper package.json structure
14+
- Use consistent versioning across packages
15+
16+
## TypeScript Configuration
17+
- Use strict TypeScript configuration
18+
- Implement proper type definitions
19+
- Use consistent import/export patterns
20+
- Follow TypeScript best practices
21+
- Use proper module resolution
22+
23+
## Code Style
24+
- Use Biome for linting and formatting
25+
- Follow consistent naming conventions
26+
- Use proper indentation and spacing
27+
- Implement proper code organization
28+
- Follow established file structure patterns
29+
30+
## Testing
31+
- Use Vitest for testing framework
32+
- Write comprehensive unit tests
33+
- Test both success and error scenarios
34+
- Use proper mocking strategies
35+
- Maintain good test coverage
36+
37+
## Documentation
38+
- Write clear, comprehensive documentation
39+
- Use proper JSDoc comments
40+
- Maintain up-to-date README files
41+
- Document API interfaces
42+
- Use consistent documentation patterns
43+
44+
## Git Workflow
45+
- Use conventional commit messages
46+
- Implement proper branching strategy
47+
- Use meaningful commit descriptions
48+
- Follow established PR review process
49+
- Maintain clean git history
50+
51+
## Security
52+
- Use secure dependencies
53+
- Implement proper authentication
54+
- Follow security best practices
55+
- Use proper encryption where needed
56+
- Maintain secure coding practices
57+
58+
## Performance
59+
- Optimize bundle sizes
60+
- Implement proper caching strategies
61+
- Use efficient algorithms
62+
- Monitor performance metrics
63+
- Follow performance best practices

.cursor/rules/root-config.mdc

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
description: Root Configuration Rules for the Hypergraph monorepo and its packages
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
# Root Configuration Rules
8+
9+
## Package Management
10+
- Use pnpm for package management
11+
- Maintain consistent workspace configuration
12+
- Use proper dependency management
13+
- Follow semantic versioning
14+
- Use proper package.json structure
15+
16+
## Build Configuration
17+
- Use TypeScript for configuration
18+
- Implement proper build scripts
19+
- Use consistent build tooling
20+
- Maintain proper output structure
21+
- Use proper source maps
22+
23+
## Linting and Formatting
24+
- Use Biome for linting and formatting
25+
- Maintain consistent code style
26+
- Use proper ignore patterns
27+
- Implement proper rule configuration
28+
- Follow established conventions
29+
30+
## Documentation
31+
- Maintain comprehensive README
32+
- Use proper documentation structure
33+
- Include setup instructions
34+
- Document development workflow
35+
- Use consistent documentation style
36+
37+
## CI/CD
38+
- Use proper GitHub Actions
39+
- Implement proper testing workflows
40+
- Use proper deployment strategies
41+
- Maintain proper environment configuration
42+
- Follow security best practices
43+
44+
## Development Tools
45+
- Use proper development dependencies
46+
- Implement proper tooling configuration
47+
- Use consistent development workflow
48+
- Maintain proper debugging setup
49+
- Use proper IDE configuration
50+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
description: Connect frontend application patterns and conventions
3+
globs: ["src/**/*.tsx", "src/**/*.ts"]
4+
alwaysApply: false
5+
---
6+
7+
# Connect Frontend App Rules
8+
9+
## Technology Stack
10+
- Use Vite for build tooling
11+
- Use TanStack Router for routing
12+
- Use TanStack Query for server state
13+
- Use Tailwind CSS for styling
14+
- Use React 19 with latest features
15+
16+
## Component Architecture
17+
- Use functional components with hooks
18+
- Implement proper TypeScript interfaces
19+
- Use the Hypergraph React SDK components
20+
- Follow the established routing patterns
21+
22+
## State Management
23+
- Use XState Store for complex state
24+
- Use React Query for server state
25+
- Use Hypergraph contexts for app state
26+
- Implement proper loading states
27+
28+
## Authentication
29+
- Use Privy for authentication
30+
- Implement proper SIWE integration
31+
- Handle authentication state properly
32+
- Use secure authentication patterns
33+
34+
## Routing
35+
- Use TanStack Router for type-safe routing
36+
- Implement proper route guards
37+
- Use nested routing where appropriate
38+
- Handle route parameters safely
39+
40+
## Styling
41+
- Use Tailwind CSS for styling
42+
- Follow responsive design patterns
43+
- Use consistent design tokens
44+
- Implement proper accessibility
45+
46+
## Performance
47+
- Use React.memo for expensive components
48+
- Implement proper code splitting
49+
- Use lazy loading for routes
50+
- Optimize bundle size
51+
52+
## Testing
53+
- Use React Testing Library
54+
- Test user interactions
55+
- Mock external dependencies
56+
- Test authentication flows
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
description: Create Hypergraph App CLI patterns and conventions
3+
globs: ["src/**/*.ts"]
4+
alwaysApply: false
5+
---
6+
7+
# Create Hypergraph App CLI Rules
8+
9+
## CLI Architecture
10+
- Use Effect CLI for command-line interface
11+
- Implement proper subcommands
12+
- Use descriptive command names
13+
- Provide helpful error messages
14+
- Implement proper help text
15+
16+
## Template System
17+
- Use structured templates for scaffolding
18+
- Implement proper template validation
19+
- Use consistent template structure
20+
- Provide clear template documentation
21+
- Support multiple template types
22+
23+
## File Operations
24+
- Use safe file system operations
25+
- Implement proper error handling
26+
- Validate file paths and permissions
27+
- Use consistent file naming
28+
- Implement proper backup strategies
29+
30+
## User Experience
31+
- Provide clear progress indicators
32+
- Implement proper error recovery
33+
- Use consistent output formatting
34+
- Provide helpful suggestions
35+
- Implement proper validation
36+
37+
## Code Generation
38+
- Generate type-safe code
39+
- Use consistent code formatting
40+
- Implement proper imports
41+
- Follow established patterns
42+
- Generate comprehensive documentation
43+
44+
## Testing
45+
- Test CLI commands thoroughly
46+
- Mock file system operations
47+
- Test error scenarios
48+
- Test template generation
49+
- Use Vitest for testing
50+
51+
## Distribution
52+
- Use proper package.json configuration
53+
- Implement proper binary setup
54+
- Use TypeScript for type safety
55+
- Follow npm publishing best practices
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
description: Create Hypergraph CLI tool patterns and conventions
3+
globs: ["src/**/*.ts"]
4+
alwaysApply: false
5+
---
6+
7+
# Create Hypergraph CLI Rules
8+
9+
## CLI Architecture
10+
- Use Effect CLI for command-line interface
11+
- Implement proper subcommands
12+
- Use descriptive command names
13+
- Provide helpful error messages
14+
- Implement proper help text
15+
16+
## Template System
17+
- Use structured templates for scaffolding
18+
- Implement proper template validation
19+
- Use consistent template structure
20+
- Provide clear template documentation
21+
- Support multiple template types
22+
23+
## File Operations
24+
- Use safe file system operations
25+
- Implement proper error handling
26+
- Validate file paths and permissions
27+
- Use consistent file naming
28+
- Implement proper backup strategies
29+
30+
## User Experience
31+
- Provide clear progress indicators
32+
- Implement proper error recovery
33+
- Use consistent output formatting
34+
- Provide helpful suggestions
35+
- Implement proper validation
36+
37+
## Code Generation
38+
- Generate type-safe code
39+
- Use consistent code formatting
40+
- Implement proper imports
41+
- Follow established patterns
42+
- Generate comprehensive documentation
43+
44+
## Testing
45+
- Test CLI commands thoroughly
46+
- Mock file system operations
47+
- Test error scenarios
48+
- Test template generation
49+
- Use Vitest for testing
50+
51+
## Distribution
52+
- Use proper package.json configuration
53+
- Implement proper binary setup
54+
- Use TypeScript for type safety
55+
- Follow npm publishing best practices
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
description: Events application patterns and conventions
3+
globs: ["src/**/*.tsx", "src/**/*.ts"]
4+
alwaysApply: false
5+
---
6+
7+
# Events App Rules
8+
9+
## Technology Stack
10+
- Use Vite for build tooling
11+
- Use TanStack Router for routing
12+
- Use React for UI components
13+
- Use Tailwind CSS for styling
14+
- Use Hypergraph SDK for data management
15+
16+
## Event Management
17+
- Implement proper event creation
18+
- Use type-safe event schemas
19+
- Implement proper event validation
20+
- Handle event state management
21+
- Use proper event lifecycle
22+
23+
## User Management
24+
- Implement proper user authentication
25+
- Handle user permissions
26+
- Manage user profiles
27+
- Implement proper user state
28+
- Use secure authentication patterns
29+
30+
## Data Management
31+
- Use Hypergraph for data storage
32+
- Implement proper data synchronization
33+
- Handle offline scenarios
34+
- Use proper data validation
35+
- Implement proper error handling
36+
37+
## UI/UX
38+
- Use consistent design patterns
39+
- Implement responsive design
40+
- Follow accessibility guidelines
41+
- Use proper loading states
42+
- Implement proper error states
43+
44+
## Performance
45+
- Optimize component rendering
46+
- Implement proper caching
47+
- Use lazy loading
48+
- Optimize bundle size
49+
- Monitor performance metrics
50+
51+
## Testing
52+
- Test user interactions
53+
- Test event workflows
54+
- Mock external dependencies
55+
- Test error scenarios
56+
- Use React Testing Library
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
description: Next.js example application patterns and conventions
3+
globs: ["src/**/*.tsx", "src/**/*.ts"]
4+
alwaysApply: false
5+
---
6+
7+
# Next.js Example App Rules
8+
9+
## Technology Stack
10+
- Use Next.js 15+ for framework
11+
- Use App Router for routing
12+
- Use TypeScript for type safety
13+
- Use Tailwind CSS for styling
14+
- Use Hypergraph SDK for data
15+
16+
## Next.js Patterns
17+
- Use App Router structure
18+
- Implement proper page components
19+
- Use Server Components where appropriate
20+
- Use Client Components for interactivity
21+
- Follow Next.js best practices
22+
23+
## Routing
24+
- Use App Router file-based routing
25+
- Implement proper dynamic routes
26+
- Use proper route handlers
27+
- Handle route parameters safely
28+
- Implement proper redirects
29+
30+
## Data Fetching
31+
- Use Server Components for data fetching
32+
- Implement proper loading states
33+
- Handle error boundaries
34+
- Use proper caching strategies
35+
- Implement proper revalidation
36+
37+
## Styling
38+
- Use Tailwind CSS for styling
39+
- Follow responsive design patterns
40+
- Use consistent design tokens
41+
- Implement proper accessibility
42+
- Use CSS modules when needed
43+
44+
## Performance
45+
- Use Next.js optimizations
46+
- Implement proper image optimization
47+
- Use proper code splitting
48+
- Optimize bundle size
49+
- Monitor Core Web Vitals
50+
51+
## Testing
52+
- Use Next.js testing utilities
53+
- Test page components
54+
- Test API routes
55+
- Mock external dependencies
56+
- Test user interactions

0 commit comments

Comments
 (0)