Skip to content

Commit 1a386ff

Browse files
authored
feat: add Cursor IDE host support (#71)
Add Cursor IDE baseline support, release synchronization, documentation, and GitHub Pages coverage.
2 parents 2c2c13f + 8ae04d1 commit 1a386ff

64 files changed

Lines changed: 3197 additions & 119 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ snapshot_managed_release_paths() {
2222
"CHANGELOG.md"
2323
"skills/zh/header.md.template"
2424
"skills/en/header.md.template"
25+
"skills/zh/cursor-plugin-rule.mdc.template"
26+
"skills/en/cursor-plugin-rule.mdc.template"
2527
)
2628
local path
2729
local src
@@ -152,6 +154,8 @@ git -C "$ROOT_DIR" add \
152154
CHANGELOG.md \
153155
skills/zh/header.md.template \
154156
skills/en/header.md.template \
157+
skills/zh/cursor-plugin-rule.mdc.template \
158+
skills/en/cursor-plugin-rule.mdc.template \
155159
tests/golden-snapshots.json
156160

157161
cat >"$STATE_FILE" <<EOF

.sopify/blueprint/design.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ P4b 减重和 P4c 宿主消费治理的红线边界。只冻结 artifact / schem
441441

442442
> **未列入面默认可删**`state/sessions/*``state/last_route.json`、runtime 内部模块边界、route name 全集、output 渲染文案措辞均为 runtime 内部实现,不在 keep-list 内。P4b 减重时可自由处置。
443443
444-
`host_support` 只声明官方适配器能把 Skill 语义交付到对应宿主的支持界面并由宿主消费。它不等同于原生 Skill discovery,也不证明该宿主已经完成 E2E;支持等级、已验证能力和入口形态继续由 `HostCapability` 表达。当前五个内置 Skill 面向 `codex / claude / qoder / copilot`,其中 Copilot 通过单文件展开消费。
444+
`host_support` 只声明官方适配器能把 Skill 语义交付到对应宿主的支持界面并由宿主消费。它不等同于原生 Skill discovery,也不证明该宿主已经完成 E2E;支持等级、已验证能力和入口形态继续由 `HostCapability` 表达。当前五个内置 Skill 面向 `codex / claude / qoder / copilot / cursor`,其中 Copilot 通过单文件展开消费,Cursor IDE 通过用户 Plugin Rule 与全局 Skill 树拆分消费;Agent CLI 只保留手工 Skill 与用户 Hook 兼容面
445445

446446

447447
## Output Rendering Audit — *[pre-P8 legacy reference]*
@@ -504,6 +504,7 @@ output.py 渲染层逐字段分类。只做分类,不做改造决策(改造
504504
| Claude | `protocol_verified` | `install.sh --target claude:zh-CN` | CONTINUATION + INTERACTION + AUDIT | 已验证 |
505505
| Qoder | `protocol_verified` | `install.sh --target qoder` | CONTINUATION + INTERACTION + AUDIT | W3.1-W3.3 已验证 |
506506
| Copilot | `baseline_supported` | `install.sh --target copilot` | PROMPT_ONLY | Prompt-only |
507+
| Cursor | `baseline_supported` | `install.sh --target cursor` | PROMPT_ONLY + HOOKS | IDE user Plugin Rule + global Skills/payload + user-level `~/.cursor/hooks.json`; observable IDE baseline evidence, CLI manual Skills only |
507508

508509
### 契约消费矩阵(P8 2-file state model)
509510

@@ -543,7 +544,7 @@ output.py 渲染层逐字段分类。只做分类,不做改造决策(改造
543544
- MCP 只承接 active plan / handoff 读取、protocol check 与受 guard 约束的低层 receipt 写入;分析、设计、开发、checkpoint 与 finalize 决策继续由 prompt/skill 和宿主负责。
544545
- repo-local server 为 `scripts/sopify_mcp_server.py`。Codex-first 注册已通过官方 `codex mcp get/add`、真实 stdio tool 调用和 no-op 复验。
545546
- 2026-07-17 Claude 会话级消费已通过:使用临时 MCP 配置加载同一 repo-local server,成功调用 `sopify.workspace_status_lite`;该证据不等同于持久注册。
546-
- Codex-first 表示验证顺序,不改变 Qoder、Claude、Copilot 的能力梯度或支持声明。其他宿主自动注册须复用同一最小契约并各自补证据。
547+
- Codex-first 表示验证顺序,不改变 Qoder、Claude、Copilot、Cursor 的能力梯度或支持声明。其他宿主自动注册须复用同一最小契约并各自补证据。
547548
- 当前不把 Python/MCP 依赖供给、payload 打包、doctor 检查或多宿主配置抽象升级为产品面;只有后续证据证明重复痛点时再设计。
548549

549550
### 禁止消费面
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Sopify Cursor IDE Plugin 最终独立复审任务
2+
3+
## 复审模式
4+
5+
- 只读。不要修改代码、方案、`.sopify/state`、receipts、Cursor 配置或 Git index。
6+
- 仓库:`/Users/weixin.li/code/github/sopify`
7+
- 分支:`feat/cursor-support`
8+
- 基线:`d0e81f168be629cfa7f1e6b3cce5ed01f712fc3e`
9+
- 复审对象:相对基线的全部未提交 diff,包括删除文件与 untracked 文件。
10+
- 不沿用实现者结论;只按源码、测试输出、IDE 工具轨迹和文件结果独立裁决。
11+
12+
## 已定产品边界
13+
14+
1. Cursor IDE 是自动语义入口:用户级 Plugin 中一个薄 `alwaysApply: true` Rule 负责意图分类和精确 Skill 路由。
15+
2. Agent CLI 是低频兼容面:不承诺自动加载 Plugin Rule,只保留手工 Skill 与 Cursor 实际加载范围内的用户 Hooks。
16+
3. 不安装项目 `.cursor/rules/sopify.mdc`,不新增 launcher、prompt injector、Command、Custom Agent、MCP、orchestrator 或 runtime。
17+
4. 全局五项 Skills、shared references、payload 与用户 Hooks 由同一个 Cursor host installer 管理。
18+
5. 支持档位保持 `BASELINE_SUPPORTED`;独立 sessionStart、显式 finalize、AskQuestion 跨模型稳定性不是本轮阻塞项,也不得写成已验证。
19+
6. 不修改 Cursor settings、代理、模型、账号、API Key、钥匙串或 MCP;不支持 Cloud Agent。
20+
21+
## 代码与结构审查
22+
23+
- Cursor 仍是多宿主内核中的第五个 adapter,不是 fork。
24+
- `installer/cursor_plugin.py` 只负责本地 Plugin manifest、README 和一个薄 Rule;不得维护 Plugin 私有 Skills 副本。
25+
- Cursor 安装不要求 workspace、不预热项目 `.sopify`,首次产品写入前预检用户 hooks。
26+
- Hooks 只保护明显直接写入 state/handoff/receipt,放行方案文档、业务代码和正常 `sopify_writer` 库 API;helper 异常 fail-open,并由 Doctor 报告。
27+
- Doctor 分开报告 Plugin、Skill、payload、hooks 与 IDE/CLI behavior;临时本机 transcript 不得让静态 behavior 项冒充产品认证。
28+
- 检查 Codex、Claude、Qoder、Copilot 行为没有被 Cursor-specific 分支意外改变。
29+
30+
实现者在 2026-08-22 的最终候选上报告:308 passed / 78 subtests,Python compileall、`bash -n install.sh``git diff --check` 均通过。复审者应按下面命令自行重跑,不把这段记录当成独立通过。
31+
32+
同日真实 home Doctor 中,Cursor 的 Plugin、payload、bundle resolution、Skill tree 与 Hooks 五项均为 pass;IDE/CLI behavior 仍按静态设计为 skip / `BLACK_BOX_NOT_VERIFIED`。Doctor 的 overall fail 来自本仓库旧 `.sopify/sopify.json` 对 Codex、Claude、Qoder bundle 的历史 pin,不是 Cursor 检查失败,本任务不顺手改写该 workspace 配置。
33+
34+
## 可独立核验的 IDE 证据
35+
36+
### Plugin、consult 与 Analyze
37+
38+
- 用户范围的 Sopify Plugin Rule 已在 Cursor Customize > Rules 中显示为 Always Apply,Plugin 服务日志报告 `ruleCount: 1`
39+
- consult transcript:`/Users/weixin.li/.cursor/projects/Users-weixin-li-code-github-sopify/agent-transcripts/067ce461-c667-46fb-88ce-bffe4c4362a1/067ce461-c667-46fb-88ce-bffe4c4362a1.jsonl`
40+
- Analyze transcript:`/Users/weixin.li/.cursor/projects/Users-weixin-li-code-nio-data-sprite/agent-transcripts/7101b90b-ce5d-4acb-8fc3-930056f95e68/7101b90b-ce5d-4acb-8fc3-930056f95e68.jsonl`
41+
- 核验重点:consult 不加载阶段 Skill、不续旧方案、不写 machine truth;Analyze 实际读取 Cursor Skill 并执行评分脚本,低分时不进入 Design 或写文件。
42+
43+
### AskQuestion
44+
45+
- transcript:`/Users/weixin.li/.cursor/projects/Users-weixin-li-code-nio-data-sprite/agent-transcripts/84e9fa01-c2dc-4db5-9611-0f15c120bcb8/84e9fa01-c2dc-4db5-9611-0f15c120bcb8.jsonl`
46+
- 同一会话包含 AskQuestion tool use 与 `Tool not found` 回退;结构化问卷 UI 属人工观察,transcript 不含 tool result、选项回传或 `Other...`
47+
- 这只证明 AskQuestion 调用尝试与文本回退都发生过;结构化问卷 UI 仍是人工观察。不要据此宣称每个模型或每次会话都会稳定提供问卷。
48+
49+
### Managed 主链与 Hook
50+
51+
- 临时仓库:`/private/tmp/sopify-cursor-managed-blackbox.WRxVtd`
52+
- transcript:`/Users/weixin.li/.cursor/projects/private-tmp-sopify-cursor-managed-blackbox-WRxVtd/agent-transcripts/2448476f-57b8-4e1d-a522-c19e8202d658/2448476f-57b8-4e1d-a522-c19e8202d658.jsonl`
53+
- 初始业务文件为 `hello\n`。第一轮实际读取 Analyze/Design Skills,执行评分 `10/10` 和 light 分级,创建方案并经 writer 写 active plan/handoff,然后在 `confirm_decision` 停车,业务文件未改。
54+
- 用户确认后,第二轮读取四步链与 Develop Skill,将 `src/greeting.txt` 精确改成 `hello from Cursor\n`,更新方案为 `ready_to_archive`,并经 writer 追加 `exec_001``verify_001` 与 handoff;未 finalize、未 commit。
55+
- 第三轮实际执行紧贴重定向的 Shell 直写 `active_plan.json`,Cursor Hook 返回拒绝;Agent 未尝试绕过。
56+
57+
现场哈希:
58+
59+
```text
60+
f9e1d6f57a5d7a795513cfb8ef1ce5c8c7c3deb3319a0ab38df5a73a735ad0b2 .sopify/state/active_plan.json
61+
f24d2621d2fbc470b9febdcd8e700679358469f025c25f668e74dd1e661ce950 .sopify/state/current_handoff.json
62+
7335746bb72af92df43cb5b1435934d8bed6fbe282307f02630d62836dfe4ecd .sopify/plan/20260822_greeting_from_cursor/receipts/exec_001.json
63+
70c06cac2adeecc10e91443a04149cd6d5c627befc8cc6fbdbba8943c4ff3e47 .sopify/plan/20260822_greeting_from_cursor/receipts/verify_001.json
64+
bd601aecf0dae231623085daa65a69e8304327aaa829e629eb8362f34cb0496b src/greeting.txt
65+
```
66+
67+
不要只看最终回复。以 transcript 中的 `tool_use`、方案/receipt 内容、Git diff 和文件哈希为证据。
68+
69+
## CLI 已知边界
70+
71+
- 自动用户 Plugin:`4c24eab4-dd82-46f3-8fd7-67888baa1a53`
72+
- 显式 `--plugin-dir``7626c137-9668-450f-ab00-a44619f90f9c`
73+
- 唯一标记探针:`109d2991-78e6-46d8-a19a-5bd86f3198f0`
74+
75+
三次都没有证明 Agent CLI 自动加载用户 Plugin Rule。该能力不在产品承诺内,不是 IDE baseline 阻塞项,也不得改写成 CLI 自动支持。
76+
77+
## 建议命令
78+
79+
```bash
80+
cd /Users/weixin.li/code/github/sopify
81+
git status --short --branch
82+
git diff --check
83+
git diff -- . ':(exclude).sopify/plan/20260819_cursor_support/audits/cursor_ide_final_review.md'
84+
PYTHONDONTWRITEBYTECODE=1 /opt/homebrew/opt/python@3.11/libexec/bin/python3 -m pytest -p no:cacheprovider tests -q
85+
PYTHONDONTWRITEBYTECODE=1 /opt/homebrew/opt/python@3.11/libexec/bin/python3 scripts/sopify_doctor.py --format json --home-root /Users/weixin.li
86+
```
87+
88+
普通 `git diff` 不展示 untracked 文件,请单独读取 `git status --short` 列出的全部新资产,尤其是:
89+
90+
- `installer/cursor_plugin.py`
91+
- 双语 Cursor Plugin Rule 与 README 模板
92+
- 本审计文件
93+
94+
## 输出要求
95+
96+
请直接在 chat 返回,不写文件:
97+
98+
1. 一句话裁决。
99+
2. P0 / P1 / P2 findings;没有则明确“无”,每条附文件或可观察证据。
100+
3. 是否存在过度设计、冗余入口或口径过强。
101+
4. 自动化、IDE、CLI 三类证据分别证明什么,哪些仍未验证。
102+
5. 是否认可保持 `BASELINE_SUPPORTED`
103+
6. 精确状态:`accept``accept_with_fixes``reject`
104+
105+
不要 commit、push、安装新组件、删除兼容 Skill,或生成 verify receipt。
106+
107+
## 独立复审结果(2026-08-22)
108+
109+
- 精确裁决:`accept`;P0 无,P1 无。
110+
- 认可:Cursor 仍是第五个 adapter,不是 fork;用户 Plugin 薄 Rule、全局 Skills/payload 与用户 Hooks 的分层没有引入 launcher、runtime、MCP、Custom Agent 或第二套项目 Rule。
111+
- P2-1:复审时真实安装 Rule/README 与候选模板有文字差异。已用最终 `cursor:zh-CN` 候选原位重装并逐字核对;Hooks、CLI/User settings、MCP 文件存在状态与系统代理前后不变。
112+
- P2-2:AskQuestion transcript 证明调用尝试与文本回退,但不独立证明结构化问卷结果。公开文档与方案已删除“原生问卷/Other 已验证”等过强口径,不承诺跨模型稳定性或选项回传。
113+
- P2-3:本轮独立复审没有重看 Customize UI 或 `ruleCount: 1` 日志。公开证据口径以已安装 Rule 的 `alwaysApply: true`、consult/Analyze 工具轨迹和既有人工 UI 观察分层记录,不把 UI 观察写成可移植认证。
114+
- 自动化:最终候选 `308 passed, 78 subtests passed`;Python compileall、`bash -n install.sh`、SVG XML 与 `git diff --check` 通过。
115+
- 支持边界:保持 `BASELINE_SUPPORTED`。独立 sessionStart、显式 finalize、AskQuestion 跨模型稳定性、CLI 自动 Plugin Rule 与 Cloud Agent 不在本轮闭环内。
116+
117+
## 独立视觉与文档复审(2026-08-22)
118+
119+
- 最终裁决:`accept`;P0/P1/P2 均无,未发现重复入口或过度设计。
120+
- 三张全量宿主矩阵 SVG 均通过视觉检查;Cursor 与 Copilot 均按 baseline 表达。封面、demo 与跨宿主场景图保持具体示例,不为凑齐宿主重绘。
121+
- 首轮发现的 Cursor Verify Setup 断点、badge 错误导航与 README 顶部跨宿主过强口径,已分别以用户级 Doctor/Always 验证、专项文档直链和支持入口/档位分层关闭。

0 commit comments

Comments
 (0)