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, such as generating a migration the way your project does it. 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?
- How do I use a skill in Cursor?
- How do I create a new skill?
- When is the best time to create a skill?
- Where should I put skills, and which directories does Cursor scan?
- How do teams share and standardize skills?
- Can non-engineers use skills for domain knowledge?
- Skill, rule or command: how do I decide which to reach for?
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. They're 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, which 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.
The split between SKILL.md and scripts/ is the whole point. Put the judgment part in Markdown, where you want the agent to think and use its intelligence. Put the part that must run identically every time in a script. As one field engineer put it: a skill is a combination of a natural-language description to the agent and an explicit deterministic executable script. Reach for a script when you don't want the agent inventing a fresh solution on every run.
This is covered hands-on in Agent Mode Foundations — 6 short modules, free to read.
How do I use a skill in Cursor?
You can run a skill yourself from the slash menu, or let Cursor pick it up on its own. The two manual paths are below; either way the agent loads the SKILL.md instructions and follows them.
Turn a repeated job into a project Skill
0:42 · narratedRead this demo as text
- Filter Rules, Skills, Subagents to this project. The changelog row is real discovery chrome — name plus trigger description, not an invented skill catalog.
- Open the file .cursor slash skills slash changelog slash SKILL dot md. Keep the trigger, ordered steps, and helper boundary together so the workflow is versioned with the repo.
- Invoke slash changelog. The Skill runs its local commit collector, groups the result, and hands back a bounded draft — no hidden procedure left in your head.
Practice next: Practice this yourself in the hands-on module.
Simulated Cursor 3.12 (macOS, light) — beta educational reconstruction, not the real product.
- 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?
Two ways to make a skill: write the SKILL.md file by hand, or convert an existing rule or slash command with the built-in /migrate-to-skills skill. The steps below cover the manual path, plus the one move that makes it shared rather than personal.
- 1Add a folder inside
.cursor/skills/(or.agents/skills/) and create aSKILL.mdinside it. - 2Already have a rule or slash command that does the job? Convert it with the built-in
/migrate-to-skillsskill instead of starting from scratch. - 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.
When is the best time to create a skill?
Right after you finish a task. The moment the agent has just done something well (explored a database, produced a report, figured out a build), codify it before the context evaporates.
The strongest pattern field engineers use is explore-once, then codify. Let the agent burn tokens learning your system the slow way the first time. Then turn that hard-won knowledge into a skill so every future run is fast and deterministic.
One knowledge-work engineer gave the agent almost no schema and let it think long to learn the database through an MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition.. Then she asked it to write a skill for the lookup.
Once it actually learns the structure and figures out how to work, then I'll ask it to create a skill to do this. Now it runs a ton faster. Instead of looking through the entire database, it uses the skill and knows exactly where to look.
You don't have to hand-write the file. In chat, or the CLI, run /create skill and Cursor scaffolds it with a built-in template and prompt that captures the workflow you just ran. The flow is interactive: it asks clarifying questions first (where to store it, how deep to go, which parts of the app it covers) before generating. Answer "store this in my project" to make it a project skill the team inherits.
Treat Cursor as a very intelligent colleague who knows everything about software engineering but won't think for you. It needs you to point it at the end goal. A skill is how you pin that direction down once instead of re-explaining it every session.
Where should I put skills, and which directories does Cursor scan?
Where you save a skill decides two things: who else gets it, and which files it applies to. Project root (.cursor/skills/) ships the skill with the repo for the whole team; ~/.cursor/skills/ keeps it personal across your projects. A nested folder like src/api/.cursor/skills/ scopes it to files under that subtree. The table below lists every location Cursor scans on startup.
- 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, an 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, an 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.
Can non-engineers use skills for domain knowledge?
Yes. A skill is just a Markdown file, so any team can use one to pin down definitions, canonical sources or a design system the agent must respect.
The anti-hallucination value shows up clearly outside code. Without the right context an LLM will go to the wrong place or invent an answer. A skill points it at the source of truth every time.
Cursor's finance team built a finance assistant skill holding predefined definitions of every internal term, and for each one, the table that is the canonical source of truth.
Once it knows the shape of the business (self-service customers billed via Stripe, enterprise via ACH or wire), they stop re-explaining it each session. Reported as heavily used and "super helpful".
Designers fold their design system into a skill: "every time you make changes, check the Figma design system in this skill and adhere to it", or "after any design change, use the browser and test it yourself".
Giving the agent icons, kerning and padding context this way stops it hallucinating its own and quietly remaking your design-system elements.
Cursor supports a design.md file, but a loose Markdown file is easy for the agent to overlook. Make sure it's incorporated into a skill somehow. Skills can reference scripts or other MD files, so the design context actually gets pulled in when it's relevant.
Skill, rule or command: how do I decide which to reach for?
On startup the agent reads only each skill's name and description, then pulls the full SKILL.md in when the description matches the task. That's progressive disclosureHow skills load: the agent boots knowing only each skill's name and description, then pulls a skill's full instructions into context only at the moment it decides to use it. Press Enter for the full definition.: a one-line summary is cheap, the body loads on demand. If a skill isn't firing when you expect, the description is almost always the culprit. Spell out exactly when it 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. Press Enter for the full definition. to hand off a whole job to a specialist.
All three primitives are Markdown files. What changes is the role they play.
A rule is like "you should always wear your seat belt". A skill is "this is how you parallel park". And then 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. Press Enter for the full definition. is your car is on autopilot and it's parking on its own.
- 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.
Picture the agent as a construction worker. Rules are the manuals and the city code it has to obey, static reference pulled in when it enters a relevant area. A skill is a tool in the toolbox: it picks the right one up when the task calls for it. Rules are instruction-time; skills are action-time.
That's why a deterministic procedure belongs in a skill, not a rule. A rule that says "use the development build profile" is guidance the agent may or may not follow. A skill is a definitive workflow the agent runs through. When you want the same steps every time, write a skill.
When in doubt, start with a skill. The write-tests example above is the shape most workflows take: a name, a description that says when it applies, and a few steps the agent follows. Write the SKILL.md, commit it, and reach for a rule or 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. Press Enter for the full definition. only when a skill clearly isn't the right fit.
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, so 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.
Should I use a skill or a command for new workflows?
A skill. A command can only be invoked by you; a skill can be invoked by both you and the agent, and a skill with disable-model-invocation: true in its frontmatter reproduces the human-only behaviour exactly. The sunset the field engineers predicted has effectively happened: as of July 2026 the commands page is gone from cursor.com/docs, and the built-in /migrate-to-skills skill converts existing commands. Old .cursor/commands/ files still load, but new workflows belong in .cursor/skills/.
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. Last updated July 31, 2026.
Keep reading
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.