linear-claude-skill
CLAUDE.md132 starsChanged 8 months agoMITView on GitHub
This is a Claude Code skill for managing Linear issues, projects, and teams. It provides high-level TypeScript operations, a label taxonomy system for consistent categorization, and utilities for SDK automation. linear-ops.ts — Main CLI entry point. Dispatches to command handlers for issues, projects, initiatives, and labels. All commands follow the pattern: lib/index.ts — Central export hub. All scripts import from ./lib not individual files. Label Taxonomy System — Four files work together: - taxonomy.ts: TypeScript interfaces (DomainLabel, TypeLabel, ScopeLabel, AgentId)…
- Reads credentials
In this repositoryOne other file it gives its agents.
- LinearSkill
The file
We split this CLAUDE.md into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 83
Create project with description
- Distinctive: line 87
Create issues with labels
- Very specific: line 92
All TypeScript entry points in scripts/ are pre-compiled to dist/ using esbuild for faster CLI startup (eliminates tsx runtime compilation …
- Very specific: line 98
Shared runner (
scripts/run.sh): All npm scripts delegate to a single shell script that checks for the pre-built dist/*.js file first, … - Distinctive: line 118
When creating issues, apply labels in this order:
- Very specific: line 123
Use npm run ops -- labels validate "..." to check label combinations.
- Very specific: line 127
Use @linear/sdk for typed operations (imported as LinearClient)
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is a Claude Code skill for managing Linear issues, projects, and teams. It provides high-level TypeScript operations, a label taxonomy system for consistent categorization, and utilities for SDK automation.
Common Commands
# Run setup check (validates LINEAR_API_KEY and dependencies)
npm run setup
# High-level operations CLI
npm run ops -- <command> [args]
npm run ops -- help # Show all commands
npm run ops -- create-issue "Project" "Title" "Desc"
npm run ops -- create-sub-issue ENG-100 "Title"
npm run ops -- labels taxonomy # Show label taxonomy
npm run ops -- labels validate "feature,security"
# Run GraphQL query
npm run query -- "query { viewer { name } }"
# Test Linear connection
npm run test-connectionArchitecture
Directory Structure
linear-claude-skill/
├── SKILL.md # Main skill instructions (loaded by Claude Code)
├── api.md # GraphQL API reference
├── sdk.md # SDK automation patterns
├── sync.md # Bulk sync patterns
├── docs/
│ └── labels.md # Label taxonomy documentation
├── hooks/
│ └── post-edit.sh # Auto-sync hook
├── scripts/
│ ├── run.sh # Shared runner (dist/ with tsx fallback)
│ ├── linear-ops.ts # CLI for high-level operations (main entry point)
│ ├── query.ts # GraphQL query runner
│ ├── setup.ts # Configuration validator
│ ├── sync.ts # Bulk sync operations
│ ├── linear-api.mjs # Direct API wrapper
│ └── lib/ # Shared utilities (imported by scripts)
│ ├── index.ts # Re-exports all utilities
│ ├── labels.ts # Label management (CRUD, validation)
│ ├── taxonomy*.ts # Label taxonomy system (types, data, validation)
│ ├── agent-selection.ts # Agent routing based on labels
│ ├── initiative.ts # Initiative linking
│ ├── lin-cli.ts # Optional lin CLI integration (tryLin, detection, typed wrappers)
│ ├── project-template.ts # Project creation with verification
│ └── verify.ts # Post-creation verificationKey Components
linear-ops.ts — Main CLI entry point. Dispatches to command handlers for issues, projects, initiatives, and labels. All commands follow the pattern:
const commands: Record<string, (...args: string[]) => Promise<void>> = { ... }lib/index.ts — Central export hub. All scripts import from ./lib not individual files.
Label Taxonomy System — Four files work together:
taxonomy.ts: TypeScript interfaces (DomainLabel, TypeLabel, ScopeLabel, AgentId)taxonomy-data.ts: Label definitions with colors, descriptions, agent mappingstaxonomy-validation.ts: Validation rules and keyword-based suggestionagent-selection.ts: Routes issues to agents based on domain labels
lin-cli.ts — Optional integration with the lin Rust CLI binary. Provides
isLinCliAvailable() detection (cached) and tryLin() — the single abstraction
used by command handlers for silent fast-path with SDK fallback. Includes typed
wrappers, circuit-breaker after 3 failures, and LINEAR_USE_LIN=0 kill switch.
project-template.ts — Enforces the 6-step project creation workflow:
- Create project with description
- Link to initiative (mandatory)
- Set content via projectUpdate mutation
- Ensure labels exist
- Create issues with labels
- Run verification
Build System (esbuild)
All TypeScript entry points in scripts/ are pre-compiled to dist/ using esbuild for faster CLI startup (eliminates tsx runtime compilation overhead).
scripts/build.mjs auto-discovers every scripts/*.ts file and bundles each one to dist/*.js. External dependencies (@linear/sdk) are kept external — not inlined into the bundle.
__BUNDLED__ build-time define: The linear-ops.ts entry point declares __BUNDLED__ as a global. At build time, esbuild replaces all occurrences with true. This lets code detect whether it is running from a pre-built bundle or via tsx at development time.
Shared runner (scripts/run.sh): All npm scripts delegate to a single shell script that checks for the pre-built dist/*.js file first, falling back to npx tsx if dist is missing:
"ops": "sh scripts/run.sh linear-ops"Key commands:
npm run build— Run esbuild (also runstypecheckviaprebuild)npm test— Run smoke tests that validate build outputnpx tsc --noEmit— Type-check without emitting files
Environment Variables
LINEAR_API_KEY # Required - Linear API key (lin_api_...)
LINEAR_DEFAULT_INITIATIVE_ID # Optional - Default initiative for createProjectWithDefaults()
LINEAR_USE_LIN # Optional - Set to 0 to disable lin CLI fast-pathLabel Taxonomy Rules
When creating issues, apply labels in this order:
- Type (exactly one):
feature,bug,refactor,chore,spike - Domain (1-2):
security,backend,frontend,testing,infrastructure, etc. - Scope (0-2 if applicable):
blocked,breaking-change,tech-debt, etc.
Use npm run ops -- labels validate "..." to check label combinations.
Linear API Patterns
- Use
@linear/sdkfor typed operations (imported asLinearClient) - GraphQL mutations via
fetch('https://api.linear.app/graphql', ...)for operations not in SDK - Content vs Description:
descriptionis 255 chars for list views;contentis unlimited for detail panel - Project status requires UUID lookup:
query { projectStatuses { nodes { id name } } } - Initiative linking uses
initiativeToProjectCreatemutation (not SDK method)
MCP Considerations
The skill is designed to work with Linear's official MCP server at mcp.linear.app. Helper scripts provide fallbacks for unreliable MCP operations (status updates, comments).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

