UNPKG

@morodomi/ait3

Version:

AIT³ Development Platform - AI + Ticket + Test + Tool driven development methodology

2 lines (1 loc) 7.61 kB
export declare const ait3InitTemplate = "# AIT\u00B3 Initialize - Generate CLAUDE.md with Project Analysis\n\nThis command guides you through generating a comprehensive CLAUDE.md file for your project using AIT\u00B3 commands, similar to Claude Code's /init command.\n\n## Process Overview\n\nThe `ait3-init` process analyzes your codebase and creates a CLAUDE.md file that serves as persistent instructions for Claude Code when working with your project.\n\n## Step-by-Step Instructions\n\n### Step 1: Project Analysis\nFirst, run comprehensive project analysis:\n\n```bash\n# Analyze the project structure and detect languages/frameworks\nait3 analyze project --format detailed > project-analysis.txt\n```\n\n### Step 2: Extract Key Information\nBased on the analysis, gather specific information:\n\n#### README Analysis\n```bash\n# If README.md exists, analyze it for project context\ncat README.md 2>/dev/null || echo \"No README found\"\n```\n\n#### Build Configuration\n```bash\n# Check package.json for scripts\ncat package.json | jq '.scripts' 2>/dev/null || echo \"{}\"\n\n# Check for other build configs (tsconfig.json, webpack.config.js, etc.)\nls -la | grep -E \"(tsconfig|webpack|vite|rollup|babel)\"\n```\n\n#### Test Configuration\n```bash\n# Identify test runner and configuration\ncat package.json | jq '.scripts | to_entries[] | select(.key | contains(\"test\"))' 2>/dev/null\n\n# Look for test config files\nfind . -maxdepth 2 -name \"*test*\" -o -name \"*spec*\" -o -name \"jest.config*\" -o -name \"vitest.config*\" 2>/dev/null\n```\n\n#### Lint Configuration\n```bash\n# Check for linting setup\ncat package.json | jq '.scripts | to_entries[] | select(.key | contains(\"lint\"))' 2>/dev/null\n\n# Find lint config files\nfind . -maxdepth 2 -name \".eslint*\" -o -name \".prettier*\" -o -name \"tslint*\" 2>/dev/null\n```\n\n### Step 3: Understand Business Logic\nAnalyze the core business logic:\n\n```bash\n# Use Gemini for comprehensive analysis (if available)\ngemini -p \"@src/ Explain the core business logic and main algorithms in this codebase. Focus on the primary value proposition and key technical implementations.\"\n\n# Or analyze key directories\nfind src -type f -name \"*.ts\" -o -name \"*.js\" | head -20\n```\n\n### Step 4: Environment and Deployment\nCheck for deployment and environment configurations:\n\n```bash\n# Check for environment files\nls -la | grep -E \"(.env|.env.example|.env.sample)\"\n\n# Check for CI/CD configurations\nls -la .github/workflows 2>/dev/null || ls -la .gitlab-ci.yml 2>/dev/null || ls -la .circleci 2>/dev/null\n\n# Check for Docker configurations\nls -la | grep -E \"(Dockerfile|docker-compose)\"\n\n# Check for deployment configs\nls -la | grep -E \"(vercel.json|netlify.toml|app.yaml|serverless)\"\n```\n\n### Step 5: Generate CLAUDE.md Template\nCreate a CLAUDE.md file with the gathered information:\n\n```bash\ncat > CLAUDE.md << 'EOF'\n# Project: [PROJECT_NAME]\n\n## Overview\n[Brief description from README or analysis]\n\n## Architecture\n- **Language**: [Primary language detected]\n- **Framework**: [Framework detected]\n- **Architecture Pattern**: [e.g., Pure Functions + Service Injection]\n- **Test Framework**: [e.g., Vitest, Jest]\n- **Build Tool**: [e.g., TypeScript, Webpack]\n\n## Key Commands\n```bash\nnpm install # Install dependencies\nnpm run build # Build the project\nnpm test # Run tests\nnpm run lint # Run linting\nnpm run dev # Start development server\n```\n\n## Project Structure\n```\n[Key directories and their purposes]\nsrc/\n\u251C\u2500\u2500 commands/ # [Purpose]\n\u251C\u2500\u2500 services/ # [Purpose]\n\u251C\u2500\u2500 common/ # [Purpose]\n\u2514\u2500\u2500 assets/ # [Purpose]\n```\n\n## Business Logic\n[Core business logic explanation]\n\n### Key Algorithms\n1. [Algorithm 1]: [Brief explanation]\n2. [Algorithm 2]: [Brief explanation]\n\n## Development Workflow\n[Describe the development process, e.g., AIT\u00B3 TiDD workflow]\n\n## Testing Strategy\n- **Unit Tests**: [Location and approach]\n- **Integration Tests**: [Location and approach]\n- **Test Coverage**: [Target coverage percentage]\n\n## Code Style and Standards\n- **Linting**: [ESLint/Prettier configuration]\n- **Type Safety**: [TypeScript strict mode settings]\n- **Naming Conventions**: [Describe conventions]\n\n## Environment Setup\n### Required Environment Variables\n- `VAR_NAME`: [Description]\n\n### Development Setup\n1. [Step 1]\n2. [Step 2]\n\n## Deployment\n[Deployment process and considerations]\n\n## Important Considerations\n- [Key architectural decisions]\n- [Performance considerations]\n- [Security considerations]\n\n## AI Development Guidelines\nWhen working with this codebase:\n1. [Guideline 1]\n2. [Guideline 2]\n3. [Guideline 3]\n\n## Common Tasks\n### Adding a New Feature\n1. [Step-by-step process]\n\n### Fixing a Bug\n1. [Step-by-step process]\n\n### Refactoring\n1. [Step-by-step process]\n\nEOF\n```\n\n### Step 6: Customize and Refine\nAfter generating the template:\n\n1. **Review and Edit**: Open CLAUDE.md and fill in the placeholders with actual information\n2. **Add Project-Specific Details**: Include any unique aspects of your project\n3. **Include Constraints**: Add any important limitations or requirements\n4. **Document Gotchas**: Note any non-obvious behaviors or common pitfalls\n\n### Step 7: Validate with AIT\u00B3\nEnsure the CLAUDE.md is comprehensive:\n\n```bash\n# Use Gemini to validate completeness\ngemini -p \"@CLAUDE.md @src/ Does this CLAUDE.md accurately represent the codebase? What important information is missing?\"\n\n# Test with a simple task\necho \"Use the CLAUDE.md to understand how to add a new command to this project\"\n```\n\n## Tips for Effective CLAUDE.md\n\n1. **Be Specific**: Include exact commands, file paths, and patterns\n2. **Explain Why**: Don't just document what, explain why decisions were made\n3. **Include Examples**: Show concrete examples of how to perform common tasks\n4. **Update Regularly**: Keep CLAUDE.md in sync with your codebase\n5. **Test It**: Have someone unfamiliar with the project use only CLAUDE.md to understand it\n\n## Integration with AIT\u00B3 Workflow\n\nWhen using AIT\u00B3 workflow, include:\n- How tickets are managed\n- The TiDD process (PLANNING \u2192 RED \u2192 GREEN \u2192 REFACTOR \u2192 SQUASH)\n- Where to find ticket templates\n- How to use the flow commands\n\n## Example: AIT\u00B3 Project CLAUDE.md Section\n\n```markdown\n## Development Workflow - AIT\u00B3 TiDD\n\nThis project follows the AIT\u00B3 (AI + Ticket + Test + Tool) driven development workflow:\n\n### Creating New Features\n1. Create a ticket: `ait3 ticket create \"Feature name\"`\n2. Start the ticket: `ait3 ticket start XXXX`\n3. Follow the phases:\n - PLANNING: `ait3 flow plan \"feature-name\"` (validate approach)\n - RED: `ait3 flow red XXXX` (create failing tests)\n - GREEN: `ait3 flow green XXXX` (implement to pass tests)\n - REFACTOR: `ait3 flow refactor XXXX` (optimize code)\n - SQUASH: `ait3 flow squash XXXX` (clean git history)\n4. Complete: `ait3 ticket complete XXXX`\n\n### Architecture Rules\n- All commands must be pure functions: `(args, services) \u2192 CLIResult`\n- Services are injected, never imported directly in commands\n- Tests must pass 100% before moving to REFACTOR phase\n- Mock implementations must be ticketed for future work\n```\n\nRemember: A good CLAUDE.md enables Claude Code to work effectively with your project from the first interaction, reducing onboarding time and improving code quality.\n";