Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Configure Linear across development, staging, and production environments. Use when setting up per-environment API keys, secret management, or environment-specific Linear configurations. Trigger: "linear environments", "linear staging", "linear dev prod", "linear environment setup", "multi-environment linear".
.claude/skills/jeremylongshore-linear-multi-env-setup/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | 125% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 71% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 54% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 83% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 97% | 0% |
Configure Linear integrations across dev, staging, and production with isolated API keys, secret management, environment guards, and per-environment webhook routing. Use separate Linear workspaces or at minimum separate API keys per environment.
typescript// src/config/linear.ts import { LinearClient } from "@linear/sdk"; interface LinearEnvConfig { apiKey: string; webhookSecret: string; defaultTeamKey: string; enableWebhooks: boolean; enableDebugLogging: boolean; cacheEnabled: boolean; } type Environment = "development" | "staging" | "production" | "test"; function getEnvironment(): Environment { const env = process.env.NODE_ENV ?? "development"; if (!["development", "staging", "production", "test"].includes(env)) { throw new Error(`Unknown NODE_ENV: ${env}`); } return env as Environment; } async function loadConfig(): Promise<LinearEnvConfig> { const env = getEnvironment(); // In production, use secret manager instead of env vars if (env === "production" || env === "staging") { return { apiKey: await getSecret(`linear-api-key-${env}`), webhookSecret: await getSecret(`linear-webhook-secret-${env}`), defaultTeamKey: process.env.LINEAR_DEFAULT_TEAM_KEY ?? "ENG", enableWebhooks: true, enableDebugLogging: env === "staging", cacheEnabled: true, }; } // Dev/test: use environment variables return { apiKey: process.env.LINEAR_API_KEY ?? "", webhookSecret: process.env.LINEAR_WEBHOOK_SECRET ?? "", defaultTeamKey: process.env.LINEAR_DEV_TEAM_KEY ?? "DEV", enableWebhooks: false, // No webhook server in local dev enableDebugLogging: true, cacheEnabled: false, }; }
typescript// GCP Secret Manager import { SecretManagerServiceClient } from "@google-cloud/secret-manager"; async function getSecret(name: string): Promise<string> { const client = new SecretManagerServiceClient(); const projectId = process.env.GCP_PROJECT_ID!; const [version] = await client.accessSecretVersion({ name: `projects/${projectId}/secrets/${name}/versions/latest`, }); return version.payload?.data?.toString() ?? ""; } // AWS Secrets Manager import { SecretsManagerClient, GetSecretValueCommand } from "@aws-sdk/client-secrets-manager"; async function getSecretAWS(name: string): Promise<string> { const client = new SecretsManagerClient({}); const result = await client.send(new GetSecretValueCommand({ SecretId: name })); return result.SecretString ?? ""; } // HashiCorp Vault async function getSecretVault(path: string): Promise<string> { const response = await fetch(`${process.env.VAULT_ADDR}/v1/${path}`, { headers: { "X-Vault-Token": process.env.VAULT_TOKEN! }, }); const data = await response.json(); return data.data.data.value; }
typescriptlet _client: LinearClient | null = null; let _config: LinearEnvConfig | null = null; export async function getLinearClient(): Promise<LinearClient> { if (!_client) { _config = await loadConfig(); if (!_config.apiKey) { throw new Error(`LINEAR_API_KEY not configured for ${getEnvironment()}`); } _client = new LinearClient({ apiKey: _config.apiKey }); } return _client; } export async function getConfig(): Promise<LinearEnvConfig> { if (!_config) await getLinearClient(); // Triggers config load return _config!; } // For tests: inject a mock or test client export function setTestClient(client: LinearClient) { _client = client; }
Prevent dangerous operations from running in the wrong environment.
typescriptfunction requireProduction(operation: string) { if (getEnvironment() !== "production") { throw new Error(`${operation} is production-only (current: ${getEnvironment()})`); } } function preventProduction(operation: string) { if (getEnvironment() === "production") { throw new Error(`${operation} is forbidden in production`); } } // Usage async function deleteAllTestIssues(teamKey: string) { preventProduction("deleteAllTestIssues"); // Safety guard const client = await getLinearClient(); const issues = await client.issues({ filter: { team: { key: { eq: teamKey } }, title: { startsWith: "[TEST]" }, }, }); for (const issue of issues.nodes) { await issue.delete(); } } // Safe delete: archives in prod, deletes in dev async function safeRemoveIssue(issueId: string) { const client = await getLinearClient(); if (getEnvironment() === "production") { await client.archiveIssue(issueId); } else { await client.deleteIssue(issueId); } }
typescript// Different webhook configs per environment const webhookConfigs: Record<Environment, { resourceTypes: string[]; enabled: boolean; }> = { development: { resourceTypes: [], // No webhooks in dev — use polling/ngrok manually enabled: false, }, staging: { resourceTypes: ["Issue", "Comment", "Project", "Cycle"], enabled: true, }, production: { resourceTypes: ["Issue", "Comment", "Project", "Cycle", "IssueLabel", "ProjectUpdate"], enabled: true, }, test: { resourceTypes: [], enabled: false, }, };
yaml# .github/workflows/deploy.yml name: Deploy on: push: branches: [main, release/*] jobs: deploy-staging: if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest environment: staging steps: - uses: actions/checkout@v4 - run: npm ci && npm run build - run: npm run deploy:staging env: LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }} LINEAR_WEBHOOK_SECRET: ${{ secrets.LINEAR_WEBHOOK_SECRET }} deploy-production: if: startsWith(github.ref, 'refs/heads/release/') runs-on: ubuntu-latest environment: production steps: - uses: actions/checkout@v4 - run: npm ci && npm run build - run: npm run deploy:production env: LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }} LINEAR_WEBHOOK_SECRET: ${{ secrets.LINEAR_WEBHOOK_SECRET }}
typescript// scripts/validate-environment.ts async function validateEnvironment() { const env = getEnvironment(); console.log(`Validating Linear config for: ${env}\n`); const config = await loadConfig(); const checks = [ { name: "API Key", ok: config.apiKey.startsWith("lin_api_") }, { name: "Webhook Secret", ok: !config.enableWebhooks || config.webhookSecret.length > 10 }, { name: "Default Team", ok: config.defaultTeamKey.length > 0 }, ]; // Test API connectivity try { const client = new LinearClient({ apiKey: config.apiKey }); const viewer = await client.viewer; const teams = await client.teams(); const team = teams.nodes.find(t => t.key === config.defaultTeamKey); checks.push({ name: "API Auth", ok: true }); checks.push({ name: "Default Team Exists", ok: !!team }); console.log(` User: ${viewer.name} (${viewer.email})`); console.log(` Teams: ${teams.nodes.map(t => t.key).join(", ")}`); } catch (e: any) { checks.push({ name: "API Auth", ok: false }); console.error(` Auth failed: ${e.message}`); } for (const { name, ok } of checks) { console.log(` ${ok ? "PASS" : "FAIL"}: ${name}`); } const failed = checks.filter(c => !c.ok).length; if (failed > 0) process.exit(1); } validateEnvironment();
| Error | Cause | Solution | |-------|-------|----------| | Wrong environment data | API key for wrong workspace | Verify secrets per environment | | Secret not found | Missing in secret manager | Add secret for the target environment | | Team not found | Wrong defaultTeamKey | Check team key matches the environment's workspace | | Permission denied | Insufficient API key scope | Regenerate with correct scopes |
bashNODE_ENV=staging npx tsx scripts/validate-environment.ts # Output: # Validating Linear config for: staging # User: CI Bot (ci@company.com) # Teams: ENG, PRODUCT, DESIGN # PASS: API Key # PASS: Webhook Secret # PASS: Default Team # PASS: API Auth # PASS: Default Team Exists
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-15 | fail→pass | 23,395 | 15,715 | -33% | 1 | 1 | 0% | 2,064 | 4,649 | +125% | 0 | 0 | — |
case-01 | fail→fail | 23,467 | 18,045 | -23% | 1 | 1 | 0% | 2,962 | 5,001 | +69% | 0 | 0 | — |
case-02 | fail→pass | 21,058 | 19,241 | -9% | 1 | 1 | 0% | 3,175 | 5,416 | +71% | 0 | 0 | — |
case-03 | fail→fail | 23,695 | 25,227 | +6% | 1 | 1 | 0% | 3,890 | 7,119 | +83% | 0 | 0 | — |
case-04 | pass→pass | 30,623 | 18,433 | -40% | 1 | 1 | 0% | 2,517 | 5,121 | +103% | 0 | 0 | — |
case-05 | pass→pass | 18,030 | 13,777 | -24% | 1 | 1 | 0% | 1,920 | 4,168 | +117% | 0 | 0 | — |
case-06 | pass→pass | 19,957 | 20,454 | +2% | 1 | 1 | 0% | 3,160 | 5,616 | +78% | 0 | 0 | — |
case-07 | fail→pass | 25,692 | 16,698 | -35% | 1 | 1 | 0% | 3,076 | 4,749 | +54% | 0 | 0 | — |
case-08 | fail→fail | 14,997 | 11,015 | -27% | 1 | 1 | 0% | 1,581 | 3,296 | +108% | 0 | 0 | — |
case-09 | pass→pass | 13,171 | 12,550 | -5% | 1 | 1 | 0% | 1,595 | 3,636 | +128% | 0 | 0 | — |
case-10 | pass→pass | 15,239 | 14,431 | -5% | 1 | 1 | 0% | 1,848 | 4,249 | +130% | 0 | 0 | — |
case-11 | fail→fail | 20,094 | 18,997 | -5% | 1 | 1 | 0% | 2,318 | 5,194 | +124% | 0 | 0 | — |
case-12 | pass→pass | 11,269 | 6,209 | -45% | 1 | 1 | 0% | 1,528 | 3,323 | +117% | 0 | 0 | — |
case-13 | fail→pass | 23,379 | 14,844 | -37% | 1 | 1 | 0% | 2,586 | 4,733 | +83% | 0 | 0 | — |
case-14 | pass→pass | 21,318 | 11,324 | -47% | 1 | 1 | 0% | 2,316 | 4,377 | +89% | 0 | 0 | — |
case-16 | fail→fail | 25,247 | 18,987 | -25% | 1 | 1 | 0% | 2,745 | 4,553 | +66% | 0 | 0 | — |
case-17 | pass→pass | 18,661 | 3,571 | -81% | 1 | 1 | 0% | 2,562 | 3,070 | +20% | 0 | 0 | — |
case-18 | fail→pass | 23,738 | 13,827 | -42% | 1 | 1 | 0% | 2,540 | 5,011 | +97% | 0 | 0 | — |
case-19 | pass→pass | 13,039 | 15,148 | +16% | 1 | 1 | 0% | 2,413 | 3,903 | +62% | 0 | 0 | — |
case-20 | fail→pass | 13,278 | 14,395 | +8% | 1 | 1 | 0% | 1,981 | 3,814 | +93% | 0 | 0 | — |
case-21 | pass→pass | 14,744 | 13,661 | -7% | 1 | 1 | 0% | 1,757 | 4,097 | +133% | 0 | 0 | — |
case-22 | fail→pass | 18,098 | 13,504 | -25% | 1 | 1 | 0% | 2,136 | 4,113 | +93% | 0 | 0 | — |
case-23 | fail→pass | 22,794 | 21,110 | -7% | 1 | 1 | 0% | 2,982 | 3,678 | +23% | 0 | 0 | — |
case-24 | fail→pass | 6,567 | 3,609 | -45% | 1 | 1 | 0% | 914 | 3,108 | +240% | 0 | 0 | — |
case-25 | fail→pass | 17,002 | 3,358 | -80% | 1 | 1 | 0% | 1,728 | 3,043 | +76% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +40 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.