Perhaps many people like me spend too much time on thinking out laconic, good and working .cursor/rules
It would be great if we could start from some reasonable template .cursor/rules suitable for the given project tech-stack and LLM-model?
Ideally these .mdc rule files should be generated by Composer as your very first project setup step.
Here I assume that the rules should be tailored mainly for Composer agent mode (I hope we forget about redundant “normal mode” soon).
For example, as for the Rust I’d start from:
.cursor/rules/session-startup.mdc
:
---
description: start-up rules to be applied at the beginning each session (Chat, Composer and Bug Finder)
globs:
---
# Session Start-up Rules
- ensure the code base is indexed/read
- in particular ensure the [README.md](mdc:README.md) and all files in doc/ directory are read in
Thoughts:
-
I am not sure whether code base is automatically read on session startup (and will it be the same in the next Cursor version?)
-
even after code base is explicitly read/indexed, I see that instructions from README.md are boldly ignored.
code-generation-finalization-rule.mdc
:
---
description: The rules to be applied after the code changes are done by Composer
globs:
---
The following rules should be applied after the code changes are done by Composer
- always run build to ensure your code changes don't break the build phase
- run build in a form defined in project docs (README.md and doc/*)
- after build succeeded run the tests (test invocations should be also done according to the docs)
- for the introduced new benchmarking tests invoke 'cargo test' prepended by `timeout` and reasonable time threshold value (e.g. 5s) to. Do so until you get the benchmarking test runnable to avoid unlucky long or even infinite waiting. After you get test runnable, the benchmarking duration should be set to smth about 15s if not differently requested
Thoughts:
- actually test-related rules could be in the separate test-rules.mdc file.
Guys, meanwhile, please share your successful .mdc rules