Skip to content

Coding Rules

Coding Rules

Guitar Prometheus follows the rules in ~/.claude/rules/ for any agent working in this repo. The high-level points are listed here so contributors without that ruleset still follow the same conventions.

C++ Style

  • C++17. No C++20 features.
  • Class members are private by default. Reference > pointer > value (unless the value is small).
  • Constructor-sink pattern: take collections by value, std::move into the field.
  • Models are immutable. Mutators rebuild a fresh instance and replace the old one.
  • Avoid backwards-compatibility hacks (_unused renames, re-exported types, // removed: ... markers). When code is dead, delete it.

Documentation Comments

  • Headers are fully Doxygen-documented.
  • .cpp files have no docs and minimal inline comments — only when the why is non-obvious (a hidden constraint, an invariant, a workaround for a specific bug, behaviour that would surprise a reader).
  • Don’t reference the current task or fix in code comments — those belong in the commit message.

Commit Messages

Follow the 50/80 rule: subject line ≤ 50 characters, body wrapped at 80 characters.

Simple commits (single logical change)

Subject line only:

Fix typo in retry logic

Subject + flat bullet list. See ~/.claude/rules/commit-messages.md for examples.

Complex commits (multiple areas touched)

Subject + sectioned bullets. Section headers end with a colon. Bullets start with - .

Subject line conventions

  • Imperative mood, no trailing period.
  • Phase-execution commits prefix the subject with Phase N FN.M: to match the implementation-plan checkpoints.
  • Commits include a Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> trailer when an agent contributed.

Performance Claims

Don’t write absolute performance claims (“zero cost”, “free at runtime”) in code, comments, or commit messages. State observed measurements instead, with the test conditions.

File Organization

  • src/public/ — headers consumed by other targets (tests, future embedders). Public API surface.
  • src/private/ — implementation files + private headers. Not exposed beyond the guitar_prometheus_core library.
  • tests/ — Catch2 unit + integration tests. One file per area of coverage.
  • resources/ — bundled JSON schemas, profiles, fonts.
  • documentation/ — this tree.