Initial commit: ClaudeForge v1.0.0

This commit is contained in:
Reza Rezvani
2025-11-12 11:19:48 +01:00
commit 37422c1667
42 changed files with 11812 additions and 0 deletions
+152
View File
@@ -0,0 +1,152 @@
# Basic Usage Examples
Common ClaudeForge usage scenarios.
---
## Example 1: New TypeScript React Project
**Scenario:** Starting fresh project, need CLAUDE.md
**Setup:**
```bash
mkdir my-react-app
cd my-react-app
npm init -y
npm install react react-dom typescript
```
**Run ClaudeForge:**
```
/enhance-claude-md
```
**Claude's Response:**
```
Discovered:
- Project Type: Web App
- Tech Stack: TypeScript, React, Node.js
- Team Size: Solo
- Phase: Prototype
Creating CLAUDE.md (85 lines) with:
- Project structure diagram
- Setup instructions (npm install, npm start)
- Component guidelines
- TypeScript best practices
```
**Output:** Single `CLAUDE.md` file, ~85 lines
---
## Example 2: Python FastAPI Project
**Scenario:** API service, team of 6
**Setup:**
```bash
mkdir api-service
cd api-service
echo "fastapi[all]" > requirements.txt
echo "pytest" >> requirements.txt
mkdir app tests
```
**Run ClaudeForge:**
```
/enhance-claude-md
"This is a Python FastAPI API service. Team of 6 developers, MVP phase."
```
**Output:** `CLAUDE.md` with:
- FastAPI patterns
- Async/await guidelines
- Testing with pytest
- API documentation standards
---
## Example 3: Full-Stack Application
**Scenario:** Large project with backend + frontend
**Setup:**
```bash
mkdir fullstack-app
cd fullstack-app
mkdir backend frontend
cd backend && echo "express" > package.json
cd ../frontend && echo "react" > package.json
```
**Run ClaudeForge:**
```
/enhance-claude-md
```
**Output:** Modular structure
- `CLAUDE.md` (root navigation)
- `backend/CLAUDE.md` (API guidelines)
- `frontend/CLAUDE.md` (React patterns)
---
## Example 4: Enhance Existing Basic File
**Before:**
```markdown
# CLAUDE.md
## Tech Stack
- TypeScript
- React
```
**Run:**
```
/enhance-claude-md
```
**Claude Analyzes:**
```
Quality Score: 25/100
Missing:
- Project Structure
- Setup & Installation
- Core Principles
- Common Commands
```
**After:** Complete 120-line file with all sections
---
## Example 5: Quality Check Before Commit
**Scenario:** Made edits, verify quality
**Run:**
```
/enhance-claude-md
"Just validate, don't make changes"
```
**Output:**
```
Quality Score: 88/100
✅ Length: 245 lines (good)
✅ Structure: All required sections
✅ Formatting: Valid markdown
⚠️ Consider adding: Performance Guidelines
```
---
See also:
- [modular-setup.md](modular-setup.md) - Complex projects
- [integration-examples.md](integration-examples.md) - CI/CD integration
+142
View File
@@ -0,0 +1,142 @@
# Integration Examples
Integrating ClaudeForge with CI/CD and development workflows.
---
## GitHub Actions Integration
**`.github/workflows/validate-claude-md.yml`:**
```yaml
name: Validate CLAUDE.md
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install ClaudeForge
run: |
curl -fsSL https://raw.githubusercontent.com/alirezarezvani/ClaudeForge/main/install.sh | bash
export PATH="$HOME/.claude/bin:$PATH"
- name: Validate CLAUDE.md
run: |
# Check file exists
test -f CLAUDE.md || exit 1
# Check minimum quality (requires Python validation)
python3 -c "
from skill.validator import BestPracticesValidator
content = open('CLAUDE.md').read()
validator = BestPracticesValidator(content)
results = validator.validate_all()
passed = sum(1 for r in results if r['passed'])
if passed < 4:
print(f'Quality check failed: {passed}/5 checks passed')
exit(1)
print(f'Quality check passed: {passed}/5 checks')
"
```
---
## Pre-Commit Hook
**`.claude/hooks/pre-commit.sh`:**
```bash
#!/bin/bash
# Validate CLAUDE.md before commit
if [ -f "CLAUDE.md" ]; then
echo "Validating CLAUDE.md..."
# Check file length
lines=$(wc -l < CLAUDE.md)
if [ $lines -lt 20 ] || [ $lines -gt 400 ]; then
echo "Error: CLAUDE.md length ($lines lines) outside recommended range (20-300)"
exit 1
fi
# Check required sections
for section in "Core Principles" "Tech Stack" "Workflow"; do
if ! grep -q "$section" CLAUDE.md; then
echo "Error: Missing required section: $section"
exit 1
fi
done
echo "✅ CLAUDE.md validation passed"
fi
```
**Setup:**
```bash
chmod +x .claude/hooks/pre-commit.sh
git config core.hooksPath .claude/hooks
```
---
## Package.json Scripts
**`package.json`:**
```json
{
"scripts": {
"validate:claude": "python3 -m skill.validator CLAUDE.md",
"update:claude": "echo 'Run: /enhance-claude-md in Claude Code'",
"precommit": "./.claude/hooks/pre-commit.sh"
}
}
```
**Usage:**
```bash
npm run validate:claude # Check CLAUDE.md quality
```
---
## Team Onboarding Automation
**`scripts/onboard-developer.sh`:**
```bash
#!/bin/bash
# Onboard new developer with ClaudeForge
echo "Setting up ClaudeForge for new team member..."
# Install ClaudeForge
curl -fsSL https://raw.githubusercontent.com/alirezarezvani/ClaudeForge/main/install.sh | bash
# Verify CLAUDE.md exists
if [ ! -f "CLAUDE.md" ]; then
echo "No CLAUDE.md found. Run /enhance-claude-md in Claude Code to create one."
fi
echo "✅ ClaudeForge installed. Restart Claude Code to use."
```
---
## CI/CD Pipeline Integration
**GitLab CI (`.gitlab-ci.yml`):**
```yaml
validate_claude:
stage: validate
script:
- python3 -c "import sys; sys.path.insert(0, 'skill'); from validator import BestPracticesValidator; v = BestPracticesValidator(open('CLAUDE.md').read()); results = v.validate_all(); sys.exit(0 if all(r['passed'] for r in results) else 1)"
only:
- merge_requests
```
---
See also:
- [basic-usage.md](basic-usage.md)
- [modular-setup.md](modular-setup.md)
+175
View File
@@ -0,0 +1,175 @@
# Modular Architecture Setup
Examples of modular CLAUDE.md structure for large projects.
---
## When to Use Modular Architecture
- Full-stack projects with distinct frontend/backend
- Team size > 10 developers
- Single CLAUDE.md would exceed 300 lines
- Different teams own different areas
---
## Example: E-Commerce Platform
**Project Structure:**
```
ecommerce/
├── CLAUDE.md # Root navigation
├── backend/
│ ├── CLAUDE.md # API guidelines
│ └── api/
├── frontend/
│ ├── CLAUDE.md # React guidelines
│ └── src/
├── mobile/
│ ├── CLAUDE.md # React Native guidelines
│ └── app/
└── database/
├── CLAUDE.md # Schema guidelines
└── migrations/
```
**Setup:**
```bash
mkdir -p ecommerce/{backend,frontend,mobile,database}
cd ecommerce
# Create basic files for detection
echo '{"dependencies":{"express":""}}' > backend/package.json
echo '{"dependencies":{"react":""}}' > frontend/package.json
echo '{"dependencies":{"react-native":""}}' > mobile/package.json
```
**Run:**
```
/enhance-claude-md
"Use modular architecture for this full-stack e-commerce platform"
```
**Output:**
- `CLAUDE.md` - 95 lines (navigation)
- `backend/CLAUDE.md` - 180 lines (API, auth, payments)
- `frontend/CLAUDE.md` - 165 lines (components, state, cart)
- `mobile/CLAUDE.md` - 145 lines (screens, navigation, offline)
- `database/CLAUDE.md` - 120 lines (schema, migrations, queries)
---
## Root CLAUDE.md (Navigation Hub)
**Content:**
```markdown
# CLAUDE.md
Quick navigation hub for this project.
## Quick Navigation
- [Backend API Guidelines](backend/CLAUDE.md)
- [Frontend React Guidelines](frontend/CLAUDE.md)
- [Mobile App Guidelines](mobile/CLAUDE.md)
- [Database Operations](database/CLAUDE.md)
## Core Principles
1. API-first development
2. Mobile-responsive design
3. Database integrity
4. Comprehensive testing
## Project Structure
```
[ASCII tree diagram]
```
## Common Commands
```bash
# Backend
cd backend && npm run dev
# Frontend
cd frontend && npm start
# Mobile
cd mobile && npm run ios
```
```
---
## Context-Specific Files
### backend/CLAUDE.md
**Focus:**
- API endpoints design (REST/GraphQL)
- Authentication & authorization
- Database queries and optimization
- Error handling patterns
- Testing strategies (unit, integration)
### frontend/CLAUDE.md
**Focus:**
- Component architecture
- State management
- Routing and navigation
- Performance optimization
- Accessibility standards
### mobile/CLAUDE.md
**Focus:**
- Screen layouts
- Native features (camera, GPS, etc.)
- Offline functionality
- Platform-specific patterns (iOS/Android)
- App store deployment
### database/CLAUDE.md
**Focus:**
- Schema design
- Migration procedures
- Query optimization
- Backup strategies
- Data integrity rules
---
## Benefits
✅ **Separation of Concerns:** Each area has focused guidelines
✅ **Team Ownership:** Different teams manage their files
✅ **Maintainability:** Easier to update specific areas
✅ **Scalability:** Add new areas without bloat
✅ **Readability:** Each file stays under 200 lines
---
## Maintenance
**Guardian Agent updates all files:**
```
# New backend dependency added
✅ backend/CLAUDE.md updated: Tech Stack section
# New frontend component pattern
✅ frontend/CLAUDE.md updated: Component Guidelines
# Database schema change
✅ database/CLAUDE.md updated: Schema Documentation
```
---
See also:
- [basic-usage.md](basic-usage.md) - Simple projects
- [integration-examples.md](integration-examples.md) - CI/CD