| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 2 | 12 | 27 | 5% |
| Commands | 1 | 2 | 3 | 17% |
| Section tags | 6 | 1 | 4 | 55% |
What each file covers
Sections
2 shared · 12 only in A · 27 only in B- − Development Guidelines
- − 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
- + Project: Megarepo - AI Setup Repository
- + Overview
- + Architecture
- + Coding Preferences
- + General Guidelines
- + AI Development Specific
- + Code Style
- + File Organization
- + Instructions for Claude
- + Project Understanding
- + When Adding New Code
- + AI-Specific Considerations
- + Testing Strategy
- + Documentation Requirements
- + Constraints and Limitations
- + Initial Setup (when code is added)
- + Verify package.json exists before running commands
- + Install dependencies if package.json exists
- + Check for environment variables
- + AI Service Integration
- + Check for AI-related packages
- + Validate environment configuration
- + Before Committing
- + Run linting if configured
- + Run tests if configured
- + Check for secrets in staged files
- + Notes
- Technology Stack
- Development Workflow
Commands
1 shared · 2 only in A · 3 only in B- − npm run build
- − npm test
- + npm run lint 2>/dev/null || echo "No lint script found"
- + npm run test 2>/dev/null || echo "No test script found"
- + git diff --cached --name-only | xargs grep -l "api.*key\|secret\|token" || echo "No potential secrets found"
- npm install
Section tags
6 shared · 1 only in A · 4 only in B- − build
- + testing-strategy
- + security
- + do-not
- + docs
- setup
- test
- code-style
- architecture
- dependencies
- agent-behaviour
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 · CLAUDE.md
@@ +1 @@
1# Project: Megarepo - AI Setup Repository
2
3## Overview
4Megarepo is a minimal repository template designed for AI-related projects and development. It serves as a foundational setup repository that provides basic configuration files and structure for Node.js/Next.js AI applications. The repository is currently in a minimal state and is intended to be expanded with AI-specific tooling, configurations, and project scaffolding.
5
6## Architecture
7- **Current Structure**: Minimal setup with basic configuration files
8- **Target Architecture**: Node.js/Next.js based AI applications
9- **Key Directories** (when populated):
10 - `src/` - Main source code directory
11 - `src/pages/` - Next.js pages (if Next.js project)
12 - `src/components/` - React components for AI interfaces
13 - `src/utils/` - Utility functions and AI helpers
14 - `public/` - Static assets and files
15- **Configuration Files**:
16 - `.gitignore` - Pre-configured for Node.js/Next.js projects
17 - `LICENSE` - MIT license
18 - `.github/copilot-instructions.md` - Detailed AI agent instructions
19
20## Technology Stack
21- **Frontend**: Next.js, React (intended)
22- **Runtime**: Node.js
23- **Package Manager**: npm
24- **License**: MIT
25- **AI Integrations**: To be determined based on project needs (OpenAI, LangChain, Hugging Face, etc.)
26
27## Coding Preferences
28
29### General Guidelines
30- Follow existing patterns established in the repository
31- Prioritize minimal, surgical changes over large refactors
32- Maintain consistency with the existing file structure
33- Use TypeScript when adding JavaScript code (based on .gitignore patterns)
34
35### AI Development Specific
36- Use environment variables for API keys and sensitive configuration
37- Never commit API keys or secrets to the repository
38- Structure AI-related code in logical, modular components
39- Document AI model dependencies and version requirements
40- Include error handling for AI service failures
41
42### Code Style
43- Follow standard Node.js/Next.js conventions
44- Use meaningful variable and function names, especially for AI-related functionality
45- Include JSDoc comments for complex AI algorithms or integrations
46- Organize imports: external dependencies first, then internal modules
47
48### File Organization
49- Keep configuration files in the root directory
50- Place source code in `src/` directory when added
51- Use clear, descriptive file names
52- Group related functionality together
53
54## Instructions for Claude
55
56### Project Understanding
57- This repository is currently minimal and serves as a template/setup for AI projects
58- No build system or source code exists yet - do not attempt to build, test, or run code
59- The repository is pre-configured for Node.js/Next.js development patterns
60- Focus on the intended AI setup purpose when making recommendations
61
62### When Adding New Code
631. **Always check for existing package.json before running npm commands**
642. **Follow the patterns established in `.github/copilot-instructions.md`**
653. **Set appropriate timeouts for long-running operations** (builds: 60+ minutes, installs: 10+ minutes)
664. **Validate changes don't break existing minimal structure**
67
68### AI-Specific Considerations
69- When adding AI dependencies, verify compatibility with the intended Node.js/Next.js stack
70- Create `.env.example` files to document required environment variables
71- Consider rate limiting and error handling for AI service integrations
72- Document AI model requirements, versions, and expected behavior
73
74### Testing Strategy
75- When source code is added, include tests for AI functionality
76- Test error scenarios (API failures, rate limits, invalid responses)
77- Include integration tests for AI service connections
78- Document how to run tests with mock AI services for CI/CD
79
80### Documentation Requirements
81- Update README.md when adding significant functionality
82- Document AI service setup and configuration steps
83- Include examples of AI integrations and usage
84- Maintain this claude.md file as the project evolves
85
86### Constraints and Limitations
87- Repository is currently minimal - respect this intentional simplicity
88- Do not add unnecessary complexity or dependencies prematurely
89- Maintain compatibility with the existing MIT license
90- Follow the existing .gitignore patterns for Node.js/Next.js projects
91- Respect the established minimal change philosophy outlined in copilot-instructions.md
92
93## Development Workflow
94
95### Initial Setup (when code is added)
96```bash
97# Verify package.json exists before running commands
98test -f package.json && echo "Node.js project detected" || echo "No package.json found"
99
100# Install dependencies if package.json exists
101npm install
102
103# Check for environment variables
104ls .env* || echo "No environment files found"
105```
106
107### AI Service Integration
108```bash
109# Check for AI-related packages
110grep -E "(openai|langchain|tensorflow|pytorch|huggingface)" package.json
111
112# Validate environment configuration
113test -f .env.example && echo "Environment template found" || echo "Create .env.example for required variables"
114```
115
116### Before Committing
117```bash
118# Run linting if configured
119npm run lint 2>/dev/null || echo "No lint script found"
120
121# Run tests if configured
122npm run test 2>/dev/null || echo "No test script found"
123
124# Check for secrets in staged files
125git diff --cached --name-only | xargs grep -l "api.*key\|secret\|token" || echo "No potential secrets found"
126```
127
128## Notes
129- This configuration file should be updated as the repository evolves from its current minimal state
130- The repository is designed to be a foundation for AI projects, so expect significant expansion
131- Always refer to `.github/copilot-instructions.md` for additional context and detailed workflows
132- Maintain the minimal, focused approach that characterizes this repository template
@@ −1 +1 @@
1−# Development Guidelines
1+# Project: Megarepo - AI Setup Repository
22
3+## Overview
4+Megarepo is a minimal repository template designed for AI-related projects and development. It serves as a foundational setup repository that provides basic configuration files and structure for Node.js/Next.js AI applications. The repository is currently in a minimal state and is intended to be expanded with AI-specific tooling, configurations, and project scaffolding.
5+
6+## Architecture
7+- **Current Structure**: Minimal setup with basic configuration files
8+- **Target Architecture**: Node.js/Next.js based AI applications
9+- **Key Directories** (when populated):
10+ - `src/` - Main source code directory
11+ - `src/pages/` - Next.js pages (if Next.js project)
12+ - `src/components/` - React components for AI interfaces
13+ - `src/utils/` - Utility functions and AI helpers
14+ - `public/` - Static assets and files
15+- **Configuration Files**:
16+ - `.gitignore` - Pre-configured for Node.js/Next.js projects
17+ - `LICENSE` - MIT license
18+ - `.github/copilot-instructions.md` - Detailed AI agent instructions
19+
320 ## Technology Stack
4−This repository is pre-configured for **Node.js/Next.js development** with AI integrations.
21+- **Frontend**: Next.js, React (intended)
22+- **Runtime**: Node.js
23+- **Package Manager**: npm
24+- **License**: MIT
25+- **AI Integrations**: To be determined based on project needs (OpenAI, LangChain, Hugging Face, etc.)
526
6−### When Source Code is Added
7−Follow these patterns based on existing repository guidelines:
27+## Coding Preferences
828
9−```bash
10−# Always verify package.json exists first
11−test -f package.json && echo "Node.js project detected" || echo "No package.json found"
29+### General Guidelines
30+- Follow existing patterns established in the repository
31+- Prioritize minimal, surgical changes over large refactors
32+- Maintain consistency with the existing file structure
33+- Use TypeScript when adding JavaScript code (based on .gitignore patterns)
1234
13−# Install dependencies with appropriate timeout
14−npm install # Allow 10+ minutes for completion
35+### AI Development Specific
36+- Use environment variables for API keys and sensitive configuration
37+- Never commit API keys or secrets to the repository
38+- Structure AI-related code in logical, modular components
39+- Document AI model dependencies and version requirements
40+- Include error handling for AI service failures
1541
16−# Build with extended timeout for AI projects
17−npm run build # Allow 60+ minutes - AI projects can have complex builds
42+### Code Style
43+- Follow standard Node.js/Next.js conventions
44+- Use meaningful variable and function names, especially for AI-related functionality
45+- Include JSDoc comments for complex AI algorithms or integrations
46+- Organize imports: external dependencies first, then internal modules
1847
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
48+### File Organization
49+- Keep configuration files in the root directory
50+- Place source code in `src/` directory when added
51+- Use clear, descriptive file names
52+- Group related functionality together
2453
25−# Run tests with adequate time
26−npm test # Allow 30+ minutes for comprehensive test suites
27−## AI Integration Best Practices
54+## Instructions for Claude
2855
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
56+### Project Understanding
57+- This repository is currently minimal and serves as a template/setup for AI projects
58+- No build system or source code exists yet - do not attempt to build, test, or run code
59+- The repository is pre-configured for Node.js/Next.js development patterns
60+- Focus on the intended AI setup purpose when making recommendations
3661
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/`
62+### When Adding New Code
63+1. **Always check for existing package.json before running npm commands**
64+2. **Follow the patterns established in `.github/copilot-instructions.md`**
65+3. **Set appropriate timeouts for long-running operations** (builds: 60+ minutes, installs: 10+ minutes)
66+4. **Validate changes don't break existing minimal structure**
4267
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−}
68+### AI-Specific Considerations
69+- When adding AI dependencies, verify compatibility with the intended Node.js/Next.js stack
70+- Create `.env.example` files to document required environment variables
71+- Consider rate limiting and error handling for AI service integrations
72+- Document AI model requirements, versions, and expected behavior
73+
74+### Testing Strategy
75+- When source code is added, include tests for AI functionality
76+- Test error scenarios (API failures, rate limits, invalid responses)
77+- Include integration tests for AI service connections
78+- Document how to run tests with mock AI services for CI/CD
79+
80+### Documentation Requirements
81+- Update README.md when adding significant functionality
82+- Document AI service setup and configuration steps
83+- Include examples of AI integrations and usage
84+- Maintain this claude.md file as the project evolves
85+
86+### Constraints and Limitations
87+- Repository is currently minimal - respect this intentional simplicity
88+- Do not add unnecessary complexity or dependencies prematurely
89+- Maintain compatibility with the existing MIT license
90+- Follow the existing .gitignore patterns for Node.js/Next.js projects
91+- Respect the established minimal change philosophy outlined in copilot-instructions.md
92+
93+## Development Workflow
94+
95+### Initial Setup (when code is added)
96+```bash
97+# Verify package.json exists before running commands
98+test -f package.json && echo "Node.js project detected" || echo "No package.json found"
99+
100+# Install dependencies if package.json exists
101+npm install
102+
103+# Check for environment variables
104+ls .env* || echo "No environment files found"
61105 ```
62106
63−## File Structure Standards
64−Follow the established minimal structure and expand thoughtfully:
107+### AI Service Integration
108+```bash
109+# Check for AI-related packages
110+grep -E "(openai|langchain|tensorflow|pytorch|huggingface)" package.json
65111
112+# Validate environment configuration
113+test -f .env.example && echo "Environment template found" || echo "Create .env.example for required variables"
66114 ```
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
115+
116+### Before Committing
117+```bash
118+# Run linting if configured
119+npm run lint 2>/dev/null || echo "No lint script found"
120+
121+# Run tests if configured
122+npm run test 2>/dev/null || echo "No test script found"
123+
124+# Check for secrets in staged files
125+git diff --cached --name-only | xargs grep -l "api.*key\|secret\|token" || echo "No potential secrets found"
82126 ```
83127
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
128+## Notes
129+- This configuration file should be updated as the repository evolves from its current minimal state
130+- The repository is designed to be a foundation for AI projects, so expect significant expansion
131+- Always refer to `.github/copilot-instructions.md` for additional context and detailed workflows
132+- Maintain the minimal, focused approach that characterizes this repository template
