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/__tests__/validate-description.test.ts

View on GitHub
/**
 * End-to-end tests for `validate-description` subcommand.
 *
 * Spawns the compiled dist/linear-ops.js bundle and asserts exit codes
 * and stderr fragments for each code path.
 *
 * Run: npm test (requires: npm run build)
 */

import { describe, it, before } from 'node:test';
import assert from 'node:assert';
import { spawnSync, type SpawnSyncReturns } from 'node:child_process';
import { existsSync, writeFileSync, mkdtempSync } from 'node:fs';
import { join } from 'node:path';
import { tmpdir } from 'node:os';

const ROOT = join(import.meta.dirname, '..', '..');
const CLI = join(ROOT, 'dist', 'linear-ops.js');

const VALID_BODY = [
  '## Context',
  'We need to enforce acceptance criteria on every new Linear issue because today the description field is optional and frequently empty.',
  '',
  '## Acceptance Criteria',
  '- [ ] Validator rejects descriptions shorter than the minimum body length',
  '- [ ] Validator accepts descriptions that include the full template',
].join('\n');

// Always scrub LINEAR_API_KEY: this command must not depend on it, and we
// don't want tests silently inheriting the developer's real key (see
// smoke.test.ts:58-60 for the same pattern).
const SCRUBBED_ENV = { ...process.env, LINEAR_API_KEY: '' };

function run(args: string[], opts: { input?: string } = {}): SpawnSyncReturns<string> {
  return spawnSync('node', [CLI, 'validate-description', ...args], {
    cwd: ROOT,
    env: SCRUBBED_ENV,
    input: opts.input,
    encoding: 'utf8',
  }) as SpawnSyncReturns<string>;
}

describe('validate-description CLI', () => {
  let tmpDir: string;
  let validFile: string;
  let invalidFile: string;

  before(() => {
    if (!existsSync(CLI)) {
      throw new Error('dist/linear-ops.js not built — run `npm run build` first');
    }
    tmpDir = mkdtempSync(join(tmpdir(), 'validate-description-'));
    validFile = join(tmpDir, 'valid.md');
    invalidFile = join(tmpDir, 'invalid.md');
    writeFileSync(validFile, VALID_BODY);
    writeFileSync(invalidFile, 'too short and no AC heading');
  });

  it('exits 0 on a valid positional body', () => {
    const r = run([VALID_BODY]);
    assert.strictEqual(r.status, 0, `stderr: ${r.stderr}\nstdout: ${r.stdout}`);
    assert.match(r.stdout, /valid/i);
  });

  it('exits 5 on an invalid positional body (default strict)', () => {
    const r = run(['too short']);
    assert.strictEqual(r.status, 5, `expected 5 got ${r.status}\nstderr: ${r.stderr}`);
    assert.match(r.stderr, /Acceptance Criteria/i);
  });

  it('exits 5 on an empty body', () => {
    const r = run(['']);
    assert.strictEqual(r.status, 5);
    assert.match(r.stderr, /empty/i);
  });

  it('exits 0 on a valid --file fixture', () => {
    const r = run(['--file', validFile]);
    assert.strictEqual(r.status, 0, `stderr: ${r.stderr}`);
  });

  it('exits 5 on an invalid --file fixture', () => {
    const r = run(['--file', invalidFile]);
    assert.strictEqual(r.status, 5);
    assert.match(r.stderr, /Acceptance Criteria/i);
  });

  it('exits 2 when --file points at a missing path', () => {
    const r = run(['--file', '/nonexistent/path/definitely-not-there.md']);
    assert.strictEqual(r.status, 2, `stderr: ${r.stderr}`);
    assert.match(r.stderr, /Cannot read file/i);
  });

  it('exits 2 when no body / flag supplied', () => {
    const r = run([]);
    assert.strictEqual(r.status, 2);
    assert.match(r.stderr, /Usage/i);
  });

  it('--strict=false downgrades invalid body to exit 0', () => {
    const r = run(['--strict=false', 'too short']);
    assert.strictEqual(r.status, 0, `stderr: ${r.stderr}`);
    assert.match(r.stderr, /downgraded/i);
  });

  it('accepts a valid body over stdin', () => {
    const r = run(['--stdin'], { input: VALID_BODY });
    assert.strictEqual(r.status, 0, `stderr: ${r.stderr}\nstdout: ${r.stdout}`);
  });

  it('rejects an invalid body over stdin', () => {
    const r = run(['--stdin'], { input: 'not enough' });
    assert.strictEqual(r.status, 5);
  });

  it('does not require LINEAR_API_KEY', () => {
    // Re-assert the core contract: the command ran above with LINEAR_API_KEY=''
    // and still produced exit 0/5, not 1 (MISSING_API_KEY). One belt-and-braces
    // check: valid body with scrubbed env must still exit 0.
    const r = run([VALID_BODY]);
    assert.notStrictEqual(r.status, 1, 'must not fail with MISSING_API_KEY');
    assert.strictEqual(r.status, 0);
  });
});
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