Skip to content

Chapter 9 · Composition & Advanced

A skill alone is useful. Skills combined with each other and with your agent's other mechanisms — hooks, subagents, MCP servers — are how you build the equivalent of a small engineering process that runs on demand.

Skill + skill: be a good neighbor

Installed skills don't live alone — an agent may have dozens, and your skill activates into that shared environment. Composition rules that keep a fleet of skills healthy:

  • One skill, one job. A release-manager mega-skill that commits, changelogs, versions, and deploys will fight with your commit-crafter and your deploy skills. Prefer three focused skills the agent can chain.
  • Narrow triggers on overlapping ground. If two skills both mention "deploy", both fire on every deploy question. Write descriptions that partition the space (chapter 4 — negative triggers).
  • Reference sibling skills by name and condition, not by assuming they're loaded. The agent loads skills on demand, so say the condition: "After the changelog entry is written, suggest the user run the version-bump skill."

A multi-skill pipeline

Skills compose into pipelines through the artifacts they hand forward:

flowchart LR
    A["commit-crafter<br><i>clean commits</i>"] --> B["changelog-forge<br><i>reads git history</i>"]
    B --> C["version-bump<br><i>tags the release</i>"]
    C --> D["lessons-keeper<br><i>records what hurt</i>"]

Nobody orchestrates this pipeline explicitly — the data connects them: clean conventional commits make changelog-forge's categorization deterministic; a written changelog makes the version bump trivial; the release's rough edges become lessons. This is the quiet reason to enforce format standards: they're the interfaces between your skills.

Skill + hooks: deterministic triggers

Hooks are shell commands your agent runs on fixed events (before commits, after file saves, on tool use). They're the deterministic counterpart to a skill's probabilistic trigger. Two productive pairings:

  1. Hook as reminder. A PreCommit hook that checks for a CHANGELOG entry and prints "changelog-forge skill is available for this" turns the agent's attention to the skill at exactly the right moment — no waiting on the description match.
  2. Hook as guardrail, skill as procedure. The hook blocks (--no-verify, deploys on Friday) — the skill teaches what to do instead. Hooks say no; skills say how.

Hooks are configured per-agent (settings files, not skills), so treat them as the ops layer around skills, not part of them. When you install a skill that matters, ask: is there an event that should always remind me it exists?

Skill + subagents: context isolation

Long workflows pollute the main conversation — hundreds of tool calls of exploration drown the actual task. Many agents can spawn subagents: separate contexts that run a scoped job and return only the conclusion.

A skill can direct that delegation:

## Code review workflow

1. Gather the diff and the changed files list yourself.
2. Spawn a review subagent with: the diff, the changed files, and the
   checklist below. The subagent returns findings only — it should not
   edit files.
3. Triage the returned findings yourself: drop false positives, keep
   evidence-backed issues.
4. Present only issues you would stand behind, grouped as
   Critical / Suggestion / Nit.

The pattern: the skill owns the procedure; the subagent owns the bulk work; the main context receives only the result. Your judgment step (triage) stays in the main thread where the user's full context lives.

Skill + MCP: procedures for capabilities

MCP servers give agents capabilities (query a database, drive a browser, call an API); skills give them procedures (when, in what order, with what standards). The combination is where flaky MCP usage becomes reliable: a skill can be the manual for an MCP tool.

---
name: incident-triage
description: Triage production incidents using the Sentry and Linear MCP
  servers. Use when the user mentions an incident, an outage, error spikes,
  Sentry, or asks what broke.
---

# Incident Triage

## Workflow

1. Pull the top 10 error groups from Sentry via the MCP tool — by
   `count_24h`, not first_seen. Write the query exactly as given in
   [references/sentry-queries.md](references/sentry-queries.md).
2. For each group, check the release it appeared in (Sentry MCP) and whether
   a deploy preceded it (git log).
3. Deduplicate: groups sharing a root-cause stack frame are one incident.
4. For confirmed incidents, create a Linear issue via MCP using the
   template in [assets/incident_issue.md](assets/incident_issue.md) —
   severity, affected endpoint, first bad release, link to Sentry group.
5. Report a one-paragraph summary per incident. Do not attempt fixes
   unless asked.

The MCP tools could be used without the skill — but without it, every triage is improvised: different sorts, missed deduplication, inconsistent issues. The skill captures the process; the MCP servers provide the hands. (The same pattern applies to any CLI toolchain — gh, docker, terraform, rtk-style tool wrappers: a skill that encodes your invocation standards beats the agent's guess every time.)

Slash commands and explicit invocation

Most agents also let the user invoke a skill deliberately (typing its name as a command), and some frontmatter extensions support disable-model-invocation to make a skill manual-only — loaded when named, never auto-triggered. Use manual-only for:

  • skills with side effects the user should consciously choose (deploy to production, send messages),
  • skills whose trigger context is ambiguous (one-off admin flows).

Everything else should stay auto-triggerable — that's the point of the description engineering in chapter 4.

The composition checklist

Before building your next skill, check whether it should:

  • [ ] delegate bulk work to a subagent (context isolation),
  • [ ] be reminded by a hook at a fixed event,
  • [ ] orchestrate MCP tools or CLIs with explicit procedures,
  • [ ] hand artifacts to — or receive them from — a sibling skill,
  • [ ] record what it learned with a memory protocol (chapter 8).

Chapter 10 · Testing & Evals — because a skill is software, and software gets tested.