Add an Agent or Skill¶
Adding a new agent¶
Create a markdown file in plugins/ml-lab/agents/:
The file should define:
- Name and description — frontmatter that Claude Code uses for dispatch
- Persona — who the agent is and what perspective it brings
- Instructions — what the agent does when dispatched
- Output format — what artifacts the agent produces
The agent is dispatched via the Agent tool from the main session (or from a skill). It runs as a subagent with isolated context.
Plugin cache sync
A PostToolUse hook (sync-plugin-cache.sh) automatically rsyncs edits in plugins/ml-lab/ to the versioned plugin cache. No manual reinstall needed after editing.
Adding a new skill¶
Create a directory in plugins/ml-lab/skills/ with a SKILL.md file:
The SKILL.md file defines:
- Frontmatter —
name,description(used for routing), and optionalmodel - Instructions — the step-by-step workflow the skill executes
- Scripts — any supporting scripts go in
skills/my-skill/scripts/
Once the plugin cache syncs, the skill is available as /my-skill.
Registering in the plugin manifest¶
If adding to the ml-lab plugin, update the plugin manifest at:
Agents are auto-discovered from agents/; skills are auto-discovered from skills/. The manifest registers the plugin with Claude Code's plugin system.
Testing¶
- Edit the agent or skill file
- Wait for the sync hook to fire (or manually reinstall)
- Invoke the skill or dispatch the agent
- Verify output matches expectations
You have now...¶
Added a new agent or skill to the ml-lab plugin and verified it works through the plugin cache sync system.