Skip to content

Conversation

@armenzg
Copy link
Member

@armenzg armenzg commented Dec 23, 2025

Adds .cursor/rules/*.mdc files to automatically load domain-specific AGENTS.md files based on the file being edited:

  • Backend Python files → loads src/AGENTS.md
  • Test files → loads tests/AGENTS.md
  • Frontend files → loads static/AGENTS.md
  • All files → always loads root AGENTS.md

Benefits:

  • Token efficient: Only loads relevant context for current task
  • Better AI responses: Gets targeted guidance (backend vs frontend vs testing patterns)
  • Prevents context overload: No need to load all guides simultaneously

Also includes documentation in root AGENTS.md and .cursor/rules/README.md explaining the setup.

@armenzg armenzg self-assigned this Dec 23, 2025
@armenzg armenzg force-pushed the cursor_rules/armenzg branch from b9feb73 to 45709ae Compare December 23, 2025 18:29
@armenzg armenzg marked this pull request as ready for review December 23, 2025 18:30
Split AGENTS.md references into context-specific .mdc files that load based
on the file being edited:

- backend.mdc: Loads src/AGENTS.md when editing src/**/*.py
- tests.mdc: Loads tests/AGENTS.md when editing test files
- frontend.mdc: Loads static/AGENTS.md when editing frontend files
- general.mdc: Always loads root AGENTS.md (alwaysApply: true)

Benefits:
- Token efficient: Only loads relevant context for current file
- Better AI responses: Targeted guidance (backend vs frontend vs tests)
- Prevents context overload: No need to load all guides simultaneously

Also added:
- .cursor/rules/README.md documenting the setup
- Context-aware loading section in root AGENTS.md
- Trailing newlines in .mdc files (best practice)

The @file: directive works in .mdc files within .cursor/rules/, not in plain
text .cursorrules files.

Docs: https://docs.cursor.com/en/context/rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants