new-vda5050-connector
The new-vda5050-connector command scaffolds a complete VDA 5050 v3.0.0 fleet bridge package using Clean Architecture, generating domain entities, application handlers, and infrastructure adapters for MQTT and ROS 2 Navigation. Use this when building an AGV connector or fleet control system that must translate between industry-standard VDA 5050 messages and ROS 2 Nav 2 APIs, supporting both Python (pydantic) and C++ (struct) implementations with full schema validation and test coverage.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/harunkurtdev/ros2-claude-code-template/HEAD/.claude/commands/new-vda5050-connector.md -o ~/.claude/commands/new-vda5050-connector.mdnew-vda5050-connector.md
Scaffold a VDA 5050 connector / fleet bridge package.
Argument handling (`$ARGUMENTS`):
1. `<package>` — new package name (required), created under `src/`.
2. `[lang]` — `python` (pydantic idiom) or `cpp` (struct + nlohmann
idiom). Default `python`.
3. `[side]` — `robot` (AGV side, default) or `fleet` (master control).
If anything is missing, ask before scaffolding.
Process:
1. Read the skill `vda5050_integration`, the format guide
`vda5050_implementation_formats.md`, and the spec
`vda5050_messages.md`. Pick the matching reference impl to mirror:
* python + fleet → `~/nav2_ws/src/isaac_mission_dispatch`
* python/cpp + robot (ROS 2) → `~/nav2_ws/src/isaac_ros_cloud_control`
and the template's `~/nav2_ws/src/vda5050_connector`
* cpp core → `~/nav2_ws/src/vda5050_core`
2. Scaffold the Clean Architecture layout (see `clean_architecture.md`):
* **domain/entities** — message models for `order`, `state`,
`action`, `connection`, `factsheet` (pydantic camelCase, or C++
struct + snake_case). **No MQTT / no `rclpy` / no `*_msgs`.**
* **domain/interfaces** — ports: `MqttClientInterface`,
`NavigationAdapterInterface`.
* **application** — `OrderHandler` (graph traversal, base/horizon,
stitching), `StateAssembler`, `InstantActionHandler` (actionStatus
state machine).
* **infrastructure** — `MqttBridge` (paho / PahoMqttCpp; topic
`vda5050/v3/<mfr>/<serial>/<topic>`, QoS 0 except `connection` QoS 1
+ `CONNECTION_BROKEN` last will; JSON validated against
`~/nav2_ws/src/VDA5050/json_schemas/`), `Nav2Adapter`
(order→`NavigateThroughPoses`, telemetry from `/amcl_pose`,`/odom`,
`/battery_state`), composition-root node.
3. Use **v3.0.0 enum spellings** (`CONNECTION_BROKEN`, `TEACH_IN`,
`SINGLE`, `HIBERNATING`, `RETRIABLE`) — not the v2 spellings in the
reference repos (see the v2→v3 table in
`vda5050_implementation_formats.md`). `version = "3.0.0"`.
4. Wire build files (`setup.py`/`package.xml` for Python;
`CMakeLists.txt`/`package.xml` for C++) and a launch + params file.
5. Add tests: domain entities + handlers without ROS/broker; one
round-trip (order JSON → Nav 2 goal; telemetry → state JSON validated
against the schema).
6. `pre-commit run --files <touched files>`.
7. Print: files created, the layer map, and how to run it against a local
MQTT broker.
Keep the protocol out of the domain (it is an infrastructure concern),
never mutate a released base, and increment `headerId` per topic.Scaffold a Behavior Tree leaf node — plain BehaviorTree.CPP (SyncActionNode / StatefulActionNode / ConditionNode) or a BehaviorTree.ROS2 wrapper (RosActionNode / RosServiceNode / RosTopicPubNode / RosTopicSubNode) — with ports, factory/plugin registration, and XML v4 usage. Trigger when the user asks to write a behavior-tree node (not Nav 2-specific).
Use proactively before opening a PR that adds or changes BehaviorTree.CPP nodes or BehaviorTree.ROS2 wrappers (RosActionNode/RosServiceNode/RosTopicPub/SubNode, TreeExecutionServer). Reviews a diff against BT.CPP v4 conventions — node base-class choice, non-blocking ticks, ports/blackboard typing, factory/plugin registration, XML v4, and the ROS 2 wrapper contract. Returns a punch list with file:line anchors, not a rewrite.
Build the colcon workspace (optionally a single package) and report the outcome.
Use when a design decision touches Clean Architecture boundaries in a ROS 2 project — which layer a new behaviour belongs to, whether a port belongs in domain or application, whether a new node should be lifecycle-managed, whether to compose nodes or split packages. Returns an architectural recommendation with trade-offs, not implementation.
Author a new skill under .claude/skills/<name>/SKILL.md with valid frontmatter, following the template conventions, and index it in CLAUDE.md + README.md.
Use when a design decision touches the gz-sim ECS — where new state should live, which system phase should write it, how to avoid coupling, whether to add a component vs. a member variable, whether a new system should be split or merged with an existing one. Returns an architectural recommendation with trade-offs, not implementation.
Author a new asset for this .claude/ template — a rule, skill, slash command, or sub-agent — following the project's conventions and wiring it into the CLAUDE.md / README.md indexes. Trigger when the user wants to add or extend a command, skill, agent, or rule (make the template itself extensible).
Configure and build gz-sim from source using either CMake/Ninja directly or a colcon workspace. Trigger when the user asks to build, recompile, configure, or set up the gz-sim binary tree.