Skip to content

Lesson 14 ยท Rules and Configuration

Skills and Subagents

Package repeatable know-how as Cursor skills, delegate focused work to subagents, use custom modes and decide whether a rule, skill or subagent fits.

Rules are good for standing instructions. Some knowledge is needed only sometimes, such as "how we cut a release". Some work is better done by a separate helper with its own context. For these, Cursor has skills and subagents.

Skills

A skill is a folder that contains a file named SKILL.md. It teaches the agent how to do a particular job and may include extra files:

TEXT
.cursor/skills/release-notes/
  SKILL.md
  scripts/       optional code to run
  references/    optional documents, read when needed
  assets/        optional templates and data

As of December 2026, the desktop app looks for project skills in .cursor/skills/ and .agents/skills/, and for personal ones in the folders with the same names under your home directory. It also loads some folders used by other tools.

Front matter field Required Notes
name Yes Lowercase letters, numbers, hyphens; must match the folder name
description Yes What it does and when to use it
paths No Limit the skill to matching files
disable-model-invocation No true means it runs only when you call it

Here is an example skill of our own:

TEXT
---
name: release-notes
description: Draft release notes from merged commits. Use when asked for release notes or a changelog entry.
---

# Release notes

1. Run git log from the last release tag to HEAD.
2. Group changes into Added, Changed and Fixed.
3. Write for users, not developers.
4. List anything that breaks compatibility at the top.
5. Show the draft. Do not edit CHANGELOG.md until I approve it.

To use it, let the agent decide (it reads the description), or type / and choose its name, which applies to one message. You can also keep a skill active for a whole session as a custom mode, with Alt+Enter (Option+Enter on a Mac). Built-in slash commands such as /create-skill, /create-rule, /create-subagent and /create-hook help you create configuration.

Validate a skill

Mistakes in the front matter can stop a skill from working as you expect. This real script checks the two required fields.

Python Check skill front matter

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

It reads only simple one-line values. Use a YAML library for real front matter.

Subagents

A subagent is a helper that the main agent hands a task to. It works in its own context window and returns a result. This keeps noisy work, such as searching hundreds of files, out of your main conversation.

The documentation lists built-in subagents for exploring the codebase and for using the browser, which the agent uses automatically. You can define your own as Markdown files in .cursor/agents/, or in ~/.cursor/agents/ for all projects. All the front matter fields are optional:

Field Meaning
name Identifier, taken from the file name if missing
description Helps the main agent decide when to delegate
model inherit (default) or a specific model ID
readonly true blocks file edits and state-changing shell commands
is_background true runs it without blocking the main agent

An example:

TEXT
---
name: security-reviewer
description: Reviews diffs for security problems. Use proactively after changes to sign-in or file handling.
readonly: true
---

Review the current diff. For each finding give: file, line, risk
and a concrete fix. If you find nothing, say so and list what
you checked.

Call it with /security-reviewer, or ask for it by name. The main agent can start several subagents at once. You can also ask for isolation, so that each gets its own worktree or cloud environment.

A subagent has its own context. Do not assume it knows everything you discussed. Make sure the goal, the files and the limits reach it.

Rule, skill or subagent?

Choose the right tool

Rule Standing guidance
Skill Procedure on demand
Subagent Separate context
1 / 2
Need Choose
"Always use type hints" Rule
"How to publish a release" Skill
"Search the codebase without filling my chat" Subagent
"Review this without the ability to edit" Subagent with readonly: true

A /migrate-to-skills command converts some older dynamic rules and slash commands into skills.

Plugins and trust

Skills, rules, subagents, hooks and server settings can be shared as plugins through marketplaces. A skill can include scripts that may run on your computer. Read what you install, as you would review any third-party code.

Test a skill or subagent

Treat a new skill or subagent like new code. Try it on a safe example where you know the correct result.

  • Triggering: does the agent pick it up for the right requests, and leave it alone for others? If not, rewrite the description with the words people actually use.
  • Steps: does it follow the order you wrote? Number the steps and name the exact commands.
  • Limits: does it stop where you said, such as before editing a file?
  • Output: is the result in a form you can check quickly?

For a reviewer subagent, plant a known problem in a practice branch and see whether it finds it. One success does not prove that it will always do so, but a failure tells you the instructions need work.

Keep scripts in a skill small and readable. A script gives repeatable results for mechanical steps, such as collecting commit messages, while the model handles judgment. Because scripts run code, review changes to them as carefully as changes to your application.

Common mistakes

  • A vague description, so the agent cannot tell when the skill applies.
  • One giant skill that tries to cover everything.
  • A reviewer subagent that can also edit the code it reviews.

Check your understanding

Quick check ยท 3 questions

of 3 answered You scored / 3 ยท perfect!

  1. 1. Which file must a skill folder contain?

    The folder needs SKILL.md with a name and a description.
  2. 2. What is a key property of a subagent?

    Separate context keeps noisy work out of the main conversation.
  3. 3. What does readonly: true do for a subagent?

    It is a good fit for reviewers.

Summary

  • Skills package procedures in a folder with SKILL.md.
  • Subagents are focused helpers with their own context.
  • Use rules for standing guidance, skills for procedures and subagents for delegated work.
  • Review third-party skills and plugins before installing them.

Next: Models, Plans and Usage

Your progress is saved in this browser. No account needed.