IDE Rules Command Structure
Overviewโ
This document defines the command structure for generating IDE-specific rules using the MCP ADR Analysis Server. These commands can be used in Claude.ai or any MCP-compatible environment to generate customized IDE configurations based on your project's architecture.
Base Command Patternโ
/generate-ide-rules --ide <IDE_NAME> --project <PROJECT_PATH> [OPTIONS]
Supported IDEsโ
cursor- Cursor IDEwindsurf- Windsurf IDEvscode- Visual Studio Codejetbrains- JetBrains IDEs (IntelliJ, WebStorm, PyCharm, etc.)sublime- Sublime Textneovim- Neovimemacs- Emacs
Command Optionsโ
Required Parametersโ
--ide <name>- Target IDE for rule generation--project <path>- Project path to analyze
Optional Parametersโ
--output <path>- Output directory (default:./ide-rules/)--analyze-depth <level>- Analysis depth:basic,comprehensive,deep(default:comprehensive)--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 <level>- Team experience:junior,mixed,senior
Usage Examplesโ
Basic Generationโ
# Generate Cursor rules for current project
/generate-ide-rules --ide cursor --project .
# Generate VS Code rules with comprehensive analysis
/generate-ide-rules --ide vscode --project /path/to/project --analyze-depth comprehensive
Advanced Generationโ
# Generate Windsurf rules with all features
/generate-ide-rules --ide windsurf --project . \
--include-workflows \
--include-snippets \
--include-shortcuts \
--security-focus
# Generate JetBrains rules for enterprise team
/generate-ide-rules --ide jetbrains --project . \
--team-size large \
--experience-level mixed \
--include-workflows
MCP Tool Integrationโ
The command structure maps to the following MCP tools:
1. Project Analysisโ
Tool: analyze_project_ecosystem
Parameters: {
"analysisDepth": "<from --analyze-depth>",
"includeEnvironment": true,
"enhancedMode": true
}
2. Rule Generationโ
Tool: generate_rules
Parameters: {
"adrDirectory": "./adrs",
"source": "both",
"outputFormat": "json"
}
3. Workflow Creationโ
Tool: get_workflow_guidance
Parameters: {
"goal": "ide configuration optimization",
"projectContext": "existing_project",
"primaryConcerns": ["<from focus flags>"]
}
Output Structureโ
Generated rules are saved in the following structure:
ide-rules/
โโโ <ide-name>/
โ โโโ rules.md # Main rules file
โ โโโ settings.json # IDE-specific settings
โ โโโ workflows/ # Workflow configurations
โ โโโ snippets/ # Code snippets
โ โโโ shortcuts/ # Keyboard shortcuts
Workflow Integrationโ
In Claude.aiโ
User: /generate-ide-rules --ide cursor --project . --include-workflows
Claude: [Executes MCP tools to analyze project and generate Cursor-specific rules]
In Custom MCP Clientโ
const result = await mcp.execute('generate-ide-rules', {
ide: 'cursor',
project: '.',
includeWorkflows: true
});
Rule Categories Generatedโ
-
Code Completion Rules
- Import suggestions
- Pattern detection
- Context awareness
-
AI Assistant Configuration
- Project-specific knowledge
- Code generation rules
- Security patterns
-
Linting & Formatting
- Auto-fix rules
- Code style enforcement
- Architecture compliance
-
Workflow Automations
- Pre-commit hooks
- Test generation
- Deployment checks
-
Integration Points
- MCP server connection
- Tool automation
- External services
Customization Pointsโ
Each generated rule file includes customization sections where you can:
- Add project-specific patterns
- Override default settings
- Define custom workflows
- Configure team preferences
Best Practicesโ
- Initial Setup: Run comprehensive analysis on first generation
- Regular Updates: Regenerate rules after major architectural changes
- Team Alignment: Share generated rules via version control
- Incremental Refinement: Start with basic rules, add features as needed
- Validation: Use
validate_rulestool to ensure compliance
Error Handlingโ
Common issues and solutions:
- No ADRs found: Generate ADRs first using
generate_adrs_from_prd - Invalid project path: Ensure path exists and contains valid project
- Unsupported IDE: Check supported IDEs list or use generic template
- Analysis timeout: Use
--analyze-depth basicfor large projects
Future Enhancementsโ
Planned features:
- IDE plugin generation
- Rule versioning and history
- Team collaboration features
- Cloud sync capabilities
- AI-powered rule optimization