# Skill to Protocol
<!--
ref: @protocol/skill-to-protocol
tags: [conversion, skills, protocols, knowledge management]
aliases: [harvest-skills, harvest skills]
triggers: [convert skill, access knowledge, optimize agent performance]
trigger_prompt: When you need to make a skill's knowledge available to any agent via an HTTP call, or when considering the cost-effectiveness of using protocols over skills.
category: meta
last_reviewed: 2026-04-30
complements: [@protocol/extract, @protocol/harvest, @protocol/append, @protocol/protocol-api, @protocol/protocol-to-skill]
audience: [agent-author]
version: 17
updated_at: 2026-07-14T23:11:59.238Z
-->

Convert a skill into a protocol to make its knowledge accessible via HTTP endpoints.

For the reverse direction — installing a protocol as a local skill — see [@protocol/protocol-to-skill](@protocol/protocol-to-skill).

## What is a "skill" and why convert it?

Skills and protocols both give an agent specialized knowledge, but they're packaged differently. A **skill** is a self-contained folder — `SKILL.md` plus scripts, references, and assets — loaded automatically when the agent's harness matches the task description. A **protocol** is a single markdown document fetched on demand via HTTP. Skills are modular and composable; each has a single responsibility, clear input/output contract, and can be tested in isolation.

Converting a skill to a protocol makes its knowledge available to any agent that can call an HTTP endpoint, not just harnesses that support the plugin format. The trade-off isn't fetch vs activation cost — both pay continuously for every token-in-context once loaded. The difference is *when* they enter context: skills load eagerly (full body in context the whole session once their description matches the task); protocols load lazily (in context starting at fetch). This is why **conversion is editorial, not mechanical** — eagerly-loaded verbose content is wasteful because you pay for it whether the task ends up needing it.

Build modular skills rather than monolithic agents. Protocols extend that principle: each converted skill becomes a lean parent (what an agent loads first) plus appendix children (what it fetches when it's already executing a specific step).

## Why convert

Skills and protocols solve the same problem (give an agent specialized knowledge) with different mechanics:

| | Skill | Protocol |
|---|---|---|
| **Format** | Folder: SKILL.md + scripts/, references/, assets/ | Single markdown doc |
| **Activation** | Auto-loaded when description matches the task | Explicit fetch by ref |
| **Hosting** | Filesystem, plugin marketplaces | HTTP API (protocol.supply) |
| **Composition** | Implicit via filesystem layout | Explicit via parent/child refs |
| **Cost model** | Eager load: in context the whole session once activated | Lazy load: in context from fetch onward; both pay continuously while loaded |

The relevant difference is **when content enters context**, not what it costs once there. Skills load eagerly — when their description matches the task, the full skill body arrives in context whether you use it or not, and sits there for the session. Protocols load lazily — they only enter context when explicitly fetched, but once there they cost the same way. Both pay continuously for every token-in-context. Verbose skills are wasteful because you pay for the entire body whether the task ends up needing it; verbose protocols are wasteful because every fetch dumps the full body into context for the rest of the session. **Conversion is editorial, not mechanical** — but because tokens-in-context are paid continuously, not because protocols pay per-fetch and skills don't.

## License gate (read first)

Audit the source skill's `LICENSE.txt` before any conversion. Anthropic's official skills repo, for example:

| License | Skills | Action |
|---|---|---|
| Apache 2.0 | algorithmic-art, brand-guidelines, canvas-design, claude-api, frontend-design, internal-comms, mcp-builder, skill-creator, slack-gif-creator, theme-factory, web-artifacts-builder, webapp-testing | Harvest with attribution |
| All rights reserved | docx, pdf, pptx, xlsx | **Skip — not redistributable** |
| No LICENSE.txt | doc-coauthoring | Skip — default copyright applies |

Ambiguous license? Skip and link to the source.

## When NOT to convert

- Skills whose value is the bundled code (a Python module that does the work; SKILL.md is just glue) — link to the GitHub repo instead.
- Skills that depend on closed assets (proprietary fonts, brand IP that isn't yours, paid templates).
- Heuristic: if >70% of the skill's value lives in `scripts/` or `assets/` you can't redistribute, skip.

## Multi-doc target model

Each skill becomes a **family** inside `@skills`:

```
skill-name/
├── SKILL.md              →  @skills/skill-name              (parent — lean core)
├── references/foo.md     →  @skills/skill-name/foo          (appendix child)
├── scripts/extract.py    →  @skills/skill-name/extract      (appendix child, code wrapped)
├── examples/sample.md    →  @skills/skill-name/sample       (appendix child)
└── assets/template.pptx  →  (NOT harvested — listed-and-linked from parent)
```

Path-based slugs work because the protocol API parses `file.path = "skill/child"` into `path: "skill"`, `slug: "child"`, fetchable at `@skills/skill/child`.

### Parent (core protocol) — what stays

The parent is what an agent loads first. Keep it small and load-bearing:

1. One-line description (becomes `short`)
2. **When to use** — when the skill applies
3. **Workflow** — high-level flow with explicit pointers to appendix children (3–10 lines)
4. **Key concepts** — definitions or principles only if needed for the workflow to make sense
5. **Bundled resources** — auto-generated children list
6. **Binary assets** — listed-and-linked, not harvested
7. Footer attribution

### Appendix children — what gets extracted

Stuff you fetch when you're already executing:
- Step-by-step procedures (e.g., "Run and evaluate test cases")
- Domain primers (e.g., a whole way of thinking about an aesthetic)
- Style guides
- Edge case catalogs
- **Every non-binary file under the skill folder → a child carrying the file's actual content.** The rule is the file *type*, not the subdirectory name: `references/`, `examples/`, `agents/`, `themes/`, `shared/`, `templates/`, and any other subdir of `.md`/`.txt`/code all get their content bundled. Do **not** enumerate a fixed allowlist of subdirs — a subdir you didn't anticipate (`themes/`, `shared/`) must still be harvested, not skipped.
- Each `scripts/*.{py,sh,js,ts}` → child wrapping full source in a fenced code block
- Empty/trivial files (`__init__.py`) → skip

> **A child's body is the source file's content, never a pointer to it.** The only "listed-and-linked, not harvested" case is a **binary** asset (see the parent's Binary-assets section). A markdown/text/code file is *always* harvested with its content inline. A child whose body is just "Appendix to `@skills/x` — bundled `foo.md` from the source skill" plus the attribution footer, with none of `foo.md`'s actual content, is a **broken stub** — the content was dropped. This is the failure that stubbed all of `theme-factory`'s themes and several `claude-api`/`internal-comms`/`skill-creator` children: the harvester treated harvestable markdown like a binary asset and wrote a link where the content belonged.

## Quality bars

These are the editorial bars the conversion must clear. They exist because v1 of the harvest produced verbose, ugly parents that read like skill-priming text mid-task instead of fetched reference.

### Length

- **Parent: ≤200 lines / ~10KB soft cap.** If the source SKILL.md exceeds this, extract sub-procedures until the parent fits. The cap is judgment, not arithmetic — `mcp-builder` lands at 261 lines and is acceptable because it's already mostly a flow diagram + reference table.
- **Appendix child: no cap, but split scripts >500 lines** into multiple appendices.

### Voice

Parent reads as **reference**: "X is done by Y, then Z."

Appendices may use **procedural** voice: "Do this, then that."

Neither uses **priming** voice ("your job is...", "Cool? Cool.", "feel free to vibe"). Priming voice presumes the reader is mid-task and being primed. Protocols are read as reference. If you find priming voice in the source, rewrite into reference or procedural voice.

### Headings

- Title case or sentence case.
- **Never ALL CAPS** unless the source is a formal acronym (`MCP`, `API`, `HTTP`).
- Source `# H1` headings inside the body get downshifted to `## H2` (the parser splits documents on H1; leaving body H1s fragments one skill into many orphan entries).

### Anti-priming transforms

When extracting from the source body, strip:

- **Generic wrapper headers** like `## Skill instructions` — adds zero info, just visual padding. Drop it; the body is the body.
- **Personality asides** — paragraphs that explain how to communicate with the user, audience-targeting notes, "be flexible" reassurances. Cut.
- **Repeated emphasis** like "**Emphasize craftsmanship REPEATEDLY**" — designed to bias model behavior, weird as reference text. Strip the meta-instruction; keep the underlying point once.
- **Conversational asides** ("Cool? Cool.", "Of course, you should...") — cut.
- **Self-references to the skill** — "this skill", "when this skill is active" — rewrite as direct statement of the procedure.

## Splitting heuristic

When a parent exceeds the length cap, identify split candidates:

1. Walk H2-or-deeper sections in source order.
2. Any section >50 source lines that is a **self-contained sub-procedure or domain primer** is a split candidate.
3. Extract it as an appendix child. Replace the section in the parent with a 1–3 line summary plus a `` `@skills/<skill>/<appendix>` `` reference.
4. Re-measure parent length. Repeat until under cap.

What does NOT split:
- Quick-reference tables (keep in parent for fast lookup)
- Decision trees with <20 lines (keep)
- Opening framing/principles that the workflow depends on (keep)

## Cross-protocol references — renderer-safe form

For any reference between protocols, use **bare backtick-formatted refs**: `` `@skills/foo` ``. Do NOT wrap in explicit markdown links like `` [`@skills/foo`](https://...) ``. The platform's renderer autolinks bare refs, and explicit `[text](url)` wrappers around `@`-prefixed text produce malformed HTML at render time (the URL parser collides with the autolinker).

Applies to:
- Parent's "Bundled resources" list items
- Child docs' "Appendix to ..." preamble
- Workflow pointers from parent to children

External links (GitHub source URLs, asset links) — regular `[text](url)` is safe; only `@`-prefixed protocol refs trigger the autolink collision.

## Frontmatter mapping

| SKILL.md field | Protocol field | Rule |
|---|---|---|
| `name` | slug in `ref:` | identity: `@skills/<name>` |
| `description` (what part) | line after H1 (becomes `short`) | First sentence, noun-phrase form |
| `description` (when part) | "When to use" section | Distill the "Use when..." clause |
| `license` | `license:` in HTML comment + footer | **Override with audit result** — Anthropic's frontmatter says "Complete terms in LICENSE.txt"; normalize to `Apache-2.0` when the audit confirms |
| `compatibility` | "Requirements" note near top | Only if non-trivial |
| `metadata.author` | footer attribution | Always credit |
| `allowed-tools` | omit | Protocol-side concept doesn't apply |

## Triggers (the highest-leverage choice)

A skill's `description` is its auto-load trigger. Protocols have no auto-load — they're found via search. Compensate by stuffing every domain keyword from the description and any `Keywords:` line into `triggers:` on the parent. Children inherit a subset (domain tags only); they're discovered through the parent's "Bundled resources" section, not standalone search.

Validate: `protocol /search.md?q=<keyword>` for each top trigger should return the parent.

## Naming

- **Repo:** `@skills` — one repo for the entire marketplace.
- **Parent slug:** source skill `name` verbatim (`anthropics/skills/skills/X` → `@skills/X`).
- **Child slug:** flattened relative path with hyphens (`python/managed-agents/README.md` → `python-managed-agents-readme`).
- **Source-repo collision:** if two source repos ship the same skill name, prefer the upstream/canonical one and namespace the second: `@skills/pdf-superpowers`.
- **Cross-skill child-slug uniqueness (known backend issue).** The import endpoint has a "migration fallback" lookup that finds entries by repo+slug only, ignoring path. Two children with the same slug at different paths (e.g., `algorithmic-art/philosophy-creation` and `canvas-design/philosophy-creation`) collapse into one entry — the second write silently overwrites the first. Workaround: prefix child slugs with a skill-specific qualifier so they're globally unique within `@skills`. Use `algorithmic-art/algorithmic-philosophy` and `canvas-design/design-philosophy`, not the generic `philosophy-creation`. Drop this rule once `EntryService.importMarkdownBulk`'s fallback to `findByRepoAndSlug` is removed.

## Attribution (mandatory)

Every protocol — parent and every child — ends with:

```markdown
---

**Source:** [<file-or-skill-name>](<github URL>) — <Org> Agent Skills, <license>.
**Converted via:** `@protocol/skill-to-protocol`
```

Non-negotiable for redistribution and trust.

## Publishing

Two-pass mandatory: children's `parentRef` resolves at write-time and fails if parent doesn't exist yet.

```bash
# Pass 1: parents
curly protocol /repo/skills/import -X POST \
  -H "Content-Type: application/json" \
  -d '{"files":[{"path":"skill-name","content":"<parent markdown>"}]}'

# Pass 2: children
curly protocol /repo/skills/import -X POST \
  -H "Content-Type: application/json" \
  -d '{"files":[{"path":"skill-name/child-slug","content":"<child markdown>"}]}'
```

Body parser limit is ~100KB — chunk batches at ~60KB budget.

## Validation checklist

- [ ] License audited — Apache 2.0 / MIT / BSD or equivalent permissive
- [ ] Parent ≤200 lines (soft cap)
- [ ] No ALL CAPS body headings, no priming voice in parent
- [ ] No `## Skill instructions` wrapper, no personality asides
- [ ] Body H1s downshifted to H2 (parser splits on H1)
- [ ] Parent `ref:` is `@skills/<skill-name>`
- [ ] Children have `parentRef: @skills/<skill-name>`
- [ ] Cross-protocol refs are bare backtick form, not `[text](url)` wrapped
- [ ] Bundled resources section lists every child + summary
- [ ] **No stub children.** Every child's body carries its source file's actual content, not just a preamble + attribution. Mechanical check: after stripping frontmatter, title, the "Appendix to…" preamble, the `**Source:**`/`**Converted via:**` footer, and any `*Related:*` block, each child must have substantive content left (a body of only ~40 chars means the content was dropped — re-harvest that file).
- [ ] Binary assets section lists upstream URLs for non-harvestable files
- [ ] Footer attribution on every doc (parent + every child)
- [ ] Parent surfaces in `protocol /search.md?q=<top-keyword>`

## Worked examples

- `@skills/brand-guidelines` — single-doc skill, no children. Pure-instruction baseline.
- `@skills/mcp-builder` — multi-doc with references + scripts. Standard case.
- `@skills/skill-creator` — refined large skill: lean parent + 4 operational appendices (creating-a-skill, running-evaluations, improving-the-skill, description-optimization). Compare against the source to see every quality bar applied.

---

This is itself a protocol. Fetch the latest before any harvest or refinement run.

---

*Related: `@protocol/groom-protocols` · `@content/web/github/2026-11-25-claude-code-v2-1-332` · `@content/web/github/2026-11-24-builtin-ship-shadows-user-skill` · `@content/web/github/2026-11-17-open-artifact` · `@content/youtube/yifan-bth/the-openclaw-security-settings-i-actually-change`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*