Files
Nexus/docs/project/cursor-plugins-for-nexus.md
T
r 9c9a51263c chore: 本地快照 — 终端 UI、服务器 site_url、后台任务与 Agent 导航
汇总未提交工作区:Servers 列表 site_url 链接、终端页与选机器 UI、SSH 连通性与 Telegram 通知、agent/offline/unset_path 后台调度与 gate_ai_review 门控;更新 AGENTS 与 agent-exploration 规则(仅本机 commit);同步 web/app 构建产物与相关文档。
2026-06-18 06:01:50 +08:00

6.0 KiB
Raw Blame History

Cursor 插件 / MCP / Skills — Nexus 用法对照

工作区:~/NexusLinux)。改 MCP 配置后 Developer: Reload Window

优先级总览

优先级 能力 Nexus 场景 启用方式
P0 MySQL MCP 查表结构、EXPLAIN、验收数据 .cursor/mcp.json + scripts/linux_mcp_mysql.sh
P0 Playwright 14 页 SPA 登录/路由验收 frontendnpm run test:e2e;可选 Playwright MCP
P0 fastapi-expert / python-pro server/ API、async、Pydantic Agent 改后端时自动适用
P0 vue-expert / typescript-pro frontend/ Vuetify SPA Agent 改前端时自动适用
P0 security-reviewer / secure-code-guardian JWT、注入、凭据脱敏 合 PR / 改 auth、WebSSH、sync 前
P1 code-reviewer / pr-test-analyzer 交付前 diff 审查、测覆盖 用户说「review」或大范围改动后
P1 playwright-expert flaky E2E、新页面加用例 frontend/e2e/
P1 devops-engineer Docker、CI、Supervisor docker-composedeploy/
P3 chainguard-*暂不启用 镜像 CVE / Dockerfile 硬化 需 OAuth;用户决定先跳过
P1 database-optimizer / sql-pro 慢查询、分页、索引 *_repo.py、审计报告里的 PERF
P2 Linear MCP 需求/缺陷跟踪(若团队用 Linear) Settings → MCP 登录
P2 Slack MCP 部署/告警通知到频道 需 Bot Token
P2 Figma MCP 新页面 UI 稿 → 组件(有设计稿时) 需 Figma 文件权限
P3 Datadog MCP 生产 APM/日志(有 Datadog 账号时) ddsetup skill
memory MCP 跨会话记忆(可选) 勿写入密钥

P0MySQL MCP(强烈推荐)

用途Agent 直接 list_tables / query / explain_query,比手写 mysql CLI 更安全(只读/allowlist)。

一次性配置(Ubuntu

cd ~/Nexus
# Node 20+(示例用 nvm
node -v   # 需 v20+

python3 scripts/sync_mysql_mcp_env.py --writable   # 本地开发可写
chmod +x scripts/linux_mcp_mysql.sh
  1. 确认 .cursor/mcp.json 使用 scripts/linux_mcp_mysql.sh(已随仓库更新,勿再用 WSL 旧路径)。
  2. Cursor Settings → MCPmysql-mcp 绿点。
  3. 对 Agent 说:「用 MySQL MCP test_connectionlist_tables」。

详见 docs/project/mysql-mcp-setup.md

SOCKS5 代理(如 192.168.124.93:10808):复制 scripts/npm-proxy.env.examplescripts/npm-proxy.envMCP 脚本自动加载。npm 不认 socks5:// URL,已本地安装包时无需 npx;否则用 proxychains4


P0Playwright(前端验收)

仓库已有frontend/e2e/full-acceptance.spec.mjs(全站路由 + 控件冒烟)。

cd ~/Nexus/frontend
npm ci
export NEXUS_E2E_BASE=http://127.0.0.1:8600
export NEXUS_E2E_USER=admin
export NEXUS_E2E_PASSWORD='你的密码'
npx playwright install chromium
npm run test:e2e

Playwright MCPCursor 插件):适合 Agent 在对话里打开 /app/#/login 做浏览器抽测;若 STATUS 报错,在 Settings → MCP 完成认证后 Reload。

与门控关系:部署后应用 curl /health + 可选 Playwright,代替「请你人工点一遍」。


P0:后端 / 前端 Skills(改代码时)

Skill 路径关键词 Nexus 文件
fastapi-expert FastAPI、JWT、WebSocket server/api/*.py, server/main.py
python-pro ruff、pytest、类型 server/, tests/
vue-expert Vue3、Pinia、Vuetify frontend/src/
websocket-engineer WS 告警、WebSSH server/api/websocket.py, webssh.py
fullstack-guardian 端到端功能(API+页面+安全) 新 CRUD 页面

用法:在需求里点名即可,例如「用 fastapi-expert 规范改 servers.py 分页」。


P1:安全与质量

Skill 何时用
security-reviewer 改认证、文件上传、脚本执行、Agent API Key
code-reviewer 提交前看 diff(配合 standards/line-walk-audit-standard-v2.md
pr-test-analyzer 大 PR 是否缺 tests/test_api.py / E2E
comment-analyzer 大段注释/文档变更后核对是否与代码一致
type-design-analyzer 新 Pydantic 模型 / TS 类型设计

Nexus 强制deploy/pre_deploy_check.sh 八道门(含 Gate 8 AI Reviewscripts/gate_ai_review.py)— Skills 不替代门控,只补审查维度。


P1Docker / Chainguard

能力 Nexus
devops-engineer docker-compose.ymldeploy/、Supervisor
chainguard-migrate-dockerfile FROM python:3.12-slim 换为加固基础镜像
chainguard-inspect-image / cg-apk 查 CVE、对比 digest

当前 Dockerfile 为开发友好镜像;上生产前可用 Chainguard skill 做 镜像硬化方案(需单独设计文档 + changelog)。


P2:协作与设计(按需)

  • Linear MCP:把 docs/reports/ 待办同步为 issue(需团队使用 Linear)。
  • Slack MCPsupervisorctl restart 或门控失败时发频道(需 Webhook/Bot)。
  • Figma MCP:新仪表盘/设置页有稿时,figma-generate-design + vue-expert 对齐 Vuetify。

不建议用于 Nexus 的

  • 部门型多 Agent 话术(见 .cursor/rules/no-department-agents.mdc
  • 在 MCP / 对话里粘贴生产 SECRET_KEY、完整 .env
  • 用 Figma/Linear 代替 changelog + 审计 8 步(流程仍以 perfect-implementation.mdc 为准)

推荐 Agent 提示词模板

【任务】……
【插件】需要时用 MySQL MCP 查 nexus.admins / servers;改完跑 ruff + test_api;前端改动则 playwright e2e。
【约束】perfect-implementation;单 Agentchangelog。

维护

  • 换机或路径变更:只改 scripts/linux_mcp_mysql.sh / .cursor/mcp.json,勿写死 C:\Users\...
  • 新增 MCP:在本文件加一行 P0/P1/P2,并在 docs/changelog/ 记一笔。