How to generate a production-ready ROS2 node from a spec
Quando usar: You're about to write a new node and want clean lifecycle + tests from the start.
Pré-requisitos
- Skill installed — git clone https://github.com/arpitg1304/robotics-agent-skills ~/.claude/skills/robotics-agent-skills
- ROS2 Humble+ on PATH — Follow docs.ros.org install
Fluxo
-
Describe the nodeCreate a ROS2 Humble node that subscribes to /scan (LaserScan), filters obstacles, and publishes /cmd_vel using a state machine.✓ Copiado→ Node with clear class separation, lifecycle hooks, param declarations
-
Ask for testsWrite pytest unit tests for the filter logic and a launch_test for the integration.✓ Copiado→ Tests runnable via colcon test
-
PackageProduce package.xml and CMakeLists.txt with correct dependencies.✓ Copiado→ colcon build succeeds
Resultado: A ROS2 package that passes colcon build + test with meaningful coverage.
Armadilhas
- Claude mixes ROS1 and ROS2 APIs — State version explicitly in the prompt every time — 'ROS2 Humble'
- Node lacks shutdown handling — Ask for on_shutdown hooks and SIGTERM cleanup specifically