/scaffolding:skill-authoringfrom scaffolding
Defines the frontmatter contract, body structure, and validation rules for authoring scaffolding-compatible skills. Use when creating or reviewing SKILL.md files.
Ships in scaffolding. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Methodology for authoring scaffolding-compatible skills. A skill is a single
SKILL.md file under skills/<name>/ that encodes a reusable methodology Claude
Code can auto-invoke. This skill defines the frontmatter contract, the recommended
body structure, the description-writing rules, and the quality bar every authored
skill must meet before it ships.
Apply this skill when:
/create-skill command to scaffold a new skillskills/<name>/SKILL.md fileDo NOT apply this skill for:
distillagent-memoryEvery SKILL.md MUST begin with a YAML frontmatter block delimited by ---:
| Field | Rule |
|---|---|
name | Required. Kebab-case ^[a-z][a-z0-9-]*$. MUST equal the parent directory name. |
description | Required. Non-empty, 1–340 characters. Follows the Description Contract below. |
context | Optional. Only value: fork — run the skill in an isolated forked subagent. See "Context: fork". |
agent | Optional. Sub-agent for a forked skill: Explore, Plan, or general-purpose. |
effort | Optional. Reasoning-effort hint: low, medium, or high. |
name and description are the only required fields. context, agent,
and effort are optional delivery-tuning fields. All five are value-checked by
validators/validate-skill.sh; any other frontmatter key is left untouched.
The description field drives Claude Code's automatic skill invocation. A vague
or overbroad description either fails to trigger or triggers on the wrong tasks.
Every scaffolding skill description MUST follow this template:
"<one-line capability summary>. TRIGGER when: <2-4 concrete observable situations>. SKIP: <1-2 cases handled by a named neighbour skill or out of scope>."
Rules:
| Rule | Detail |
|---|---|
| Length cap | Keep the whole string under ~340 characters. Trim the summary first. |
| Observable triggers | Use observable verbs/nouns ("writing a migration"), not adjectives ("complex DB work"). |
| 2–4 triggers | Fewer than 2 under-triggers; more than 4 dilutes the match. |
Named SKIP | Name the competing neighbour skill — e.g. SKIP: ... (use python-patterns). |
Mutual SKIP | If skill A's SKIP names skill B, skill B's SKIP SHOULD name skill A. No two skills' TRIGGER clauses may overlap without a mutual disambiguating SKIP. |
| Under-trigger bias | For borderline cases, prefer under-triggering over false activations. |
When a skill has no overlapping neighbour, the SKIP clause may instead name an
explicitly out-of-scope case. The /create-skill command composes this string
automatically from the collected inputs.
A skill body should read top-to-bottom as a methodology, not as prose. Use this section order:
| Order | Section | Content |
|---|---|---|
| 1 | ## Purpose | One short paragraph: what the skill encodes and the outcome. |
| 2 | ## When to Apply | Bulleted TRIGGER situations, then explicit SKIP cases. |
| 3 | Methodology section(s) | The repeatable procedure — prefer decision tables. |
| 4 | ## Anti-Patterns | Table of common mistakes and their corrections. |
| 5 | ## Quality Checklist | Verifiable completion criteria. |
Guidelines:
templates/skill-template.md.A skill reaches an agent in one of two ways, and the author should decide which on purpose:
| Mode | Mechanism | Use when |
|---|---|---|
| Preloaded | Listed in an agent's skills: frontmatter — in context from turn one. | The agent needs the skill on nearly every task it runs. |
| Invoked | Auto-loaded on demand when the task matches the skill's description: TRIGGER/SKIP. | The skill is situational. |
Decision rule: preload a skill when an agent needs it almost every task;
otherwise leave it invoked and rely on a precise description:. Preloading is a
context-budget decision (skills < 300 tokens each) — prefer invoked when in
doubt. The full Command → Agent → Skill responsibility split lives in
docs/orchestration-pattern.md.
context: fork runs a skill in an isolated forked subagent so its large body and
working notes never pollute the main thread's context. It is a third delivery
mode alongside preloaded and invoked.
| When to fork | When NOT to fork |
|---|---|
| Skill is heavy (large reference catalog) AND one-shot (consulted once to produce an artifact, no interleaving with main reasoning). | Skill is iterative — it must see the current main-thread code/decisions on every step (e.g. testing-strategy, pattern-recognition). |
Pair context: fork with an agent: to pick the fork's sub-agent:
agent: | Loads | Use for |
|---|---|---|
Explore | lighter (skips CLAUDE.md + git) | read-only investigation; the fork produces advice only, writes nothing. |
Plan | lighter (skips CLAUDE.md + git) | planning passes. |
general-purpose | CLAUDE.md + history | reference skills that read context AND may need to write/apply guidance. |
Reference skills that apply guidance (and may write) should use
agent: general-purpose. Never fork an iterative skill — it would lose the live
context it depends on. Reverting is trivial: delete the two lines.
!command)A skill body may inject live shell output at load time. Claude Code executes a bang-prefixed command (the bang at line start or after whitespace) and inlines its stdout when the skill loads. Use this only for cheap, read-only, secret-free context.
The syntax is a bang immediately followed by a backtick-wrapped command. Shown here in a fenced block (NOT inline) so this doc itself does not execute anything on load:
Current branch: !`git branch --show-current 2>/dev/null || true`
Rules:
| Rule | Detail |
|---|---|
| Cheap only | Instant commands (git branch, git worktree list). No network, no test runs, no find /. It runs on every skill load. |
| No secrets | NEVER inject printenv, env dumps, tokens, or cat .env. Read-only git/status only. |
| Fail quietly | Append `2>/dev/null |
| Portable | Use universally available commands (git). No project-specific binaries. |
| Doc examples | In documentation, always wrap bang-command examples in fenced code blocks, never inline backticks — inline backticked bang-commands in docs can be wrongly executed by the parser. |
A SKILL.md file MUST stay under 500 lines. Auto-injected skill context is
bounded; an oversized skill is silently truncated and loses its tail content. If a
skill approaches the limit, split it into two narrower skills with distinct
TRIGGER/SKIP clauses rather than letting one file sprawl.
Before a new or edited skill ships:
---name is kebab-case and equals the parent directory namedescription follows the Description Contract and is under 340 chars## Purpose, ## When to Apply, a methodology section, and ## Anti-PatternsSKIP clausebash validators/validate-skill.sh skills/<name>/SKILL.md exits 0README.md / CHANGELOG.md and bump plugin.json countsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub komluk/scaffolding --plugin scaffolding39 skills in this plugin
/agent-commsSendMessage recipient validation and worktreePath safety (CWE-59). TRIGGER when: validating a SendMessage `to:` recipient against the agent whitelist, or a worktreePath from another agent before acting on it. SKIP: routing topology (agent Comms Protocol); git ops (use git-operations); worktree recovery (use worktree-management)./agent-memoryRepo-local file memory under .scaffolding/ (shared/agent/conversation tiers). TRIGGER when: reading or writing .scaffolding/ memory files, or choosing which file tier an insight belongs in. SKIP: vector memory / MCP search and store (use semantic-memory-mcp); distilling conversations (use distill)./api-designRESTful API design standards: resource naming, HTTP methods, status codes, pagination, versioning. TRIGGER when: designing new API endpoints, defining error response shapes, or adding pagination/filtering. SKIP: implementing FastAPI route code (use python-patterns); error-handling internals (use error-handling)./context-engineeringOptimize Claude Code context-window usage for accuracy and cost. TRIGGER when: hitting context limits, structuring prompts for an agent, or trimming what gets injected into a task. SKIP: persisting knowledge across sessions (use agent-memory); semantic recall tuning (use semantic-memory-mcp)./database-optimizationSchema design, index strategy, migration safety, and query analysis. TRIGGER when: designing tables or indexes, writing a migration, or diagnosing a slow query. SKIP: writing ORM model code (use python-patterns); generic backend patterns (use python-patterns)./distillKnowledge distillation: candidate extraction, confidence scoring, tier routing. Invoked by /learn and the memory-ingest Stop hook, not loaded proactively by agents. TRIGGER when: /learn or the Stop hook asks to distill, or scoring a candidate. SKIP: file memory writes (use agent-memory); vector store (use semantic-memory-mcp).Other plugins' skills for the same job