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

extending_claude_config

This skill provides a structured recipe for authoring new assets (rules, skills, slash commands, or sub-agents) within a `.claude/` template directory while maintaining consistent conventions, formatting, and cross-linking across the configuration. Use it when adding extensible functionality to a Claude Code project that follows the ROS2 template structure, ensuring new assets follow established tone, frontmatter standards, and are properly indexed in documentation files.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/harunkurtdev/ros2-claude-code-template /tmp/extending_claude_config && cp -r /tmp/extending_claude_config/.claude/skills/extending_claude_config ~/.claude/skills/extending_claude_config
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Extending the `.claude/` config

This template is **self-extensible**: rules, skills, slash commands and
sub-agents are plain Markdown files under `.claude/`. This skill is the
recipe for adding a new one *consistently* — same frontmatter, same tone,
same indexing — so the config stays coherent.

> Scope note: for `settings.json` (permissions, hooks, env), use the
> `update-config` skill instead. This skill is about authoring
> rules/skills/commands/agents.

## The four asset types

| Asset | Lives in | Purpose | Discovered by |
|-------|----------|---------|---------------|
| **rule** | `rules/<name>.md` | reference / constraints Claude should always respect | read on demand; listed in CLAUDE.md |
| **skill** | `skills/<name>/SKILL.md` | a how-to / scaffolding recipe with YAML frontmatter | the skill loader (frontmatter `name`/`description`) |
| **command** | `commands/<name>.md` | a `/slash-command` with frontmatter | the command loader |
| **agent** | `agents/<name>.md` | a sub-agent (`subagent_type`) with frontmatter | the Agent tool |

## Conventions (match the existing files)

- **Tone:** concise, imperative, concrete. Tables over prose. Reference
  real source paths (`~/nav2_ws/src/...`) when the asset documents a
  library.
- **Cross-link:** a skill points at its rule(s); a command points at its
  skill; an agent points at the rules it reviews against. Use the exact
  file names.
- **Pairing:** a *scaffolding* skill usually gets a matching slash command
  and, where useful, a *reviewer* agent (e.g. `ros2_controller_creation`
  ↔ `/new-controller` ↔ `ros2-controllers-reviewer`). Reference packages
  cloned next to the workspace are the source of truth — read them.
- **Always update the indexes** (see "Wiring" below) — an unindexed asset
  is invisible.

## Templates

### rule — `rules/<name>.md`
No frontmatter. Start with an H1 and a one-line purpose + source path.
```markdown
# <Title> Reference

<one-line purpose>. Source: `~/nav2_ws/src/<repo>/` (version …).

## 1. <Concept>
| … | … |
```

### skill — `skills/<name>/SKILL.md`
```markdown
---
name: <snake_or_kebab_name>
description: <what it does + when to trigger; trigger-oriented, one sentence>
---

# <Title>

<intro + pointers to rules/reference repos>

## First decision: <pick the variant>
## <step-by-step>
## Common pitfalls
```

### command — `commands/<name>.md`
```markdown
---
description: <one-line, imperative>
argument-hint: "<arg1> <arg2> [optional]"
allowed-tools: ["Bash", "Read", "Write", "Edit"]
---

<what it does>

Argument handling (`$ARGUMENTS`): 1. … 2. …
If anything is missing, ask before acting.

Process:
1. Read the `<skill>` skill.
2. …
N. Print a summary (files created, next command to run).
```

### agent — `agents/<name>.md`
```markdown
---
name: <kebab-name>
description: Use proactively before <X>. Reviews a diff against <conventions>. Returns a punch list with file:line anchors, not a rewrite.
tools: ["Bash", "Read", "Grep", "Glob"]
model: sonnet
---

You are the <domain> reviewer for …
## Process  (identify diff → cluster → checklist → report)
## Checklist  (grounded in the rules)
## Output format  (Must fix / Should fix / Nice to have; file:line)
Do not restate the diff. Do not rewrite the patch. Stay short.
```

## Wiring (mandatory — do this every time)

After creating the file, index it so it is discoverable:

1. **`.claude/CLAUDE.md`**
   - rule → add a row to the **Rules** table (and "Where things live").
   - skill → add a row to the **Skills index** (right subsection).
   - command → add a row to the **Slash commands** table.
   - agent → add a row to the **Sub-agents** table.
2. **`.claude/README.md`**
   - add the file to the `rules/` or `agents/` tree, or the command list
     under "How to use".
3. If the asset documents an external repo, note the clone path and
   version, exactly as the VDA 5050 / ros2_control / BehaviorTree entries do.

## Checklist before finishing

- [ ] Frontmatter present & valid (skills/commands/agents).
- [ ] Cross-links use real existing file names.
- [ ] Indexed in **both** CLAUDE.md and README.md.
- [ ] Tone/sections match a sibling asset of the same type.
- [ ] For scaffolding skills: a matching command exists (and a reviewer
      agent if it warrants review).
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.

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.

gz-changelogSlash Command

Summarize commits on the current branch (vs origin/main) into a Changelog-style bullet list ready to paste into Changelog.md.