tdd-ros2

Establish test-first workflows for ROS 2 nodes using gtest and pytest.

8|2|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/p1tl0rd/antigravity-ros2-skills --skill tdd-ros2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-ros2
Source: https://github.com/p1tl0rd/antigravity-ros2-skills/tree/main/.agent/skills/tdd-ros2
Command: npx skills add https://github.com/p1tl0rd/antigravity-ros2-skills --skill tdd-ros2

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

ROS 2 development often faces brittle behavior due to insufficient testing. This skill defines a test-driven workflow combining gtest for C++ and pytest for Python to ensure critical ROS 2 nodes are validated from the outset.

Core Features & Use Cases

  • Test-First Development: Write unit and integration tests before implementing features to guide design.
  • Multi-Language Coverage: Use gtest for C++ nodes and pytest for Python nodes, with launch_testing for integration.
  • Quality & Compliance: Enforce 80%+ test coverage for critical nodes and enable red-green-refactor cycles.

Quick Start

Run the ROS 2 TDD workflow to validate a new node with gtest and pytest.

Frequently Asked Questions about tdd-ros2

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

FAQPage Schema
How do I set up test-driven development for ROS 2 nodes?

You establish a test-first workflow for ROS 2 nodes by writing gtest and pytest tests before implementation. This approach uses launch_testing for integration validation to guide node design and ensure reliable behavior from the outset.

Why does my ROS 2 package behavior remain brittle during integration?

ROS 2 package brittleness often stems from insufficient testing. Applying a test-driven workflow with gtest for C++ and pytest for Python validates critical nodes from the outset, preventing unexpected integration failures.

Can I use pytest and gtest together for ROS 2 package testing?

Yes, you can use pytest and gtest together for ROS 2 package testing. Gtest handles C++ nodes while pytest validates Python nodes, and launch_testing integrates them for comprehensive coverage.

What's the best way to enforce code coverage in ROS 2 projects?

The best way to enforce code coverage in ROS 2 is applying a TDD workflow with continuous validation. This approach maintains 80% or higher test coverage for critical nodes using gtest and pytest.

How do I run red-green-refactor cycles in a ROS 2 environment?

You run red-green-refactor cycles in a ROS 2 environment by integrating gtest, pytest, and launch_testing. This workflow enforces writing failing tests first, implementing features, and refining code while maintaining 80%+ coverage.