维护洋葱私有 Cursor 插件市场 onions-plugins:每个插件在仓库内以独立目录发布,由根目录的 marketplace.json 聚合为可安装包。
| 路径 | 说明 |
|---|---|
plugins/<name>/ |
单插件源码:rules/、skills/、commands/、assets/ 等,以及必需的 plugins/<name>/.cursor-plugin/plugin.json |
.cursor-plugin/marketplace.json |
市场清单:声明 pluginRoot(当前为 plugins)及插件列表,source 为相对 pluginRoot 的插件目录名 |
docs/add-a-plugin.md |
新增插件的步骤、清单字段与校验说明 |
scripts/validate-template.mjs |
提交前校验插件与市场配置 |
install/cursor |
将本仓库中的 .cursor 配置(commands / rules / skills)同步到目标项目或 ~/.cursor,见 install/README.md |
scripts/sync-guardrails.mjs |
从 ai-guardrails 仓库同步前端 skills / rules / mcp 到 frontend、fe-figma-flow、fe-onion-stack 插件 |
在 Cursor 中可参考 docs/add-a-plugin.md 操作:创建 plugins/<插件名>/、编写 plugin.json、在 .cursor-plugin/marketplace.json 注册,并运行 node scripts/validate-template.mjs 通过校验后再提交。
建议:直接告诉cursor 参考 docs/add-a-plugin.md 新增某某插件
Cursor → Settings → Plugins → onions-plugins → 进入插件市场 → 选择插件 → Add to Cursor
- 后端 / 全栈(含 Go 与团队后端规范):建议安装 Common + Backend
- 仅需文档规范、代码审查、飞书分支等通用能力:可只安装 Common
- 前端安全审查 / 工程规范:建议安装 Common + Frontend
- 前端 Figma 还原 / 响应式开发:建议安装 fe-figma-flow(可叠加 fe-onion-stack)
- 洋葱内部前端技术栈(onion-ui / onion-utils / 视频):安装 fe-onion-stack
- 前端/后端 Spec-Driven(OpenSpec 变更目录):按需安装 fe-specflow / be-specflow(可与 Common 同装)
| 插件 ID | 说明 |
|---|---|
| common | 通用:rules(如文档语言规范)、commands(如 /cr)、skills(本地 AI 代码审查、飞书需求分支等) |
| backend | 后端:rules(Go、HTTP、数据库、工程约定、安全合规等) |
| frontend | 前端安全与规范(同步自 ai-guardrails):skills(fe-security、技术选型守卫、页面体验审查、工程化标准、性能优化)+ rules(commit、fe-engineering-*、性能优化触发规则) |
| fe-figma-flow | 前端 Figma 还原工作流(同步自 ai-guardrails):figma-read、img CDN 处理、响应式布局分析与实现、design-tokens,内置 Figma/CDN/DevTools mcp.json |
| fe-onion-stack | 前端洋葱内部技术栈(同步自 ai-guardrails):onion-ui、onion-utils、洋葱视频、API 层规范 |
| fe-specflow | 前端 Specflow:OpenSpec + Superpowers 编排,/fe-sdd、pull-spec、e2e-verify 等 |
| be-specflow | 后端 Specflow:同上后端视角,/be-sdd、前端契约/QA spec 拉取、交叉验证与归档 |
frontend、fe-figma-flow、fe-onion-stack 三个插件的内容同步自 ai-guardrails 仓库(source of truth),请勿在本仓库手改这些插件的 skills/、rules/、mcp.json,改动请提交到 ai-guardrails 后重新同步:
# 默认源为本地 ../ai-guardrails,可用 --source 指定路径
node scripts/sync-guardrails.mjs
node scripts/validate-template.mjs每个同步插件根目录的 .sync-meta.json 记录了内容源版本、commit 与同步时间。内容到插件的映射表维护在 scripts/sync-guardrails.mjs 的 PLUGIN_MAPPING 中。
ai-guardrails 打仓库级 tag vX.Y.Z 发版时,其 CI 会通过 trigger token 调起本仓库的 sync-guardrails 流水线(见 .gitlab-ci.yml 与 scripts/ci-sync-guardrails.sh):自动拉取对应 tag 内容、运行同步与校验,有变更则推 sync/ai-guardrails-* 分支并创建 MR。也支持定时任务与 Web 手动触发兜底。
启用前需配置:
- cursorkit:CI 变量
SYNC_GITLAB_TOKEN(ai-guardrails read_repository + cursorkit write_repository/api),并在 Settings → CI/CD 创建 Pipeline trigger token; - ai-guardrails:CI 变量
CURSORKIT_TRIGGER_TOKEN(填上一步的 trigger token)。