linear-reference-architecture
Production-grade Linear integration architecture patterns. Use when designing system architecture, choosing integration patterns, or reviewing architectural decisions for Linear integrations. Trigger: "linear architecture", "linear system design", "linear integration patterns", "linear best practices architecture".
Best use case
linear-reference-architecture is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Production-grade Linear integration architecture patterns. Use when designing system architecture, choosing integration patterns, or reviewing architectural decisions for Linear integrations. Trigger: "linear architecture", "linear system design", "linear integration patterns", "linear best practices architecture".
Teams using linear-reference-architecture should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/linear-reference-architecture/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How linear-reference-architecture Compares
| Feature / Agent | linear-reference-architecture | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Production-grade Linear integration architecture patterns. Use when designing system architecture, choosing integration patterns, or reviewing architectural decisions for Linear integrations. Trigger: "linear architecture", "linear system design", "linear integration patterns", "linear best practices architecture".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Linear Reference Architecture
## Overview
Production-grade architectural patterns for Linear integrations. Choose the right pattern based on team size, complexity, and real-time requirements.
## Architecture Decision Matrix
| Pattern | Best For | Complexity | Rate Budget | Example |
|---------|----------|------------|-------------|---------|
| Simple | Single app, small team | Low | < 500 req/hr | Internal dashboard |
| Service-Oriented | Multiple apps, shared state | Medium | 500-2,000 req/hr | Platform with Linear sync |
| Event-Driven | Real-time needs, many consumers | High | < 500 req/hr + webhooks | Multi-service notification system |
| CQRS | Audit trails, complex queries | Very High | Minimal API calls | Compliance-grade tracking |
## Architecture 1: Simple Integration
Direct SDK calls from your application. Best for scripts, internal tools, and prototypes.
```typescript
// src/linear.ts — single module, shared client
import { LinearClient } from "@linear/sdk";
const client = new LinearClient({ apiKey: process.env.LINEAR_API_KEY! });
// Direct SDK calls from any part of your app
export async function getOpenIssues(teamKey: string) {
return client.issues({
first: 50,
filter: {
team: { key: { eq: teamKey } },
state: { type: { nin: ["completed", "canceled"] } },
},
orderBy: "priority",
});
}
export async function createBugReport(teamId: string, title: string, description: string) {
const labels = await client.issueLabels({ filter: { name: { eq: "Bug" } } });
return client.createIssue({
teamId,
title,
description,
priority: 2,
labelIds: labels.nodes.length ? [labels.nodes[0].id] : [],
});
}
```
## Architecture 2: Service-Oriented with Gateway
Centralized Linear access through a gateway service with caching and rate limiting.
```typescript
// src/linear-gateway.ts
import { LinearClient } from "@linear/sdk";
class LinearGateway {
private client: LinearClient;
private cache = new Map<string, { data: any; expiresAt: number }>();
private requestQueue: Array<{ fn: () => Promise<any>; resolve: Function; reject: Function }> = [];
private processing = false;
constructor(apiKey: string) {
this.client = new LinearClient({ apiKey });
}
// Cached reads
async getTeams() {
return this.cachedQuery("teams", () => this.client.teams().then(r => r.nodes), 600);
}
async getStates(teamId: string) {
return this.cachedQuery(`states:${teamId}`, async () => {
const team = await this.client.team(teamId);
return (await team.states()).nodes;
}, 1800);
}
// Rate-limited writes
async createIssue(input: any) {
return this.enqueue(() => this.client.createIssue(input));
}
async updateIssue(id: string, input: any) {
return this.enqueue(() => this.client.updateIssue(id, input));
}
// Custom queries through the gateway
async rawQuery(query: string, variables?: any) {
return this.enqueue(() => this.client.client.rawRequest(query, variables));
}
// Cache invalidation (called from webhook handler)
invalidate(pattern: string) {
for (const key of this.cache.keys()) {
if (key.startsWith(pattern)) this.cache.delete(key);
}
}
private async cachedQuery<T>(key: string, fn: () => Promise<T>, ttlSec: number): Promise<T> {
const cached = this.cache.get(key);
if (cached && Date.now() < cached.expiresAt) return cached.data;
const data = await this.enqueue(fn);
this.cache.set(key, { data, expiresAt: Date.now() + ttlSec * 1000 });
return data;
}
private async enqueue<T>(fn: () => Promise<T>): Promise<T> {
return new Promise((resolve, reject) => {
this.requestQueue.push({ fn, resolve, reject });
if (!this.processing) this.processQueue();
});
}
private async processQueue() {
this.processing = true;
while (this.requestQueue.length > 0) {
const { fn, resolve, reject } = this.requestQueue.shift()!;
try { resolve(await fn()); } catch (e) { reject(e); }
if (this.requestQueue.length > 0) {
await new Promise(r => setTimeout(r, 100)); // 10 req/sec max
}
}
this.processing = false;
}
}
export const gateway = new LinearGateway(process.env.LINEAR_API_KEY!);
```
## Architecture 3: Event-Driven
Webhook-centric architecture. Minimal API calls, real-time processing.
```typescript
// src/event-processor.ts
import express from "express";
import crypto from "crypto";
import { EventEmitter } from "events";
// Internal event bus
const bus = new EventEmitter();
// Webhook ingester
const app = express();
app.post("/webhooks/linear", express.raw({ type: "*/*" }), (req, res) => {
const sig = req.headers["linear-signature"] as string;
const body = req.body.toString();
const expected = crypto.createHmac("sha256", process.env.LINEAR_WEBHOOK_SECRET!)
.update(body).digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) {
return res.status(401).end();
}
const event = JSON.parse(body);
res.json({ ok: true });
// Emit to internal consumers
bus.emit(`${event.type}.${event.action}`, event);
bus.emit(event.type, event);
bus.emit("*", event);
});
// Consumer: Slack notifications
bus.on("Issue.update", async (event) => {
if (event.updatedFrom?.stateId && event.data.state?.type === "completed") {
await notifySlack(`Done: ${event.data.identifier} ${event.data.title}`);
}
});
// Consumer: Database sync
bus.on("Issue", async (event) => {
if (event.action === "create") await db.issues.insert(event.data);
if (event.action === "update") await db.issues.update(event.data.id, event.data);
if (event.action === "remove") await db.issues.softDelete(event.data.id);
});
// Consumer: Cache invalidation
bus.on("*", (event) => {
gateway.invalidate(event.type.toLowerCase());
});
```
## Architecture 4: CQRS with Local State
Separate read and write paths. Full local state for complex queries, API for writes.
```typescript
// Write side: mutations go through Linear API
async function createIssue(input: any) {
const result = await gateway.createIssue(input);
// Local state updated via webhook, not here
return result;
}
// Read side: queries against local database (no API calls)
async function getSprintVelocity(teamKey: string, sprints: number) {
return db.query(`
SELECT c.name, SUM(i.estimate) as velocity
FROM cycles c
JOIN issues i ON i.cycle_id = c.id AND i.state_type = 'completed'
WHERE c.team_key = ? AND c.completed_at IS NOT NULL
ORDER BY c.completed_at DESC
LIMIT ?
`, [teamKey, sprints]);
}
// Sync: webhook events keep local state fresh
// Full sync: daily consistency check (see linear-data-handling)
```
## Project Structure
```
src/
linear/
gateway.ts # Rate-limited, cached API access
webhook-handler.ts # Signature verification + routing
event-bus.ts # Internal event distribution
cache.ts # TTL cache with invalidation
services/
issue-service.ts # Business logic
sync-service.ts # Data synchronization
config/
linear.ts # Environment config + validation
```
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Rate limit exceeded | Too many direct API calls | Route all calls through gateway |
| Stale cache | TTL too long, missed webhook | Webhook invalidation + periodic full sync |
| Event loss | Webhook delivery failure | Idempotent handlers + consistency checks |
| Schema drift | SDK version mismatch | Pin version, test upgrades in staging |
## Resources
- [Linear API Best Practices](https://linear.app/developers/graphql)
- [Event-Driven Architecture](https://martinfowler.com/articles/201701-event-driven.html)
- [CQRS Pattern](https://martinfowler.com/bliki/CQRS.html)Related Skills
workhuman-reference-architecture
Workhuman reference architecture for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman reference architecture".
wispr-reference-architecture
Wispr Flow reference architecture for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr reference architecture".
windsurf-reference-architecture
Implement Windsurf reference architecture with optimal project structure and AI configuration. Use when designing workspace configuration for Windsurf, setting up team standards, or establishing architecture patterns that maximize Cascade effectiveness. Trigger with phrases like "windsurf architecture", "windsurf project structure", "windsurf best practices", "windsurf team setup", "optimize for cascade".
windsurf-architecture-variants
Choose workspace architectures for different project scales in Windsurf. Use when deciding how to structure Windsurf workspaces for monorepos, multi-service setups, or polyglot codebases. Trigger with phrases like "windsurf workspace strategy", "windsurf monorepo", "windsurf project layout", "windsurf multi-service", "windsurf workspace size".
webflow-reference-architecture
Implement Webflow reference architecture — layered project structure, client wrapper, CMS sync service, webhook handlers, and caching layer for production integrations. Trigger with phrases like "webflow architecture", "webflow project structure", "how to organize webflow", "webflow integration design", "webflow best practices".
vercel-reference-architecture
Implement a Vercel reference architecture with layered project structure and best practices. Use when designing new Vercel projects, reviewing project structure, or establishing architecture standards for Vercel applications. Trigger with phrases like "vercel architecture", "vercel project structure", "vercel best practices layout", "how to organize vercel project".
vercel-architecture-variants
Choose and implement Vercel architecture blueprints for different scales and use cases. Use when designing new Vercel projects, choosing between static, serverless, and edge architectures, or planning how to structure a multi-project Vercel deployment. Trigger with phrases like "vercel architecture", "vercel blueprint", "how to structure vercel", "vercel monorepo", "vercel multi-project".
veeva-reference-architecture
Veeva Vault reference architecture for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva reference architecture".
vastai-reference-architecture
Implement Vast.ai reference architecture for GPU compute workflows. Use when designing ML training pipelines, structuring GPU orchestration, or establishing architecture patterns for Vast.ai applications. Trigger with phrases like "vastai architecture", "vastai design pattern", "vastai project structure", "vastai ml pipeline".
twinmind-reference-architecture
Production architecture for meeting AI systems using TwinMind: transcription pipeline, memory vault, action item workflow, and calendar integration. Use when implementing reference architecture, or managing TwinMind meeting AI operations. Trigger with phrases like "twinmind reference architecture", "twinmind reference architecture".
together-reference-architecture
Together AI reference architecture for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together reference architecture".
techsmith-reference-architecture
TechSmith reference architecture for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith reference architecture".