llnl/smith/cpp-style
Claude Code and agent skill by llnl/smith
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
C++ coding style and naming conventions for Smith (primarily src/smith), including formatting via the CMake `style` target.
Install
npx vskill@latest install llnl/smith/cpp-styleSKILL.md
Smith C++ Style & Naming
Use this skill when adding or editing C++ in src/smith/ and examples/. Do not use this for tribol, mfem, or axom.
Formatting (clang-format)
- Smith uses repo-root
.clang-format(Google-derived,ColumnLimit: 120, includes are not auto-sorted). - Prefer letting formatting be enforced by the build-system target instead of hand-formatting.
Run auto-format (from an existing build directory):
File structure
- License header: Keep the existing copyright + SPDX block at the top of C++ files.
- Header guards: Use
#pragma oncefor headers. - Doxygen file header: Use a
/** ... */block with@fileand@brief. - Namespaces: Prefer nested namespaces like
namespace smith::input { ... }. - Namespace closing comment: Close with
} // namespace smith::input(match the opened namespace). - Trailing newline: Ensure each file ends with a newline.
Includes
.clang-format has SortIncludes: false, so keep the project’s existing conventions:
- In a
.cpp, include the corresponding header first (e.g.,#include "smith/foo.hpp"). - Include
smith/smith_config.hppbefore any Smith headers. - Group includes with blank lines (typical grouping: C++ standard library, third-party, Smith headers).
- Don’t churn includes solely to “sort” them; keep diffs minimal and consistent.
- Use
// clang-format off/// clang-format ononly for tightly controlled formatting blocks (e.g., initializer tables).
Naming conventions (as used in src/smith)
- Namespaces:
smithat the root; submodules usesmith::<module>. - Types (
class,struct,enum class,usingaliases):PascalCase(e.g.,SolidMechanicsContact). - Functions/methods:
camelCase(e.g.,defineAndParse,findMeshFilePath). - Local variables / parameters:
snake_case(e.g.,input_file_path,restart_cycle). - Data members:
snake_case_trailing underscore (e.g.,contact_,use_warm_start_). - Macros / compile options:
SCREAMING_SNAKE_CASE(e.g.,MFEM_USE_MPI,SMITH_MARK_FUNCTION). - Constants: prefer
SCREAMING_SNAKE_CASEwhen it’s part of a type’s API (e.g.,NUM_STATE_VARS); for small localconstexprvalues, use a descriptive name that reads well at the callsite.
Comments & documentation
- Prefer Doxygen-style docstrings for public APIs:
@brieffor summary@param[in]/@param[in,out]for parameters@tparamfor template parameters- Use
///for short Doxygen comments on declarations when a full block is overkill.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cpp-style/SKILL.md
Popularity
- Repository stars
- 234
- Repository forks
- 35
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 24 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/llnl/smith/cpp-style)