### Setup and Installation Commands Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-frontend-CLAUDE.md Provides shell commands for setting up the development environment. This includes installing dependencies, configuring environment variables, and starting the development server. ```bash # Install dependencies npm install # Set up environment variables cp .env.example .env # Edit .env with: # - VITE_API_URL (backend API URL) # - VITE_ENV (development/staging/production) # Start development server npm run dev # Server runs at http://localhost:5173 ``` -------------------------------- ### Manual Git Clone Installation Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Installs ClaudeForge by cloning the repository and then running the local installation script. This method allows for inspection of the script before execution and is suitable for users familiar with Git. ```bash # Clone the repository git clone https://github.com/alirezarezvani/ClaudeForge.git # Navigate to directory cd ClaudeForge # Run installer ./install.sh # macOS/Linux # or .\install.ps1 # Windows ``` -------------------------------- ### Copy Components for Manual Installation Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Manually copies the skill, command, and agent components to the specified installation directory. This is part of the advanced manual installation process. ```bash # Create directories mkdir -p "$INSTALL_DIR/skills" mkdir -p "$INSTALL_DIR/commands" mkdir -p "$INSTALL_DIR/agents" # Copy skill cp -r skill "$INSTALL_DIR/skills/claudeforge-skill" # Copy slash command cp -r command "$INSTALL_DIR/commands/enhance-claude-md" # Copy guardian agent cp agent/claude-md-guardian.md "$INSTALL_DIR/agents/" ``` -------------------------------- ### Install Dependencies and Run Server Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-backend-CLAUDE.md Commands for installing project dependencies, setting up environment variables, starting Docker services, running database migrations, generating Prisma client, seeding the database, and starting the development server. ```bash # Install dependencies npm install # Set up environment variables cp .env.example .env # Edit .env with: # - DATABASE_URL (PostgreSQL connection string) # - REDIS_URL (Redis connection string) # - JWT_SECRET (secret for token signing) # - PORT (default 3000) # Start PostgreSQL and Redis (using Docker) docker-compose up -d postgres redis # Run database migrations npx prisma migrate dev # Generate Prisma client npx prisma generate # Seed database npm run seed # Start development server npm run dev ``` -------------------------------- ### FastAPI Development Server Setup and Run Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/python-api-CLAUDE.md Commands to set up a Python virtual environment, install dependencies, configure environment variables, start PostgreSQL with Docker, run database migrations, seed the database, and launch the FastAPI development server using Uvicorn. ```bash # Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt # Set up environment variables cp .env.example .env # Edit .env with: # - DATABASE_URL (PostgreSQL connection string) # - SECRET_KEY (for JWT token signing) # - ENVIRONMENT (development/staging/production) # Start PostgreSQL (using Docker) docker-compose up -d postgres # Run database migrations alembic upgrade head # Seed database (if needed) python -m app.scripts.seed # Start development server uvicorn app.main:app --reload # Server runs at http://localhost:8000 # API docs at http://localhost:8000/docs (Swagger UI) # Alternative docs at http://localhost:8000/redoc (ReDoc) ``` -------------------------------- ### Update ClaudeForge using Installer (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Details the process of updating ClaudeForge using the provided installer script. It involves pulling the latest changes from the main branch and then running the installer, which will back up the existing installation. ```bash # Pull latest changes cd ClaudeForge git pull origin main # Run installer (existing installation will be backed up) ./install.sh ``` -------------------------------- ### Onboarding Script: Install ClaudeForge Source: https://github.com/alirezarezvani/claudeforge/blob/dev/examples/integration-examples.md A bash script to automate the installation of ClaudeForge for new team members. It downloads and installs ClaudeForge and checks if `CLAUDE.md` exists, prompting the user to create it if necessary. ```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." ``` -------------------------------- ### Troubleshooting: Running Installer from Wrong Directory Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Provides a solution for the common 'Installation files not found' error by ensuring the installer script is executed from the repository's root directory. ```bash cd ClaudeForge # Navigate to repository root ./install.sh # Run from correct directory ``` -------------------------------- ### Check Skill Installation on Windows Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Lists the files in the ClaudeForge skill directory for user-level installations on Windows. This is used to verify that the skill components have been copied correctly. ```powershell dir $env:USERPROFILE\.claude\skills\claudeforge-skill\ ``` -------------------------------- ### Check Command Installation on Windows Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Lists the files in the ClaudeForge command directory for user-level installations on Windows. This verifies the correct installation of the enhance-claude-md command. ```powershell dir $env:USERPROFILE\.claude\commands\enhance-claude-md\ ``` -------------------------------- ### Check Skill Installation on macOS/Linux Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Lists the files in the ClaudeForge skill directory for user-level installations on macOS and Linux. This is used to verify that the skill components have been copied correctly. ```bash ls -la ~/.claude/skills/claudeforge-skill/ ``` -------------------------------- ### Manual Quality Hook Installation Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Manually installs the pre-commit quality hooks for ClaudeForge. This involves creating a hooks directory and copying the pre-commit script, then making it executable. This is for project-level installations. ```bash # During installer # When prompted: "Would you like to install quality hooks?" # Type: y # Or manually: mkdir -p .claude/hooks cp hooks/pre-commit.sh .claude/hooks/ chmod +x .claude/hooks/pre-commit.sh ``` -------------------------------- ### Example Documentation Commit Message Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md This example demonstrates a commit message for documentation changes. The type is 'docs' and the scope is 'quick-start'. The description explains that the installation steps have been clarified and troubleshooting information has been added. ```gitcommit docs(quick-start): Clarify installation steps Adds more detailed explanations for each step. Includes troubleshooting for common issues. ``` -------------------------------- ### Check Command Installation on macOS/Linux Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Lists the files in the ClaudeForge command directory for user-level installations on macOS and Linux. This verifies the correct installation of the enhance-claude-md command. ```bash ls -la ~/.claude/commands/enhance-claude-md/ ``` -------------------------------- ### Test ClaudeForge Installation Script Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md Demonstrates how to test the installation script for ClaudeForge, including installation and uninstallation procedures. ```bash # Test install.sh ./install.sh # Choose option 2 (project-level) # Verify all components copied correctly # Test uninstall rm -rf ./.claude ``` -------------------------------- ### Manual Installation Script Source: https://github.com/alirezarezvani/claudeforge/blob/dev/README.md Provides instructions for manually installing ClaudeForge by cloning the repository and running the appropriate installation script for your operating system. ```bash git clone https://github.com/alirezarezvani/ClaudeForge.git cd ClaudeForge ./install.sh # or .\install.ps1 on Windows ``` -------------------------------- ### Manual ClaudeForge Update (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Provides instructions for manually updating ClaudeForge by backing up the current skill, command, and agent, then copying the new version into the appropriate directories. This method requires manual intervention for each component. ```bash # Backup current installation mv ~/.claude/skills/claudeforge-skill ~/.claude/skills/claudeforge-skill.backup # Copy new version cp -r skill ~/.claude/skills/claudeforge-skill # Repeat for command and agent ``` -------------------------------- ### Update Installer Scripts Source: https://github.com/alirezarezvani/claudeforge/blob/dev/CLAUDE.md Instructions for editing and testing the installer scripts (`install.sh` for macOS/Linux and `install.ps1` for Windows). Key areas to focus on include installation paths, component copying, backup procedures, and optional quality hook installation. The snippet includes commands to test the installer. ```bash # Edit installer vim install.sh # or install.ps1 # Key sections: # - Installation paths (user-level vs project-level) # - Component copying (skill, command, agent) # - Backup logic (existing installations) # - Quality hooks installation (optional) # Test installer ./install.sh # Choose test option and verify all components copied correctly ``` -------------------------------- ### Clone and Setup ClaudeForge Repository Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md Steps to fork, clone, create a branch, make changes, and push to your ClaudeForge repository fork for contributing code. ```bash # Fork the repository # Clone your fork git clone https://github.com/YOUR-USERNAME/ClaudeForge.git cd ClaudeForge # Create a branch git checkout -b feature/amazing-feature # Make your changes # Test your changes ./install.sh # Test installation /enhance-claude-md # Test in Claude Code # Commit your changes git commit -m "Add amazing feature" # Push to your fork git push origin feature/amazing-feature # Open a Pull Request ``` -------------------------------- ### Set Project-Level Installation Directory Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Defines the environment variable for the project-level installation directory. This scope makes ClaudeForge available only in the current project. The path differs between macOS/Linux and Windows. ```bash # macOS/Linux INSTALL_DIR="./.claude" # Windows $INSTALL_DIR=".\.claude" ``` -------------------------------- ### Set Up Environment Variables Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-root-CLAUDE.md Copies the example environment file to a new file named .env, which should then be edited with specific credentials. This is crucial for configuring the application's settings. ```bash cp .env.example .env # Edit .env with your credentials ``` -------------------------------- ### Start Development Servers Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-root-CLAUDE.md Starts both the backend and frontend development servers concurrently. This command is used for local development and testing. ```bash npm run dev ``` -------------------------------- ### Install claude-md-guardian Agent (Project-Level) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/agent/claude-md-guardian.md Installs the claude-md-guardian agent specifically for the current project by creating a local .claude/agents directory and copying the agent file into it. ```bash mkdir -p .claude/agents cp generated-agents/claude-md-guardian.md .claude/agents/ ``` -------------------------------- ### Set User-Level Installation Directory Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Defines the environment variable for the user-level installation directory. This scope makes ClaudeForge available in all projects on the system. The path differs between macOS/Linux and Windows. ```bash # macOS/Linux INSTALL_DIR="$HOME/.claude" # Windows $INSTALL_DIR="$env:USERPROFILE\.claude" ``` -------------------------------- ### Grant Execute Permission to Installer (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Ensures the installation script has execute permissions on macOS and Linux systems. This is necessary to run the installer directly. It can be run using `chmod` or explicitly with `bash`. ```bash chmod +x install.sh # or run with bash explicitly bash install.sh ``` -------------------------------- ### Check Agent Installation on macOS/Linux Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Checks for the presence of the ClaudeForge guardian agent file in the agents directory for user-level installations on macOS and Linux. ```bash ls -la ~/.claude/agents/claude-md-guardian.md ``` -------------------------------- ### Install ClaudeForge - macOS/Linux Shell Script Source: https://github.com/alirezarezvani/claudeforge/blob/dev/README.md This script downloads and installs ClaudeForge on macOS and Linux systems using a curl command. It fetches the installation script from a GitHub raw URL and executes it. ```bash curl -fsSL https://raw.githubusercontent.com/alirezarezvani/ClaudeForge/main/install.sh | bash ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-root-CLAUDE.md Installs all project dependencies for the entire monorepo using npm. This is a prerequisite for setting up the development environment. ```bash npm install ``` -------------------------------- ### Configure Git to Use Quality Hooks Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Configures Git to use the locally stored quality hooks for pre-commit validation. This ensures that code quality checks are performed before each commit. ```bash # Add to .git/config or use git config git config core.hooksPath .claude/hooks ``` -------------------------------- ### Install Agent - User-Level Source: https://github.com/alirezarezvani/claudeforge/blob/dev/agent/README.md Copies the claude-md-guardian agent to the user's Claude Code agent directory for availability across all projects. Requires restarting Claude Code. ```bash # Copy agent to user directory cp generated-agents/claude-md-guardian/claude-md-guardian.md ~/.claude/agents/ # Restart Claude Code ``` -------------------------------- ### Resolve "Skill not found" Error (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Troubleshoots the "Skill not found" error by verifying the skill directory name. It shows how to list existing skills and rename a directory if it does not match the expected `claudeforge-skill` name. ```bash # Verify skill directory name is exactly: ls ~/.claude/skills/ # Should show: claudeforge-skill # If different, rename: mv ~/.claude/skills/old-name ~/.claude/skills/claudeforge-skill ``` -------------------------------- ### Install ClaudeForge - Windows PowerShell Script Source: https://github.com/alirezarezvani/claudeforge/blob/dev/README.md This PowerShell script installs ClaudeForge on Windows. It uses Invoke-WebRequest to download the installation script and then executes it. ```powershell iwr https://raw.githubusercontent.com/alirezarezvani/ClaudeForge/main/install.ps1 -useb | iex ``` -------------------------------- ### Bash Git Command Examples for Agent Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/ARCHITECTURE.md Provides example Bash commands used by an agent to detect changes in a Git repository. These commands help identify file modifications, commit history, and specific file changes to trigger updates. ```bash git diff --name-status HEAD~10 git log --since="1 week ago" --oneline git diff HEAD~10 -- package.json requirements.txt ``` -------------------------------- ### Install claude-md-guardian Agent (User-Level) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/agent/claude-md-guardian.md Copies the claude-md-guardian agent to the user's global agent directory, making it available for use across all projects on the system. ```bash cp generated-agents/claude-md-guardian.md ~/.claude/agents/ ``` -------------------------------- ### Python Docstring Example Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md Shows the standard format for Python docstrings, including arguments and return values, for documenting functions. ```python def validate_length(self, content: str) -> bool: """ Validate CLAUDE.md file length. Args: content: File content as string Returns: True if length is valid, False otherwise """ pass ``` -------------------------------- ### Start Services with Docker Compose Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-root-CLAUDE.md Starts all services defined in the docker-compose.yml file in detached mode. This command is used to bring up the entire application stack locally. ```bash docker-compose up -d ``` -------------------------------- ### Environment Variables Configuration (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/python-api-CLAUDE.md Example environment variables required for the application, database connection, authentication, and CORS settings. ```bash # Application ENVIRONMENT=development SECRET_KEY=your-secret-key-here DEBUG=True # Database DATABASE_URL=postgresql+asyncpg://user:password@localhost/dbname # Authentication ACCESS_TOKEN_EXPIRE_MINUTES=30 REFRESH_TOKEN_EXPIRE_DAYS=7 # CORS ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173 ``` -------------------------------- ### Database Transaction Example Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-backend-CLAUDE.md Example of using Prisma's transaction API to perform multiple database operations atomically. This ensures that either all operations succeed or none of them do, maintaining data consistency. ```typescript await prisma.$transaction(async (tx) => { await tx.user.update({ ... }); await tx.account.create({ ... }); }); ``` -------------------------------- ### Example Commit Message Structure Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md This example demonstrates the recommended commit message format for the project. It includes a type, scope, short description, an optional longer description, and a reference to related issues. This structure helps in maintaining a clear and consistent commit history. ```gitcommit type(scope): Short description Longer description if needed. Fixes #123 ``` -------------------------------- ### Install Claude-MD Guardian Agent (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/README.md Provides bash commands to install the claude-md-guardian agent at either the user-level (affecting all projects) or the project-level (affecting only the current project). It involves copying the agent's markdown file to the appropriate .claude/agents directory. ```bash # User-level (all projects) cp generated-agents/claude-md-guardian.md ~/.claude/agents/ # Project-level (current project) cp generated-agents/claude-md-guardian.md .claude/agents/ ``` -------------------------------- ### Package.json Scripts for ClaudeForge Source: https://github.com/alirezarezvani/claudeforge/blob/dev/examples/integration-examples.md Defines npm scripts in `package.json` for validating and updating CLAUDE.md, and setting up the pre-commit hook. These scripts simplify common ClaudeForge operations via the command line. ```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" } } ``` ```bash npm run validate:claude # Check CLAUDE.md quality ``` -------------------------------- ### Bash Command for Installing Claude-md-enhancer Skill Source: https://github.com/alirezarezvani/claudeforge/blob/dev/agent/README.md Provides the bash command to install the 'claude-md-enhancer' skill by copying it to the local Claude skills directory, typically used during troubleshooting. ```bash # Install the skill cp -r generated-skills/claude-md-enhancer/ ~/.claude/skills/ # Restart Claude Code ``` -------------------------------- ### PEP 8 Python Code Style Example Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md Demonstrates correct and incorrect Python code style according to PEP 8 guidelines, focusing on function naming and parameter formatting. ```python # Good def analyze_file(self, content: str) -> Dict[str, Any]: """Analyze CLAUDE.md file content.""" pass # Bad def analyzeFile(self,content): pass ``` -------------------------------- ### Install Agent - Project-Level Source: https://github.com/alirezarezvani/claudeforge/blob/dev/agent/README.md Copies the claude-md-guardian agent to the current project's agent directory, making it available only for that specific project. Requires restarting Claude Code. ```bash # Create agents directory mkdir -p .claude/agents # Copy agent cp generated-agents/claude-md-guardian/claude-md-guardian.md .claude/agents/ # Restart Claude Code ``` -------------------------------- ### Project Context Parameters Configuration (JSON) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/README.md Defines the context parameters for project generation, including project type, tech stack, team size, development phase, workflows, modularity, and subdirectories. These parameters guide the generation of a comprehensive CLAUDE.md file. ```json { "type": "fullstack", "tech_stack": ["typescript", "react", "node"], "team_size": "small", "phase": "mvp", "workflows": ["tdd", "cicd"], "modular": true, "subdirectories": ["backend", "frontend"] } ``` -------------------------------- ### Pytest Example: Create User Endpoint Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/python-api-CLAUDE.md A Pytest example demonstrating how to test the user creation endpoint using `httpx.AsyncClient`. It checks for a successful creation (201 status code) and verifies the returned data. ```python import pytest from httpx import AsyncClient from app.main import app @pytest.mark.asyncio async def test_create_user(client: AsyncClient): """Test user creation endpoint.""" response = await client.post( "/api/v1/users", json={"email": "test@example.com", "name": "Test User"} ) assert response.status_code == 201 data = response.json() assert data["email"] == "test@example.com" assert "id" in data ``` -------------------------------- ### Component Test Example with React Testing Library Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-frontend-CLAUDE.md An example of a component test using React Testing Library. It renders a UserProfile component and asserts that specific text is present in the document, focusing on user interaction and expected output rather than implementation details. ```typescript test('renders user profile', () => { render(); expect(screen.getByText(/profile/i)).toBeInTheDocument(); }); ``` -------------------------------- ### Python Type Hinting Example Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md Illustrates the use of type hints in Python function definitions for better code clarity and maintainability. ```python # Always use type hints def calculate_score(sections: List[str]) → int: return len(sections) * 10 ``` -------------------------------- ### Add New Rust Template to ClaudeForge Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md Example of adding a new Rust template to ClaudeForge, including file creation, updating the template selector, and testing. ```bash # Create Rust template vim skill/examples/rust-cli-CLAUDE.md # Update selector vim skill/template_selector.py # Add: if 'Cargo.toml' in files: return 'rust-cli' # Test # Create test Rust project, run /enhance-claude-md ``` -------------------------------- ### Example Output Formats for CLAUDE.md Updates Source: https://github.com/alirezarezvani/claudeforge/blob/dev/agent/README.md Demonstrates the different output formats used by the guardian agent to report CLAUDE.md updates, ranging from silent notifications to detailed major milestone reports. ```plaintext ✓ CLAUDE.md current (no significant changes detected) ``` ```plaintext ✅ CLAUDE.md updated: - Tech Stack: Added 2 dependencies - Setup: New environment variable Changes: 2 sections, 8 lines ``` ```plaintext 🔄 Major changes detected - Full quality check performed Updates applied: - Architecture: New microservices pattern documented - Tech Stack: 5 new dependencies added - Setup & Installation: Updated for monorepo - Common Commands: Added 3 new scripts Quality Score: 75 → 88 (+13) Changes: 6 sections, 45 lines ✅ CLAUDE.md fully synchronized ``` -------------------------------- ### Check Agent Installation on Windows Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Checks for the presence of the ClaudeForge guardian agent file in the agents directory for user-level installations on Windows. ```powershell dir $env:USERPROFILE\.claude\agents\claude-md-guardian.md ``` -------------------------------- ### Common Development and Production Commands with npm Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-frontend-CLAUDE.md A collection of essential npm commands for managing the development and production lifecycle of the project. This includes starting the dev server, running linters, type checking, formatting, building for production, and analyzing bundle sizes. ```bash # Development npm run dev # Start dev server (http://localhost:5173) npm test # Run all tests npm run test:watch # Run tests in watch mode npm run lint # Run ESLint npm run type-check # TypeScript check npm run format # Format code with Prettier # Production npm run build # Build for production npm run preview # Preview production build locally npm run analyze # Analyze bundle size # Testing npm run test:unit # Unit tests only npm run test:e2e # E2E tests with Playwright npm run test:coverage # Coverage report ``` -------------------------------- ### Example Bug Fix Commit Message Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md This example shows a commit message for a bug fix. The type is 'fix' and the scope is 'installer'. The description details the resolution of path separator issues on Windows platforms by updating the installation script. ```gitcommit fix(installer): Resolve Windows path issues Fixes path separator issues on Windows platforms. Updates install.ps1 to use platform-specific paths. Fixes #67 ``` -------------------------------- ### Common Development and Database Commands (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-backend-CLAUDE.md Lists essential bash commands for local development and database management. This includes starting the dev server, running linters, formatting code, managing database migrations, seeding data, and accessing the database GUI. These commands streamline the development workflow. ```bash # Development npm run dev # Start dev server with hot reload npm test # Run all tests npm run test:watch # Run tests in watch mode npm run lint # Run ESLint npm run format # Format code with Prettier # Database npm run migrate # Run migrations npm run migrate:rollback # Rollback last migration npm run migrate:reset # Reset database (dev only) npm run seed # Seed database with test data npx prisma studio # Open Prisma Studio (DB GUI) ``` -------------------------------- ### Bypass PowerShell Execution Policy for Installer (PowerShell) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Addresses Windows installer failures due to PowerShell execution policy restrictions. This snippet demonstrates how to temporarily bypass the policy for the current process and then run the PowerShell installer script. ```powershell # Run PowerShell as Administrator # Set execution policy temporarily: Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass # Then run installer: .\install.ps1 ``` -------------------------------- ### Manual Testing: Initialize New Project with Slash Command Source: https://github.com/alirezarezvani/claudeforge/blob/dev/CLAUDE.md Steps to test the initialization of a new project using the `/enhance-claude-md` slash command. This involves creating a test project, running the command, and verifying Claude's exploration, detection, and CLAUDE.md creation. ```bash # 1. Create test project mkdir test-project && cd test-project git init npm init -y # or create package.json # 2. Run slash command /enhance-claude-md # 3. Verify Claude: # - Explores repository # - Detects TypeScript/Node project # - Shows discoveries # - Asks for confirmation # - Creates CLAUDE.md with native format ``` -------------------------------- ### User-Level ClaudeForge Uninstallation (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Removes ClaudeForge components installed at the user level on macOS and Linux. This includes the skill, command, and agent directories and files. ```bash # macOS/Linux rm -rf ~/.claude/skills/claudeforge-skill rm -rf ~/.claude/commands/enhance-claude-md rm -f ~/.claude/agents/claude-md-guardian.md ``` -------------------------------- ### Common Production and Debugging Commands (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-backend-CLAUDE.md Details bash commands for building and running the application in a production environment, as well as for debugging purposes. This includes commands for creating a production build, starting the production server, and initiating a debug session. These are vital for deployment and troubleshooting. ```bash # Production npm run build # Build TypeScript npm start # Start production server # Debugging npm run dev:debug # Start with debugger npm run logs # View application logs ``` -------------------------------- ### Project-Level ClaudeForge Uninstallation (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Removes ClaudeForge components installed within a specific project directory on macOS and Linux. This includes skills, commands, agents, and optionally hooks. ```bash # macOS/Linux rm -rf ./.claude/skills/claudeforge-skill rm -rf ./.claude/commands/enhance-claude-md rm -f ./.claude/agents/claude-md-guardian.md rm -rf ./.claude/hooks # If quality hooks were installed ``` -------------------------------- ### Project-Level ClaudeForge Uninstallation (PowerShell) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Removes ClaudeForge components installed within a specific project directory on Windows using PowerShell. This includes skills, commands, agents, and optionally hooks, utilizing the `Remove-Item` cmdlet. ```powershell # Windows (PowerShell) Remove-Item -Recurse -Force .\.claude\skills\claudeforge-skill Remove-Item -Recurse -Force .\.claude\commands\enhance-claude-md Remove-Item -Force .\.claude\agents\claude-md-guardian.md Remove-Item -Recurse -Force .\.claude\hooks ``` -------------------------------- ### API Documentation Access (HTTP) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-backend-CLAUDE.md Instructs users on how to access the interactive API documentation after the server has started. It provides the default URL and highlights the features of the Swagger UI, such as endpoint listing, schema visualization, and testing capabilities. This facilitates API integration and understanding. ```text http://localhost:3000/api-docs ``` -------------------------------- ### User-Level ClaudeForge Uninstallation (PowerShell) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/INSTALLATION.md Removes ClaudeForge components installed at the user level on Windows using PowerShell. This includes the skill, command, and agent directories and files. The `Remove-Item` cmdlet is used with recursive and force options. ```powershell # Windows (PowerShell) Remove-Item -Recurse -Force $env:USERPROFILE\.claude\skills\claudeforge-skill Remove-Item -Recurse -Force $env:USERPROFILE\.claude\commands\enhance-claude-md Remove-Item -Force $env:USERPROFILE\.claude\agents\claude-md-guardian.md ``` -------------------------------- ### Initialize and Run Project Validation Source: https://context7.com/alirezarezvani/claudeforge/llms.txt Initializes a BestPracticesValidator with project content and context, then runs all validation checks. The report indicates whether the project adheres to best practices. ```python project_context = { "type": "fullstack", "tech_stack": ["TypeScript", "React", "Node.js"], "team_size": "small" } validator = BestPracticesValidator(content, project_context) # Run all validation checks validation_report = validator.validate_all() if validation_report['valid']: print(f"✅ Validation passed: {validation_report['pass_count']}/{validation_report['pass_count'] + validation_report['fail_count']} checks") else: print(f"❌ Validation failed:") for error in validation_report['errors']: print(f" - {error}") ``` -------------------------------- ### Trigger ClaudeForge Enhancement - CLI Source: https://github.com/alirezarezvani/claudeforge/blob/dev/README.md Command to initiate the ClaudeForge CLAUDE.md enhancement process within a project. After installation, this command is run in the terminal to start the interactive workflow. ```bash /enhance-claude-md ``` -------------------------------- ### Running Tests with npm Commands Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-frontend-CLAUDE.md Common npm commands for executing various types of tests, including all tests, unit tests, E2E tests with Playwright, and tests with coverage reporting. These commands facilitate efficient testing workflows. ```bash # Run tests npm test # All tests npm run test:unit # Unit tests only npm run test:e2e # E2E tests with Playwright npm run test:coverage # With coverage report ``` -------------------------------- ### GitHub Actions: Validate CLAUDE.md with ClaudeForge Source: https://github.com/alirezarezvani/claudeforge/blob/dev/examples/integration-examples.md This workflow validates the CLAUDE.md file using ClaudeForge during CI/CD. It checks for file existence and a minimum quality score using Python. Ensure ClaudeForge is installed and the Python script can access the validator. ```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') " ``` -------------------------------- ### Example Git Tagging for Release Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md This bash command snippet shows how to create and push a git tag for a new release. It's part of the release process to version the project and make it available for deployment. This command is typically run after updating version numbers in relevant files. ```bash git tag -a v1.1.0 -m "Release v1.1.0" git push origin v1.1.0 ``` -------------------------------- ### Running Project Tests (Bash) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-backend-CLAUDE.md Provides bash commands to execute various test suites for the project. It includes options for running all tests, unit tests, integration tests, and tests with code coverage reports. These commands are crucial for maintaining code quality and identifying regressions. ```bash # Run tests npm test # All tests npm run test:unit # Unit tests only npm run test:integration # Integration tests only npm run test:coverage # With coverage report ``` -------------------------------- ### React Query for Server State Management Source: https://github.com/alirezarezvani/claudeforge/blob/dev/skill/examples/modular-frontend-CLAUDE.md Illustrates the usage of React Query's `useQuery` hook for fetching and managing server state. It shows how to define a query key and a query function to fetch user data, and how the hook provides loading and error states. ```typescript const { data, isLoading, error } = useQuery({ queryKey: ['users', userId], queryFn: () => fetchUser(userId) }); ``` -------------------------------- ### Example Feature Commit Message Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/CONTRIBUTING.md This example illustrates a commit message for a new feature. It follows the specified format, indicating the type as 'feat' and the scope as 'analyzer'. The description clearly states the addition of code example detection and its purpose. ```gitcommit feat(analyzer): Add code example detection Adds check for code examples in CLAUDE.md files. Contributes to quality score calculation. Fixes #45 ``` -------------------------------- ### ClaudeForge Data Flow: New Project Initialization (Python) Source: https://github.com/alirezarezvani/claudeforge/blob/dev/docs/ARCHITECTURE.md Details the step-by-step data flow for initializing a new project with ClaudeForge. It outlines the sequence from user command to skill invocation, analysis, generation, validation, and final CLAUDE.md file creation, primarily involving Python modules. ```text 1. User → /enhance-claude-md 2. Command checks: CLAUDE.md not found 3. Command → Skill (initialize mode) 4. Skill workflow.py: - generate_exploration_prompt() - Claude explores repository - analyze_discoveries(exploration_results) - Returns project_context 5. Skill template_selector.py: - select_template(project_context) - Returns template configuration 6. Skill generator.py: - generate_root_file(template) - Returns CLAUDE.md content 7. Skill validator.py: - validate_all(generated_content) - Returns validation report 8. Output → CLAUDE.md file(s) created ```