mirror of
https://gh.wpcy.net/https://github.com/elementor/elementor.git
synced 2026-06-18 04:33:19 +08:00
## Summary - Condense 5 workspace rules (`development-workflow`, `legacy-integration`, `react-typescript`, `turbo-repo`, `wordpress-php`) from verbose to concise, and switch them from `alwaysApply: true` to `alwaysApply: false` (on-demand), saving ~4k tokens per session - Add root `.cursorignore` to exclude generated directories (`node_modules/`, `build/`, `vendor/`, `.turbo/`, etc.) from Cursor indexing - Net reduction: 1,055 lines removed, 98 added ## Test plan - [ ] Verify Cursor still picks up on-demand rules when editing matching files (e.g. `.php` files trigger `wordpress-php.mdc`) - [ ] Verify Cursor indexing excludes directories listed in `.cursorignore` - [ ] Confirm no impact on existing development workflows Made with [Cursor](https://cursor.com) <!--start_gitstream_placeholder--> ### ✨ PR Description ## 1. Problem & Context Cursor's AI context was bloated with verbose rules (~1000+ lines) that always applied, slowing down every interaction and including irrelevant legacy/PHP context for TypeScript work. This optimizes token usage by condensing rules 5-10x, disabling auto-apply (`alwaysApply: false`), and excluding build artifacts via `.cursorignore`. ## 2. What Changed (Where) - `.cursor/rules/development-workflow.mdc` - Condensed from 261 to 38 lines (command reference only) - `.cursor/rules/legacy-integration.mdc` - Condensed from 304 to 55 lines (removed adapters, test patterns) - `.cursor/rules/react-typescript.mdc` - Condensed from 325 to 56 lines (kept core patterns, removed examples) - `.cursor/rules/turbo-repo.mdc` - Condensed from 150 to 49 lines (workflow and pluggable pattern focus) - `.cursor/rules/wordpress-php.mdc` - Condensed from 176 to 48 lines (security + performance essentials) - `.cursorignore` - New file excluding `node_modules/`, `vendor/`, build artifacts, test outputs ## 3. How It Works All rule files now act as quick-reference cheat sheets instead of comprehensive guides. Set `alwaysApply: false` so Cursor only loads rules when file globs match (e.g., PHP rules only for `**/*.php`). The `.cursorignore` prevents Cursor from indexing 10K+ files in `node_modules/`, `vendor/`, and build directories, reducing context window pollution. Developers manually reference rules when needed rather than auto-injecting ~1000 lines per query. ## 4. Risks **False negatives on rule application**: If globs are too narrow or developers forget rules exist, they might miss guidance. Mitigate by keeping rule names descriptive and ensuring common file patterns are covered. **Context starvation on complex tasks**: Removing detailed examples might force developers to external docs. Monitor if this increases back-and-forth or errors—can restore specific examples if needed. _Generated by LinearB AI and added by gitStream._ <sub>AI-generated content may contain inaccuracies. Please verify before using. 💡 **Tip:** You can customize your AI Description using **Guidelines** [Learn how](https://docs.gitstream.cm/automation-actions/#describe-changes)</sub> <!--end_gitstream_placeholder--> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: ElementorBot <48412871+elementorbot@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| rules | ||
| system-prompts | ||
| README.md | ||
Cursor AI Configuration
This directory contains AI agent configuration for test generation and code assistance.
File Structure
Rules (/rules/)
tests-code-style.mdc- Technical testing rules and code quality standards- Code quality, test reliability, browser/environment rules
- Applies only to test files (
globs: *test*)
System Prompts (/system-prompts/)
test-gen/- Test generation specific promptsagent-rules.md- High-level testing process and strategyelementor-specific.md- Elementor platform implementation detailsmcp-rules.md- Model Context Protocol integration rules- See
/test-gen/README.mdfor detailed documentation
Rule Hierarchy
- General code style (workspace-wide rules) - applies to all files
- Technical testing rules (tests-code-style.mdc) - applies to test files only
- Test generation prompts (system-prompts/test-gen/) - AI agent guidance
- Process & strategy (agent-rules.md) - high-level workflow guidance
- Platform specifics (elementor-specific.md) - implementation details
- Tool integration (mcp-rules.md) - MCP usage patterns
This hierarchy prevents rule duplication and ensures clear separation of concerns.