Coding Standards

amber is C++17. Four-space indentation, no tabs, 100-column soft limit. The.clang-format file is the source of truth, run it on any code you touch.


General

  • C++17. No C++20 features yet. Stay portable.
  • clang-format. Run clang-format -i <files> on code you touch.
  • No tabs. Four-space indentation only.
  • 100-column soft limit. Wrap long lines, but don't break early.
  • No comments that restate the code. If the code is clear, don't comment it.

File Organization

  • lib/ + include/agent/, the UI-free core. No UI concerns here.
  • tui/, the ncurses client. Depends on the library through AgentHooks, never the reverse.
  • bench/, the KPI harness. Same layering rules.
  • tools/, tool implementations (read, write, search, bash).
  • prompts/, system/tool prompts in Markdown, loaded at runtime.

Naming Conventions

  • snake_case for variables, functions, and files.
  • PascalCase for classes and types.
  • UPPER_SNAKE_CASE for macros and constants.
  • _suffix for private member variables.

SPDX Headers

Every new source file must carry the SPDX header:

// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 Jacek Trefon (www.trefon.com)

Commit Messages

  • Imperative mood. "fix drawer scroll" not "fixed drawer scroll".
  • Scoped prefixes. tui: fix drawer scroll, bench: add scenario.
  • Tests for behavior changes go in tests/run_tests.cpp.

Linting

Both must come back clean before a commit:

make lint     # run clang-tidy over project sources
make analyze  # run cppcheck as a second opinion
amber 0.5.8Apache 2.0C++17
utf-8ncursesJacek Trefon www.trefon.com2026