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:
bash
curl -sSL https://raw.githubusercontent.com/[your-repo]/generate-ide-rules.sh | bash -s -- --ide cursor
Download and use:
bash
# 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
bash
# 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
bash
# 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
- Project Analysis: Automatically detects your project type, technologies, and structure
- Documentation Download: Pulls the latest IDE rules documentation from the repository
- Context Generation: Creates a detailed prompt for LLM processing
- 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
- Run the script with your preferred IDE and options
- Review the generated prompt in
ide-rules/generate-prompt.txt
- Copy to your LLM (Claude, ChatGPT, etc.)
- Save the output as
[ide]-rules.md
- Apply to your IDE configuration
IDE-Specific Instructions
Cursor
- Open Cursor settings (Cmd/Ctrl + ,)
- Navigate to 'Rules' section
- Paste the generated rules
VS Code
- Copy settings from generated rules
- Open settings.json (Cmd/Ctrl + Shift + P > 'Preferences: Open Settings (JSON)')
- Merge with your existing settings
JetBrains IDEs
- Import the generated XML configurations
- Apply the code style and inspection profiles
- Configure live templates
Windsurf
- Copy the YAML configuration
- Apply to your workspace settings
- Enable AI pair programming features
Integration with CI/CD
Add to your CI/CD pipeline:
yaml
- 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
bash
# 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
bash
# Regenerate when project structure changes
./generate-ide-rules.sh --ide cursor --include-workflows
Troubleshooting
Common Issues
- Script not found: Ensure the GitHub URL is correct
- Permission denied: Run
chmod +x generate-ide-rules.sh
- Network issues: Download script locally and run offline
- No rules generated: Check project structure and IDE support
Debug Mode
bash
# Run with verbose output
bash -x ./generate-ide-rules.sh --ide cursor
Environment Variables
Set these for customized behavior:
bash
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:
bash
# 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:
- Create template in
docs/ide-rules/ide-specific/[new-ide]/
- Add IDE to the VALID_IDES list in the script
- Add IDE-specific usage instructions
- Test with various project types
License
MIT License - Use freely in your projects!