Skip to content
zero2vibecodelearn vibe coding
Level 5 · Memory and the team 8 min Reviewed by the author · Oct 15, 2026 Verified against Claude Code v2.1.292 · Oct 15, 2026Official docs: SkillsSomething out of date? Tell us

Skill patterns

A skill can do more than instructions and $ARGUMENTS. It can insert a command's output into itself, keep reference material in neighbouring files, run in a separate subagent, take named arguments and pre-approve the tools it needs.

Level 5 · 0 / 4 lessons0%
In this lesson

You already know that a is a folder with a SKILL.md file: a description in the and instructions in the body, plus $ARGUMENTS for whatever you typed after the name. Now, five patterns that make a skill stronger — and leaner.

Five patterns

PatternHow you write itWhat it does
Live data!`git diff HEAD` in the bodyClaude Code runs the command before Claude reads the skill and inserts the output
Neighbouring filesfiles next to SKILL.md, linked from itlong reference material Claude reads only when needed
Its own contextcontext: fork in the frontmatterthe skill becomes a task for a background
Named argumentsarguments: [focus], and $focus in the bodyeach word after the name fills its own field
Allowed toolsallowed-tools: Read, Grepthese tools run without a prompt during the skill’s turn

A skill for reviewing changes

Let’s put it all together. The file .claude/skills/changes-review/SKILL.md:

---
name: changes-review
description: Reviews uncommitted changes against the team checklist. Use when asked for a review before committing.
context: fork
arguments: [focus]
allowed-tools: Bash(git diff *)
---

## Changes

!`git diff HEAD`

## Task

Review the changes above against [checklist.md](checklist.md), paying most attention to $focus.
Name each problem with its file and line, and finish with one line: is it ready to commit.

And next to it, in the same folder, checklist.md:

- Every changed function has a test.
- Errors are reported, not swallowed.
- There are no secrets in the code or configs.

What happens when you type /changes-review tests:

  1. Claude Code runs git diff HEAD and inserts the diff into the skill’s text.
  2. The word tests goes in place of $focus.
  3. The skill becomes a task for a subagent. It works in the background, does not see your conversation, opens checklist.md itself and sends a report when it is done.

Try /changes-review secrets — the same skill will look at secrets first.

Fine points

A failed command aborts the skill. If an injected command exits with an error, or your permission rules do not let it through, the skill does not run at all: you will see Shell command failed or Shell command permission check failed. Run the command by hand and look at the allowed-tools line. Outside Auto mode, a command your rules do not allow stops the skill — which is why allowed-tools: Bash(git diff *) is not redundant here.

allowed-tools forbids nothing. It only allows what it lists without a prompt, for the turn the skill runs in. Other tools stay available — just with the usual prompts.

Keep SKILL.md short. Once it runs, its whole text stays in the conversation. The documentation recommends no more than 500 lines, with the details in neighbouring files: Claude opens those only if it needs them.

Quick check

A skill with !`npm run lint` does not run and says Shell command failed. What do you do first?

Careful

Practice in the terminal

Check your understanding

Answered 0/3
Mode:

What does the line !`git diff HEAD` in the body of SKILL.md do?

A skill has allowed-tools with Read, Glob, Grep. Can Claude edit files in it?

What does the line context: fork in a skill's frontmatter change?

Finish the task in the terminal and answer the questions to complete the lesson.

📝 My notes

Saved automatically in this browser · shows up on the Notes page.

Task

Build the changes-review skill line by line with echo: frontmatter with name, description, context: fork and arguments: [focus], and in the body the !`git diff HEAD` injection. Put checklist.md next to it.

Tab complete · ↑ history · Ctrl+L clear · help commands

  • Not done: The skill has a name
  • Not done: The skill has a description
  • Not done: The skill runs in a separate subagent
  • Not done: The skill takes a focus argument
  • Not done: A live diff is inserted into the skill
  • Not done: The checklist sits next to SKILL.md

Lesson Q&A

What does the line !`git diff HEAD` in the body of SKILL.md do?

Claude Code runs the command before Claude reads the skill and inserts its output in that spot — The command runs in advance, and Claude receives the skill with live data already in it. If the command fails or your rules do not allow it, the whole skill is aborted.

A skill has allowed-tools with Read, Glob, Grep. Can Claude edit files in it?

Yes — allowed-tools only allows the listed tools without a prompt; it does not remove others — allowed-tools removes permission prompts for the listed tools during the turn the skill runs in. The other tools are still available — with the usual prompts.

What does the line context: fork in a skill's frontmatter change?

The skill becomes a task for a subagent that works in the background, does not see your conversation, and sends the result when it is done — With context: fork, the skill does not clutter the main conversation: a subagent does the work in its own context, and only the result comes back to you.

A skill with !`npm run lint` does not run and says Shell command failed. What do you do first?

A failed injected command aborts the whole skill. First get it passing on its own — or inject a command that does not fail when it finds problems.

Commands in this lesson

Terms in this lesson

Move between lessons with ← → · search with ⌘K

Written and reviewed by Mikhail Kuzmitskii