Convert Cursor Rules or AGENTS.md to SKILL.md

Which Cursor rules, AGENTS.md sections and slash commands should become skills, how the frontmatter maps, and what Cursor's /migrate-to-skills does and skips.

· 4 min read · Skillland

GuidesAuthoring

Rules files and AGENTS.md load into every session, or every session that touches certain files. A skill loads only when a request matches it. Moving the right parts out of the first group and into skills cuts what the agent reads on every request and gives those parts a name you can call. Moving the wrong parts breaks conventions the agent needs every time.

This guide covers what to convert, how the fields map, and how to check the result.

What should stay where it is

Keep anything the agent needs on every task:

  • build, test and lint commands
  • naming and formatting conventions
  • "never do X" rules
  • the project layout

These are facts, not procedures. Claude Code's docs put it as: create a skill "when a section of CLAUDE.md has grown into a procedure rather than a fact" (Claude Code skills docs).

Cursor draws the same line in code. Its /migrate-to-skills command does not touch rules with alwaysApply: true or with globs, and it skips User Rules "since they are not stored on the file system" (Cursor: Agent Skills).

What should become a skill

  • A Cursor rule with a description and no globs. Cursor already treats it as on demand: the "Agent reads the description and pulls the rule in when relevant" (Cursor: Rules). That's how a skill works, and it's exactly the kind of rule /migrate-to-skills converts.
  • A section of AGENTS.md or CLAUDE.md that reads like a checklist: "How to cut a release", "How to add a migration", "Steps for a new API endpoint". If most tasks don't need it, it doesn't need to load every session.
  • A slash command. In Cursor, /migrate-to-skills turns commands into skills with disable-model-invocation: true, "preserving their explicit invocation behavior". In Claude Code, .claude/commands/ files keep working, and the docs suggest moving a command to a skill when it needs more than one file: .claude/commands/deploy.md becomes .claude/skills/deploy/SKILL.md, and you still type /deploy.

Let Cursor do the first pass

In Cursor, type /migrate-to-skills in Agent chat. The docs say it was added in Cursor 2.4 and that it "helps you convert existing dynamic rules and slash commands to skills". Review the generated skills in .cursor/skills/ before you commit them. Then run them through the validator, because a rule's description was written to be read by a person picking rules, and often it doesn't say when to use it.

Convert by hand

Here's a Cursor rule that should be a skill:

---
description: Database migrations
alwaysApply: false
---

When adding a migration:
- create it with `pnpm db:new <name>`
- never edit a migration that has been merged
- run `pnpm db:check` before committing

And the same content as .agents/skills/add-migration/SKILL.md:

---
name: add-migration
description: Creates and checks a database migration with the project's db scripts. Use when the user asks to add, change or roll back a database table, column or index.
---

# Add a migration

1. Create the file with `pnpm db:new <short-name>`.
2. Write the change and its rollback in the new file.
3. Run `pnpm db:check` and fix anything it reports.
4. Never edit a migration that is already on main. Add a new one instead.

## Example

"Add an index on orders.created_at" becomes `pnpm db:new add-orders-created-at-index` with one `CREATE INDEX` and one `DROP INDEX`.

The field mapping:

Cursor ruleSKILL.md
file name (database.mdc)folder name, and the same string in name
descriptiondescription, rewritten to say what the skill does and when to use it
globspaths (Cursor and Claude Code skills both support it)
alwaysApply: trueno skill: keep it as a rule or move it to AGENTS.md
bodybody, as numbered steps with an example

Three details catch people out.

The description has to change. "Database migrations" was enough for a rule list. A skill's description is matched against what the user types, so it should name the result and the requests that call for it. The validator flags descriptions with no "Use when" and ones that are too short.

globs is legacy in skills. Cursor says it's "still accepted as a fallback for older skills, but new skills should use paths". The validator reports it as legacy globs.

Referenced files work differently. A Cursor rule can point at a file, but Cursor notes that "The file's contents are not inlined into the prompt". A skill can bundle the file inside its own folder, in references/ or scripts/, and link to it from SKILL.md with a relative path so the agent opens it when needed. Links that point outside the skill folder fail the linked file check, since the folder may be copied somewhere else on install.

From AGENTS.md

AGENTS.md has no frontmatter, so there's nothing to map. For each section you move:

  1. Make a folder named after the task, such as .agents/skills/cut-release/.
  2. Write a name and a description that ends with "Use when..." and the requests that should load it.
  3. Paste the section as the body and turn the prose into numbered steps.
  4. Leave one line in AGENTS.md, such as "Release steps live in the cut-release skill", so readers of the file know where it went.

The .agents/skills/ folder is read by both Codex and Cursor. For Claude Code, add a symlink at .claude/skills/cut-release; Cursor reads .claude/skills/ as well. The create-a-skill guide has the full folder list for each agent.

Check the result

Run the validator over the whole folder:

npx -p @skillland/validator skillland check .agents/skills

It checks every SKILL.md below that path against the validator rules, each one taken from the spec or an agent's docs. Then try a request that should load each skill, and one that shouldn't, to see that the descriptions match the way you expect.

share