| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 6 | 10 | 0% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 0 | 2 | 7 | 0% |
What each file covers
Sections
0 shared · 6 only in A · 10 only in B- − Cline Rules for Megarepo
- − Rules Structure
- − How Cline Uses These Rules
- − Customization
- − Rules Bank Approach
- − Consistency with Other AI Assistants
- + Code Quality Standards
- + Core Development Principles
- + 1. TypeScript Guidelines
- + 2. TypeScript Patterns
- + 3. React Best Practices
- + 4. Testing Patterns
- + 5. Error Handling Standards
- + 6. Documentation Requirements
- + 7. Code Style Guidelines
- + 8. API Development Standards
Commands
neither file has anySection tags
0 shared · 2 only in A · 7 only in B- − architecture
- − do-not
- + test
- + code-style
- + types
- + testing-strategy
- + git-pr
- + api
- + docs
Line diff
HerringtonDarkholme/megarepo · .clinerules/README.md
@@ −1 @@
1# Cline Rules for Megarepo
2
3This directory contains Cline Rules that provide system-level guidance for the Cline AI assistant when working on this AI setup repository.
4
5## Rules Structure
6
7The rules are organized into focused files that build upon each other:
8
91. **`01-core-principles.md`** - Fundamental principles including minimal change philosophy and AI-first development
102. **`02-development.md`** - Development guidelines for Node.js/Next.js AI projects
113. **`03-documentation.md`** - Documentation requirements and standards
124. **`04-security.md`** - Security guidelines for AI projects and API key management
13
14## How Cline Uses These Rules
15
16Cline automatically processes all Markdown files in this directory, combining them into a unified set of rules. The numeric prefixes help organize the files in a logical sequence, ensuring core principles are established before specific guidelines.
17
18## Customization
19
20These rules are tailored specifically for the Megarepo AI setup repository and should be updated as the project evolves. The rules emphasize:
21
22- **Minimal Changes**: Surgical, precise modifications that respect the repository's intentional simplicity
23- **AI-First Development**: Patterns and practices optimized for AI service integrations
24- **Security Best Practices**: Safe handling of API keys and sensitive data
25- **Node.js/Next.js Patterns**: Guidelines specific to the target technology stack
26
27## Rules Bank Approach
28
29This repository follows the "active rules" pattern where the `.clinerules/` directory contains only the rules that should be active. For projects with multiple contexts, consider creating a `clinerules-bank/` directory with additional rule sets that can be activated as needed.
30
31## Consistency with Other AI Assistants
32
33These rules are designed to work alongside other AI assistant configurations in this repository:
34- GitHub Copilot (`.github/copilot-instructions.md`)
35- Claude AI (`CLAUDE.md`)
36- Cursor AI (`.cursorrules`)
37- Gemini CLI (`GEMINI.md`)
38- Universal AI guidelines (`AGENT.md`, `AGENTS.md`)
39
40All configurations share common principles while being optimized for each assistant's specific capabilities.
HerringtonDarkholme/megarepo · .cursor/rules/code-quality.mdc
@@ +1 @@
1---
2description: "Code quality standards including TypeScript, testing, and formatting guidelines"
3globs: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.test.*", "**/*.spec.*"]
4alwaysApply: true
5---
6
7# Code Quality Standards
8
9Comprehensive code quality guidelines for the AI setup repository.
10
11## Core Development Principles
12
13### 1. TypeScript Guidelines
14- Use strict type checking
15- Define interfaces for all AI API responses
16- Use union types for AI model selections
17- Implement proper error type definitions
18
19### 2. TypeScript Patterns
20```typescript
21// Define interfaces for AI responses
22interface AIResponse {
23 content: string;
24 model: string;
25 usage: {
26 prompt_tokens: number;
27 completion_tokens: number;
28 };
29}
30
31// Use union types for model selection
32type AIModel = 'gpt-4' | 'gpt-3.5-turbo' | 'claude-3' | 'claude-2';
33```
34
35### 3. React Best Practices
36- Use functional components with hooks
37- Implement proper cleanup for AI subscriptions
38- Use React.memo for expensive AI-powered components
39- Handle loading and error states consistently
40
41### 4. Testing Patterns
42```javascript
43// Example AI component test pattern
44describe('AI Chat Component', () => {
45 it('handles API errors gracefully', async () => {
46 // Mock AI service failure
47 mockAIService.mockRejectedValue(new Error('API Error'));
48
49 render(<ChatComponent />);
50
51 // Test error handling and user feedback
52 expect(screen.getByText(/error/i)).toBeInTheDocument();
53 });
54});
55```
56
57### 5. Error Handling Standards
58- Write comprehensive error handling and logging
59- Implement proper error boundaries for React components
60- Use custom error types for different failure scenarios
61- Provide meaningful error messages to users
62
63### 6. Documentation Requirements
64- Document all AI-related functions and components
65- Include usage examples for AI integrations
66- Explain prompt engineering decisions
67- Document environment setup requirements
68
69### 7. Code Style Guidelines
70- Write clean, readable, and well-documented code
71- Follow established linting and formatting rules
72- Write meaningful commit messages and documentation
73- Use descriptive variable and function names
74
75### 8. API Development Standards
76- Follow RESTful principles for AI service endpoints
77- Implement proper rate limiting and authentication
78- Use middleware for common AI service operations
79- Document API endpoints with clear examples
@@ −1 +1 @@
1−# Cline Rules for Megarepo
1+---
2+description: "Code quality standards including TypeScript, testing, and formatting guidelines"
3+globs: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.test.*", "**/*.spec.*"]
4+alwaysApply: true
5+---
26
3−This directory contains Cline Rules that provide system-level guidance for the Cline AI assistant when working on this AI setup repository.
7+# Code Quality Standards
48
5−## Rules Structure
9+Comprehensive code quality guidelines for the AI setup repository.
610
7−The rules are organized into focused files that build upon each other:
11+## Core Development Principles
812
9−1. **`01-core-principles.md`** - Fundamental principles including minimal change philosophy and AI-first development
10−2. **`02-development.md`** - Development guidelines for Node.js/Next.js AI projects
11−3. **`03-documentation.md`** - Documentation requirements and standards
12−4. **`04-security.md`** - Security guidelines for AI projects and API key management
13+### 1. TypeScript Guidelines
14+- Use strict type checking
15+- Define interfaces for all AI API responses
16+- Use union types for AI model selections
17+- Implement proper error type definitions
1318
14−## How Cline Uses These Rules
19+### 2. TypeScript Patterns
20+```typescript
21+// Define interfaces for AI responses
22+interface AIResponse {
23+ content: string;
24+ model: string;
25+ usage: {
26+ prompt_tokens: number;
27+ completion_tokens: number;
28+ };
29+}
1530
16−Cline automatically processes all Markdown files in this directory, combining them into a unified set of rules. The numeric prefixes help organize the files in a logical sequence, ensuring core principles are established before specific guidelines.
31+// Use union types for model selection
32+type AIModel = 'gpt-4' | 'gpt-3.5-turbo' | 'claude-3' | 'claude-2';
33+```
1734
18−## Customization
35+### 3. React Best Practices
36+- Use functional components with hooks
37+- Implement proper cleanup for AI subscriptions
38+- Use React.memo for expensive AI-powered components
39+- Handle loading and error states consistently
1940
20−These rules are tailored specifically for the Megarepo AI setup repository and should be updated as the project evolves. The rules emphasize:
41+### 4. Testing Patterns
42+```javascript
43+// Example AI component test pattern
44+describe('AI Chat Component', () => {
45+ it('handles API errors gracefully', async () => {
46+ // Mock AI service failure
47+ mockAIService.mockRejectedValue(new Error('API Error'));
48+
49+ render(<ChatComponent />);
50+
51+ // Test error handling and user feedback
52+ expect(screen.getByText(/error/i)).toBeInTheDocument();
53+ });
54+});
55+```
2156
22−- **Minimal Changes**: Surgical, precise modifications that respect the repository's intentional simplicity
23−- **AI-First Development**: Patterns and practices optimized for AI service integrations
24−- **Security Best Practices**: Safe handling of API keys and sensitive data
25−- **Node.js/Next.js Patterns**: Guidelines specific to the target technology stack
57+### 5. Error Handling Standards
58+- Write comprehensive error handling and logging
59+- Implement proper error boundaries for React components
60+- Use custom error types for different failure scenarios
61+- Provide meaningful error messages to users
2662
27−## Rules Bank Approach
63+### 6. Documentation Requirements
64+- Document all AI-related functions and components
65+- Include usage examples for AI integrations
66+- Explain prompt engineering decisions
67+- Document environment setup requirements
2868
29−This repository follows the "active rules" pattern where the `.clinerules/` directory contains only the rules that should be active. For projects with multiple contexts, consider creating a `clinerules-bank/` directory with additional rule sets that can be activated as needed.
69+### 7. Code Style Guidelines
70+- Write clean, readable, and well-documented code
71+- Follow established linting and formatting rules
72+- Write meaningful commit messages and documentation
73+- Use descriptive variable and function names
3074
31−## Consistency with Other AI Assistants
32−
33−These rules are designed to work alongside other AI assistant configurations in this repository:
34−- GitHub Copilot (`.github/copilot-instructions.md`)
35−- Claude AI (`CLAUDE.md`)
36−- Cursor AI (`.cursorrules`)
37−- Gemini CLI (`GEMINI.md`)
38−- Universal AI guidelines (`AGENT.md`, `AGENTS.md`)
39−
40−All configurations share common principles while being optimized for each assistant's specific capabilities.
75+### 8. API Development Standards
76+- Follow RESTful principles for AI service endpoints
77+- Implement proper rate limiting and authentication
78+- Use middleware for common AI service operations
79+- Document API endpoints with clear examples
