This skill automates Galaxy workflows using BioBlend and Planemo, enabling API-driven execution, batch processing, status checks, and robust error handling.
npx playbooks add skill delphine-l/claude_global --skill automation
This skill provides expert knowledge for automating Galaxy workflows using BioBlend (Python Galaxy API library) and Planemo (Galaxy workflow testing and execution tool).
Use this skill when:
This skill is NOT project-specific - it's useful for ANY Galaxy automation project.
Detailed reference material is split into separate files:
---
Store in environment variables:
import os
api_key = os.environ.get('GALAXY_API_KEY')
if not api_key:
raise ValueError("GALAXY_API_KEY environment variable not set")
gi = GalaxyInstance(url, api_key)
Mask in logs:
def mask_api_key(key):
"""Mask API key for display"""
if len(key) <= 8:
return '*' * len(key)
return f"{key[:4]}{'*' * (len(key) - 8)}{key[-4:]}"
masked_key = mask_api_key(api_key)
print(f"Using API key: {masked_key}")
---
Always quote paths in shell commands:
# Good - handles spaces
command = f'planemo run "{workflow_path}" "{job_yaml}"'
# Bad - breaks with spaces
command = f'planemo run {workflow_path} {job_yaml}'
---
--simultaneous_uploads vs sequentialos.system() shifts exit codes (exit 1 -> return 256)return_code >> 8 to get actual exit code--test_output_json with planemoget_invocations() without filters returns EVERY user's invocations, not just yoursInvocation <hex_id>)Invocation <52bc9f6134abd589>---
---
When using the Galaxy MCP tools (mcp__Galaxy__*), connect at the start of each session.
MCP tools cannot read shell environment variables directly. The URL is safe to resolve via Bash:
echo "$GXYVGP" # Galaxy instance URL -- safe to echo
Then pass the resolved values:
mcp__Galaxy__connect(url="<resolved_url>", api_key="<resolved_key>")
> echo "$TESTKEY" / echo "$MAINKEY" is blocked. The Claude Code permission classifier
> refuses to print secrets, so the resolve-then-pass pattern stalls on its first command. Do
> not work around it with printenv/cut/base64 tricks -- that defeats the protection the
> block exists for.
Two ways forward:
! echo $KEY themselves (the ! prefix puts theoutput into the conversation under their control). Required if you need mcp__Galaxy__connect.
curl with the variable inline -- the shell expands it, so the keynever enters the transcript. Fine for the whole read/debug loop:
curl -s -H "x-api-key: $MAINKEY" "$GXYVGP/api/invocations/$INV" | python3 -m json.tool
curl -s -H "x-api-key: $MAINKEY" "$GXYVGP/api/jobs/$JOB?full=true"
curl -s -H "x-api-key: $MAINKEY" -H "Content-Type: application/json" \
-X POST "$GXYVGP/api/workflows" -d @workflow-payload.json
IMPORTANT: Use $TESTKEY for all testing and workflow runs. $MAINKEY is an admin key — it can see and modify ALL users' data. Only use $MAINKEY when admin access is specifically needed.
Which key, by task:
| Task | Key | Why |
|------|-----|-----|
| Workflow development: planemo tests, lint, your own invocations | $TESTKEY | Default. No admin side effects. |
| Debugging a real user's failed invocation or job | $MAINKEY | Admin account -- required to read another user's invocations, jobs and datasets. |
| Cross-user queries (e.g. job-state counts per tool version) | $MAINKEY | Non-admin keys only see your own jobs. |
The split is workflow dev vs investigating someone else's run -- not "testing vs production".
When a user hands you an invocation ID to debug, that is a $MAINKEY task. When in doubt, ask.
| Env Var | Instance | Notes |
|---------|----------|-------|
| $GXYVGP | https://vgp.usegalaxy.org | VGP production, user: delphinel (admin) |
| $TESTKEY | Testing API key for VGP | Use this for all planemo tests and workflow runs |
| $MAINKEY | Admin API key for VGP | Admin tasks only — sees ALL users' data, NEVER use for testing |
---
When using [browser-use](https://github.com/browser-use/browser-use) to automate Galaxy UI interactions:
ChatAnthropic wrapper — use browser_use.llm.anthropic.chat.ChatAnthropic, NOT langchain_anthropic.ChatAnthropic. The langchain version lacks a provider property that browser-use requires.ChatAnthropic(model="claude-sonnet-4-20250514", api_key=os.environ["ANTHROPIC_API_KEY"])BrowserSession(cdp_url="http://localhost:9222")chrome --remote-debugging-port=9222record_video_dir is NOT available since browser-use uses CDP directly, not Playwright contexts. Use ffmpeg screen capture instead.upload_file() for Zenodo URLs---
---
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.