new_ros2_package

Scaffolds ROS 2 packages with a Clean Architecture directory layout in colcon workspaces.

Updated Aug 16, 2026
One-click install
npx skills add https://github.com/three1324/yeonjinautomotive --skill new-ros2-package-three1324
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new_ros2_package
Source: https://github.com/three1324/yeonjinautomotive/tree/main/.claude/skills/new_ros2_package
Command: npx skills add https://github.com/three1324/yeonjinautomotive --skill new-ros2-package-three1324

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Creating a new ROS 2 package by hand produces inconsistent structures, missing install rules, and packages that fail colcon builds or lack test wiring from day one. ## Core Features & Use Cases - Package Scaffolding: Generates ament_python or ament_cmake skeletons via ros2 pkg create, then restructures them into domain, application, infrastructure, and presentation layers. - Build Configuration: Provides ready-made package.xml dependencies, setup.py data_files and entry_points, and CMakeLists.txt install and test rules. - Interfaces-First Workflow: Guides creation of a separate <name>_msgs package with rosidl_default_generators before the implementation package when custom messages are needed. - Use Case: When starting a new perception or control node for a robot, run this recipe to get a compiling, lint-clean, test-ready package before writing any behavior. ## Quick Start Ask the assistant to create a new ROS 2 package named my_planner using ament_python in the current colcon workspace following the Clean Architecture template.

Frequently Asked Questions about new_ros2_package

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

FAQPage Schema
How do I create a new ROS 2 package in a colcon workspace?

Run ros2 pkg create with --build-type ament_python or ament_cmake from the workspace src directory, then restructure the output into domain, application, infrastructure, and presentation layers. Verify the skeleton compiles with colcon build before adding behavior.

Should I use ament_python or ament_cmake for a ROS 2 package?

Choose ament_cmake for packages with heavy computation, hardware drivers, or Nav2 plugins. Choose ament_python for application-level orchestrators such as lifecycle launchers, mission scripts, and glue code.

How do I add custom messages to a ROS 2 package?

Create a separate <name>_msgs package first using ament_cmake with rosidl_default_generators, then have the implementation package depend on it. Build and verify the interfaces package before downstream packages, or they will fail loudly.

Why does my new ROS 2 package fail colcon test?

Missing ament_lint_auto and ament_lint_common test dependencies in package.xml are a common cause. Add both as test_depend entries and include a placeholder smoke test so colcon test is meaningful from the start.

What install rules does a Python ROS 2 package need in setup.py?

The data_files list must install the resource marker, package.xml, launch files into share/<name>/launch, and config YAML files into share/<name>/config. Console script entry points are added when the first node is created.