smithery.ai

tdd-ros2

ROS 2 Test-Driven Development workflow using gtest (C++) and pytest (Python). Enforces 80%+ coverage for critical nodes.

First seen Apr 18, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,329 B
  • docs SUMMARY.md 136 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

ROS 2 TDD Workflow

Core Principles

  1. Tests FIRST: Write gtest or pytest before implementation.
  2. Red-Green-Refactor: Test fail -> Code fix -> Optimize.
  3. Integration: Use launch_testing for node interaction tests.

Workflow

1. Define Requirements (User Story)

"As a robot, I need to stop when obstacle < 0.5m."

2. Write Test Case

C++ (GTest)

TEST_F(SafetyNodeTest, StopsOnObstacle) {
  node_->publish_scan(0.4); // Simulate 0.4m
  auto cmd = node_->get_cmd_vel();
  EXPECT_EQ(cmd.linear.x, 0.0);
}

Python (Pytest)

def test_stop_on_obstacle(safety_node):
    safety_node.publish_scan(0.4)
    cmd = safety_node.get_cmd_vel()
    assert cmd.linear.x == 0.0

3. Run Test (Fail)

colcon test --packages-select my_safety_pkg

4. Implement Logic

Write minimal code in safety_node to pass the test.

5. Verify & Coverage

colcon test --packages-select my_safety_pkg
colcon test-result --all

Tools

  • Unit: amentcmakegtest, amentcmakepytest
  • Integration: launchtesting, osrfpycommon
  • Mocking: gmock (C++), unittest.mock (Python)