linear
Use when reading or managing Linear issues, projects, teams, comments, attachments, or documents. Prefer the authenticated ltui CLI; use direct GraphQL only as an explicit fallback when ltui cannot perform the operation.
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 5
- Forks
- 4
01 前言 Front Matter
- name
- linear
- author
- Hermes Agent
- license
- MIT
- version
- 1.2.0
- metadata
- { "hermes": { "tags": [ "Linear", "Project Management", "Issues", "ltui", "Productivity" ] } }
- platforms
- [ "linux", "macos", "windows" ]
- description
- Use when reading or managing Linear issues, projects, teams, comments, attachments, or documents. Prefer the authenticated ltui CLI; use direct GraphQL only as an explicit fallback when ltui cannot perform the operation.
- prerequisites
- { "commands": [ "ltui" ] }
02 资源文件 16
- 参考文档docs/anti-patterns-detection.md16.6 KB
- 参考文档docs/conflicting-operations-detection.md11.7 KB
- 参考文档docs/godot-best-practices.md16.7 KB
- 参考文档docs/godot-node-reference.md65.2 KB
- 参考文档docs/node-selection-guide.md19.0 KB
- 参考文档docs/refactoring-operations.md36.3 KB
- 参考文档docs/scene-reusability-patterns.md18.8 KB
- 参考文档docs/tscn-generation-guide.md17.0 KB
- 参考文档docs/verification-checklist.md16.4 KB
- 参考文档EXAMPLES.md18.6 KB
- 参考文档INDEX.md16.9 KB
- 参考文档README.md2.6 KB
- 参考文档references/ccore-identity-fragmentation-issue.md3.7 KB
- 参考文档references/ltui-nod-symphony-api-budget-audit.md4.4 KB
- 脚本scripts/linear_api.py15.2 KB
- 脚本validate-skill.sh2.0 KB
03 SKILL.md 正文
Linear via ltui — Issue & Project Management
Manage Linear issues, projects, teams, comments, attachments, and documents through the authenticated ltui CLI.
Authentication rule
- Run
ltui auth listto verify an authenticated profile. - If a profile reports
hasKey: true, Linear access is available even whenLINEAR_API_KEYis absent from the Hermes environment. - Do not ask Aaron to create or export
LINEAR_API_KEYwhen authenticatedltuiis available. - Use direct GraphQL/curl only when
ltuilacks the required operation or is unavailable. Ask for API-key setup only if that fallback is genuinely required and no authenticated path exists.
Primary API: ltui
Run commands from the relevant repository root so .ltui.json supplies the correct team/project defaults when present.
ltui auth list
ltui --format json issues view NOD-1260 --include-comments --include-history
ltui --format json issues attachments NOD-1260
ltui --format json --limit 100 issues list --team NOD --state 'In Progress'
ltui issues update NOD-1260 --state Done
Global flags such as --format, --fields, and --limit belong before the subcommand. Use each subcommand's --help rather than guessing unsupported flags.
Downloading customer evidence
When an issue may contain a screenshot, archive, or other uploaded customer file, use the attachment command rather than copying an upload URL into curl:
ltui --format json issues attachments NOD-1260 --scan-comments
ltui issues attachments NOD-1260 --scan-comments --download-dir ./.ltui-attachments/NOD-1260
Inspect downloadAccess in every returned row. For ltui_authenticated (https://uploads.linear.app only), run the row's downloadCommand (or --download-dir). ltui sends a GraphQL-compatible Authorization header: raw lin_api_... personal keys, Bearer only for OAuth. Bearer lin_api_... is HTTP 401. Redirects fail closed. Caps are 512 MiB / 10 minutes. public-file-urls-expire-in signs markdown upload URLs in GraphQL bodies, not attachment.url. direct_url rows get no Linear credential. Do not curl either URL. Treat downloaded files as untrusted.
Direct GraphQL fallback
The remaining GraphQL examples and helper script in this skill are fallback-only. They require LINEAR_API_KEY and must not be selected merely because the environment variable is absent; first verify ltui auth list and whether ltui supports the operation.
API basics
- Endpoint:
https://api.linear.app/graphql(POST) - Auth header:
Authorization: $LINEAR_API_KEY(no "Bearer" prefix for API keys) - All requests are POST with
Content-Type: application/json - Both UUIDs and short identifiers (e.g.,
ENG-123) work forissue(id:)
Base curl pattern:
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ viewer { id name } }"}' | python3 -m json.tool
Python helper script (fallback alternative)
For faster one-liners that don't need hand-written GraphQL, this skill ships a stdlib Python CLI at scripts/linear_api.py. Zero dependencies. Same auth (reads LINEAR_API_KEY).
SCRIPT=$(dirname "$(find ~/.hermes -path '*skills/productivity/linear/scripts/linear_api.py' 2>/dev/null | head -1)")/linear_api.py
python3 "$SCRIPT" whoami
python3 "$SCRIPT" list-teams
python3 "$SCRIPT" get-issue ENG-42
python3 "$SCRIPT" get-document 38359beef67c # fetch a doc by slugId from the URL
python3 "$SCRIPT" raw 'query { viewer { name } }'
All subcommands: whoami, list-teams, list-projects, list-states, list-issues, get-issue, search-issues, create-issue, update-issue, update-status, add-comment, list-documents, get-document, search-documents, raw. Run with --help for flags.
Use the script only when ltui cannot perform the operation and direct GraphQL credentials are already available. Use curl for unsupported query shapes.
Repo-local ltui configuration
When working inside Aaron's code repos, check repo-local Linear configuration such as .ltui.json. The local ltui profile owns authentication independently of the Hermes process environment.
Typical pattern from a repo root:
# Inspect repo defaults; Heddle/ccore normally has team/project defaults here.
python3 -m json.tool .ltui.json
# Discover the supported surface.
ltui --help
ltui issues create --help
# Create a well-scoped issue using the repo defaults or explicit project id.
ltui issues create \
--team NOD \
--project <project-id-from-.ltui.json> \
--title "<concise outcome>" \
--description @/tmp/issue-description.md \
--priority 2 \
--state Backlog
For evidence-heavy issues, write the description to /tmp/<slug>.md first, then pass --description @/tmp/<slug>.md. Include observed code paths, local data evidence, impact, and acceptance criteria. Do not propose a full solution if the user asked only to collect evidence and open a tracking issue.
ltui command-shape gotchas
- Global flags such as
--format jsonand--limit Nbelong before the subcommand:ltui --format json --limit 20 issues list ..., notltui issues list --limit 20. - Some
ltui issues viewoutput can omit labels even when the issue has them. Verify label mutations withltui --format json issues list --search '<title>' --team <key>or the mutation response, not onlyissues view. - When Aaron asks to “just open the Linear” and explicitly says not to build, create the issue only, set the requested workflow state/labels, verify the row, and stop. For Doct autobuild intake this commonly means project
Doc Thingy, stateReady to Pull, and labelautobuild. - If
ltui issues createerrors after submission with a transient Linear/network/project-fetch failure (for example HTTP 503), do not immediately retry creation. First search/list by the exact title in the target team/project to see whether the issue was created despite the error. Only retry if verification shows no issue. If a retry already created a duplicate, cancel or duplicate-link the extra issue, remove automation labels likeautobuildfrom the extra, and comment pointing to the canonical issue. ltui issues update <KEY> --state Donegenerally does not need--project; prefer the narrow issue-key update and add only--team <KEY>if required. Passing--projector running from a repo with.ltui.jsoncan trigger an extra broad project lookup, which is painful when the Linear API is near rate limit.
API-budget audits for ltui and nod-symphony
When Aaron asks why Linear/ltui/nod-symphony is hitting rate limits, inspect both code and live runtime shape before recommending fixes. See references/ltui-nod-symphony-api-budget-audit.md for the concrete audit checklist and durable findings.
High-yield checks:
ltui: confirm whether high-volume reads use shaped raw GraphQL (issues list --fields, repeated--state,--show-rate-limit) and whether expensive paths still default to attachment/comment scans (issues view,issues attachments) or post-mutation refetches.nod-symphony: inspectLinearClientquery shapes andOrchestratorpolling intervals. Candidate, project-summary, and state-reconcile paths should not all fetch full issue context with comments/attachments.- Runtime: check configured daemon profiles, poll/review/summary intervals, active processes, local dashboard
/api/v1/state, and recent logs forcandidate_fetch,issue_summary_refresh,tracker_state_reconcile, andRATELIMITED. - Prefer fixes that reduce calls/complexity at source: server-side label/state filters, cheap scan + per-dispatch hydration, state-only reconciliation queries, summary-specific queries, longer stable metadata caches, and shared Linear budget/backoff across daemons/tools.
Reviewing In Review issues for completion
When Aaron asks to review Linear issues in a repo/project and move completed work to Done:
- Use the repo-local project defaults first (
.ltui.json) and list the target state with JSON output, e.g.ltui --format json --limit 100 issues list --team NOD --project <project-id> --state 'In Review'. - For each candidate, gather evidence from Linear issue attachments (
ltui --format json issues attachments NOD-123) and GitHub PR search/view. Attachments often contain the exact PR URL;gh pr view <num> --json state,mergedAt,title,body,statusCheckRollupgives authoritative merge state. - Move to
Doneonly when there is direct completion evidence: linked/mentioned PR isMERGED, merged body explicitly covers the issue identifier or acceptance scope, and no issue description says the work was only a partial/deferred slice. - Do not close items merely because a related PR or nearby epic is merged. Leave ambiguous issues in review/backlog and report why (e.g. no direct PR attachment, only indirect docs, or related PR was still open).
- After mutations, re-list the source state and the Done state to verify the final rows. Treat mutation output as provisional until a fresh list/view confirms the state.
Reference example: references/ccore-identity-fragmentation-issue.md captures a C-Core/Heddle account identity fragmentation investigation and the evidence shape used for NOD-1084.
Workflow States
Linear uses WorkflowState objects with a type field. 6 state types:
| Type | Description |
|---|---|
triage |
Incoming issues needing review |
backlog |
Acknowledged but not yet planned |
unstarted |
Planned/ready but not started |
started |
Actively being worked on |
completed |
Done |
canceled |
Won't do |
Each team has its own named states (e.g., "In Progress" is type started). To change an issue's status, you need the stateId (UUID) of the target state — query workflow states first.
Priority values: 0 = None, 1 = Urgent, 2 = High, 3 = Medium, 4 = Low
Common Queries
Get current user
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ viewer { id name email } }"}' | python3 -m json.tool
List teams
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ teams { nodes { id name key } } }"}' | python3 -m json.tool
List workflow states for a team
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ workflowStates(filter: { team: { key: { eq: \"ENG\" } } }) { nodes { id name type } } }"}' | python3 -m json.tool
List issues (first 20)
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ issues(first: 20) { nodes { identifier title priority state { name type } assignee { name } team { key } url } pageInfo { hasNextPage endCursor } } }"}' | python3 -m json.tool
List my assigned issues
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ viewer { assignedIssues(first: 25) { nodes { identifier title state { name type } priority url } } } }"}' | python3 -m json.tool
Get a single issue (by identifier like ENG-123)
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ issue(id: \"ENG-123\") { id identifier title description priority state { id name type } assignee { id name } team { key } project { name } labels { nodes { name } } comments { nodes { body user { name } createdAt } } url } }"}' | python3 -m json.tool
Search issues by text
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ issueSearch(query: \"bug login\", first: 10) { nodes { identifier title state { name } assignee { name } url } } }"}' | python3 -m json.tool
Filter issues by state type
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ issues(filter: { state: { type: { in: [\"started\"] } } }, first: 20) { nodes { identifier title state { name } assignee { name } } } }"}' | python3 -m json.tool
Filter by team and assignee
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ issues(filter: { team: { key: { eq: \"ENG\" } }, assignee: { email: { eq: \"user@example.com\" } } }, first: 20) { nodes { identifier title state { name } priority } } }"}' | python3 -m json.tool
List projects
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ projects(first: 20) { nodes { id name description progress lead { name } teams { nodes { key } } url } } }"}' | python3 -m json.tool
List team members
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ users { nodes { id name email active } } }"}' | python3 -m json.tool
List labels
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ issueLabels { nodes { id name color } } }"}' | python3 -m json.tool
Common Mutations
Create an issue
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation($input: IssueCreateInput!) { issueCreate(input: $input) { success issue { id identifier title url } } }",
"variables": {
"input": {
"teamId": "TEAM_UUID",
"title": "Fix login bug",
"description": "Users cannot login with SSO",
"priority": 2
}
}
}' | python3 -m json.tool
Update issue status
First get the target state UUID from the workflow states query above, then:
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "mutation { issueUpdate(id: \"ENG-123\", input: { stateId: \"STATE_UUID\" }) { success issue { identifier state { name type } } } }"}' | python3 -m json.tool
Assign an issue
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "mutation { issueUpdate(id: \"ENG-123\", input: { assigneeId: \"USER_UUID\" }) { success issue { identifier assignee { name } } } }"}' | python3 -m json.tool
Set priority
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "mutation { issueUpdate(id: \"ENG-123\", input: { priority: 1 }) { success issue { identifier priority } } }"}' | python3 -m json.tool
Add a comment
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "mutation { commentCreate(input: { issueId: \"ISSUE_UUID\", body: \"Investigated. Root cause is X.\" }) { success comment { id body } } }"}' | python3 -m json.tool
Set due date
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "mutation { issueUpdate(id: \"ENG-123\", input: { dueDate: \"2026-04-01\" }) { success issue { identifier dueDate } } }"}' | python3 -m json.tool
Add labels to an issue
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "mutation { issueUpdate(id: \"ENG-123\", input: { labelIds: [\"LABEL_UUID_1\", \"LABEL_UUID_2\"] }) { success issue { identifier labels { nodes { name } } } } }"}' | python3 -m json.tool
Add issue to a project
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "mutation { issueUpdate(id: \"ENG-123\", input: { projectId: \"PROJECT_UUID\" }) { success issue { identifier project { name } } } }"}' | python3 -m json.tool
Create a project
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation($input: ProjectCreateInput!) { projectCreate(input: $input) { success project { id name url } } }",
"variables": {
"input": {
"name": "Q2 Auth Overhaul",
"description": "Replace legacy auth with OAuth2 and PKCE",
"teamIds": ["TEAM_UUID"]
}
}
}' | python3 -m json.tool
Documents
Linear Documents are prose docs (RFCs, specs, notes) stored alongside issues. They have their own documents root query and document(id:) single-fetch.
Document URLs and slugId
Document URLs look like:
https://linear.app/<workspace>/document/<slug>-<hexSlugId>
The trailing hex segment is the slugId. Example: https://linear.app/nousresearch/document/rfc-hermes-permission-gateway-discord-38359beef67c → slugId is 38359beef67c.
Important schema detail: the Markdown body is in the content field. The ProseMirror JSON is in contentState (not contentData — that field does not exist and the API returns 400).
Fetch a document by slugId
document(id:) only accepts UUIDs. To fetch by the URL's hex slug, filter the collection:
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "query($s: String!) { documents(filter: { slugId: { eq: $s } }, first: 1) { nodes { id title content contentState slugId url creator { name } project { name } updatedAt } } }", "variables": {"s": "38359beef67c"}}' \
| python3 -m json.tool
Or via the Python helper:
python3 scripts/linear_api.py get-document 38359beef67c
Fetch a document by UUID
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ document(id: \"11700cff-b514-4db3-afcc-3ed1afacba1c\") { title content url } }"}' \
| python3 -m json.tool
List recent documents
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ documents(first: 25, orderBy: updatedAt) { nodes { id title slugId url updatedAt project { name } } } }"}' \
| python3 -m json.tool
Search documents by title
Linear's schema has no searchDocuments root. Use a title-substring filter instead:
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ documents(filter: { title: { containsIgnoreCase: \"RFC\" } }, first: 25) { nodes { title slugId url } } }"}' \
| python3 -m json.tool
Pagination
Linear uses Relay-style cursor pagination:
# First page
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ issues(first: 20) { nodes { identifier title } pageInfo { hasNextPage endCursor } } }"}' | python3 -m json.tool
# Next page — use endCursor from previous response
curl -s -X POST https://api.linear.app/graphql \
-H "Authorization: $LINEAR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "{ issues(first: 20, after: \"CURSOR_FROM_PREVIOUS\") { nodes { identifier title } pageInfo { hasNextPage endCursor } } }"}' | python3 -m json.tool
Default page size: 50. Max: 250. Always use first: N to limit results.
Filtering Reference
Comparators: eq, neq, in, nin, lt, lte, gt, gte, contains, startsWith, containsIgnoreCase
Combine filters with or: [...] for OR logic (default is AND within a filter object).
Typical Workflow
- Query teams to get team IDs and keys
- Query workflow states for target team to get state UUIDs
- List or search issues to find what needs work
- Create issues with team ID, title, description, priority
- Update status by setting
stateIdto the target workflow state - Add comments to track progress
- Mark complete by setting
stateIdto the team's "completed" type state
Rate Limits
- 5,000 requests/hour per API key
- 3,000,000 complexity points/hour
- Use
first: Nto limit results and reduce complexity cost - Monitor
X-RateLimit-Requests-Remainingresponse header
Important Notes
- Always use
terminaltool withcurlfor API calls — do NOT useweb_extractorbrowser - Always check the
errorsarray in GraphQL responses — HTTP 200 can still contain errors - If
stateIdis omitted when creating issues, Linear defaults to the first backlog state - The
descriptionfield supports Markdown - Use
python3 -m json.toolorjqto format JSON responses for readability
04 同仓库更多 Skills
blocked-page-recovery
Use when a fetch fails: 403/429, paywall, WAF, bot wall.
writing-plans
Use when creating or updating executable software plans. Keep plans as local files unless the user explicitly asks to register them in Doct.
test-driven-development
TDD: enforce RED-GREEN-REFACTOR, tests before code.
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.
spike
Throwaway experiments to validate an idea before build.
simplify-code
Parallel 3-agent cleanup of recent code changes.