Skip to content

Build team skills with the right frontmatter

Create a Claude Code skill at the right scope with frontmatter (context: fork, allowed-tools, argument-hint) that fits the task, and choose a skill or CLAUDE.md for a convention.

Scenario

Scenario: Code Generation with Claude Code. Your team wrote a /schema-diff command that compares the database schema with every model file and prints each mismatch. It works. It also prints about 15,000 tokens into the session, and an hour later Claude has lost track of the refactoring plan you agreed on before you ran it.

Half the team runs it with no argument and Claude guesses which database to check. One developer keeps a private copy with extra checks that no one else has.

Three small lines of frontmatter, and one decision about where the file lives, fix all of this.

Explanation

Commands are now skills. In the current docs, custom commands have been merged into skills: .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md both create /deploy. Command files keep working, but skills are preferred for new work because they can hold supporting files and let Claude load them when relevant. The exam guide still speaks of "slash commands in .claude/commands/": read it as the same thing.

Scope is where the file lives.

Location Who gets it
.claude/skills/<name>/SKILL.md (or .claude/commands/) The team, once committed
~/.claude/skills/<name>/SKILL.md (or ~/.claude/commands/) Only you, in all your projects

If a personal and a project skill share a name, /name runs the personal one. So a personal variant of a team skill gets its own name (schema-diff-strict): you keep both, and nobody else is affected.

Frontmatter configures it. YAML between --- markers at the top of SKILL.md:

  • description: what the skill does and when to use it. Claude reads it to decide when to load the skill.
  • argument-hint: shown during autocomplete, e.g. [database] [schema-dir], so people see which arguments to pass. The body receives them as $ARGUMENTS (or $0, $1). The exam guide says it "prompts developers for required parameters".
  • context: fork: runs the skill in a separate subagent (agent picks the type; general-purpose by default). The subagent doesn't see your conversation, and only its result comes back, so verbose analysis or brainstorming stays out of your session. Use it only for skills with a complete task, not for skills that need the conversation so far.
  • allowed-tools: tools Claude may use without asking during the turn that runs the skill. In the current docs it pre-approves; it does not remove other tools. To take tools away, use disallowed-tools or deny rules. The exam guide treats allowed-tools as the way to limit a skill's tools.
  • disable-model-invocation: true: only a person can run it, for steps with side effects such as deploying.

Skill or CLAUDE.md? CLAUDE.md loads in every session: use it for facts and standards that always apply. A skill's body loads only when it is used: use it for procedures and task-specific workflows. A standard that must hold for all code, kept only in a skill, is missed whenever nobody invokes the skill.

Worked example

Before: .claude/commands/schema-diff.md with no frontmatter.

Compare the database schema with every model file
in src/models/ and list each mismatch.

After: .claude/skills/schema-diff/SKILL.md, committed.

---
description: Compare a database schema with the model
  files and report mismatches. Use before a migration.
argument-hint: "[database] [models-dir]"
context: fork
allowed-tools: Read Grep Bash(psql *)
---

Compare the schema of database $0 with the models in
$1. Return a table of mismatches: model, column, problem.

What each change does:

  • argument-hint shows [database] [models-dir] as people type /schema-diff, and $0, $1 put the values into the task.
  • context: fork keeps the 15,000 tokens of comparison in a subagent. Your session gets only the table.
  • allowed-tools lets the run read and query without a prompt for each step.
  • The developer with extra checks copies it to ~/.claude/skills/schema-diff-strict/: a different name, so the team version stays as it is.