This repository is the official VS Code and GitHub Copilot focused fork of the ROS2 Clean Architecture template. It preserves the original architectural goals, restructures the guidance around Copilot-native customization primitives, and now adds a neutral AGENTS.md layer so the template is not coupled to a single tool surface.
The template is meant for ROS2 projects that want:
- Clean Architecture boundaries that stay intact while features grow
- consistent ROS2 patterns in Python and C++
- better context management for GitHub Copilot inside VS Code
- reusable guidance for nodes, launch files, messaging, lifecycle handling, testing, TF2, diagnostics, and bagging
The old Claude-centric layout has been replaced by a Copilot-centric layout:
AGENTS.mdnow holds the durable, tool-neutral engineering contract.github/copilot-instructions.mdis the always-on workspace instruction file.github/instructions/holds targeted, task-specific guidance that Copilot can load only when needed.github/agents/holds specialized Copilot personas for backend work, frontend-facing work, and integration review.github/skills/holds reusable deep-dive workflows and templates for common ROS2 tasks- the former
rulesandcommandscontent is now expressed as instruction files so context stays narrower and easier for Copilot to route
This template is optimized for selective context loading rather than loading every rule up front.
- Start with
AGENTS.mdfor the durable engineering contract. - Read
.github/copilot-instructions.mdfor the repository-wide Copilot operating model. - Load only the instruction file that matches the task.
- Load a skill or custom agent only when the task needs a reusable workflow or a narrower persona.
That keeps prompts smaller and reduces irrelevant context during normal development.
AGENTS.md
.github/
├── copilot-instructions.md
├── agents/
│ ├── frontend-ui.agent.md
│ ├── integration-review.agent.md
│ └── ros-backend.agent.md
├── instructions/
│ ├── context-routing.instruction.md
│ ├── clean-architecture.instruction.md
│ ├── ros2-packages-and-nodes.instruction.md
│ ├── ros2-communication.instruction.md
│ ├── ros2-launch-and-lifecycle.instruction.md
│ ├── ros2-testing.instruction.md
│ ├── robot-description-and-tf.instruction.md
│ └── ros2-runtime-workflows.instruction.md
└── skills/
├── ros2_node_creation/
├── ros2_launch_config/
├── ros2_service_action/
├── ros2_messaging/
├── ros2_testing/
├── ros2_lifecycle/
├── ros2_transforms/
├── ros2_diagnostics/
└── ros2_bag/
Use .github/instructions/ for targeted guidance:
context-routing.instruction.md: how Copilot should choose the smallest relevant contextclean-architecture.instruction.md: domain, application, infrastructure, and presentation boundariesros2-packages-and-nodes.instruction.md: package structure, naming, parameters, logging, and node layoutros2-communication.instruction.md: topics, QoS, messages, services, and actionsros2-launch-and-lifecycle.instruction.md: launch composition and lifecycle node behaviorros2-testing.instruction.md: unit, integration, and launch testing strategyrobot-description-and-tf.instruction.md: URDF, xacro, TF2, and robot frame guidanceros2-runtime-workflows.instruction.md: build, test, sourcing, introspection, and debugging commands
Use .github/agents/ when a task benefits from a narrower specialist persona:
ros-backend: ROS2 package, node, messaging, launch, lifecycle, and test workfrontend-ui: frontend-facing integration work with explicit backend contractsintegration-review: end-to-end review of contracts, validation, and architectural fit
Use .github/skills/ when Copilot needs a task-focused workflow rather than a general rule set:
ros2_node_creation: create or refactor ROS2 nodes and package scaffoldingros2_launch_config: structure launch files and parameter loadingros2_service_action: implement service and action patternsros2_messaging: build publishers, subscribers, and message mapping layersros2_testing: add tests across the ROS2 testing pyramidros2_lifecycle: implement managed nodes and state transitionsros2_transforms: integrate TF2 without leaking framework dependencies into the domainros2_diagnostics: add diagnostics and health monitoringros2_bag: record, replay, and inspect ROS2 bag data
Open the repository in VS Code and work with Copilot in natural language. For best results:
- Describe the ROS2 task directly.
- Mention the architectural layer or package when it matters.
- Ask for a specific skill when you want scaffolded output.
- Keep requests scoped to one subsystem when possible.
Examples:
- "Create a lifecycle-enabled Python sensor node using the
ros2_node_creationskill." - "Refactor this publisher/subscriber flow to keep ROS2 message mapping in infrastructure only."
- "Add launch tests for this package using the testing instruction and the
ros2_testingskill."
- Domain code stays free of ROS2 dependencies.
- Application code orchestrates use cases and ports.
- Infrastructure code owns ROS2 nodes, adapters, message conversions, and hardware integration.
- Presentation code depends inward.
- Tests and documentation move with meaningful interface changes.
This project remains available under the Apache 2.0 License.