Skip to content
bits
Work with coding agents · Lesson 4 of 7 · 8 min

Teach it a skill

Verified claude-code 2.1.317

Tutor:

Your CLAUDE.md holds what the agent needs every session. But some know-how is only needed sometimes: how your team writes commit messages, how to build a Cloudflare Worker, how to design a page that doesn't look generic. That's what a skill is for.

Tutor:

Skills use progressive disclosure: each skill's description (plus optional when_to_use, together truncated at 1,536 characters in the listing) sits in context every session; the body, and any files it points to, load only when Claude invokes it. So the description is a routing rule: say what it does and when to use it. Frontmatter can also pre-approve tools for the turn that uses the skill (allowed-tools: it grants, it doesn't restrict), switch the model for that turn, or turn off automatic use so it only runs as /name (disable-model-invocation). name is optional and defaults to the folder name.

Tutor:
Plain text
---
description: Writes commit messages in our house style. Use when the user asks for a commit message or is about to commit.
---

1. First line: type(scope): summary, under 60 characters.
   Types: feat, fix, docs, refactor, test, chore.
2. Blank line, then one or two sentences on why, not what.
3. Never mention the AI or tools used.

Save that as .claude/skills/commit-message/SKILL.md in a project (or under ~/.claude/skills/ to use it everywhere). The folder name becomes its name.

Tutor:

You don't have to write every skill yourself. The teams behind your tools publish theirs, and the build-along courses use three (checked November 2026):

  • Cloudflare, inside Claude Code: /plugin marketplace add cloudflare/skills, then /plugin install cloudflare@cloudflare. That adds Cloudflare's skills and its docs MCP servers (next lesson).

  • Frontend design, from Anthropic: npx skills add anthropics/skills --skill frontend-design.

  • Remix: the Remix team keeps its skills in the remix-run/remix repo. npx skills add remix-run/remix --list shows them; pick one with --skill.

npx skills is a small open-source installer that copies a skill's folder into your project. A skill is instructions your agent will follow, so read it before you install it, as you would a script.

Tutor:

Your turn. Write a tiny SKILL.md for commit messages in your own words, then on the last line hand it a change to describe, like this: Change: the homepage now shows a “closed today” banner on Sundays. Claude here plays the agent that loaded your skill.

Your turn

Goal Write a skill whose description says when to use it, and see Claude follow its rules

What good looks likeThe coach checks the reply
  • Has a description linenot checked yet
  • Says when to use itnot checked yet
  • Gives the formatnot checked yet
  • Hands it a changenot checked yet
  • Ran at 1.0not checked yet
  • Starts with a typenot checked yet
  • The description says when to use the skill, not only what it doesnot checked yet
  • The steps are rules a reader could check, not vague advicenice to have
  • The commit message follows the skill's formatnot checked yet

Run your prompt and the replies land here.

    ~0 tokens

    Turn on JavaScript to run prompts.