Skip to content

wrsmith108/linear-claude-skill

Managing Linear issues, projects, and teams. Use when working with Linear tasks, creating issues, updating status, querying projects, or managing team workflows.

FileKindSize
SKILL.mdskill md22.7 KB
scripts/__tests__/bulk-create.test.tsscript5.0 KB
scripts/__tests__/issue-description.test.tsscript6.8 KB
scripts/__tests__/lin-cli.test.tsscript3.8 KB
scripts/__tests__/lint-issues.test.tsscript2.3 KB
scripts/__tests__/retry.test.tsscript8.2 KB
scripts/__tests__/smoke.test.tsscript7.0 KB
scripts/__tests__/validate-description.test.tsscript4.3 KB
scripts/build.mjsscript1.4 KB
scripts/bulk-create.tsscript12.5 KB
scripts/create-initiative-update.tsscript5.8 KB
scripts/create-issue-with-project.tsscript8.0 KB
scripts/create-project-update.tsscript5.5 KB
scripts/extract-image.tsscript2.2 KB
scripts/lib/agent-selection.tsscript8.7 KB
scripts/lib/exit-codes.tsscript357 B
scripts/lib/index.tsscript3.1 KB
scripts/lib/initiative.tsscript5.0 KB
scripts/lib/issue-description.tsscript7.1 KB
scripts/lib/labels.tsscript7.6 KB
scripts/lib/lin-cli.tsscript7.3 KB
scripts/lib/linear-utils.tsscript9.3 KB
scripts/lib/project-template.tsscript8.8 KB
scripts/lib/retry.tsscript4.8 KB
scripts/lib/taxonomy-data.tsscript8.1 KB
scripts/lib/taxonomy-validation.tsscript10.0 KB
scripts/lib/taxonomy.tsscript3.6 KB
scripts/lib/verify.tsscript6.6 KB
scripts/linear-api.mjsexecutablescript12.1 KB
scripts/linear-ops.tsscript69.1 KB
scripts/lint-issues.tsscript6.9 KB
scripts/phase-complete.tsscript12.4 KB
scripts/query.shexecutablescript498 B
scripts/query.tsscript3.5 KB
scripts/run.shexecutablescript321 B
scripts/setup.tsscript8.6 KB
scripts/sync-skill-version.mjsscript2.0 KB
scripts/sync.tsscript5.7 KB
scripts/upload-image.tsscript4.4 KB

scripts/upload-image.ts

View on GitHub
#!/usr/bin/env npx tsx
/**
 * Upload image to Linear and optionally attach to an issue
 *
 * Usage:
 *   npx tsx scripts/upload-image.ts <image-path> [issue-id] [comment-text]
 *
 * Examples:
 *   npx tsx scripts/upload-image.ts ~/Desktop/screenshot.png
 *   npx tsx scripts/upload-image.ts /tmp/diagram.jpg TRE-123
 *   npx tsx scripts/upload-image.ts /tmp/mockup.png TRE-123 "Here's the mockup"
 *
 * Output:
 *   - Prints the asset URL (for embedding in descriptions/comments)
 *   - If issue-id provided, adds the image as a comment on that issue
 */

import { readFileSync, statSync } from 'fs';
import { basename, extname } from 'path';
import { EXIT_CODES } from './lib/exit-codes.js';
import { getLinearClient } from './lib/linear-utils.js';

// Detect content type
const contentTypeMap: Record<string, string> = {
  '.png': 'image/png',
  '.jpg': 'image/jpeg',
  '.jpeg': 'image/jpeg',
  '.gif': 'image/gif',
  '.webp': 'image/webp',
  '.svg': 'image/svg+xml',
  '.pdf': 'application/pdf',
};

async function main() {
  const args = process.argv.slice(2);
  if (args.length === 0) {
    console.error('Usage: npx tsx scripts/upload-image.ts <image-path> [issue-id] [comment-text]');
    console.error('Example: npx tsx scripts/upload-image.ts ~/Desktop/screenshot.png TRE-123');
    process.exit(EXIT_CODES.INVALID_ARGUMENTS);
  }

  const imagePath = args[0].replace(/^~/, process.env.HOME || '');
  const issueIdentifier = args[1];
  const commentText = args[2] || '';

  const ext = extname(imagePath).toLowerCase();
  const contentType = contentTypeMap[ext] || 'application/octet-stream';

  // Read file
  let fileData: Buffer;
  let fileSize: number;
  try {
    fileData = readFileSync(imagePath);
    fileSize = statSync(imagePath).size;
  } catch (err) {
    console.error(`[ERROR] Cannot read file: ${imagePath}`);
    console.error(err instanceof Error ? err.message : String(err));
    process.exit(EXIT_CODES.INVALID_ARGUMENTS);
  }

  const filename = basename(imagePath);
  console.log(`Uploading: ${filename} (${(fileSize / 1024).toFixed(1)} KB, ${contentType})`);

  let client;
  try {
    client = getLinearClient();
  } catch (err) {
    console.error(err instanceof Error ? err.message : String(err));
    process.exit(EXIT_CODES.MISSING_API_KEY);
  }

  // Step 1: Request upload URL from Linear
  const uploadResult = await client.fileUpload(contentType, filename, fileSize);
  const uploadFile = uploadResult.uploadFile;

  if (!uploadFile) {
    console.error('[ERROR] Failed to get upload URL from Linear');
    process.exit(EXIT_CODES.API_ERROR);
  }

  const { uploadUrl, assetUrl, headers } = uploadFile;

  // Step 2: Upload file to the signed URL
  const uploadHeaders: Record<string, string> = {
    'Content-Type': contentType,
    'Cache-Control': 'public, max-age=31536000',
  };
  for (const h of headers) {
    uploadHeaders[h.key] = h.value;
  }

  const uploadResponse = await fetch(uploadUrl, {
    method: 'PUT',
    headers: uploadHeaders,
    body: new Uint8Array(fileData),
  });

  if (!uploadResponse.ok) {
    console.error(`[ERROR] Upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`);
    process.exit(EXIT_CODES.API_ERROR);
  }

  console.log('\n[SUCCESS] Image uploaded!');
  console.log(`  Asset URL: ${assetUrl}`);
  console.log(`  Markdown:  ![${filename}](${assetUrl})`);

  // Step 3: Optionally attach to an issue as a comment
  if (issueIdentifier) {
    console.log(`\nAttaching to issue ${issueIdentifier}...`);

    // Find issue by identifier
    const issueNumber = parseInt(issueIdentifier.replace(/^[A-Z]+-/, ''), 10);
    const teamKey = issueIdentifier.replace(/-\d+$/, '');

    const issues = await client.issues({
      filter: {
        number: { eq: issueNumber },
        team: { key: { eq: teamKey } },
      },
    });

    if (issues.nodes.length === 0) {
      console.error(`[ERROR] Issue ${issueIdentifier} not found`);
      process.exit(EXIT_CODES.RESOURCE_NOT_FOUND);
    }

    const issue = issues.nodes[0];
    const body = commentText
      ? `${commentText}\n\n![${filename}](${assetUrl})`
      : `![${filename}](${assetUrl})`;

    await client.createComment({
      issueId: issue.id,
      body,
    });

    console.log(`[SUCCESS] Image attached to ${issueIdentifier} as a comment`);
    console.log(`  Issue URL: ${issue.url}`);
  }
}

main().catch(err => {
  console.error('[ERROR]', err instanceof Error ? err.message : String(err));
  process.exit(EXIT_CODES.API_ERROR);
});
planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.Stars: 108kUpdated Claude CodeCodexVerifiedInstall
meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要".Stars: 108kUpdated Claude CodeCodexVerifiedInstall