Files
nodnarbnitram__claude-code-…/plugins/cce-linear/commands/existing-linear.md
Brandon Martin 1ac816cc29 refactor(plugins): package self-contained plugin installs (#5)
## Summary
- convert the marketplace packages into self-contained plugin installs
with local `agents/`, `skills/`, `commands/`, and `hooks/` content
- replace the old `triage-workflow` path with the new `linear` skill and
ship a dedicated `cce-linear` plugin for Linear-backed ticket and PR
workflows
- remove the unfinished `cce-auto-blog` plugin so this PR stays focused
on the plugin infrastructure redo

## What Changed
- added `scripts/sync_plugin_packages.py` to generate package manifests
and sync plugin-local assets from the shared `.claude/` source tree
- updated `.claude-plugin/marketplace.json` and per-plugin manifests for
19 packages, including new `cce-linear` and `cce-tauri` entries
- materialized packaged plugin assets under `plugins/*` so marketplace
installs no longer depend on repo-root `.claude` paths
- rewired Linear commands to use the `linear` skill wrapper scripts and
removed hardcoded workspace-specific Linear URLs
- refreshed root and plugin README files to match the packaged layout
and current plugin inventory

## Verification
- `python3 -m py_compile scripts/sync_plugin_packages.py
install_extensions.py .claude/skills/linear/scripts/*.py`
- `python3 scripts/sync_plugin_packages.py`
- validated plugin JSON/manifests and `cce-linear` package wiring
- confirmed no `axios-hq` or `triage-workflow` references remain in the
`.claude` Linear sources

---------

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-01 21:51:29 -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 linearis 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