Skip to main content

Standalone IDE Rules Generator

Overviewโ€‹

The generate-ide-rules script is a standalone tool that can be used in any project to generate IDE-specific configurations. It downloads the necessary documentation and creates customized rules based on your project's structure.

Installationโ€‹

One-line installation and usage:โ€‹

curl -sSL https://raw.githubusercontent.com/[your-repo]/generate-ide-rules.sh | bash -s -- --ide cursor

Download and use:โ€‹

# Download the script
curl -sSL https://raw.githubusercontent.com/[your-repo]/generate-ide-rules.sh -o generate-ide-rules.sh
chmod +x generate-ide-rules.sh

# Run with options
./generate-ide-rules.sh --ide cursor --include-workflows

Usage Examplesโ€‹

Basic Usageโ€‹

# Generate Cursor rules for current project
./generate-ide-rules.sh --ide cursor

# Generate VS Code rules with comprehensive analysis
./generate-ide-rules.sh --ide vscode --depth comprehensive

Advanced Usageโ€‹

# Full-featured generation for Windsurf
./generate-ide-rules.sh --ide windsurf \
--include-workflows \
--include-snippets \
--include-shortcuts \
--security-focus

# Enterprise team setup
./generate-ide-rules.sh --ide jetbrains \
--team-size large \
--experience mixed \
--performance-focus

Command Optionsโ€‹

OPTIONS:
-i, --ide <name> Target IDE: cursor, windsurf, vscode, jetbrains, sublime, neovim, emacs
-p, --project <path> Project path to analyze (default: .)
-o, --output <path> Output directory (default: ./ide-rules)
-d, --depth <level> Analysis depth: basic, comprehensive, deep
--include-workflows Include workflow automations
--include-snippets Include code snippets
--include-shortcuts Include keyboard shortcuts
--security-focus Emphasize security patterns
--performance-focus Emphasize performance optimizations
--team-size <size> Team size: solo, small, medium, large
--experience <level> Team experience: junior, mixed, senior
--llm <mode> LLM mode: prompt, claude, openai
-h, --help Show help message

How It Worksโ€‹

  1. Project Analysis: Automatically detects your project type, technologies, and structure
  2. Documentation Download: Pulls the latest IDE rules documentation from the repository
  3. Context Generation: Creates a detailed prompt for LLM processing
  4. Rule Generation: Generates IDE-specific configuration files

Supported Project Typesโ€‹

  • Node.js (React, Vue, TypeScript, JavaScript)
  • Python (Django, Flask, FastAPI)
  • Java (Spring Boot, Maven, Gradle)
  • Go (Modules, CLI applications)
  • Rust (Cargo projects)
  • Docker (Containerized applications)
  • Multi-language projects

Output Structureโ€‹

ide-rules/
โ”œโ”€โ”€ README.md # Generated documentation
โ”œโ”€โ”€ generate-prompt.txt # LLM prompt for rule generation
โ””โ”€โ”€ cursor-rules.md # Generated IDE rules (manual step)

Workflowโ€‹

  1. Run the script with your preferred IDE and options
  2. Review the generated prompt in ide-rules/generate-prompt.txt
  3. Copy to your LLM (Claude, ChatGPT, etc.)
  4. Save the output as [ide]-rules.md
  5. Apply to your IDE configuration

IDE-Specific Instructionsโ€‹

Cursorโ€‹

  1. Open Cursor settings (Cmd/Ctrl + ,)
  2. Navigate to 'Rules' section
  3. Paste the generated rules

VS Codeโ€‹

  1. Copy settings from generated rules
  2. Open settings.json (Cmd/Ctrl + Shift + P > 'Preferences: Open Settings (JSON)')
  3. Merge with your existing settings

JetBrains IDEsโ€‹

  1. Import the generated XML configurations
  2. Apply the code style and inspection profiles
  3. Configure live templates

Windsurfโ€‹

  1. Copy the YAML configuration
  2. Apply to your workspace settings
  3. Enable AI pair programming features

Integration with CI/CDโ€‹

Add to your CI/CD pipeline:

- name: Generate IDE Rules
run: |
curl -sSL https://raw.githubusercontent.com/[your-repo]/generate-ide-rules.sh | bash -s -- --ide cursor
git add ide-rules/
git commit -m "Update IDE rules" || exit 0

Team Usageโ€‹

Share Rulesโ€‹

# Generate rules and commit to repository
./generate-ide-rules.sh --ide cursor --team-size medium
git add ide-rules/
git commit -m "Add team IDE configuration"
git push

Update Rulesโ€‹

# Regenerate when project structure changes
./generate-ide-rules.sh --ide cursor --include-workflows

Troubleshootingโ€‹

Common Issuesโ€‹

  1. Script not found: Ensure the GitHub URL is correct
  2. Permission denied: Run chmod +x generate-ide-rules.sh
  3. Network issues: Download script locally and run offline
  4. No rules generated: Check project structure and IDE support

Debug Modeโ€‹

# Run with verbose output
bash -x ./generate-ide-rules.sh --ide cursor

Environment Variablesโ€‹

Set these for customized behavior:

export IDE_RULES_OUTPUT_DIR="./custom-rules"
export IDE_RULES_DOCS_URL="https://your-custom-repo.com/docs"
export IDE_RULES_DEFAULT_IDE="cursor"

API Integration (Coming Soon)โ€‹

Future versions will support direct API integration:

# With Claude API
./generate-ide-rules.sh --ide cursor --llm claude --api-key $CLAUDE_API_KEY

# With OpenAI API
./generate-ide-rules.sh --ide cursor --llm openai --api-key $OPENAI_API_KEY

Contributingโ€‹

To add support for new IDEs:

  1. Create template in ./ide-rules/ide-specific/[new-ide]/
  2. Add IDE to the VALID_IDES list in the script
  3. Add IDE-specific usage instructions
  4. Test with various project types

Licenseโ€‹

MIT License - Use freely in your projects!