Skip to main content
ClaudeWave
ES, Spanish
Slash Command215 estrellas del repoactualizado 4mo ago

new-package

The new-package slash command scaffolds a ROS 2 package (ament_python or ament_cmake) under the src/ directory with a Clean Architecture folder structure separating domain, application, infrastructure, and presentation layers. Use this command when starting a new ROS 2 package to establish a standardized, maintainable codebase organization with required directories for launch configurations, config files, and tests already in place.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/harunkurtdev/ros2-claude-code-template/HEAD/.claude/commands/new-package.md -o ~/.claude/commands/new-package.md
Después abre una sesión nueva de Claude Code; el slash command carga automáticamente.

new-package.md

Scaffold a new package under `src/` of the current ROS 2 workspace.

Argument handling (`$ARGUMENTS`):
* First token → `package_name` (required, must match `[a-z][a-z0-9_]*`).
* Second token → `python` or `cpp` (required).
* Remaining tokens → free-form description for `package.xml`.

If `$ARGUMENTS` is empty or malformed, ask the user before doing anything.

Process:
1. Read the `new_ros2_package` skill end to end.
2. Verify `src/<package_name>/` does not already exist.
3. Run `ros2 pkg create` with the right build type:
   * Python: `ros2 pkg create --build-type ament_python <name>
     --license Apache-2.0 --maintainer-name "$(git config user.name)"
     --maintainer-email "$(git config user.email)"`
   * C++:    `ros2 pkg create --build-type ament_cmake  <name>
     --license Apache-2.0 --maintainer-name "$(git config user.name)"
     --maintainer-email "$(git config user.email)"`
4. **Restructure into Clean Architecture layout** following the
   `new_ros2_package` skill's templates:
   * Python:
     ```
     src/<name>/<name>/
       domain/        (entities, value objects, ports)
       application/   (use cases, application services)
       infrastructure/ (ROS 2 nodes, repositories)
       presentation/  (CLI, launch entrypoints)
     ```
   * C++:
     ```
     src/<name>/
       include/<name>/{domain,application,infrastructure,presentation}/
       src/{domain,application,infrastructure,presentation}/
     ```
5. Add `launch/`, `config/`, `test/` directories with a placeholder
   `.gitkeep` and a minimal smoke test.
6. Update `package.xml` with the description from `$ARGUMENTS` and add
   `<test_depend>ament_lint_auto</test_depend>` + the default linters.
7. Update `setup.py` / `CMakeLists.txt` to install the launch/config
   directories.
8. Run `pre-commit run --files <every file you touched>` (or
   `ament_*` if pre-commit is not yet configured).
9. Print a summary:
   * Path to the new package
   * Build command (`/build <name>` or `colcon build --packages-select <name>`)
   * Files created

Do **not** run `colcon build` automatically — the user may want to
review first.
behaviortree_node_creationSkill

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).

behaviortree-reviewerSubagent

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.

buildSlash Command

Build the colcon workspace (optionally a single package) and report the outcome.

clean-arch-architectSubagent

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.

commandsSkill

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.

ecs-architectSubagent

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.

extending_claude_configSkill

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).

gz-buildSkill

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.