Cursor的上下文

类型 描述 路径
Rules 项目Rules: .cursor/rules
Commands 项目Commands: .cursor/commands
全局Commands: ~/.cursor/commands
Skills 项目Skills: .cursor/skills 或者 .agent/skills
全局Skills: ~/.cursor/skills
SubAgents 项目SubAgents: .cursor/agents
全局SubAgents: ~/.cursor/agents

Rules

Commands

Skills

Skill的目录结构如下, 必须是一个包含有SKILL.md文件的文件夹

1
2
3
4
.agents/
└── skills/
└── my-skill/
└── SKILL.md

SKILL.md 文件的模板如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
name: my-skill
description: Short description of what this skill does and when to use it.
---

# My Skill

Detailed instructions for the agent.

## When to Use

- Use this skill when...
- This skill is helpful for...

## Instructions

- Step-by-step guidance for the agent
- Domain-specific conventions
- Best practices and patterns
- Use the ask questions tool if you need to clarify requirements with the user