Skill creator primer

From sammcj/agentic-coding · View interactive version

Skill creator primer is an AI agent skill from the GitHub repository sammcj/agentic-coding. You **MUST** load this skill before the skill-creator skill AND before making ANY change to, or conducting a review of ANY Agent Skill. Triggers include creating, editing, reviewing, or contributing to any part of an Agent Skill (description, frontmatter, body, references, scripts, trigger evals, co

How to use this skill

Skill file

Skill Creator Primer

Note: If the skill-creator skill is missing: stop and ask the user to install skill-creator@claude-plugins-official (registering the marketplace first via /plugin marketplace add anthropics/claude-plugins-official if needed), or to clone https://github.com/anthropics/skills and link its skills directory into their local skills directory.

Route to an entry point by the task in front of you (which-one routing per "Routing when branches multiply", not a content index):

Read references/fable-5-2.md when running as, or authoring for, Claude Fable 5.2 or Mythos 5.2.

Predictable Process, Not Identical Output

A skill wrangles determinism out of a stochastic system where applicable. What it makes predictable is the _process_ - the agent taking the same steps each run - not the _output_. A brainstorming skill should predictably diverge: its tokens vary, its behaviour doesn't. This is the lens for the rest of this primer: triggering, structure, steering, and pruning are all levers on process consistency; cost and maintainability follow. Judge any change by whether it makes the agent behave more consistently, given what that particular skill is for.

Track Each Step as a Task

Before you create, update, or review a skill, create a task (todo) for each step of the work - the primer sections you'll apply, plus a self-review pass - each phrased with its completion criterion, then work them to completion.

How Skills Actually Work

Skills are prompt-based context modifiers. When invoked, a skill:

  1. Injects SKILL.md instructions into the conversation context
  2. Modifies execution context by changing tool permissions and optionally switching models
  3. Guides the agent's behaviour through concise instructions

Skill selection happens through pure LLM reasoning. No algorithmic matching, keyword search, or intent classification (the optional paths frontmatter, a file-glob gate, is the sole exception). The agent reads descriptions in the Skill tool's prompt and reasons about which matches. This makes the description field the single most critical element.

Branches decide what to disclose. Inline what every branch of the skill needs; push behind a context pointer (a bundled file) only what a single branch reaches. A pointer's _wording_, not its target, decides whether the agent follows it - a must-have target behind a weak pointer is a variance bug, so sharpen the wording before settling for inlining. When in doubt for this primer, keep almost-certainly-needed material inline so the agent never has to decide whether to read it.

Routing when branches multiply. When a skill fans out to many references, write the load decision as a decision tree: each branch a one-line qualifier, each leaf a reference pointer.

Invocation mode is a trade-off - choose it deliberately.

Default to model-invoked for mid-task discovery; switch to user-invoked when the skill is occasional and the user will reliably reach for it. When the right mode isn't obvious, give the user both options with a one-line pro/con each.


Skills vs Custom Agents

Before writing a skill, confirm a skill is the right vehicle:

Prefer One Skill Over Many Closely Related Skills

When a request spans several related capabilities, default to a single skill that uses progressive disclosure rather than a separate skill per capability:


Capture Intent from Conversation

When a user says "turn this into a skill", extract the workflow from the current conversation before asking questions. Look for:

Before drafting, settle:

Fill gaps with the user, then proceed to skill creation.

Draft inside the primer's assets/skill-template.md: copy it into the new skill directory as SKILL.md, fill the placeholders, delete unused sections.

Writing Effective Descriptions

The description is the single most important part of a skill to get right. It shares a token budget with every other skill's description and is always active in the agent's context.

Skill Description Checklist

Create a task per item below, judge each pass/fail; done when all pass. Re-check the set after any edit - one fix can break another (an added clause can blow the word cap):

  1. Be concise. Skills are for agent consumption; agents need clear, high-signal triggers, not verbose prose.
  2. Keep it to 1-2 sentences. The validator's word cap is a ceiling, never a target to fill: the description is charged to every turn of every session whether it fires or not, so over-cap outranks anything in the body.
  3. Descriptions are solely for the agent deciding whether to load the skill. No instructions for after activation, and no summary of the skill's content or inner workings - a workflow summary invites the agent to act on the summary and skip the skill's branches.
  4. Ensure the description is distinct. It must not be confusable with neighbouring skills - similar names, the same verb/object, or overlapping situational triggers. The co-active set varies per deployment, so distinctiveness comes from a tight, specific trigger; when the neighbours are enumerable, run "Check for Description Trigger Conflicts" below.
  5. Use imperative phrasing. Frame the description as an instruction to the agent: Use this skill when rather than This skill does. The agent is deciding whether to act, so tell it when to act.
  6. Focus on user intent, not implementation. Describe what the user is trying to achieve, not the skill's internal mechanics. The agent matches against what the user asked for.
  7. Front-load the leading word. The description is where a leading word does its invocation work, so lead with it. If the same word lives in the user's prompts, docs, and code, invocation lands harder.
  8. One trigger per branch, no synonym padding. Give one trigger for each distinct branch the skill handles; synonyms that rename a single branch are duplication that spends context without widening coverage. Cut identity already stated in the skill body.
  9. When a skill over-fires, add a negative-trigger exclusion clause. Name the neighbouring intent and where it belongs instead - "Do NOT use for X, use Y instead" - so the agent can route away from the skill as well as toward it.

Check for Description Trigger Conflicts

Two skills conflict when an agent, reading both descriptions, cannot reliably tell which one a request should load - that is the only thing this check looks for; skills covering related ground are fine. Run the check against the neighbours you can enumerate: the skills installed beside it, or the repo it is being contributed to.

To compare a new or edited description against a set of skills, list each skill's directory, name, and description:

python3 <skill-creator-primer>/scripts/list_descriptions.py <skills-root>

Group skills sharing a verb or object (create/edit, diagram, review, test), then compare pairwise for shared intent without a disambiguator - not merely shared words.

A pair is ACCEPTABLE when a clear disambiguator is present in the trigger:

A pair is a CONFLICT when:

ACCEPTABLE - near-identical wording, but the tool name routes cleanly:

mermaid-diagrams: "...creating or updating mermaid diagrams. Provides guidance on mermaid best practices."

excalidraw-diagrams: "...create or update Excalidraw diagrams. Provides guidance on Excalidraw best practices."

CONFLICT - one trigger is a verbatim subset of the other, with no distinguishing "use when":

domain-model: "Grilling session that challenges your plan against the existing domain model. Use when user wants to stress-test a plan against their project's language..."

grill-with-docs: "Grilling session that challenges your plan against the existing domain model..." (identical opening, no distinguishing trigger)

On a real conflict, pick the lightest fix: sharpen one description's "use when" to name what is distinct, narrow one skill's scope, or merge genuinely identical skills. Leave descriptions that already route cleanly alone, however alike they read.

Testing Skill Triggering

A skill activates purely on its description - the agent reads descriptions and reasons about which to load. To measure whether a description fires on the right requests and stays quiet on the rest - especially when over- or under-triggering is a risk - write trigger evals: realistic queries, each labelled with whether the skill should activate, scored against the live description.

Place an eval set at evals/<set>.json beside the skill and run it with the bundled scripts/eval_triggering.py. Read references/trigger-evals.md before writing or running skill evals.

Degrees of Freedom

Match specificity to the task's fragility and variability:

High freedom (text instructions): Multiple approaches valid, decisions depend on context, heuristics guide approach.

Medium freedom (pseudocode/parameterised scripts): Preferred pattern exists, some variation acceptable, configuration affects behaviour.

Low freedom (specific scripts, few parameters): Operations fragile and error-prone, consistency critical, specific sequence required.

Think of the agent exploring a path: a narrow bridge with cliffs needs guardrails (low freedom), an open field allows many routes (high freedom).

Skill Writing Tips

Selecting content

Structuring the skill

Steering the agent

Writing Scripts

When a skill bundles scripts:

Token Budget Guidance

Challenge each piece: "Does the agent need this, and does it justify its token cost?"

Examples

Good example (concise, actionable):

## Extract PDF text

Use pdfplumber for text extraction:

`python scripts/extract_pdf_text.py <pdf-file>`

Bad example (verbose, wrapped):

## Extract PDF text

PDF (Portable Document Format) files are a common file format that contains
text, images, and other content. To extract text from a PDF, you'll need to
use a library. There are many libraries available for PDF processing, but
pdfplumber is recommended because it's easy to use and handles most cases well.
First, you'll need to install it using pip. Then you can use the code below...

Good example (instructions as structure):

1. Run the skill's evals if present.
2. On failure, tune the description and re-run.

Bad example (the same instructions, buried in prose, wrapped):

When you begin the review you should first check whether the skill has evals,
and if it does, run them before anything else, keeping in mind that failures
may mean the description needs tuning, in which case you should revisit it
and run them again.

Bundled File Layout

Standardise where bundled files live so skills stay predictable across the toolkit:

What to Not Include in a Skill

Skills should only contain files that directly support functionality.

DO NOT create:

Write Skills to Run Across Agents

Claude Code is our primary target, but other agents read the same format, so keep wording and tooling portable:

Claude Code Frontmatter & Extensions

These are Claude Code-specific fields not covered by the Agent Skills spec. Only include when specifically needed:


Validating a Skill

Validate against the official Agent Skills specification with the bundled validate_skill.py. Spec checks run only when invoked; while the primer is active, a PostToolUse hook re-runs the token report (--report-only) after every edit to a skill's SKILL.md or references:

uv run <skill-creator-primer>/scripts/validate_skill.py <skill-dir> [<skill-dir> ...]

Several skills can be passed at once: each report is headed by its path, with a pass count at the end. The exit code fails if any skill fails.

On a valid skill it also prints a token-budget estimate and rating alongside the spec checks. It counts only the Markdown that SKILL.md actually references (transitively), so a stray unreferenced file does not inflate the figure. The count uses a chars/4.12 heuristic calibrated against tiktoken; add --tiktoken (run via uv run --with tiktoken) to count with the real tokeniser instead.

When the user asks for a skill report, a page, or a visual of the findings, read references/html-report.md and run the renderer it describes. The text report above covers every other case.

Upstream validators may have an incomplete frontmatter allowlist

skills-ref (and skill-creator's quick_validate.py, which gates packaging via python -m scripts.package_skill - the failure surfaces as "Validation failed") may recognise only six core spec properties (name, description, license, allowed-tools, metadata, compatibility) and error on every valid Claude Code extension field (when_to_use, argument-hint, arguments, disable-model-invocation, user-invocable, disallowed-tools, model, effort, context, agent). A skill failing only on one of those fields is still valid.

The bundled validate_skill.py errors only on genuine spec violations and downgrades unknown fields to warnings, so documented extensions and fields newer than the linter pass. It also parses frontmatter with PyYAML rather than skills-ref's StrictYAML, so flow-style arrays (allowed-tools: [Read, Write]) pass.

The official docs at https://code.claude.com/docs/en/skills#frontmatter-reference are the authoritative, version-current list.

Failure Modes

Diagnose an oversized or unreliable skill against these modes and apply the cure.

Self-Review Protocol

When a skill spans 3+ references of 1000+ lines each, fan the per-file read-only passes out to parallel sub-agents (each reviews its own files for low-value prose and within-file repetition, returning a summary) - reads don't collide. Cross-file checks (e.g. duplication between SKILL.md and references) can't be split; the main agent reconciles those from the summaries. Keep edits to one agent, or give each sub-agent non-overlapping files.

After creating or updating a skill, you MUST always perform a critical self-review using the primer. Create and complete tasks / TODOs for each of the following:

  1. Check for duplicated information within SKILL.md, across SKILL.md and reference files, and between the text and the scripts (a script's --help, docstring and header comment are places too). Keep one copy, in the place that is loaded latest, and point to it.
  2. Remove low-value prose and filler. Apply the deletion test: cut the passage; if the agent's behaviour wouldn't change, it's a no-op - leave it deleted (see "Failure Modes"). For a contrast pair ("not X, it's Y"), apply the swap test: if reversing it reads as well, the contrast carries nothing - state the claim directly.
  3. Thin the language - make important information prominent while reducing word count.
  4. Run the validator (see "Validating a Skill"); at an OK or Poor rating, first rule out "Tool compensation" (Failure Modes), then run a compression pass:
  1. Verify the description is concise (short) yet complete enough for triggering (see the Writing Effective Descriptions checklist)
  2. Decide the invocation mode (see "Invocation mode is a trade-off").
  3. Ensure no extraneous files were created
  4. Frame guidance positively to avoid the pink elephant effect (see Skill Writing Tips)
  5. Deterministic tools are used for deterministic outcomes. If a script can perform a task, have the agent call that script rather than relying on interpreted instructions.
  6. If the skill has evals, the evals are up to date and run without issue.
  7. For a newly created skill: once the steps above pass, dispatch a fresh-context sub-agent (not a fork - see "Skills vs Custom Agents") to activate the skill-creator-primer and skill-creator skills and review the new skill read-only per "Reviewing a Skill" below, returning graded findings. Action the spec and primer violations, decide each judgement call, then re-validate; one round is the default. Without sub-agents, ask the user to run the review in a fresh session.
  8. Re-run the validator if any step after 4 changed the skill; the review closes on a passing gate.

Verbosity is not rewarded - knowledge quality is.

Reviewing a Skill

The review criteria are the same whether the skill is yours or someone else's. Read the full skill (SKILL.md plus every referenced file) before judging any diff - a clean-looking edit can duplicate or contradict a reference you haven't seen. Then:

  1. Validate mechanically first - see "Validating a Skill" (spec and token budget).
  2. Diagnose against "Failure Modes"; report each finding by mode, with its cure.
  3. If the description changed, hold it to the "Skill Description Checklist" and "Check for Description Trigger Conflicts"; run the skill's trigger evals only when over- or under-triggering is in question - they are a tuning aid, not a gate.
  4. For a diff, confirm the description and reference pointers still match the skill's branches after the change (see "How Skills Actually Work").
  5. Grade every finding: spec violation, primer violation (cite the section), or judgement call. Only the first two block.

Fix what you find by default; report the graded findings instead when the situation is review-only - you have no write tools (a critical-review sub-agent), or the fixes belong to the contribution's author. Self-review inherits the author's assumptions - use fresh eyes or a fresh-context agent (see "Skills vs Custom Agents").

Remember: Less is more. Skills MUST be concise! When in doubt write skill content in a TLDR format.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.