Production-ready rules for modern C++ development.
By Vinnie Falco • Source: cppalliance/coro-io-context
| File | Description |
|---|---|
| cpp.mdc | Class layout, coding conventions, error handling |
| cpp-comments.mdc | Comment philosophy: explain WHY, not how |
| cpp-javadoc.mdc | Javadoc/Doxygen documentation standards |
| cmake.mdc | CMake best practices, presets, no in-source builds |
| File | Description |
|---|---|
| build.md | Build C++ projects with CMake |
| commit.md | AI-generated conventional commit messages |
| fix.md | Fix compile errors, then fix failing tests |
# Copy all C++ rules to your project
mkdir -p .cursor/rules
cp *.mdc .cursor/rules/- Private data members first, public interface last
structif all public, otherwiseclass- Protect
min/maxwith parentheses:(std::min)(a, b) - Idiomatic error checks:
ec.failed()not!!ec
- Explain WHY, not how or what
- Code should be self-documenting
- No ASCII-art dividers
- Brief starts with action verb based on function type
- Section order: Brief → Description → @par → @throws → @param → @return
- Exception safety guarantees documented
- Always use
cmake --preset - Never in-source builds
- Forbidden:
cmake .,cmake -B .
These rules are by Vinnie Falco, author of:
- Boost.Beast - HTTP/WebSocket
- Boost.URL - URL parsing
- Boost.JSON - JSON library
Licensed under MIT. Used with permission.