AI 程式設計教程中文版
官方教程中文版整合與 SDK

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。

流程:

  1. 開啟 Cursor integrations。
  2. 點選 Linear 旁的 Connect。
  3. 連線 Linear workspace 並選擇 team。
  4. 點選 Authorize。
  5. 回到 Cursor 完成 Cloud Agent setup:連線 GitHub、選擇 default repository、開啟 usage-based pricing、確認 privacy settings。

第一次使用會觸發 Cursor 與 Linear 的 account linking。先把賬號關聯做好,再驗證真實 issue。

3. 兩種啟動方式

方式操作適合
Delegate issue開啟 issue,點選 assignee field,選擇 Cursorissue 已經足夠清楚
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:

SettingLocation用途
Default RepositoryCursor Dashboardissue 未指定 repo 時的 fallback
Default ModelCursor DashboardCloud Agents 預設模型
Base BranchCursor DashboardPR 建立時的起始 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 建立要求:

  1. Linear workspace -> Settings -> Labels。
  2. 新建 group,名稱必須是 repo,大小寫不敏感,但不能寫成 Repository 等變體。
  3. group 內建立 owner/repo 格式的 labels。
  4. 把 label 加到 issue 或 project。

7. Repository selection

Cursor 按這個優先順序選擇 repo:

  1. Issue description / comments 中的 [repo=owner/repository]
  2. 當前 issue labels。
  3. Linear project labels。
  4. 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 僅在低風險範圍啟用。

官方來源

接下來去哪

本頁目錄