| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 14 | 11 | 0% |
| Commands | 0 | 3 | 0 | 0% |
| Section tags | 2 | 5 | 1 | 25% |
What each file covers
Sections
0 shared · 14 only in A · 11 only in B- − Development Guidelines
- − Technology Stack
- − When Source Code is Added
- − Always verify package.json exists first
- − Install dependencies with appropriate timeout
- − Build with extended timeout for AI projects
- − Run tests with adequate time
- − Build with reasonable timeout for most projects
- − AI Integration Best Practices
- − Preferred AI Dependencies
- − Code Organization
- − Error Handling Pattern
- − File Structure Standards
- − Development Workflow
- + Project Structure & Architecture
- + Expected Project Structure
- + Key Directory Guidelines
- + Source Code Organization
- + Component Organization
- + Utility Organization
- + Architectural Principles
- + 1. Node.js/Next.js Development
- + 2. File Naming Conventions
- + 3. Import Organization
- + 4. Configuration Management
Commands
0 shared · 3 only in A · 0 only in B- − npm install
- − npm run build
- − npm test
Section tags
2 shared · 5 only in A · 1 only in B- − setup
- − build
- − test
- − dependencies
- − agent-behaviour
- + ui
- code-style
- architecture
Line diff
HerringtonDarkholme/megarepo · .clinerules/02-development.md
@@ −1 @@
1# Development Guidelines
2
3## Technology Stack
4This repository is pre-configured for **Node.js/Next.js development** with AI integrations.
5
6### When Source Code is Added
7Follow these patterns based on existing repository guidelines:
8
9```bash
10# Always verify package.json exists first
11test -f package.json && echo "Node.js project detected" || echo "No package.json found"
12
13# Install dependencies with appropriate timeout
14npm install # Allow 10+ minutes for completion
15
16# Build with extended timeout for AI projects
17npm run build # Allow 60+ minutes - AI projects can have complex builds
18
19# Run tests with adequate time
20npm test # Allow 30+ minutes for comprehensive test suites
21```
22# Build with reasonable timeout for most projects
23npm run build # Allow 15-30 minutes for most Node.js/Next.js builds with AI integrations
24
25# Run tests with adequate time
26npm test # Allow 30+ minutes for comprehensive test suites
27## AI Integration Best Practices
28
29### Preferred AI Dependencies
30When adding AI functionality, use these established packages:
31- `openai` - Official OpenAI API client
32- `@langchain/core` - LangChain framework for AI workflows
33- `@vercel/ai` - Vercel AI SDK for streaming and UI integration
34- `@huggingface/inference` - Hugging Face API client
35- `@anthropic-ai/sdk` - Anthropic Claude API client
36
37### Code Organization
38- Place AI client configurations in `src/lib/` directory
39- Create reusable AI components in `src/components/ai/`
40- Implement API routes for AI services in `src/app/api/` (Next.js App Router)
41- Define TypeScript types for AI responses in `src/types/`
42
43### Error Handling Pattern
44```javascript
45// Implement comprehensive error handling for AI services
46try {
47 const response = await aiClient.chat.completions.create({
48 model: "gpt-4",
49 messages: [{ role: "user", content: prompt }]
50 });
51 return response.choices[0].message.content;
52} catch (error) {
53 if (error.code === 'rate_limit_exceeded') {
54 throw new AIRateLimitError('Rate limit exceeded, please try again later');
55 }
56 if (error.code === 'insufficient_quota') {
57 throw new AIQuotaError('API quota exceeded');
58 }
59 throw new AIServiceError(`AI service failed: ${error.message}`);
60}
61```
62
63## File Structure Standards
64Follow the established minimal structure and expand thoughtfully:
65
66```
67.
68├── .clinerules/ # Cline AI rules (this directory)
69├── .github/ # GitHub workflows and Copilot instructions
70├── .kiro/steering/ # Kiro AI steering files
71├── .cursorrules # Cursor AI development rules
72├── CLAUDE.md # Claude AI specific configuration
73├── GEMINI.md # Gemini CLI configuration
74├── AGENT.md # Universal AI agent instructions
75├── package.json # Dependencies and scripts (when added)
76├── src/ # Source code (when added)
77│ ├── lib/ # AI clients and utilities
78│ ├── components/ # React components including AI components
79│ ├── app/ # Next.js App Router (pages and API routes)
80│ └── types/ # TypeScript definitions
81└── public/ # Static assets
82```
83
84## Development Workflow
851. **Before Changes**: Check repository state and existing patterns
862. **During Development**: Follow TypeScript best practices and AI patterns
873. **Testing**: Include AI service mocks and error scenario testing
884. **Documentation**: Update relevant AI configuration files as needed
HerringtonDarkholme/megarepo · .cursor/rules/project-structure.mdc
@@ +1 @@
1---
2description: "File organization and architectural patterns for the AI setup repository"
3globs: ["src/**/*", "app/**/*", "public/**/*", "docs/**/*"]
4alwaysApply: false
5---
6
7# Project Structure & Architecture
8
9Guidelines for organizing files and structuring the AI setup repository.
10
11## Expected Project Structure
12
13```
14.
15├── README.md # Project documentation
16├── LICENSE # MIT license
17├── .gitignore # Node.js/Next.js patterns
18├── .cursor/rules/ # Cursor project rules
19├── .env.example # Environment variable template
20├── package.json # Dependencies and scripts
21├── next.config.js # Next.js configuration
22├── tsconfig.json # TypeScript configuration
23├── src/
24│ ├── app/ # Next.js app directory
25│ ├── components/ # React components
26│ ├── lib/ # Utility functions and AI clients
27│ ├── types/ # TypeScript type definitions
28│ └── utils/ # Helper functions
29├── public/ # Static assets
30└── docs/ # Additional documentation
31```
32
33## Key Directory Guidelines
34
35### Source Code Organization
36- `src/lib/` - Place AI client configurations and utilities here
37- `src/components/` - Reusable UI components, including AI-powered components
38- `src/app/api/` - API routes for AI services and integrations
39- `src/types/` - TypeScript definitions for AI responses and data models
40
41### Component Organization
42- Group related components in feature-specific subdirectories
43- Keep component styles and tests near the component
44- Use index files for clean imports
45
46### Utility Organization
47- Group related utilities in feature-specific directories
48- Separate AI-specific utilities from general utilities
49- Implement consistent naming patterns
50
51## Architectural Principles
52
53### 1. Node.js/Next.js Development
54- Follow Next.js 13+ App Router patterns when applicable
55- Use modern ES6+ JavaScript/TypeScript features
56- Implement proper async/await patterns for AI API calls
57- Use React Server Components where appropriate
58- Optimize for both development and production environments
59
60### 2. File Naming Conventions
61- Use camelCase for JavaScript/TypeScript files
62- Use PascalCase for React component files
63- Use kebab-case for API routes and static files
64- Use descriptive names that indicate purpose
65
66### 3. Import Organization
67- Group imports by type (external, internal, relative)
68- Use absolute imports with path aliases when configured
69- Keep imports organized and clean
70
71### 4. Configuration Management
72- Keep all configuration files in the project root
73- Use TypeScript for configuration files when possible
74- Document configuration options and their purposes
@@ −1 +1 @@
1−# Development Guidelines
1+---
2+description: "File organization and architectural patterns for the AI setup repository"
3+globs: ["src/**/*", "app/**/*", "public/**/*", "docs/**/*"]
4+alwaysApply: false
5+---
26
3−## Technology Stack
4−This repository is pre-configured for **Node.js/Next.js development** with AI integrations.
7+# Project Structure & Architecture
58
6−### When Source Code is Added
7−Follow these patterns based on existing repository guidelines:
9+Guidelines for organizing files and structuring the AI setup repository.
810
9−```bash
10−# Always verify package.json exists first
11−test -f package.json && echo "Node.js project detected" || echo "No package.json found"
11+## Expected Project Structure
1212
13−# Install dependencies with appropriate timeout
14−npm install # Allow 10+ minutes for completion
13+```
14+.
15+├── README.md # Project documentation
16+├── LICENSE # MIT license
17+├── .gitignore # Node.js/Next.js patterns
18+├── .cursor/rules/ # Cursor project rules
19+├── .env.example # Environment variable template
20+├── package.json # Dependencies and scripts
21+├── next.config.js # Next.js configuration
22+├── tsconfig.json # TypeScript configuration
23+├── src/
24+│ ├── app/ # Next.js app directory
25+│ ├── components/ # React components
26+│ ├── lib/ # Utility functions and AI clients
27+│ ├── types/ # TypeScript type definitions
28+│ └── utils/ # Helper functions
29+├── public/ # Static assets
30+└── docs/ # Additional documentation
31+```
1532
16−# Build with extended timeout for AI projects
17−npm run build # Allow 60+ minutes - AI projects can have complex builds
33+## Key Directory Guidelines
1834
19−# Run tests with adequate time
20−npm test # Allow 30+ minutes for comprehensive test suites
21−```
22−# Build with reasonable timeout for most projects
23−npm run build # Allow 15-30 minutes for most Node.js/Next.js builds with AI integrations
35+### Source Code Organization
36+- `src/lib/` - Place AI client configurations and utilities here
37+- `src/components/` - Reusable UI components, including AI-powered components
38+- `src/app/api/` - API routes for AI services and integrations
39+- `src/types/` - TypeScript definitions for AI responses and data models
2440
25−# Run tests with adequate time
26−npm test # Allow 30+ minutes for comprehensive test suites
27−## AI Integration Best Practices
41+### Component Organization
42+- Group related components in feature-specific subdirectories
43+- Keep component styles and tests near the component
44+- Use index files for clean imports
2845
29−### Preferred AI Dependencies
30−When adding AI functionality, use these established packages:
31−- `openai` - Official OpenAI API client
32−- `@langchain/core` - LangChain framework for AI workflows
33−- `@vercel/ai` - Vercel AI SDK for streaming and UI integration
34−- `@huggingface/inference` - Hugging Face API client
35−- `@anthropic-ai/sdk` - Anthropic Claude API client
46+### Utility Organization
47+- Group related utilities in feature-specific directories
48+- Separate AI-specific utilities from general utilities
49+- Implement consistent naming patterns
3650
37−### Code Organization
38−- Place AI client configurations in `src/lib/` directory
39−- Create reusable AI components in `src/components/ai/`
40−- Implement API routes for AI services in `src/app/api/` (Next.js App Router)
41−- Define TypeScript types for AI responses in `src/types/`
51+## Architectural Principles
4252
43−### Error Handling Pattern
44−```javascript
45−// Implement comprehensive error handling for AI services
46−try {
47− const response = await aiClient.chat.completions.create({
48− model: "gpt-4",
49− messages: [{ role: "user", content: prompt }]
50− });
51− return response.choices[0].message.content;
52−} catch (error) {
53− if (error.code === 'rate_limit_exceeded') {
54− throw new AIRateLimitError('Rate limit exceeded, please try again later');
55− }
56− if (error.code === 'insufficient_quota') {
57− throw new AIQuotaError('API quota exceeded');
58− }
59− throw new AIServiceError(`AI service failed: ${error.message}`);
60−}
61−```
53+### 1. Node.js/Next.js Development
54+- Follow Next.js 13+ App Router patterns when applicable
55+- Use modern ES6+ JavaScript/TypeScript features
56+- Implement proper async/await patterns for AI API calls
57+- Use React Server Components where appropriate
58+- Optimize for both development and production environments
6259
63−## File Structure Standards
64−Follow the established minimal structure and expand thoughtfully:
60+### 2. File Naming Conventions
61+- Use camelCase for JavaScript/TypeScript files
62+- Use PascalCase for React component files
63+- Use kebab-case for API routes and static files
64+- Use descriptive names that indicate purpose
6565
66−```
67−.
68−├── .clinerules/ # Cline AI rules (this directory)
69−├── .github/ # GitHub workflows and Copilot instructions
70−├── .kiro/steering/ # Kiro AI steering files
71−├── .cursorrules # Cursor AI development rules
72−├── CLAUDE.md # Claude AI specific configuration
73−├── GEMINI.md # Gemini CLI configuration
74−├── AGENT.md # Universal AI agent instructions
75−├── package.json # Dependencies and scripts (when added)
76−├── src/ # Source code (when added)
77−│ ├── lib/ # AI clients and utilities
78−│ ├── components/ # React components including AI components
79−│ ├── app/ # Next.js App Router (pages and API routes)
80−│ └── types/ # TypeScript definitions
81−└── public/ # Static assets
82−```
66+### 3. Import Organization
67+- Group imports by type (external, internal, relative)
68+- Use absolute imports with path aliases when configured
69+- Keep imports organized and clean
8370
84−## Development Workflow
85−1. **Before Changes**: Check repository state and existing patterns
86−2. **During Development**: Follow TypeScript best practices and AI patterns
87−3. **Testing**: Include AI service mocks and error scenario testing
88−4. **Documentation**: Update relevant AI configuration files as needed
71+### 4. Configuration Management
72+- Keep all configuration files in the project root
73+- Use TypeScript for configuration files when possible
74+- Document configuration options and their purposes
