Using Linear
Guide for working with Linear project management via GraphQL API. Use when creating/updating Linear issues, changing status, adding comments, or uploading files/screenshots. Covers raw GraphQL, Python SDK (linear-py), issue search, mutations, and file upload workflows with Google Cloud Storage signed URLs. Tested October 2025.
What this skill does
# Using Linear
Comprehensive guide for working with Linear project management system via GraphQL API and Python SDK.
**Last tested**: October 26, 2025
**Test workspace**: cs1060f25
**Recommended approach**: Raw GraphQL with urllib
## When to Use This Skill
Use this skill when:
- Creating or updating Linear issues programmatically
- Searching for issues by identifier or filter
- Changing issue status (e.g., marking as "Done")
- Adding comments to issues
- Uploading files or screenshots to Linear issues
- Automating Linear workflows with Python scripts
## API Approaches
### Raw GraphQL (Recommended) ⭐
**Pros**: Full feature support, file uploads, variables, no dependencies
**Cons**: More verbose
**Use when**: Need file uploads, complex queries, or full API access
```python
import json
import urllib.request
def graphql_request(query, variables=None):
url = "https://api.linear.app/graphql"
payload = {"query": query}
if variables:
payload["variables"] = variables
req = urllib.request.Request(
url,
data=json.dumps(payload).encode('utf-8'),
headers={
"Authorization": "lin_api_...",
"Content-Type": "application/json"
}
)
with urllib.request.urlopen(req) as response:
return json.loads(response.read().decode('utf-8'))
```
### Python SDK (linear-py)
**Pros**: Simpler API for basic operations
**Cons**: No file uploads, no variables in queries, limited field support (no `estimate`!)
**Use when**: Only need simple reads
```python
from linear import Linear
client = Linear("lin_api_...")
teams = client.teams() # Returns list of dicts
```
**SDK Limitations**:
- Uses snake_case (`team_id`) not camelCase (`teamId`)
- Cannot pass variables to GraphQL queries
- No file upload support
- `estimate` parameter doesn't work in create_issue
**Recommendation**: Use raw GraphQL for any real work. SDK only for quick prototypes.
### Comprehensive Guide
See `references/linear-api-comprehensive-guide.md` for:
- Detailed SDK comparison with tested examples
- Advanced GraphQL patterns (pagination, filtering, bulk operations)
- File upload workflow variations
- Common gotchas and solutions
- Testing results from cs1060f25 workspace
## API Authentication
Linear uses API tokens for authentication. Include the token in request headers:
```python
headers = {
"Authorization": "lin_api_...",
"Content-Type": "application/json"
}
```
**API Endpoint**: `https://api.linear.app/graphql`
## Common Operations
### 1. Search for Issue by Identifier
To find an issue like "UNIFIED-26":
```python
query = """
query SearchIssues($filter: IssueFilter!) {
issues(filter: $filter) {
nodes {
id
identifier
title
}
}
}
"""
variables = {
"filter": {
"number": {"eq": 26} # Extract number from "UNIFIED-26"
}
}
result = graphql_request(query, variables)
# Find exact match
for issue in result["data"]["issues"]["nodes"]:
if issue["identifier"] == "UNIFIED-26":
return issue
```
**Important**: Filter by number first, then match exact identifier to handle multiple teams.
### 2. Update Issue Status
To mark an issue as "Done":
```python
mutation = """
mutation UpdateIssue($id: String!, $input: IssueUpdateInput!) {
issueUpdate(id: $id, input: $input) {
success
issue {
id
state {
name
}
}
}
}
"""
variables = {
"id": issue_id,
"input": {
"stateId": "done_state_id" # Get from team workflow states
}
}
```
### 3. Update Issue Due Date
To set a due date on an issue:
```python
mutation = """
mutation UpdateIssueDueDate($id: String!, $dueDate: TimelessDate!) {
issueUpdate(id: $id, input: {dueDate: $dueDate}) {
success
issue {
id
identifier
dueDate
}
}
}
"""
variables = {
"id": issue_id,
"dueDate": "2025-11-03" # ISO 8601 format: YYYY-MM-DD
}
result = graphql_request(mutation, variables)
```
**TimelessDate Type**:
- Scalar type that accepts ISO 8601 date format: `YYYY-MM-DD`
- Also accepts shortcuts like `"2021"` for midnight Jan 01 2021
- Accepts ISO 8601 duration strings added to current date (e.g., `"-P2W1D"` = 2 weeks and 1 day ago)
- Common format: `"2025-11-03"` for November 3, 2025
### 4. Update Issue Labels
**IMPORTANT:** Linear doesn't have `issueAddLabel` mutation. Use `issueUpdate` with `labelIds` array instead.
To add or update labels on an issue:
```python
# First, get current labels
get_issue_query = """{
issues(filter: {identifier: {eq: "UNIFIED-15"}}) {
nodes {
id
labels { nodes { id name } }
}
}
}"""
issue_result = graphql_request(get_issue_query)
issue = issue_result['data']['issues']['nodes'][0]
issue_id = issue['id']
current_label_ids = [label['id'] for label in issue['labels']['nodes']]
# Add new label to existing ones
mutation = """
mutation UpdateIssueLabels($id: String!, $labelIds: [String!]!) {
issueUpdate(id: $id, input: {labelIds: $labelIds}) {
success
issue {
id
labels { nodes { name } }
}
}
}
"""
# Append new label ID to existing labels
new_label_ids = current_label_ids + [new_label_id]
variables = {
"id": issue_id,
"labelIds": new_label_ids # Array of ALL label IDs (existing + new)
}
result = graphql_request(mutation, variables)
```
**Key points:**
- `labelIds` parameter **REPLACES** all labels (doesn't append)
- Always include existing label IDs + new ones
- Use `String!` type for label IDs, not `ID!`
### 4. Add Comment to Issue
To add a text comment (supports Markdown):
```python
mutation = """
mutation CreateComment($input: CommentCreateInput!) {
commentCreate(input: $input) {
success
comment {
id
body
}
}
}
"""
variables = {
"input": {
"issueId": issue_id,
"body": "Comment text with **Markdown** support"
}
}
```
## File Upload Workflow
Uploading files to Linear requires a two-step process with Google Cloud Storage signed URLs.
### Overview
1. Request upload URL from Linear GraphQL API
2. Upload file to Google Cloud Storage with required headers
3. Use returned asset URL in comments or issue descriptions
### Critical Discovery: Required Headers
**Google Cloud Storage signed URLs require EXACT headers** that match the cryptographic signature. Linear's API provides these headers - they MUST be included in the upload request.
### Step 1: Request Upload URL
Query Linear's `fileUpload` mutation with file metadata:
```python
query = """
mutation FileUpload($size: Int!, $filename: String!, $contentType: String!) {
fileUpload(size: $size, filename: $filename, contentType: $contentType) {
success
uploadFile {
uploadUrl
assetUrl
headers {
key
value
}
}
}
}
"""
variables = {
"size": os.path.getsize(file_path),
"filename": os.path.basename(file_path),
"contentType": "image/png" # or appropriate MIME type
}
result = graphql_request(query, variables)
upload_data = result["data"]["fileUpload"]["uploadFile"]
```
**Response includes**:
- `uploadUrl`: Google Cloud Storage signed URL (valid for 60 seconds)
- `assetUrl`: Final Linear CDN URL for the uploaded file
- `headers`: Array of required headers for upload
### Step 2: Upload File with Required Headers
**Critical**: Include ALL headers returned by Linear API:
```bash
curl -X PUT \
-H "Content-Type: image/png" \
-H "x-goog-content-length-range: [exact_size],[exact_size]" \
-H 'Content-Disposition: attachment; filename="..."' \
-T /path/to/file \
"[uploadUrl]"
```
**Headers breakdown**:
1. `Content-Type`: Must match `contentType` from mutation (part of signature)
2. `x-goog-content-length-range`: Exact file size range (provided by Linear)
3. `Content-Disposition`: Filename for download (provided by Linear)
**Python example using urllib**:
```python
import urllib.request
# Build headers from Linear's response
upload_headers = {"Content-TypRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.