Linear 集成
基于 Cursor 官方 Linear integration 文档解释 issue delegation、repo labels、triage rules 和 follow-up。
Linear 集成让团队可以把 issue 直接委派给 Cursor,或在 Linear 评论里 mention @Cursor 启动 Cloud Agent。
阅读目标:读完本章,你应该能把 Linear issue、repo 选择、branch/model 参数和 Cloud Agent status 串成一条可复盘的开发工作流。
1. 什么时候用
| 场景 | Linear 集成价值 |
|---|---|
| PM / support 已经在 Linear 写清需求 | 直接从 issue 启动 agent |
| issue 有上下文、验收标准、截图 | agent 能读取 issue 信息作为任务输入 |
| 团队按 project / label 路由 repo | 用 Linear labels 统一 repo routing |
| 需要看到执行状态 | Cloud Agent status 回写 Linear activity |
不适合把所有 issue 都自动丢给 Cursor。官方也说明 Cursor 会分析 issue 并过滤非开发工作,但商业团队仍应保留 triage 标准。
2. 安装和账号关联
安装要求:
- 连接 Linear integration 需要 Cursor admin。
- 其他 team settings 可由非 admin members 配置。
- PR 创建需要 GitHub connection。
流程:
- 打开 Cursor integrations。
- 点击 Linear 旁的 Connect。
- 连接 Linear workspace 并选择 team。
- 点击 Authorize。
- 回到 Cursor 完成 Cloud Agent setup:连接 GitHub、选择 default repository、开启 usage-based pricing、确认 privacy settings。
第一次使用会触发 Cursor 与 Linear 的 account linking。先把账号关联做好,再验证真实 issue。
3. 两种启动方式
| 方式 | 操作 | 适合 |
|---|---|---|
| Delegate issue | 打开 issue,点击 assignee field,选择 Cursor | issue 已经足够清楚 |
Mention @Cursor | 在评论写 @Cursor fix the authentication bug described above | 需要补充具体指令或追加 follow-up |
Cloud Agents 会在 Linear 中显示实时状态,完成后自动创建 PR。详细进度也能在 Cursor dashboard 的 Cloud Agents 区查看。
4. Follow-up instructions
运行中的 agent 可以继续接收 Linear 评论中的 @Cursor 指令。适合:
- 补充复现步骤。
- 修改实现方向。
- 要求增加测试。
- 让 agent 解释当前卡点。
但 follow-up 仍然会影响正在运行的 agent。高敏项目不要让任意成员在 issue 里随意改任务方向,尤其是涉及 secrets、权限、生产数据或付款逻辑时。
5. 配置项
基础设置在 Dashboard -> Cloud Agents:
| Setting | Location | 用途 |
|---|---|---|
| Default Repository | Cursor Dashboard | issue 未指定 repo 时的 fallback |
| Default Model | Cursor Dashboard | Cloud Agents 默认模型 |
| Base Branch | Cursor Dashboard | PR 创建时的起始 branch |
Linear 中也可以通过 issue description、comments、issue labels 和 project labels 配置行为。
6. [key=value] 和 labels
Issue 描述或评论可以用 [key=value]:
| Key | 示例 | 用途 |
|---|---|---|
repo | [repo=anysphere/everysphere] | 指定目标 repository |
branch | [branch=feature-branch] | 指定 base branch |
model | [model=claude-3.5-sonnet] | 指定模型 |
Issue labels 和 project labels 使用 parent-child 结构:parent label 是配置 key,child label 是值。
repo label 创建要求:
- Linear workspace -> Settings -> Labels。
- 新建 group,名称必须是
repo,大小写不敏感,但不能写成 Repository 等变体。 - group 内创建
owner/repo格式的 labels。 - 把 label 加到 issue 或 project。
7. Repository selection
Cursor 按这个优先级选择 repo:
- Issue description / comments 中的
[repo=owner/repository]。 - 当前 issue labels。
- Linear project labels。
- Cursor dashboard default repository。
商业团队建议:project labels 做默认路由,issue comment 只用于临时覆盖。这样既少重复,也能保留清晰的例外记录。
8. Advanced: triage rules
Linear triage rules 可以自动给 issue 加 labels、assign to Cursor,并按条件触发 Cloud Agents。
注意官方限制:当前 Linear triage rules 需要 human assignee 才会 fire,这个限制未来可能变化。
先不要把 triage rules 直接开到全项目。推荐:
- 先在一个项目里配置 repo label。
- 再用一类低风险 bug 自动 assign Cursor。
- 最后看 PR 质量、误触发率和成本。
商业级验收
上线前至少完成:
- 测试 issue 通过 assignee 委派 Cursor。
- 测试评论
@Cursor追加 follow-up。 [repo=]、issue label、project label、default repo 四层优先级可解释。- GitHub connection 能让 agent 创建 PR。
- usage-based pricing 和 Privacy Mode 已确认。
- request ID / agent activity 排障路径写入 SOP。
- triage rules 仅在低风险范围启用。
官方来源
- Cursor Linear Integration —— 官方安装、delegation、comments、repository selection、labels、triage rules 和 support。
- Cursor Cloud Agents —— Linear 触发的 Cloud Agent 背景。
- Cursor Automations —— 事件触发和后台 agent run 背景。