Agents
Cursor Agent Skills: How to Use and Create Reusable Agent Commands
A Cursor Agent Skill is a portable SKILL.md file that teaches the agent a domain-specific workflow — like running your test suite, generating a migration, or doing a security review. Skills live in .cursor/skills/ or .agents/skills/, are discovered automatically on startup and can be invoked with /skill-name in chat.
On this page
What is a Cursor Agent Skill?
A skill is a version-controlled directory containing a SKILL.md file and optional scripts. SKILL.md has a YAML frontmatter block (name and description) followed by Markdown instructions — the same instructions you might type in a long prompt, but stored once and reused automatically.
- SKILL.md
- Required. YAML frontmatter (name, description) + Markdown instructions for the agent.
- scripts/
- Optional. Executable files the agent can run as part of the skill (shell, Python, node).
- references/
- Optional. Context files the skill loads on demand — keeps base context lean.
- assets/
- Optional. Images, templates or any non-code resource the skill references.
A prompt in chat is thrown away after the session. A skill is committed to your repo and versioned like code. When your teammate clones the project, they get the same skills.
How do I use a skill in Cursor?
- 1Type
/in the agent chat panel and search for the skill name (e.g.,/write-tests). - 2Select the skill to invoke it — the agent loads the SKILL.md instructions and runs the workflow.
- 3Alternatively, prefix a message with
@and select a skill to attach it as context without running it automatically.
Cursor also discovers skills automatically. When a skill's description matches the current task context, the agent may apply it without an explicit invocation. You still see the agent's reasoning in the trace.
How do I create a new skill?
- 1Type
/create-skillin agent chat and describe the skill you want. Cursor walks you through naming, structuring and saving it. - 2Or create the file manually: add a folder inside
.cursor/skills/(or.agents/skills/) and create aSKILL.mdinside it. - 3Write YAML frontmatter at the top — a
nameanddescription— then add Markdown instructions below the---separator. - 4Commit the folder to your repo so the whole team shares the skill.
A minimal skill file looks like this:
yaml
---
name: write-tests
description: "Generate a test file for a module using the project's testing conventions."
---
When writing tests:
1. Look at existing tests in tests/ for patterns.
2. Use the same assertion library and file-naming convention.
3. Cover the happy path, one edge case and one error case.
Where should I put skills, and which directories does Cursor scan?
- Location
- .cursor/skills/ (project root)
- Scope
- This project only
- Best for
- Project-specific workflows, conventions
- Location
- .agents/skills/ (project root)
- Scope
- This project only
- Best for
- Same — alternate convention used by some teams
- Location
- ~/.cursor/skills/ (home dir)
- Scope
- All your projects
- Best for
- Personal productivity skills you use everywhere
- Location
- ~/.agents/skills/ (home dir)
- Scope
- All your projects
- Best for
- Global skills shared across machines
- Location
- Nested: src/api/.cursor/skills/
- Scope
- Files inside that subdirectory
- Best for
- Monorepo packages with their own conventions
| Location | Scope | Best for |
|---|---|---|
| .cursor/skills/ (project root) | This project only | Project-specific workflows, conventions |
| .agents/skills/ (project root) | This project only | Same — alternate convention used by some teams |
| ~/.cursor/skills/ (home dir) | All your projects | Personal productivity skills you use everywhere |
| ~/.agents/skills/ (home dir) | All your projects | Global skills shared across machines |
| Nested: src/api/.cursor/skills/ | Files inside that subdirectory | Monorepo packages with their own conventions |
Skills in nested directories are automatically scoped to files inside that directory. Cursor picks up all locations on startup.
How do teams share and standardize skills?
Check .cursor/skills/ into your repository. Every developer who clones the repo gets the same skill library. This is the primary way to enforce coding conventions, runbook steps and team-specific workflows across the agent.
- Coding conventions —
write-tests,add-migration,format-prskills enforce team standards automatically. - Runbook tasks —
deploy-staging,rotate-secrets,check-sentrywrap multi-step ops into one command. - Domain knowledge —
hipaa-review,gdpr-checklistencode compliance checklists the agent runs before shipping.
Skills load references on demand, so they do not blow up your context window on every prompt. Put heavy reference material (API specs, large runbooks) in a references/ subfolder and cite it in SKILL.md — the agent fetches it when it needs it.
Skill, rule or command — how do I decide which to reach for?
A skill is not auto-loaded into context. On startup the agent only reads each skill's name and description, then pulls the full SKILL.md in only when the description matches the task. This is progressive disclosure: a one-line summary is cheap, the body is loaded on demand. The practical consequence - if a skill never fires when you expect it to, the problem is almost always the description, not the instructions. Make the description say plainly when the skill applies.
A Skill is a how - an action or workflow the agent reaches for ("generate a migration", "run the security review").
A Sub-agent is a role or persona - a separate worker you delegate to ("the reviewer", "the test-writer") that runs with its own context. Reach for a skill to teach one capability; reach for a sub-agentA child agent a main agent spawns to work in parallel with its own context window, handing results back so the parent's context stays clean. to hand off a whole job to a specialist.
- Mechanism
- Rule (.cursor/rules/)
- When it loads
- Always on, every prompt
- Mental model
- An always-on convention the agent must follow
- Mechanism
- Skill (.cursor/skills/)
- When it loads
- On demand, when the description matches
- Mental model
- A capability the agent reaches for when relevant
- Mechanism
- Command (/slash menu)
- When it loads
- When you explicitly start it
- Mental model
- A job you kick off yourself from the slash menu
| Mechanism | When it loads | Mental model |
|---|---|---|
| Rule (.cursor/rules/) | Always on, every prompt | An always-on convention the agent must follow |
| Skill (.cursor/skills/) | On demand, when the description matches | A capability the agent reaches for when relevant |
| Command (/slash menu) | When you explicitly start it | A job you kick off yourself from the slash menu |
Rule = invariant convention. Skill = reachable capability. Command = an action you start. They compose - a command can invoke a skill, and rules apply throughout.
Plan modeA mode that makes no edits: it researches the codebase and produces an editable plan you review before any code changes. is itself a built-in skill - the same progressive-disclosure mechanism powers the modes you already use, not just the ones you author. A concrete in-the-wild example is the dogfooded de-slop skillA shared Cursor skill that strips typical AI-generated tells (filler comments, vague names, over-engineering) and applies house style.: a skill whose description tells the agent to strip filler and AI-tells from generated prose, so it fires automatically when the agent is about to write copy.
Frequently asked questions
Skill or rule — which do I use?
Use a rule for something the agent must always do - a convention that applies on every prompt, like "use tabs" or "never edit generated files". Use a skill for a capability the agent should reach for only when relevant, like generating a migration or running a release checklist. Rules are always-on context; skills load on demand when their description matches the task.
Do skills cost tokens?
Only when invoked. On startup the agent reads just each skill's name and description, which is cheap. The full SKILL.md body and any references/ files are pulled into context only when the skill actually fires - so a library of unused skills doesn't bloat your context window.
Do Agent Skills work in the Cursor CLI as well as the editor?
Yes. Cursor discovers skills from the same directories in both the editor and the CLI. A skill you write for editor use is automatically available when you run cursor from your terminal.
Can a skill run scripts automatically?
A skill can reference scripts in a scripts/ subfolder, and the agent can run them using its terminal tool. The agent still shows the command in the trace before execution — you can always see what is about to run.
Is there a built-in skills marketplace or registry?
As of mid-2026, Cursor does not have an official public registry, but the open standard means teams share skills through GitHub repos. Search GitHub for .cursor/skills to find community examples.
Can I have a skill apply only to a specific file type or folder?
Yes. Skills in nested subdirectories (e.g., src/frontend/.cursor/skills/) are automatically scoped to files inside that directory. For broader rules, use the skill's instructions to tell the agent which files or patterns it applies to.
How is a skill different from a Cursor Rule?
Rules (in .cursor/rules/) set persistent coding conventions that apply in every prompt — always-on context. Skills are on-demand capabilities you invoke with /skill-name; they fire when relevant, not on every message. Use both: rules for invariant style, skills for recurring workflows.
Sources & last verified
- Cursor - Agent Skills
- Cursor - Skills (Help)
- Cursor Changelog - Subagents, Skills and Image Generation
- Cursor - Best Practices for Coding with Agents
Cursor ships frequently. Facts verified against primary sources on June 25, 2026.