Files
Brandon Martin 35e7f7deae feat(linear): switch cce-linear to GraphQL-only workflows (#13)
## Summary
- replace the Linear skill wrappers with shared GraphQL-only scripts and
add GraphQL-native document list/read helpers
- rewrite the source Linear skill docs and references to remove the old
Linearis-specific guidance
- bump to , resync the packaged plugin, and update packaged command/docs
wording to match the GraphQL flow

## Test Plan
- python -m compileall .claude/skills/linear/scripts
plugins/cce-linear/skills/linear/scripts
- uv run .claude/skills/linear/scripts/create-ticket.py --help
- uv run .claude/skills/linear/scripts/search-issues.py --help
- uv run .claude/skills/linear/scripts/create-project.py --help
- uv run .claude/skills/linear/scripts/list-documents.py --help
2026-04-20 16:33:19 -05:00

4.0 KiB

description, argument-hint, allowed-tools
description argument-hint allowed-tools
Create a PR for an existing Linear ticket using the linear skill wrappers <ticket-id> [--skip-validation] AskUserQuestion, Skill, Bash(uv run:*), Bash(git checkout:*), Bash(git add:*), Bash(git commit:*), Bash(git push:*), Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git branch:*), Bash(gh pr create:*), Bash(rm:*)

Existing Linear PR Workflow

Create a new PR for an existing Linear ticket when additional related code changes are required.

Activate the linear skill first and use its wrapper scripts for all Linear operations. Do not call another Linear CLI directly from this workflow.

Context

  • Current git status: !git status --short
  • Current branch: !git branch --show-current
  • Staged changes: !git diff --cached --stat
  • Unstaged changes: !git diff --stat

Arguments

  • $1 - Linear ticket identifier (e.g., ICE-2004)
  • --skip-validation - Optional flag in $ARGUMENTS to skip success criteria validation

If ticket ID is missing, ask the user for it.

Prerequisites

  • Changes should already be made to files (staged or unstaged)
  • The linear skill must be available and its wrapper scripts must run successfully
  • gh CLI must be authenticated

Steps

Track these steps as TODOs and complete them one by one.

  1. Parse arguments - Extract ticket ID ($1) and check for --skip-validation in $ARGUMENTS.

  2. Read Linear ticket - Fetch ticket details with the linear skill wrapper:

    uv run ${CLAUDE_PLUGIN_ROOT}/skills/linear/scripts/read-ticket.py $1
    
    • Extract: identifier, title, description, branchName, state, url
    • If ticket not found, stop and inform the user.
  3. Validate success criteria (skip if --skip-validation is present)

    • Present the ticket details:
      ## Ticket: <identifier>
      **Title:** <title>
      **Status:** <state.name>
      
      **Description:**
      <description>
      
    • Ask: "Does this match the work you're committing? (yes/no)"
    • If no, ask for clarification and document for PR description.
  4. Review changes - Analyze the context above.

    • If no changes exist, stop and inform the user.
    • Summarize what will be committed.
  5. Create or checkout branch - Use the Linear branch name:

    git checkout -b <branchName>
    
    • If branch exists locally: git checkout <branchName>
    • If already on correct branch, continue.
  6. Stage and commit - Commit with ticket ID prefix:

    git add <relevant files>
    git commit -m "$(cat <<'EOF'
    <TICKET-ID>: <brief description derived from changes>
    
    <detailed description>
    
    Part of: <ticket title from Linear>
    EOF
    )"
    
    • Derive a concise commit title from the changes being committed.
    • Commit message describes THIS specific change, not the full ticket.
  7. Push branch - Push to origin:

    git push -u origin <branch-name>
    
    • If remote branch exists: git push
  8. Create PR - Open pull request:

    gh pr create --title "<TICKET-ID>: <brief description derived from changes>" --body "$(cat <<'EOF'
    ## Summary
    <what this specific PR adds/changes>
    
    ## Context
    Additional changes for <ticket URL from script output or plain <TICKET-ID>>: <ticket title from Linear>
    
    ## Test Plan
    - [ ] <verification steps>
    
    Linear: <TICKET-ID>
    EOF
    )"
    
  9. Output summary - Display results:

    | Item | Details |
    |------|---------|
    | **Linear Ticket** | <ticket URL from script output, or plain <TICKET-ID> if URL is empty> |
    | **Branch** | `<branch-name>` |
    | **PR** | <PR URL> |
    | **Note** | Additional PR for existing ticket |
    

Error Handling

  • If git add fails due to lock file, run rm -f .git/index.lock and retry.
  • If no changes to commit, stop and inform the user.
  • If ticket doesn't exist, stop and inform the user.

Examples

# With validation (default)
/existing-linear ICE-2004

# Skip validation
/existing-linear ICE-2004 --skip-validation