linear-sdk-patterns
Provides best practices and code patterns for efficient Linear SDK usage.
Install
mkdir -p .claude/skills/linear-sdk-patterns && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5375" && unzip -o skill.zip -d .claude/skills/linear-sdk-patterns && rm skill.zipInstalls to .claude/skills/linear-sdk-patterns
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
TypeScript/JavaScript SDK patterns and best practices for Linear.Key capabilities
- →Manage LinearClient instances for single or multi-user applications.
- →Implement cursor-based pagination for Linear API data.
- →Optimize relation loading to avoid N+1 query problems.
- →Construct filtered queries using various comparators and logical operators.
- →Handle API errors with type-safe error classes.
- →Execute raw GraphQL queries and mutations for advanced control.
How it works
The skill provides TypeScript code examples and explanations for common patterns when interacting with the Linear GraphQL API via the `@linear/sdk`.
Inputs & outputs
When to use linear-sdk-patterns
- →Implementing Linear API integrations
- →Optimizing SDK data fetching
- →Managing API rate limits
- →Handling Linear GraphQL relations
About this skill
Linear TypeScript SDK Patterns
Overview
Keep SDK mechanics inside a bounded adapter and expose domain-shaped results rather than generated model objects throughout the application.
Prerequisites
- The target repository, Linear workspace, environment, and accountable owner
- Current security, privacy, compliance, capacity, and change-control requirements
- An approved Linear credential only when a bounded live verification is necessary
Tool Discipline
Use Read, Glob, and Grep to inspect code, configuration, and evidence. Use WebFetch only for current first-party Linear documentation and package metadata. Use Write or Edit only for requested implementation with known target files. Never write credentials, customer content, unrestricted environment output, or unredacted GraphQL variables.
Current Contract
- Current SDK mutations use verb-first names such as
createIssue,updateUser, andarchiveProject. - Connections expose
nodes,pageInfo,fetchNext, andfetchPrevious; optional variables are passed in an object. linearClient.client.rawRequestsupports purpose-built GraphQL, whileLinearErrorexposes parsed request/response/error evidence.
Authentication
Use a personal API key only for owner-controlled scripts, OAuth with PKCE for user-delegated applications, or an enabled client-credentials grant for approved automation. Personal keys use Authorization: <API_KEY>; OAuth tokens use Authorization: Bearer <ACCESS_TOKEN>. Store credentials server-side in an approved secret manager.
Treat app approval, team access, scope changes, credential creation, rotation, revocation, and production access as owner-approved actions.
Instructions
- Inspect the installed SDK version, generated types, adapter boundary, call sites, and error policy.
- Create one client per approved auth context and inject it; never construct clients throughout business code.
- Wrap SDK models in domain functions that accept stable IDs and return minimum typed projections.
- Paginate every connection explicitly and expose checkpoints for long-running synchronization.
- Use raw GraphQL only when it measurably reduces fields or fan-out; keep operation names and variables typed.
- Normalize
LinearErrorand GraphQL partial errors into retryable, terminal, and reconciliation-required outcomes.
Approval Boundaries
Do not create, reveal, rotate, or revoke credentials; authorize an OAuth app; change scopes or team access; create, mutate, archive, or delete workspace data; configure or re-enable webhooks; import or export data; change roles, SCIM, or audit streaming; transmit diagnostics; change paid entitlements; or perform another production mutation without explicit approval from the accountable owner. Keep diagnosis read-only unless implementation was requested.
Output
Return the workspace and team scope, auth mode without credential value, files and contracts inspected, exact operation names, evidence collected, validation result, sensitive fields redacted, remaining risk, accountable owner, approval state, and rollback or next action.
Error Handling
| Condition | Response |
|---|---|
| Method missing | Compare code with the installed generated SDK and the verb-first mutation contract. |
| Connection truncated | Follow pageInfo or SDK page helpers until the required boundary is reached. |
| Model leaks across layers | Map it to a stable application-owned type at the adapter boundary. |
| Raw query drifts | Validate against current introspection/generated schema and add a contract test. |
Examples
Use a compact handoff that makes scope, mutation authority, and verification evidence reviewable.
Input:
adapter=issues; operation=listUpdated; page-size=25; checkpoint=cursor
Expected handoff:
client=injected; projection=minimal; pagination=explicit; errors=normalized
Resources
Prerequisites
Limitations
- →SDK models lazy-load relations, which can lead to N+1 problems if not batched.
- →Query complexity can be too high with too many nested relations.
- →Nullable relations are not automatically checked.
How it compares
This skill offers optimized patterns for client management, pagination, and relation loading, which helps avoid common pitfalls like N+1 queries and rate limit issues that might occur with naive SDK usage.
Compared to similar skills
linear-sdk-patterns side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| linear-sdk-patterns (this skill) | 1 | 2mo | Review | Intermediate |
| openrouter-hello-world | 7 | 2mo | Caution | Beginner |
| telegram-dev | 2 | 9mo | Review | Intermediate |
| shopify-apps | 1 | 5mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by jeremylongshore
View all by jeremylongshore →You might also like
openrouter-hello-world
jeremylongshore
Create your first OpenRouter API request with a simple example. Use when learning OpenRouter or testing your setup. Trigger with phrases like 'openrouter hello world', 'openrouter first request', 'openrouter quickstart', 'test openrouter'.
telegram-dev
2025Emma
Telegram 生态开发全栈指南 - 涵盖 Bot API、Mini Apps (Web Apps)、MTProto 客户端开发。包括消息处理、支付、内联模式、Webhook、认证、存储、传感器 API 等完整开发资源。
shopify-apps
alinaqi
Shopify app development - Remix, Admin API, checkout extensions
ccxt-typescript
ccxt
CCXT cryptocurrency exchange library for TypeScript and JavaScript developers (Node.js and browser). Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors. Use when working with crypto exchanges in TypeScript/JavaScript projects, trading bots, arbitrage systems, or portfolio management tools. Includes both REST and WebSocket examples.
rdc-endpoint-setup
reactive
Set up @data-client/endpoint for custom async operations. Wraps existing async functions with Endpoint for use with Data Client hooks. Use after rdc-setup detects non-REST/GraphQL async patterns.
route-handlers
davepoon
This skill should be used when the user asks to "create an API route", "add an endpoint", "build a REST API", "handle POST requests", "create route handlers", "stream responses", or needs guidance on Next.js API development in the App Router.