Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ROS2 Diagnostics and Health Monitoring with Clean Architecture (Python & C++)
.claude/skills/harunkurtdev-ros2-diagnostics/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -15% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -2% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-21 | ✓→✓ | = Same ✓ | 16% | 0% |
This skill demonstrates how to integrate standard ROS2 diagnostics tools for health monitoring within a Clean Architecture.
python# domain/entities/health.py class HealthLevel(Enum): OK = 0 WARN = 1 ERROR = 2 STALE = 3 @dataclass class ComponentHealth: name: str level: HealthLevel message: str values: dict
See previous Python example using diagnostic_updater.
Using diagnostic_updater package in C++.
cpp// infrastructure/ros2/diagnostics/diagnostics_manager.hpp #pragma once #include <rclcpp/rclcpp.hpp> #include <diagnostic_updater/diagnostic_updater.hpp> #include "domain/interfaces/diagnostics_port.hpp" namespace infrastructure::ros2::diagnostics { class DiagnosticsManager { public: explicit DiagnosticsManager(rclcpp::Node::SharedPtr node) : node_(node), updater_(node) { updater_.setHardwareID(node->get_name()); } void register_monitor(const std::string& name, std::function<void(diagnostic_updater::DiagnosticStatusWrapper&)> callback) { updater_.add(name, callback); } // Example callback wrapper for domain entities void check_component(diagnostic_updater::DiagnosticStatusWrapper& stat) { // Retrieve health from domain service // auto health = domain_service_->get_health(); // stat.summary(health.level, health.message); // stat.add("temp", health.value); } private: rclcpp::Node::SharedPtr node_; diagnostic_updater::Updater updater_; }; } // namespace
cpp// infrastructure/ros2/diagnostics/frequency_monitor.hpp #include <diagnostic_updater/publisher.hpp> // For TopicDiagnostic class FrequencyMonitor { public: FrequencyMonitor(diagnostic_updater::Updater& updater, const std::string& topic_name, double min_freq, double max_freq) { diagnostic_updater::FrequencyStatusParam freq_param(&min_freq, &max_freq, 0.1, 10); monitor_ = std::make_unique<diagnostic_updater::HeaderlessTopicDiagnostic>( topic_name, updater, freq_param); } void tick() { monitor_->tick(); } private: std::unique_ptr<diagnostic_updater::HeaderlessTopicDiagnostic> monitor_; };
cpp// application/services/motor_controller.cpp void MotorController::check_temp(diagnostic_updater::DiagnosticStatusWrapper& stat) { double temp = read_temp(); if (temp > 80.0) { stat.summary(diagnostic_msgs::msg::DiagnosticStatus::ERROR, "Overheating"); } else { stat.summary(diagnostic_msgs::msg::DiagnosticStatus::OK, "Normal"); } stat.add("temp", temp); }
TopicDiagnostic to monitor publication rates.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-21 | pass→pass | 10,003 | 6,839 | -32% | 1 | 1 | 0% | 1,818 | 2,112 | +16% | 0 | 0 | — |
case-22 | pass→pass | 17,496 | 13,116 | -25% | 1 | 1 | 0% | 3,635 | 3,488 | -4% | 0 | 0 | — |
case-01 | fail→pass | 19,653 | 12,439 | -37% | 1 | 1 | 0% | 3,938 | 3,342 | -15% | 0 | 0 | — |
case-02 | pass→pass | 16,318 | 14,034 | -14% | 1 | 1 | 0% | 3,050 | 3,519 | +15% | 0 | 0 | — |
case-03 | pass→pass | 13,499 | 10,066 | -25% | 1 | 1 | 0% | 2,315 | 2,800 | +21% | 0 | 0 | — |
case-04 | pass→pass | 11,307 | 9,225 | -18% | 1 | 1 | 0% | 2,130 | 2,572 | +21% | 0 | 0 | — |
case-05 | pass→pass | 12,412 | 10,283 | -17% | 1 | 1 | 0% | 2,664 | 2,974 | +12% | 0 | 0 | — |
case-18 | pass→pass | 8,936 | 5,736 | -36% | 1 | 1 | 0% | 1,798 | 1,971 | +10% | 0 | 0 | — |
case-06 | pass→pass | 12,761 | 8,840 | -31% | 1 | 1 | 0% | 2,370 | 2,443 | +3% | 0 | 0 | — |
case-07 | pass→pass | 14,999 | 13,257 | -12% | 1 | 1 | 0% | 2,787 | 3,294 | +18% | 0 | 0 | — |
case-08 | fail→fail | 12,085 | 7,857 | -35% | 1 | 1 | 0% | 2,243 | 2,286 | +2% | 0 | 0 | — |
case-09 | fail→pass | 14,029 | 9,011 | -36% | 1 | 1 | 0% | 2,644 | 2,603 | -2% | 0 | 0 | — |
case-19 | fail→pass | 5,871 | 4,266 | -27% | 1 | 1 | 0% | 1,070 | 1,589 | +49% | 0 | 0 | — |
case-10 | pass→pass | 5,627 | 4,422 | -21% | 1 | 1 | 0% | 919 | 1,549 | +69% | 0 | 0 | — |
case-11 | pass→pass | 8,118 | 4,441 | -45% | 1 | 1 | 0% | 1,412 | 1,639 | +16% | 0 | 0 | — |
case-12 | pass→pass | 3,317 | 2,378 | -28% | 1 | 1 | 0% | 526 | 1,217 | +131% | 0 | 0 | — |
case-13 | pass→pass | 11,956 | 8,559 | -28% | 1 | 1 | 0% | 2,099 | 2,580 | +23% | 0 | 0 | — |
case-20 | pass→pass | 14,277 | 12,543 | -12% | 1 | 1 | 0% | 2,882 | 3,259 | +13% | 0 | 0 | — |
case-14 | fail→pass | 15,426 | 16,506 | +7% | 1 | 1 | 0% | 2,917 | 4,000 | +37% | 0 | 0 | — |
case-15 | pass→pass | 4,009 | 3,718 | -7% | 1 | 1 | 0% | 666 | 1,438 | +116% | 0 | 0 | — |
case-16 | pass→pass | 7,947 | 6,456 | -19% | 1 | 1 | 0% | 1,336 | 1,983 | +48% | 0 | 0 | — |
case-17 | pass→pass | 15,890 | 10,929 | -31% | 1 | 1 | 0% | 2,974 | 3,001 | +1% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +18 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.