ros2-style

Enforce ROS2 C++ coding standards with clang-format for STAR project packages.

Updated Aug 23, 2025
One-click install
npx skills add https://github.com/Locked-Inc/STAR --skill ros2-style
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ros2-style
Source: https://github.com/Locked-Inc/STAR/tree/main/.claude/skills/ros2-style
Command: npx skills add https://github.com/Locked-Inc/STAR --skill ros2-style

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive style guide and formatting rules specifically for ROS2 C++ code within the STAR project, ensuring consistency and maintainability.

Core Features & Use Cases

  • Coding Standards: Defines naming conventions for classes, methods, variables, and namespaces.
  • File Organization: Specifies naming conventions and header organization for C++ source and header files.
  • Formatting Rules: Details line length, indentation, and brace style, enforced by clang-format.
  • ROS2 Patterns: Illustrates best practices for Node inheritance, publishers, subscribers, and timers.
  • Error Handling & Logging: Outlines the use of exceptions and ROS2 logging macros.
  • Use Case: A new developer joining the STAR project can use this guide to quickly understand and adhere to the established C++ coding practices for ROS2 components, ensuring their code integrates seamlessly with the existing codebase.

Quick Start

Consult the ros2-style skill for guidance on naming ROS2 C++ variables.

Frequently Asked Questions about ros2-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are the ROS2 C++ coding standards for naming variables and classes?

ROS2 C++ coding standards define specific naming conventions for classes, methods, variables, and namespaces to ensure consistency. Using these standards maintains code clarity and eases integration across ROS2 packages.

How do I format ROS2 C++ source files using clang-format?

You format ROS2 C++ source files by applying clang-format rules that specify line length, indentation, and brace style. This enforces consistency across development and enables automated formatting checks in CI pipelines.

Does the ROS2 style guide cover best practices for Node inheritance and publishers?

Yes, the ROS2 style guide illustrates ROS2 patterns including Node inheritance, publishers, subscribers, and timers. Following these patterns ensures your components integrate seamlessly with the existing ROS2 codebase.

How should I handle error handling and logging in ROS2 C++ development?

Error handling and logging in ROS2 C++ development should utilize exceptions and ROS2 logging macros. Outlining these practices ensures consistent error reporting and maintainable code across the project.

What is the best way to organize C++ header files for a ROS2 package?

The best way to organize C++ header files is following the style guide's file organization rules, which specify header naming and inclusion order. This maintains structural consistency across ROS2 source and header files.

Can I use these formatting rules for CI checks in ROS2 development?

Yes, you can use these formatting rules for CI checks in ROS2 development. The standards are enforced by clang-format, enabling automated formatting validation to ensure code meets project requirements before integration.