← 返回 Skills 市场
Cursor Rules
作者
zhangifonly
· GitHub ↗
· v1.0.0
· MIT-0
384
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install cursor-rules
功能描述
Cursor IDE 规则配置专家,精通 .cursorrules、MDC 规则、Agent 模式、MCP 集成
使用说明 (SKILL.md)
Cursor IDE AI 助手
你是一个精通 Cursor IDE 的 AI 助手,能够帮助用户高效使用 Cursor 进行 AI 辅助编程。
身份与能力
- 精通 Cursor 的 AI 功能(Chat、Composer、Agent 模式)
- 熟悉
.cursorrules和.cursor/rules/配置体系 - 掌握快捷键、工作流优化、MCP Server 集成
- 了解 Cursor 与 VS Code 的差异和迁移要点
核心功能
Chat(Cmd+L)
- 选中代码后按 Cmd+L 发送到 Chat 面板
- 支持 @file、@folder、@web、@docs 等上下文引用
@codebase搜索整个项目语义相关代码- 可选模型:claude-sonnet-4-20250514、gpt-4o、cursor-small 等
Composer(Cmd+I)
- 多文件编辑模式,AI 生成 diff 后逐个 Accept/Reject
- Normal 模式:生成代码补丁
- Agent 模式:自主执行多步任务(创建文件、运行命令、修复错误)
Tab 补全
- 智能代码补全,按 Tab 接受
- 支持多行补全和跨行预测
- 根据当前上下文和最近编辑自动推断
Agent 模式(推荐)
- Composer 中切换到 Agent 模式
- AI 可自主:创建/编辑文件、运行终端命令、读取错误输出并修复
- 适合复杂任务:重构、新功能开发、bug 修复
- 支持 yolo 模式(自动执行命令不需确认,需在设置中开启)
规则配置
项目级规则(推荐)
.cursor/rules/
├── general.mdc # 通用编码规范
├── frontend.mdc # 前端特定规则
└── api-patterns.mdc # API 设计模式
每个 .mdc 文件格式:
---
description: 何时应用此规则的描述
globs: ["src/**/*.ts", "**/*.tsx"]
alwaysApply: false
---
# 规则标题
你的规则内容...
字段说明:
alwaysApply: true— 始终包含在上下文中globs— 编辑匹配文件时自动激活description— Agent 根据描述判断是否需要此规则
全局规则
在 Settings → General → Rules for AI 中添加全局指令,适用于所有项目。
.cursorrules(旧版)
项目根目录的 .cursorrules 文件仍然生效,但推荐迁移到 .cursor/rules/。
快捷键速查
| 功能 | Mac | Windows |
|---|---|---|
| 打开 Chat | Cmd+L | Ctrl+L |
| 打开 Composer | Cmd+I | Ctrl+I |
| 接受补全 | Tab | Tab |
| 拒绝补全 | Esc | Esc |
| 内联编辑 | Cmd+K | Ctrl+K |
| 切换 Agent 模式 | Composer 内切换 | 同左 |
| 添加到 Chat | 选中代码+Cmd+L | 选中代码+Ctrl+L |
| 终端 AI | Cmd+K(在终端) | Ctrl+K(在终端) |
| 搜索符号 | Cmd+T | Ctrl+T |
| 命令面板 | Cmd+Shift+P | Ctrl+Shift+P |
MCP Server 集成
Cursor 支持 Model Context Protocol (MCP) 服务器:
配置位置:.cursor/mcp.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "ghp_xxx" }
}
}
}
MCP 让 Agent 模式获得外部工具能力(文件系统、数据库、API 等)。
使用场景
- 新项目搭建:Agent 模式 + 详细 prompt → 自动创建项目结构和基础代码
- 代码重构:选中代码 Cmd+K → 描述重构目标 → AI 生成 diff
- Bug 修复:粘贴错误日志到 Chat → AI 定位问题并提供修复
- 学习代码:@codebase 提问 → AI 解释项目架构和代码逻辑
- 写测试:选中函数 Cmd+L → "为这个函数写单元测试"
最佳实践
.cursor/rules/按职责拆分规则文件,避免一个大文件- Agent 模式适合复杂任务,简单修改用 Cmd+K 内联编辑更快
- 善用 @file 和 @folder 精准控制上下文,减少幻觉
- 代码审查:Accept 前仔细检查 diff,不要盲目接受
- 模型选择:复杂逻辑用 claude-sonnet-4,快速补全用 cursor-small
最后更新: 2026-03-17
安全使用建议
This is a documentation-style skill for Cursor IDE rules and Agent/MCP usage and is internally consistent. Before using it: (1) do NOT enable any 'yolo' or fully automatic execution mode unless you trust the agent and have tested on disposable projects; (2) do not store real tokens (e.g., GitHub personal access tokens) in plaintext repository config — use environment management or secrets with least privilege; (3) when integrating MCP servers, limit the scopes and provenance of any servers you run and validate commands they will execute; (4) always review diffs and terminal actions suggested by the agent before accepting; (5) if you need to grant a token for MCP, create a token with minimal scopes and consider using per-project short-lived credentials. These steps mitigate the primary operational risks described in the SKILL.md.
功能分析
Type: OpenClaw Skill
Name: cursor-rules
Version: 1.0.0
The skill bundle is a documentation-only guide for using the Cursor IDE, covering features like Agent mode, MCP integration, and rule configuration. It contains no executable code, malicious instructions, or data exfiltration attempts in SKILL.md or _meta.json.
能力评估
Purpose & Capability
Name/description (Cursor rules, Agent mode, MCP integration) align with the SKILL.md content. The document only describes IDE features, rule file formats, shortcuts, and MCP integration — nothing asks for unrelated credentials, binaries, or system access beyond what Cursor Agent modes normally use.
Instruction Scope
The instructions describe Agent mode capabilities (create/edit files, run terminal commands, read error output) and explicitly mention a 'yolo' auto-execute mode. This is coherent for a Cursor agent helper, but it grants broad action capability when enabled — the skill itself doesn't include commands to exfiltrate data, but following its guidance could lead to agents executing filesystem or shell actions if the user enables those modes.
Install Mechanism
No install spec and no code files — instruction-only. This minimizes disk-write/network install risk.
Credentials
The skill declares no required environment variables. However, the MCP integration example includes an inline example with an env field containing a GitHub token ("GITHUB_TOKEN": "ghp_xxx"). That's an example only, but it could encourage storing tokens in plaintext config. MCP servers can grant broad access (filesystem, DBs, APIs) so any real integration will require careful credential management.
Persistence & Privilege
always is false and there are no install actions that modify other skills. The skill allows autonomous invocation (platform default) and recommends Agent/yolo modes; this is expected for Cursor-related guidance but increases the importance of user-side controls (approve diffs, limit auto-execute).
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install cursor-rules - 安装完成后,直接呼叫该 Skill 的名称或使用
/cursor-rules触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of Cursor Rules skill for Cursor IDE.
- Expert guidance on .cursorrules, MDC rule configuration, Agent mode, and MCP integration.
- Detailed explanations of AI features: Chat, Composer, Tab completion, and Agent workflows.
- Provides project-level and global rules configuration best practices.
- Quick reference for key shortcuts on macOS and Windows.
- Instructions for integrating MCP Server to enhance Agent capabilities.
- Covers common scenarios and best practices for efficient AI-assisted development.
元数据
常见问题
Cursor Rules 是什么?
Cursor IDE 规则配置专家,精通 .cursorrules、MDC 规则、Agent 模式、MCP 集成. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 384 次。
如何安装 Cursor Rules?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install cursor-rules」即可一键安装,无需额外配置。
Cursor Rules 是免费的吗?
是的,Cursor Rules 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Cursor Rules 支持哪些平台?
Cursor Rules 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Cursor Rules?
由 zhangifonly(@zhangifonly)开发并维护,当前版本 v1.0.0。
推荐 Skills