Claude
Skills
Sign in
Back

setup-plugin-env

Included with Lifetime
$97 forever

Bootstrap jira plugin environment - sets up venv, installs dependencies, validates setup

General

What this skill does


# Plugin Environment Setup Skill

This skill handles the bootstrap process for jira plugin commands.

## Purpose

Ensures the Python virtual environment is created and dependencies are installed.
The plugin root directory is resolved by the UserPromptSubmit hook (context-hook.py),
which injects `<jira-context>` into the session. This skill only needs to handle
venv setup.

## Task

**ALWAYS run this bootstrap FIRST before doing anything else in jira commands.**

### Step 1: Extract Plugin Root

Extract `PLUGIN_ROOT` from the `<jira-context>` system reminder injected by the
UserPromptSubmit hook. Use the value from `<plugin-root>`.

If `<jira-context>` is not present, the hook may not have fired. Instruct the user
to verify the plugin is installed correctly.

---

### Step 2: Run setup_env.sh

**Execute the plugin's environment setup script:**

```bash
if [ ! -f "$PLUGIN_ROOT/scripts/setup_env.sh" ]; then
    echo "✗ setup_env.sh not found in plugin directory" >&2
    exit 1
fi

# Run setup script
bash "$PLUGIN_ROOT/scripts/setup_env.sh"
```

---

### Step 3: Verify environment

**Check that the environment is ready:**

```bash
VENV_PATH=".claude/jira/venv"

if [ ! -d "$VENV_PATH" ]; then
    echo "✗ Virtual environment not created" >&2
    exit 1
fi

# Check if Python dependencies are installed
if ! "$VENV_PATH/bin/python" -c "import atlassian" 2>/dev/null; then
    echo "⚠ Dependencies may not be fully installed"
    echo "Try running: source $VENV_PATH/bin/activate && pip install -r $PLUGIN_ROOT/requirements.txt"
else
    echo "✓ jira plugin environment is ready!"
fi
```

---

## Success Indicators

After running this skill, you should see:
- ✓ Virtual environment created at `.claude/jira/venv`
- ✓ Python dependencies installed
- ✓ Plugin environment ready for commands

## Troubleshooting

**If bootstrap fails:**
1. Ensure Python 3.8+ is installed
2. Check that the plugin is properly installed in Claude Code
3. Verify write permissions in `.claude/` directory
4. Check internet connectivity for pip install

**If dependencies fail to install:**
```bash
source ".claude/jira/venv/bin/activate"
pip install -r "$PLUGIN_ROOT/requirements.txt" --verbose
```
Files: 1
Size: 2.3 KB
Complexity: 5/100
Category: General

Related in General