# Checkout Jira

> Checkout JIRA Skill

- Skill: `valasubramanian-kr/checkout-jira` (Agent Skill)
- Install (CLI): `npx skillmds@latest add valasubramanian-kr/checkout-jira`
- Raw SKILL.md: https://api.skillmd.com/api/skills/valasubramanian-kr/checkout-jira/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: valasubramanian-kr (https://skillmd.com/u/valasubramanian-kr)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/valasubramanian-kr/checkout-jira

---


# Checkout JIRA Skill

## Purpose

Switch between JIRA issues by checking out workflow artifacts from Claude home directory to the project directory.

## Usage

```bash
/checkout-jira DRT-17270
/checkout-jira 17270
```

## What This Skill Does

1. **Extract JIRA Number**: Accepts full JIRA key (DRT-17270) or just the number (17270)
2. **Check Destination**: Verifies if workflow artifacts already exist in project directory
3. **Check Source**: Verifies artifacts exist in Claude home directory
4. **Copy Artifacts**: Copies all workflow files from `~/.claude/artifacts/jira-to-github/<JIRA-NUMBER>/` to project's `workflow/jira-to-github/<JIRA-NUMBER>/`
5. **Confirmation**: Reports successful checkout

## Prerequisites

- JIRA artifacts must exist in `~/.claude/artifacts/jira-to-github/<JIRA-NUMBER>/` (created by previous workflow runs)
- If current workflow exists in project directory, run `/stash-jira` first to preserve it

## Instructions

You are coordinating the checkout of JIRA workflow artifacts.

### Step 1: Extract JIRA Number

Extract the numeric part from the skill argument:

```bash
JIRA_ARG="<skill-argument>"

# Extract numeric part - handles both "DRT-17270" and "17270"
if [[ "$JIRA_ARG" =~ -([0-9]+)$ ]]; then
  JIRA_NUMBER="${BASH_REMATCH[1]}"
elif [[ "$JIRA_ARG" =~ ^[0-9]+$ ]]; then
  JIRA_NUMBER="$JIRA_ARG"
else
  echo "❌ Invalid JIRA format. Use 'DRT-17270' or '17270'"
  exit 1
fi
```

### Step 2: Check for Existing Workflows in Project

Check if any workflow artifacts exist in the project directory:

```bash
if [ -d "workflow/jira-to-github" ] && [ "$(ls -A workflow/jira-to-github 2>/dev/null)" ]; then
  # Workflow directory exists and is not empty
  exit 2  # Signal to ask user confirmation
fi
```

**If exit code 2 (workflows exist):**
- Use AskUserQuestion to ask: "Existing workflow artifacts found in project directory. Run /stash-jira to preserve them before checking out JIRA-${JIRA_NUMBER}?"
  - Options:
    1. "Yes, run /stash-jira first (Recommended)" - Invoke `/stash-jira` skill, then continue with checkout
    2. "Skip and overwrite" - Continue with checkout (will overwrite existing workflows)
    3. "Cancel checkout" - Exit without making changes

### Step 3: Check Source Artifacts

Verify that artifacts exist in Claude home directory:

```bash
CLAUDE_HOME="${HOME}/.claude/artifacts/jira-to-github"
SOURCE_DIR="${CLAUDE_HOME}/${JIRA_NUMBER}"

if [ ! -d "$SOURCE_DIR" ]; then
  # List available JIRA numbers
  echo "❌ No artifacts found for JIRA ${JIRA_NUMBER}"
  echo ""
  echo "Available JIRA numbers in Claude home:"
  ls -1 "${CLAUDE_HOME}" 2>/dev/null | sort -n
  exit 1
fi
```

### Step 4: Copy Artifacts

Copy all artifacts from Claude home to project directory:

```bash
DEST_DIR="workflow/jira-to-github/${JIRA_NUMBER}"

# Create destination directory
mkdir -p "$DEST_DIR"

# Copy all files and subdirectories
cp -R "${SOURCE_DIR}/"* "$DEST_DIR/"

# Verify copy succeeded
if [ $? -eq 0 ]; then
  echo "✅ Checked out JIRA-${JIRA_NUMBER}"
  echo ""
  echo "Artifacts copied to: workflow/jira-to-github/${JIRA_NUMBER}"
else
  echo "❌ Failed to copy artifacts"
  exit 1
fi
```

### Step 5: Report Success

Display confirmation message:

```
✅ Checked out JIRA-${JIRA_NUMBER}

Artifacts location: workflow/jira-to-github/${JIRA_NUMBER}
```

## Error Handling

- **Invalid JIRA format**: Show usage example
- **Source not found**: List available JIRA numbers from Claude home
- **Destination exists**: Ask user to run `/stash-jira` first or confirm overwrite
- **Copy failure**: Report error with details

## Examples

Checkout with full JIRA key:
```bash
/checkout-jira DRT-17270
```

Checkout with just the number:
```bash
/checkout-jira 17270
```

## Integration with /stash-jira

This skill works in tandem with `/stash-jira`:
1. `/stash-jira` - Moves current project workflows to Claude home (preserves work)
2. `/checkout-jira` - Copies different JIRA artifacts from Claude home to project (switches context)

This enables working on multiple JIRA issues without losing progress on any of them.

