夜雨聆风学习资料网

ARTICLE · 1383360

Cursor 插件系统:把团队规范装进 AI Agent

Cursor 插件系统:把团队规范装进 AI Agent
cursor/plugins 仓库把 Cursor 的插件规范和 149 个官方插件全部开源。本文实测官方校验器,并从零手写一个 Vue 组件守卫插件,放进本地目录即被 Cursor 识别。
rules
rules/*.mdc
给 Agent 的编码规则
skills
skills/*/SKILL.md
可被调用的技能
agents
agents/*.md
子代理定义
commands
commands/*.md
斜杠命令
hooks
hooks.json
生命周期钩子
mcpServers
mcp.json
外部工具接入

▪︎ 开发者工具:create-plugin、thermos、orchestrate、cursor-sdk

▪︎ 团队工作流:pstack、dyl-stack、cursor-team-kit

▪︎ 第三方集成:playwright、github、feishu、lark-base

curl -sL -o plugins.tgz \https://codeload.github.com/cursor/\plugins/tar.gz/refs/heads/maintar xzf plugins.tgz && cd plugins-mainnpm init -y && npm i ajv ajv-formatsnode scripts/validate-plugins.mjs
p=~/.cursor/plugins/local/vue-sfc-guardmkdir -p $p/.cursor-plugin $p/rulesmkdir -p $p/skills/sfc-auditmkdir -p $p/commands
{  "name": "vue-sfc-guard",  "displayName": "Vue SFC Guard",  "version": "0.1.0",  "description": "SFC review rules",  "license": "MIT",  "rules": "./rules/",  "skills": "./skills/",  "commands": "./commands/"}
---description: Guard Vue SFC files.alwaysApply: falseglobs:  - "**/*.vue"---# Vue SFC guard1. One component per file.2. Prefer script setup + defineProps.3. No any on props or emits.4. Over 200 lines: split into   composable + presentational parts.
---name: sfc-auditdescription: Audit Vue SFC files andreport prioritized fixes.---# SFC audit1. Glob all src/**/*.vue files.2. Check the five guard rules.3. Report file:line and a fix.4. End with counts per rule.
---name: audit-sfcdescription: Run the sfc-audit skill.---Run the sfc-audit skill on thisworkspace and print the full report.
import { readFileSync } from "fs";import Ajv from "ajv";import addFormats from "ajv-formats";const manifestPath = process.argv[2];const schema = JSON.parse(readFileSync(  "plugin.schema.json", "utf-8"));const ajv = new Ajv({allErrors: true});addFormats(ajv);const check = ajv.compile(schema);const json = JSON.parse(readFileSync(  manifestPath, "utf-8"));console.log(check(json)  ? "PASS" : check.errors);
node local-validate.mjs# FAIL vue-sfc-guard:#   must have required property 'name'# 0/1 plugins valid# 补回 name 字段,再跑一次node local-validate.mjs# PASS vue-sfc-guard v0.1.0# 1/1 plugins valid
{  "version": 1,  "hooks": {    "stop": [{      "command": "bun run stop.ts"    }]  }}
{  "mcpServers": {    "playwright": {      "command": "npx",      "args": [        "-y", "@playwright/mcp@latest"      ]    }  }}
{  "name": "vue-sfc-guard",  "source": "./vue-sfc-guard",  "description": "Vue SFC guard"}

▪︎ 团队有成文编码规范的前端团队:把规范翻译成 rules,比贴在 wiki 里有效得多

▪︎ 在写 Agent 工作流的开发者:hooks 与 mcp.json 是两个现成的扩展点

▪︎ 想给官方市场贡献插件的开发者:先跑通 validate-plugins.mjs 再提 PR

▪︎ 项目地址:https://github.com/cursor/plugins

▪︎ 官方校验器:scripts/validate-plugins.mjs

▪︎ 插件 Schema:schemas/plugin.schema.json

▪︎ 数据核对:GitHub API,2026 年 11 月 18 日

回首页,搜索你想要的文档

在首页搜索框输入关键词,快速定位资料

文库首页搜索指引 立即搜索

相关学习资料