commands
This Claude Code skill creates a new skill definition file in the `.claude/skills/` directory with proper YAML frontmatter, descriptive body content following template conventions, and automatically indexes it in both `.claude/CLAUDE.md` and `README.md`. Use it when extending the ROS 2 Claude Code configuration with new capabilities that require documentation, decision trees, step-by-step instructions, and common pitfall guidance.
git clone --depth 1 https://github.com/harunkurtdev/ros2-claude-code-template /tmp/commands && cp -r /tmp/commands/.claude/commands/new- ~/.claude/skills/commandsnew-skill.md
Add a new skill to this `.claude/` config.
Argument handling (`$ARGUMENTS`):
1. `<skill_name>` — `snake_case` or `kebab-case` (required); becomes the
directory name and the frontmatter `name`.
2. `[description]` — one-line, trigger-oriented summary. If missing, ask.
If anything is unclear (does it pair with a command/agent? which rules?),
ask before writing.
Process:
1. Read the `extending_claude_config` skill (conventions + templates).
2. Verify `skills/<skill_name>/` does not already exist.
3. Create `skills/<skill_name>/SKILL.md` with:
* YAML frontmatter `name:` + `description:` (the description must say
**what it does and when to trigger**).
* a body: intro + pointers to the relevant `rules/` and any reference
repo under `~/nav2_ws/src/`, a "first decision" section if it has
variants, step-by-step instructions, and a "Common pitfalls" list.
* tone/sections matching a sibling skill (e.g.
`ros2_controller_creation`).
4. **Index it**:
* add a row to the **Skills index** in `.claude/CLAUDE.md` (correct
subsection).
* if it is a reference-type skill, also consider a "Where things live"
row.
5. If it is a *scaffolding* skill, offer to also create the matching
`/new-*` command (`/new-command`) and, if it warrants review, a
reviewer agent (`/new-agent`).
6. Print: file created + the index rows added.
Frontmatter is mandatory — a skill without `name`/`description` is not
discoverable. Always update the index in the same change.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.
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.
Summarize commits on the current branch (vs origin/main) into a Changelog-style bullet list ready to paste into Changelog.md.