Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

C++ Cursor Rules

Production-ready rules for modern C++ development.

By Vinnie Falco • Source: cppalliance/coro-io-context


Rules

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

Commands

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

Quick Start

# Copy all C++ rules to your project
mkdir -p .cursor/rules
cp *.mdc .cursor/rules/

What's Included

Coding Conventions

  • Private data members first, public interface last
  • struct if all public, otherwise class
  • Protect min/max with parentheses: (std::min)(a, b)
  • Idiomatic error checks: ec.failed() not !!ec

Comment Style

  • Explain WHY, not how or what
  • Code should be self-documenting
  • No ASCII-art dividers

Documentation (Javadoc)

  • Brief starts with action verb based on function type
  • Section order: Brief → Description → @par → @throws → @param → @return
  • Exception safety guarantees documented

CMake

  • Always use cmake --preset
  • Never in-source builds
  • Forbidden: cmake ., cmake -B .

Attribution

These rules are by Vinnie Falco, author of:

Licensed under MIT. Used with permission.