Token导航 LogoToken导航

Agent Skill · 研究检索

linear-subagent-guide(Linear subagent 指南)

用于处理 Linear 项目、Issue、团队、周期和产品开发任务流。它适合让 Agent 辅助查询任务状态、整理需求队列、创建缺陷或汇总迭代进展。使用时需要确认 workspace、team、label、assignee 和状态流转规则;涉及批量创建或修改任务时,应先核对字段和目标团队,避免把草稿需求直接写入正式项目。

linear-subagent-guide 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 62,606。

总安装 329周安装 14GitHub Stars 公开资料未说明下载 115核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:linear-subagent-guide(Linear subagent 指南)
来源仓库:https://github.com/duongdev/ccpm
仓库路径:skills/linear-subagent-guide
安装命令:
npx skills add duongdev/ccpm --skill "linear-subagent-guide"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add duongdev/ccpm --skill "linear-subagent-guide"

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Linear Subagent Guide 提供子代理协同工作指南,优化多角色任务分配。适用于大型项目或多代理协作架构下的责任划分与接口约定。通过 npx skills add duongdev/ccpm --skill "linear-subagent-guide" 安装。

使用前应明确主从代理通信协议,防止指令冲突或重复执行。建议制定统一的日志格式与状态汇报机制,便于整体监控。

来源仓库内路径:skills/linear-subagent-guide

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add duongdev/ccpm --skill "linear-subagent-guide";命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

linear-subagent-guide 怎么安装?

在终端执行 npx skills add duongdev/ccpm --skill "linear-subagent-guide"。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

linear-subagent-guide 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

linear-subagent-guide 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

linear-subagent-guide 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

linear-subagent-guide 用的人多吗?

公开数据是累计安装 329 次,近一周安装 14 次,下载 115 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

linear-subagent-guide 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
linear-subagent-guide

Linear subagent 指南 · 本页

329—调用外部服务MIT未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
linear-subagent-guide
description
Guides optimal Linear operations usage with caching, performance patterns, and error handling. Auto-activates when implementing CCPM commands that interact with Linear. Prevents usage of non-existent Linear MCP tools.
allowed-tools
[Task]

Linear Subagent Guide

⛔ EXACT LINEAR MCP PARAMETERS (VERIFIED)

These are the EXACT parameter names from get_server_tools. Copy exactly.

Most Common Operations

// GET ISSUE - uses "id"
mcp__agent-mcp-gateway__execute_tool({
  server: "linear",
  tool: "get_issue",
  args: { id: "WORK-26" }  // ✅ CORRECT - "id" not "issueId"
})

// UPDATE ISSUE - uses "id"
mcp__agent-mcp-gateway__execute_tool({
  server: "linear",
  tool: "update_issue",
  args: {
    id: "WORK-26",        // ✅ CORRECT - "id" not "issueId"
    description: "...",
    state: "In Progress"
  }
})

// CREATE COMMENT - uses "issueId"
mcp__agent-mcp-gateway__execute_tool({
  server: "linear",
  tool: "create_comment",
  args: {
    issueId: "WORK-26",   // ✅ CORRECT - "issueId" for comments
    body: "Comment text"
  }
})

// LIST COMMENTS - uses "issueId"
mcp__agent-mcp-gateway__execute_tool({
  server: "linear",
  tool: "list_comments",
  args: { issueId: "WORK-26" }  // ✅ CORRECT
})

Parameter Reference Table

ToolRequired ParameterExample Args
get_issueid{ id: "WORK-26" }
update_issueid{ id: "WORK-26", ... }
create_commentissueId, body{ issueId: "WORK-26", body: "..." }
list_commentsissueId{ issueId: "WORK-26" }
create_issuetitle, team{ title: "...", team: "..." }
get_projectquery{ query: "ProjectName" }
get_teamquery{ query: "TeamName" }
get_userquery{ query: "me" }

Overview

The Linear subagent (ccpm:linear-operations) is a dedicated MCP handler that optimizes all Linear API operations in CCPM. Rather than making direct Linear MCP calls, commands should delegate to this subagent, which provides:

  • 50-60% token reduction (15k-25k → 8k-12k per workflow)
  • Session-level caching with 85-95% hit rates
  • Performance: <50ms for cached operations (vs 400-600ms direct)
  • Structured error handling with actionable suggestions
  • Centralized logic for Linear operations consistency

When to Use the Linear Subagent

Use the subagent for:

  • Reading issues, projects, teams, statuses
  • Creating or updating issues, projects
  • Managing labels and comments
  • Fetching documents and cycles
  • Searching Linear documentation

Never use the subagent for:

  • Local file operations
  • Git commands
  • External API calls (except Linear)

⚠️ CRITICAL: Parameter Name Gotcha

Different Linear MCP tools use different parameter names for issue IDs:

ToolParameterWRONGCORRECT
get_issueid{ issueId: "X" } ❌{ id: "X" } ✅
update_issueid{ issueId: "X" } ❌{ id: "X" } ✅
create_commentissueId{ id: "X" } ❌{ issueId: "X" } ✅
list_commentsissueId{ id: "X" } ❌{ issueId: "X" } ✅

First-call failures are often caused by using issueId instead of id for get_issue/update_issue.


Available Linear MCP Tools (Complete Reference)

Linear MCP provides 23 tools for interacting with Linear. This is the complete, validated list.


1. Comments (2 tools)

list_comments

List comments for a specific Linear issue.

Parameters:

  • issueId (string, required) - The issue ID

Example:

mcp__linear__list_comments({ issueId: "PSN-41" })
create_comment

Create a comment on a specific Linear issue.

Parameters:

  • issueId (string, required) - The issue ID
  • body (string, required) - The content of the comment as Markdown
  • parentId (string, optional) - A parent comment ID to reply to

Linear's Native Collapsible Syntax: Use +++ to create collapsible sections (starts collapsed, native Linear feature):

+++ Section Title
Content here (multi-line markdown supported)
+++

Example (simple):

mcp__linear__create_comment({
  issueId: "PSN-41",
  body: "## Progress Update\n\nCompleted first phase."
})

Example (with collapsible section):

mcp__linear__create_comment({
  issueId: "PSN-41",
  body: `🔄 **Progress Update**

Completed first phase, all tests passing

+++ 📋 Detailed Context
**Changed Files:**
- src/auth.ts
- src/tests/auth.test.ts

**Next Steps:**
- Implement phase 2
- Update documentation
+++`
})

2. Cycles (1 tool)

list_cycles

Retrieve cycles for a specific Linear team.

Parameters:

  • teamId (string, required) - The team ID
  • type (string, optional) - "current", "previous", or "next"

Example:

mcp__linear__list_cycles({ teamId: "team-123", type: "current" })

3. Documents (2 tools)

get_document

Retrieve a Linear document by ID or slug.

Parameters:

  • id (string, required) - The document ID or slug

Example:

mcp__linear__get_document({ id: "doc-abc-123" })
list_documents

List documents in the user's Linear workspace.

Parameters:

  • limit (number, optional, max 250, default 50)
  • before (string, optional) - An ID to end at
  • after (string, optional) - An ID to start from
  • orderBy (string, optional) - "createdAt" or "updatedAt" (default: "updatedAt")
  • query (string, optional) - Search query
  • projectId (string, optional) - Filter by project ID
  • initiativeId (string, optional) - Filter by initiative ID
  • creatorId (string, optional) - Filter by creator ID
  • createdAt (string, optional) - ISO-8601 date-time or duration (e.g., "-P1D")
  • updatedAt (string, optional) - ISO-8601 date-time or duration
  • includeArchived (boolean, optional, default false)

Example:

mcp__linear__list_documents({ projectId: "proj-123", limit: 20 })

4. Issues (4 tools)

get_issue

Retrieve detailed information about an issue by ID.

Parameters:

  • id (string, required) - The issue ID (e.g., "PSN-41")

Example:

mcp__linear__get_issue({ id: "PSN-41" })
list_issues

List issues in the user's Linear workspace. Use "me" for assignee to get your issues.

Parameters:

  • limit (number, optional, max 250, default 50)
  • before (string, optional)
  • after (string, optional)
  • orderBy (string, optional) - "createdAt" or "updatedAt"
  • query (string, optional) - Search title or description
  • team (string, optional) - Team name or ID
  • state (string, optional) - State name or ID
  • cycle (string, optional) - Cycle name or ID
  • label (string, optional) - Label name or ID
  • assignee (string, optional) - User ID, name, email, or "me"
  • delegate (string, optional) - Agent name or ID
  • project (string, optional) - Project name or ID
  • parentId (string, optional) - Parent issue ID
  • createdAt (string, optional) - ISO-8601 date-time or duration
  • updatedAt (string, optional) - ISO-8601 date-time or duration
  • includeArchived (boolean, optional, default true)

Example:

mcp__linear__list_issues({ assignee: "me", state: "In Progress" })
create_issue

Create a new Linear issue.

Parameters:

  • title (string, required)
  • team (string, required) - Team name or ID
  • description (string, optional) - Markdown description
  • cycle (string, optional) - Cycle name, number, or ID
  • priority (number, optional) - 0=None, 1=Urgent, 2=High, 3=Normal, 4=Low
  • project (string, optional) - Project name or ID
  • state (string, optional) - State type, name, or ID
  • assignee (string, optional) - User ID, name, email, or "me"
  • delegate (string, optional) - Agent name, displayName, or ID
  • labels (array of strings, optional) - Label names or IDs
  • dueDate (string, optional) - ISO format date
  • parentId (string, optional) - Parent issue ID for sub-issues
  • links (array of objects, optional) - Each object needs url and title

Example:

mcp__linear__create_issue({
  title: "Fix authentication bug",
  team: "Engineering",
  description: "## Problem\n\nUsers cannot login",
  state: "Todo",
  labels: ["bug", "critical"],
  assignee: "me"
})
update_issue

Update an existing Linear issue.

Parameters:

  • id (string, required) - The issue ID
  • title (string, optional)
  • description (string, optional) - Markdown
  • priority (number, optional) - 0-4
  • project (string, optional) - Project name or ID
  • state (string, optional) - State type, name, or ID
  • cycle (string, optional) - Cycle name, number, or ID
  • assignee (string, optional) - User ID, name, email, or "me"
  • delegate (string, optional) - Agent name, displayName, or ID
  • labels (array of strings, optional) - Label names or IDs (replaces existing)
  • parentId (string, optional)
  • dueDate (string, optional) - ISO format
  • estimate (number, optional) - Numerical estimate value
  • links (array of objects, optional)

Example:

mcp__linear__update_issue({
  id: "PSN-41",
  state: "In Progress",
  labels: ["planning", "implementation"]
})

5. Issue Statuses (2 tools)

list_issue_statuses

List available issue statuses in a Linear team.

Parameters:

  • team (string, required) - Team name or ID

Example:

mcp__linear__list_issue_statuses({ team: "Engineering" })
get_issue_status

Retrieve detailed information about an issue status by name or ID.

Parameters:

  • id (string, required) - Status ID
  • name (string, required) - Status name
  • team (string, required) - Team name or ID

Example:

mcp__linear__get_issue_status({ name: "In Progress", team: "Engineering" })

6. Labels (3 tools)

list_issue_labels

List available issue labels in a workspace or team.

Parameters:

  • limit (number, optional, max 250, default 50)
  • before (string, optional)
  • after (string, optional)
  • orderBy (string, optional) - "createdAt" or "updatedAt"
  • name (string, optional) - Filter by label name
  • team (string, optional) - Team name or ID

Example:

mcp__linear__list_issue_labels({ team: "Engineering" })
create_issue_label

Create a new Linear issue label.

Parameters:

  • name (string, required)
  • description (string, optional)
  • color (string, optional) - Hex color code
  • teamId (string, optional) - Team UUID (workspace label if omitted)
  • parentId (string, optional) - Parent label UUID for groups
  • isGroup (boolean, optional, default false) - Whether this is a label group

Example:

mcp__linear__create_issue_label({
  name: "feature-request",
  color: "#bb87fc",
  teamId: "team-123"
})
list_project_labels

List available project labels in the Linear workspace.

Parameters:

  • limit (number, optional, max 250, default 50)
  • before (string, optional)
  • after (string, optional)
  • orderBy (string, optional)
  • name (string, optional)

Example:

mcp__linear__list_project_labels({ limit: 100 })

7. Projects (4 tools)

list_projects

List projects in the user's Linear workspace.

Parameters:

  • limit (number, optional, max 250, default 50)
  • before (string, optional)
  • after (string, optional)
  • orderBy (string, optional)
  • query (string, optional) - Search project name
  • state (string, optional) - State name or ID
  • initiative (string, optional) - Initiative name or ID
  • team (string, optional) - Team name or ID
  • member (string, optional) - User ID, name, email, or "me"
  • createdAt (string, optional)
  • updatedAt (string, optional)
  • includeArchived (boolean, optional, default false)

Example:

mcp__linear__list_projects({ team: "Engineering", state: "started" })
get_project

Retrieve details of a specific project.

Parameters:

  • query (string, required) - Project ID or name

Example:

mcp__linear__get_project({ query: "CCPM" })
create_project

Create a new project in Linear.

Parameters:

  • name (string, required)
  • team (string, required) - Team name or ID
  • summary (string, optional) - Max 255 chars
  • description (string, optional) - Markdown
  • state (string, optional)
  • startDate (string, optional) - ISO format
  • targetDate (string, optional) - ISO format
  • priority (integer, optional) - 0-4
  • labels (array of strings, optional)
  • lead (string, optional) - User ID, name, email, or "me"

Example:

mcp__linear__create_project({
  name: "Q1 Authentication",
  team: "Engineering",
  description: "## Goals\n\n- OAuth integration\n- SSO support",
  lead: "me"
})
update_project

Update an existing Linear project.

Parameters:

  • id (string, required)
  • name (string, optional)
  • summary (string, optional)
  • description (string, optional)
  • state (string, optional)
  • startDate (string, optional)
  • targetDate (string, optional)
  • priority (integer, optional) - 0-4
  • labels (array of strings, optional)
  • lead (string, optional)

Example:

mcp__linear__update_project({
  id: "proj-123",
  state: "completed"
})

8. Teams (2 tools)

list_teams

List teams in the user's Linear workspace.

Parameters:

  • limit (number, optional, max 250, default 50)
  • before (string, optional)
  • after (string, optional)
  • orderBy (string, optional)
  • query (string, optional) - Search query
  • includeArchived (boolean, optional, default false)
  • createdAt (string, optional)
  • updatedAt (string, optional)

Example:

mcp__linear__list_teams({ includeArchived: false })
get_team

Retrieve details of a specific Linear team.

Parameters:

  • query (string, required) - Team UUID, key, or name

Example:

mcp__linear__get_team({ query: "Engineering" })

9. Users (2 tools)

list_users

Retrieve users in the Linear workspace.

Parameters:

  • query (string, optional) - Filter by name or email

Example:

mcp__linear__list_users({ query: "john" })
get_user

Retrieve details of a specific Linear user.

Parameters:

  • query (string, required) - User ID, name, email, or "me"

Example:

mcp__linear__get_user({ query: "me" })

10. Documentation (1 tool)

search_documentation

Search Linear's documentation to learn about features and usage.

Parameters:

  • query (string, required) - Search query
  • page (number, optional, default 0) - Page number

Example:

mcp__linear__search_documentation({ query: "issue statuses", page: 0 })

Summary: All 23 Tools

  1. list_comments - List comments on issue
  2. create_comment - Add comment to issue
  3. list_cycles - Get team cycles
  4. get_document - Fetch Linear document
  5. list_documents - List documents
  6. get_issue - Fetch single issue
  7. list_issues - Search/list issues
  8. create_issue - Create new issue
  9. update_issue - Update existing issue
  10. list_issue_statuses - List workflow states
  11. get_issue_status - Get specific status
  12. list_issue_labels - List labels
  13. create_issue_label - Create new label
  14. list_project_labels - List project labels
  15. list_projects - List projects
  16. get_project - Get specific project
  17. create_project - Create new project
  18. update_project - Update existing project
  19. list_teams - List all teams
  20. get_team - Get specific team
  21. list_users - List workspace users
  22. get_user - Get specific user
  23. search_documentation - Search Linear docs

Tool Validation: Critical Rules

Only Use Validated Tools

RULE: Every Linear operation MUST use a tool from the validated list above.

Examples of INVALID tool names that will fail:

  • ❌ get_issues (correct: list_issues)
  • ❌ update_comment (correct: create new comment instead)
  • ❌ delete_issue (not supported)
  • ❌ list_issue_statuses (correct tool, but check args)

Before Using a Tool

  1. Check the validated list above
  2. Verify the exact tool name matches
  3. If unsure, use list_* variants which are widely available
  4. Never assume tool names—verify first

Error Prevention Strategy

// ✅ CORRECT: Use only validated tools
Task(ccpm:linear-operations): `
operation: get_issue
params:
  issueId: PSN-29
context:
  cache: true
`

// ❌ INCORRECT: Non-existent tool
Task(ccpm:linear-operations): `
operation: fetch_issue  // This tool doesn't exist!
params:
  issueId: PSN-29
`

// ❌ INCORRECT: Assuming delete exists
Task(ccpm:linear-operations): `
operation: delete_issue  // Linear MCP doesn't support deletion
params:
  issueId: PSN-29
`

Using the Linear Subagent

⚠️ IMPORTANT: Command File Invocation Format

When writing CCPM command files (files in commands/), you MUST use explicit execution instructions, NOT the YAML template format shown in the examples below.

Command files must use this format:

**Use the Task tool to fetch the issue from Linear:**

Invoke the `ccpm:linear-operations` subagent:
- **Tool**: Task
- **Subagent**: ccpm:linear-operations
- **Prompt**:

operation: get_issue params: issueId: "{the issue ID from previous step}" context: cache: true command: "work"

Why? Claude Code interprets command markdown files as executable prompts, not documentation. YAML template syntax appears as an example rather than an instruction to execute. Explicit instructions (e.g., "Use the Task tool to...") are unambiguous execution directives that ensure Claude invokes the subagent correctly.

Basic Syntax (For Documentation/Examples Only)

The examples below use YAML template format for readability. Do NOT use this format in command files—use the explicit format shown above instead.

Task(ccpm:linear-operations): `
operation: <tool_name>
params:
  <param1>: <value1>
  <param2>: <value2>
context:
  cache: true
  command: "planning:plan"
`

Enabling Caching (Recommended)

For read operations, always enable caching to achieve 85-95% hit rates:

Task(ccpm:linear-operations): `
operation: get_issue
params:
  issueId: PSN-123
context:
  cache: true  # Enable session-level caching
  command: "planning:plan"
`

Providing Context for Better Errors

Include context to improve error messages and debugging:

Task(ccpm:linear-operations): `
operation: update_issue
params:
  issueId: PSN-29
  state: "In Progress"
context:
  cache: false  # Skip cache for writes
  command: "implementation:start"  # Which command triggered this
  purpose: "Marking task as started"  # Why we're doing this
`

Shared Helpers

The _shared-linear-helpers.md file provides convenience functions that delegate to the subagent. Use these for common operations:

getOrCreateLabel(teamId, labelName)

Smart label management with automatic creation if missing:

// Use this instead of manual list + create
const label = await getOrCreateLabel(teamId, "feature-request");

Benefits:

  • Deduplicates label creation logic
  • Handles caching automatically
  • Returns label ID or creates new one

getValidStateId(teamId, stateNameOrId)

Fuzzy state matching with suggestions on errors:

// Handles "In Progress" → actual state ID
const stateId = await getValidStateId(teamId, "In Progress");

Benefits:

  • Case-insensitive matching
  • Fuzzy matching for typos
  • Suggests available states on error

ensureLabelsExist(teamId, labelNames)

Batch create labels if missing:

// Create multiple labels in one call
const labels = await ensureLabelsExist(teamId, [
  "planning",
  "implementation",
  "review"
]);

Performance Optimization

Caching Strategy

Read Operations: Always enable caching

  • get_issue, list_issues, list_projects
  • Cache hits: 85-95%
  • Performance: <50ms

Write Operations: Disable caching

  • create_issue, update_issue, create_comment
  • Always fetch fresh data
// READ: Cache enabled
Task(ccpm:linear-operations): `
operation: get_issue
params:
  issueId: PSN-29
context:
  cache: true  # ✅ Cached reads
`

// WRITE: Cache disabled
Task(ccpm:linear-operations): `
operation: update_issue
params:
  issueId: PSN-29
  state: "Done"
context:
  cache: false  # ❌ Never cache writes
`

Batching Operations

When possible, batch related operations:

// ✅ GOOD: Get all needed data in one context
Task(ccpm:linear-operations): `
operation: get_issue
params:
  issueId: PSN-29
context:
  cache: true
  batchId: "planning-workflow"
`

// Then use Team, Project, Status in sequence
// Subsequent calls reuse cached Team/Project data

Token Reduction Comparison

OperationDirect MCPVia SubagentSavings
Get issue400ms, 2.5k tokens<50ms, 0.8k tokens68%
Update issue600ms, 3.2k tokens<50ms, 1.2k tokens62%
Create comment500ms, 2.8k tokens<50ms, 1.0k tokens64%
Workflow average500ms, 15k tokens<50ms, 8k tokens-47%

Error Handling

The Linear subagent provides structured errors with actionable suggestions.

Common Error Scenarios

STATE_NOT_FOUND

When updating an issue to a non-existent status:

error:
  code: STATE_NOT_FOUND
  message: "State 'In Review' not found in team"
  params:
    requestedState: "In Review"
    teamId: "psn123"
  suggestions:
    - "Use 'In Progress' (exact match required)"
    - "Available states: Backlog, Todo, In Progress, Done, Blocked"
    - "Check team configuration in Linear"

Fix: Use exact state name or getValidStateId() helper

LABEL_NOT_FOUND

When assigning a non-existent label:

error:
  code: LABEL_NOT_FOUND
  message: "Label 'feature' not found"
  params:
    requestedLabel: "feature"
    teamId: "psn123"
  suggestions:
    - "Label will be created automatically"
    - "Use 'ensureLabelsExist()' to batch create"
    - "Available labels: bug, feature-request, documentation"

Fix: Use getOrCreateLabel() or ensureLabelsExist() helpers

ISSUE_NOT_FOUND

When accessing a non-existent issue:

error:
  code: ISSUE_NOT_FOUND
  message: "Issue PSN-9999 not found"
  params:
    issueId: "PSN-9999"
  suggestions:
    - "Verify issue ID is correct (use Linear UI)"
    - "Check team/project context"
    - "Issue may have been archived"

Fix: Validate issue ID before using


Examples

Example 1: Get Issue with Caching

Task(ccpm:linear-operations): `
operation: get_issue
params:
  issueId: PSN-29
context:
  cache: true
  command: "planning:plan"
  purpose: "Fetch task details for planning"
`

Performance: <50ms (cached) Token cost: ~0.8k Result: Issue object with title, description, status, labels, assignee

Example 2: Update Issue Status and Labels

Task(ccpm:linear-operations): `
operation: update_issue
params:
  issueId: PSN-29
  state: "In Progress"
  labels: ["planning", "implementation"]
context:
  cache: false
  command: "implementation:start"
  purpose: "Mark task as started with relevant labels"
`

Performance: 100-200ms (no cache) Token cost: ~1.2k Result: Updated issue with new status and labels

Example 3: Create Comment with Context

Task(ccpm:linear-operations): `
operation: create_comment
params:
  issueId: PSN-29
  body: |
    Progress update:
    - Implemented JWT authentication
    - 2 unit tests passing
    - Need to fix Redis integration

    Blockers:
    - Redis library compatibility
context:
  cache: false
  command: "implementation:sync"
  purpose: "Log implementation progress"
`

Performance: 150-300ms Token cost: ~1.5k Result: Comment added to issue with timestamp

Example 4: Using Shared Helpers

// Get or create label (delegates to subagent with caching)
const label = await getOrCreateLabel(teamId, "feature-request");

// Get valid state ID (fuzzy matching with suggestions)
const stateId = await getValidStateId(teamId, "In Progress");

// Ensure multiple labels exist
const labels = await ensureLabelsExist(teamId, [
  "planning",
  "implementation",
  "blocked"
]);

// Now use the results
Task(ccpm:linear-operations): `
operation: update_issue
params:
  issueId: PSN-29
  state: ${stateId}
  labels: ${labels.map(l => l.id)}
context:
  cache: false
  purpose: "Apply validated status and labels"
`

Performance: <100ms total (mostly cached lookups) Token cost: ~1.8k Result: Reliable label/status application with error prevention

Example 5: Error Handling

// PATTERN: Try operation, handle structured errors

Task(ccpm:linear-operations): `
operation: update_issue
params:
  issueId: PSN-29
  state: "Review"  // Might not exist
context:
  cache: false
  command: "implementation:sync"
`

// If error:
// {
//   code: "STATE_NOT_FOUND",
//   suggestions: ["Available states: Backlog, Todo, In Progress, Done"]
// }

// RECOVERY: Use helper or ask user
const stateId = await getValidStateId(teamId, "Review");
// Or ask user: "Which status should I use?"

Pattern: Structured errors guide user or helper selection


Migration from Direct MCP

Before: Direct MCP Call (Inefficient)

// Direct call - no caching, higher token cost
Task(linear-operations): `
List issues in PSN project where status = "Todo"
`

// Result: ~2.5k tokens, 400ms, no future cache hits

After: Via Subagent (Optimized)

// Via subagent - automatic caching
Task(ccpm:linear-operations): `
operation: list_issues
params:
  projectId: "PSN"
  filter: {status: "Todo"}
context:
  cache: true
  command: "planning:plan"
`

// Result: ~0.9k tokens, <50ms, 85-95% cache hits next time

Common Pitfalls to Avoid

// ❌ DON'T: Forget caching
Task(ccpm:linear-operations): `
operation: get_issue
params:
  issueId: PSN-29
// Missing: context: cache: true
`

// ❌ DON'T: Use non-existent tools
Task(ccpm:linear-operations): `
operation: fetch_issue_details  // This doesn't exist
params:
  issueId: PSN-29
`

// ❌ DON'T: Cache writes
Task(ccpm:linear-operations): `
operation: update_issue
params:
  issueId: PSN-29
context:
  cache: true  // WRONG! Never cache writes
`

// ✅ DO: Follow patterns
Task(ccpm:linear-operations): `
operation: get_issue
params:
  issueId: PSN-29
context:
  cache: true  // ✅ Cache reads
  command: "planning:plan"
`

Best Practices Summary

PracticeReason
Always use subagent for Linear ops50-60% token reduction
Enable caching on reads85-95% hit rate, <50ms performance
Disable caching on writesAvoid stale data
Use shared helpersReduces duplication, better error handling
Validate tools against listPrevent failures with non-existent tools
Provide context objectBetter error messages and debugging
Handle structured errorsGraceful degradation and user guidance

References

  • Subagent Location: agents/linear-operations.md
  • Shared Helpers: agents/_shared-linear-helpers.md
  • Architecture Guide: docs/architecture/linear-subagent-architecture.md
  • Linear MCP Docs: Available via search_documentation tool

平台分布

Claude Code

26.84%
按下载量换算31

OpenCode

22.44%
按下载量换算26

Cursor

17.96%
按下载量换算21

Gemini CLI

13.51%
按下载量换算16

kilo

8.51%
按下载量换算10

windsurf

3.81%
按下载量换算4

安全审计

暂无安全审计结果可展示。

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills