ros2-clean-architecture

Organizes ROS2 projects into layered architecture separating domain, application, infrastructure, and presentation concerns.

Updated May 3, 2026
One-click install
npx skills add https://github.com/elliewlh2094/codex-robotics-skills --skill ros2-clean-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ros2-clean-architecture
Source: https://github.com/elliewlh2094/codex-robotics-skills/tree/main/.agents/skills/ros2-clean-architecture
Command: npx skills add https://github.com/elliewlh2094/codex-robotics-skills --skill ros2-clean-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of organizing ROS2 project code into a clear, scalable structure that separates concerns and facilitates testing.

Core Features & Use Cases

  • Defines a layered architecture with presentation, application, domain, and infrastructure layers.
  • Provides best practices for dependency rules, directory layouts, and interface design.
  • Use Case: Design a complex ROS2 package that involves multiple nodes, domain logic, and hardware integrations, ensuring each component is independently testable and maintainable.

Quick Start

Use the ros2-clean-architecture skill to structure your ROS2 package following the prescribed layered approach for better testing and scalability.

Frequently Asked Questions about ros2-clean-architecture

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

FAQPage Schema
How do I structure a ROS2 project for testability and maintainability?

Structure ROS2 projects for testability by adopting a layered architecture that separates concerns into presentation, application, domain, and infrastructure layers. This ensures strict dependency inversion, keeping domain logic independent and easily testable.

What is the best way to organize complex ROS2 packages with multiple interacting components?

Organize complex ROS2 packages by dividing them into presentation, application, domain, and infrastructure layers. This enforces strict separation of concerns between nodes, domain logic, and hardware integrations, ensuring components remain independently maintainable.

Does layered design work for ROS2 codebases involving hardware integrations?

Layered design works for ROS2 codebases by isolating hardware integrations within the infrastructure layer. This dependency rule keeps domain logic and application layers decoupled from specific hardware, allowing complex packages to scale without sacrificing testability.

Can I apply dependency inversion to separate domain logic from ROS2 nodes?

Apply dependency inversion in ROS2 projects to separate domain logic from nodes by placing logic in the domain layer. Application and presentation layers handle node interactions, ensuring domain components are independently testable without requiring a running ROS2 environment.

When do I need a layered architecture for my ROS2 software project?

You need layered architecture for ROS2 software projects when developing large, complex packages with multiple interacting components. It provides best practices for directory layouts and interface design to prevent tangled dependencies as the codebase scales.

Why does my ROS2 package lack modularity when adding multiple nodes and domain logic?

ROS2 packages lack modularity when domain logic and node interactions are tangled without strict separation of concerns. Implementing a layered architecture with dependency rules isolates domain logic, application orchestration, and infrastructure to restore independent testability.