Agent skill

Ros2 Robotics

by Mindrally in Mindrally/skills

Best practices for ROS 2 robotics development, covering package structure, nodes, topics/services/actions, launch files, QoS, tf2 transforms, and testing.

Apache-2.0Auto-check passed

Install Ros2 Robotics

skills CLI
$ npx skills add Mindrally/skills --skill ros2-robotics -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Mindrally/skills ros2-robotics --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Mindrally/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/ros2-robotics .claude/skills/ros2-robotics && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ros2-robotics
GitHub stars
269
Token cost
~2k tokens
SKILL.md length
739 words
Files
1
Skills in repo
34
Repo updated
First seen
Licence
Apache-2.0

At a glance

Best practices for ROS 2 robotics development, covering package structure, nodes, topics/services/actions, launch files, QoS, tf2 transforms, and testing.

  • Works in 8 steps: Scaffold the package — Run ros2 pkg… → Define interfaces — Add custom .msg,… → Implement nodes — Write focused,… → …
  • Creating ROS 2 packages
  • SKILL.md covers Workflow for Building a ROS 2…, Package Structure, Nodes and Interfaces and Timing and Frames, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Ros2 Robotics is an agent skill from Mindrally/skills. Best practices for ROS 2 robotics development, covering package structure, nodes, topics/services/actions, launch files, QoS, tf2 transforms, and testing. Use when creating ROS 2 packages, writing nodes in rclpy or rclcpp, defining custom messages/services/actions, writing launch files, configuring QoS profiles, working with tf2 transforms, or building and testing a colcon workspace.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with C++ and Python. The repository describes itself as: 265+ Claude Code skills for every major framework and language. Install with: npx skills add Mindrally/skills. The licence is Apache-2.0.

When your agent uses it

  • Creating ROS 2 packages
  • Writing nodes in rclpy
  • Defining custom messages/services/actions
  • Writing launch files

Example prompts

  • “/ros2-robotics”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Scaffold the package — Run ros2 pkg create --build-type ament_python (Python) or --build-type ament_cmake (C++) inside a colcon…
  2. Define interfaces — Add custom .msg, .srv, or .action files under msg/, srv/, action/ only when a standard interface (std_msgs…
  3. Implement nodes — Write focused, composable nodes; declare parameters explicitly; choose topics for streams, services for quick…
  4. Write launch files — Compose nodes, parameters, and remappings in a launch/*.launch.py file using launch_ros.actions.Node.
  5. Set QoS profiles intentionally — Match publisher/subscriber QoS (reliability, durability, history depth) for sensor data vs…
  6. Build the workspace — Run colcon build --symlink-install from the workspace root, then source install/setup.bash.
  7. Test — Add unit tests (pytest for Python, gtest/launch_testing for C++/integration) and run colcon test.
  8. Run and inspect — Use ros2 run, ros2 launch, ros2 topic echo, ros2 node info, and ros2 doctor to verify runtime behavior.

What it can do on your machine

Read from SKILL.md and the folder at commit 7682ca7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ros2 Robotics loads about 2k tokens when it runs. Until then it costs about 100 tokens; SKILL.md has 739 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~100
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Mindrally/skills at commit 7682ca7, republished under its Apache-2.0 licence (© Mindrally). 739 words, ~2,021 tokens.

Download SKILL.mdSave it as .claude/skills/ros2-robotics/SKILL.md (or your agent's skills folder).
name
ros2-robotics
description
Best practices for ROS 2 robotics development, covering package structure, nodes, topics/services/actions, launch files, QoS, tf2 transforms, and testing. Use when creating ROS 2 packages, writing nodes in rclpy or rclcpp, defining custom messages/services/actions, writing launch files, configuring QoS profiles, working with tf2 transforms, or building and testing a colcon workspace.
metadata.maintainer
Mindrally
metadata.source
https://github.com/Mindrally/skills

ROS 2 Robotics Development

This skill covers building ROS 2 packages and nodes, including package structure, communication patterns (topics, services, actions), timing and frames, build/test workflows with colcon, and common pitfalls in robotics software.

Workflow for Building a ROS 2 Package

  1. Scaffold the package — Run ros2 pkg create --build-type ament_python <name> (Python) or --build-type ament_cmake <name> (C++) inside a colcon workspace's src/ directory.
  2. Define interfaces — Add custom .msg, .srv, or .action files under msg/, srv/, action/ only when a standard interface (std_msgs, geometry_msgs, sensor_msgs, nav_msgs) doesn't fit.
  3. Implement nodes — Write focused, composable nodes; declare parameters explicitly; choose topics for streams, services for quick request/response, and actions for long-running goals with feedback and cancellation.
  4. Write launch files — Compose nodes, parameters, and remappings in a launch/*.launch.py file using launch_ros.actions.Node.
  5. Set QoS profiles intentionally — Match publisher/subscriber QoS (reliability, durability, history depth) for sensor data vs. command/control paths.
  6. Build the workspace — Run colcon build --symlink-install from the workspace root, then source install/setup.bash.
  7. Test — Add unit tests (pytest for Python, gtest/launch_testing for C++/integration) and run colcon test.
  8. Run and inspect — Use ros2 run, ros2 launch, ros2 topic echo, ros2 node info, and ros2 doctor to verify runtime behavior.

Package Structure

  • Keep each package focused on one robot capability or integration boundary (e.g., lidar_driver, path_planner, arm_controller) rather than a monolithic package.
  • Use package.xml consistently with the build type declared in it, and either CMakeLists.txt (ament_cmake, C++) or setup.py/setup.cfg (ament_python).
  • Organize files with launch/ for launch scripts, config/ for YAML parameter files, msg/ for message definitions, srv/ for services, action/ for actions, and urdf//xacro/ for robot descriptions.
  • Use namespaces and topic remapping instead of hardcoded topic names whenever a node might run multiple times (e.g., multi-robot setups) or be reused across projects.
  • Declare all dependencies explicitly in package.xml (<depend>, <exec_depend>, <build_depend>) so the workspace builds reproducibly.

Nodes and Interfaces

  • Keep nodes small and composable — one node per logical responsibility, wired together via topics/services/actions rather than one giant node doing everything.
  • Declare ROS 2 parameters explicitly with self.declare_parameter('rate_hz', 10.0) and read them with self.get_parameter('rate_hz').value; never rely on undeclared parameters.
  • Prefer messages (topics) for continuous state streams, services for quick, blocking request/response operations, and actions for long-running goals that report feedback and support cancellation/preemption.
  • Use standard message types (geometry_msgs/Twist, sensor_msgs/LaserScan, nav_msgs/Odometry) before creating custom interfaces — custom types fragment the ecosystem and lose compatibility with existing tools.
  • Document topic, service, action, frame, and parameter contracts (name, type, units, frame_id, update rate) in the package README or node docstring.
Example: A Minimal rclpy Publisher Node
python
import rclpy
from rclpy.node import Node
from rclpy.qos import QoSProfile, ReliabilityPolicy, HistoryPolicy
from geometry_msgs.msg import Twist


class SafeVelocityPublisher(Node):
    """Publishes bounded velocity commands at a fixed rate."""

    def __init__(self) -> None:
        super().__init__("safe_velocity_publisher")

        self.declare_parameter("rate_hz", 10.0)
        self.declare_parameter("max_linear_speed", 0.5)
        rate_hz = self.get_parameter("rate_hz").value
        self._max_linear = self.get_parameter("max_linear_speed").value

        # Reliable QoS for a low-rate command topic; sensor streams would
        # typically use BEST_EFFORT with a shallow history instead.
        qos = QoSProfile(
            reliability=ReliabilityPolicy.RELIABLE,
            history=HistoryPolicy.KEEP_LAST,
            depth=10,
        )
        self._publisher = self.create_publisher(Twist, "cmd_vel", qos)
        self._timer = self.create_timer(1.0 / rate_hz, self._on_timer)
        self._target_linear = 0.0

    def _on_timer(self) -> None:
        msg = Twist()
        msg.linear.x = max(-self._max_linear, min(self._max_linear, self._target_linear))
        self._publisher.publish(msg)


def main(args: list | None = None) -> None:
    rclpy.init(args=args)
    node = SafeVelocityPublisher()
    try:
        rclpy.spin(node)
    except KeyboardInterrupt:
        pass
    finally:
        node.destroy_node()
        rclpy.shutdown()


if __name__ == "__main__":
    main()
Show full SKILL.md (317 more words)Show less

Timing and Frames

  • Use ROS time (self.get_clock().now(), and use_sim_time when a simulation clock is in play) instead of wall-clock time whenever simulation or bag replay matters.
  • Use tf2 (tf2_ros.Buffer + TransformListener) for all frame transforms; never hand-roll coordinate transforms between named frames.
  • Document frame names (base_link, odom, map, sensor frames) and their conventions (REP-103 for axis orientation, REP-105 for the map→odom→base_link tree).
  • Avoid blocking callbacks in a node's executor thread — move long-running work to timers, a MultiThreadedExecutor, worker threads, or actions so the node keeps servicing other callbacks.
  • Set QoS profiles intentionally: BEST_EFFORT/volatile for high-rate sensor data where dropped samples are acceptable, RELIABLE/TRANSIENT_LOCAL for latched-like configuration topics, and RELIABLE/volatile for command paths.

Build and Test

  • Use colcon build (typically --symlink-install during development) and keep inter-package dependencies explicit in package.xml.
  • Run the linters and formatters the workspace already uses — ament_flake8, ament_pep257 for Python; ament_cpplint, ament_uncrustify for C++ — via colcon test.
  • Add launch_testing-based integration tests for multi-node behavior (e.g., "does node A receive what node B publishes within N seconds").
  • Use simulation (Gazebo/Ignition), recorded rosbags, or fixture data for repeatable sensor scenarios instead of relying on live hardware for every test run.
  • Explicitly test failure cases: missing/late transforms (tf2.LookupException), stale sensor data, and services or actions that are unavailable when called.

Common Mistakes

  • Hardcoding absolute filesystem paths instead of resolving them via ament_index_python.packages.get_package_share_directory.
  • Publishing velocity or actuator commands without validating frame_id, units, and timestamp freshness — a stale or wrong-frame command can move a robot unsafely.
  • Creating a custom message/service/action type when an existing standard interface already models the data.
  • Ignoring QoS incompatibility warnings between a publisher and subscriber (e.g., a BEST_EFFORT publisher with a RELIABLE subscriber) — the connection silently never delivers data.
  • Doing significant work inside a subscription callback without offloading it, starving the executor and delaying other callbacks (including safety-critical ones).
  • Forgetting use_sim_time:=true when running against a simulator, causing timestamps and tf2 lookups to disagree with the simulated clock.

© Mindrally, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in ros2-robotics of Mindrally/skills.

Open the folder on GitHubat commit 7682ca7

Compare with similar skills

Ros2 Robotics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ros2 Robotics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ros2 Robotics this skillMindrally/skills269—~2kAutomated safety check: PassApache-2.0
Paddle BuildPaddlePaddle/Paddle24k—~1kAutomated safety check: PassApache-2.0
Fory Releaseapache/fory4.6k—~2.9kAutomated safety check: PassApache-2.0
CodeQL Security Scantrailofbits/skills7.4k—~4.6kAutomated safety check: NotesCC-BY-SA-4.0
pybind11 Release Preparationpybind/pybind1118k—~1.7kAutomated safety check: PassCustom licence
Paddle Eager GraphPaddlePaddle/Paddle24k—~562Automated safety check: PassApache-2.0

Similar skills

  • Paddle Build

    PaddlePaddle/Paddle

    A skill your agent uses when needing to compile, rebuild, or install Paddle from source after code changes.

    24k GitHub stars~1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Fory Release

    apache/fory

    Prepare an Apache Fory release candidate from a clean release branch, including the version bump, RC tag, JVM staging, ASF source artifacts, SVN upload, and vote email.

    4.6k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • CodeQL Security Scan

    trailofbits/skills

    Official

    Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.

    7.4k GitHub stars~4.6k tokensUpdated 2 days ago
    SecurityAuto-check: notes
  • Opens the pybind11 release-preparation pull request: picking the release base, bumping the version in common.h and integrating the changelog, following docs/release.rst.

    18k GitHub stars~1.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Paddle Eager Graph

    PaddlePaddle/Paddle

    A skill your agent uses when navigating Paddle eager-mode (dynamic graph) source code, tracing forward/backward execution, debugging autograd issues, understanding PyLayer, or investigating…

    24k GitHub stars~562 tokensUpdated today
    DevelopmentAuto-check passed
  • Onnxtxt

    onnx/onnx

    Read or write ONNX text format ("onnxtxt"). An agent skill from onnx/onnx.

    22k GitHub stars~1.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from Mindrally/skills

All 34 skills in this repo
  • Analytics Data Analysis

    Mindrally/skills

    Best practices for analytics, data analysis, and visualization using Python, pandas, matplotlib, seaborn, and Jupyter notebooks.

    269 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Best practices for AutoML and hyperparameter search with Optuna, Ray Tune, and PyCaret, covering search-space design, validation splits, and leakage prevention.

    269 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Blender Python Addon

    Mindrally/skills

    Best practices for writing Blender Python add-ons using the bpy API, covering operators, panels, properties, registration, and API-safe scripting.

    269 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Expert guidelines for Chrome extension development with Manifest V3, covering security, performance, and best practices.

    269 GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Clean Code

    Mindrally/skills

    Clean, maintainable, human-readable code principles combined with anti-over-engineering discipline: naming, single responsibility, DRY, and scoping changes to exactly what was requested.

    269 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Design Systems

    Mindrally/skills

    Comprehensive design system guidelines for building consistent, accessible, and scalable component libraries.

    269 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Ros2 Robotics

What does Ros2 Robotics do?

Best practices for ROS 2 robotics development, covering package structure, nodes, topics/services/actions, launch files, QoS, tf2 transforms, and testing. Ros2 Robotics is an agent skill from Mindrally/skills. Best practices for ROS 2 robotics development, covering package structure, nodes, topics/services/actions, launch files, QoS, tf2 transforms, and testing.

When should I use Ros2 Robotics?

Ros2 Robotics fits situations like: creating ROS 2 packages; writing nodes in rclpy; defining custom messages/services/actions; writing launch files.

How do I install Ros2 Robotics in Claude Code?

Run `npx skills add Mindrally/skills --skill ros2-robotics -a claude-code`. Or copy the skill folder (ros2-robotics in Mindrally/skills) into .claude/skills/ros2-robotics in your project. Claude Code loads it when a task matches its description.

How do I install Ros2 Robotics in Codex?

Run `npx skills add Mindrally/skills --skill ros2-robotics -a codex`. Or copy the skill folder (ros2-robotics in Mindrally/skills) into .agents/skills/ros2-robotics in your project. Codex loads it when a task matches its description.

Can I use Ros2 Robotics in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Mindrally/skills --skill ros2-robotics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ros2-robotics, .gemini/skills/ros2-robotics, .github/skills/ros2-robotics and .opencode/skills/ros2-robotics in your project.

What does Ros2 Robotics need to run?

SKILL.md names no scripts, command-line tools or credentials: Ros2 Robotics is instructions for the agent only. Our summary lists: Python 3.

Does Ros2 Robotics access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Ros2 Robotics safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ros2 Robotics use?

Ros2 Robotics is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ros2 Robotics use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ros2 Robotics?

Skills that share tags, products or a category with Ros2 Robotics: Paddle Build (PaddlePaddle/Paddle, 24k stars), Fory Release (apache/fory, 4.6k stars), CodeQL Security Scan (trailofbits/skills, 7.4k stars) and pybind11 Release Preparation (pybind/pybind11, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ros2 Robotics?

Mindrally (a GitHub organization) maintains it in Mindrally/skills, which has 269 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on October 8, 2026.

Source: Mindrally/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.