diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 41c87a6..0beabeb 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -31,7 +31,14 @@ keep the citation accurate. ## Coding Guidelines * avoid duplicate code -* do not use the "auto" keyword +* do not use the "auto" keyword, with two exceptions: + * **named local lambdas** — a lambda's type is unnameable, and `std::function` + is not an acceptable substitute in per-tick code because it adds a heap + allocation and an indirect call + * **iterator types** — `auto it = m_buildings.find(id)` is allowed where + spelling the iterator out adds length without adding information + * everywhere else the type is written out; in particular `auto` is not used + for plain values, return values, or range-for element types * use Qt utility data types (like QPoint, QVector3D, QString, etc.) * wrap strings that appear in the UI with Qt's "tr()" * use the EventManager/EventHandler instead of defining own signals and slots