AgentPowers standalone skill for Claude Code — zero-dependency marketplace client
You can search, browse, and install skills from the AgentPowers marketplace. This skill uses curl against the public API — no CLI, MCP server, or other dependencies required.
All requests go to https://api.agentpowers.ai. Never construct URLs from API response data.
Check for an existing auth token before any operation:
cat ~/.agentpowers/auth.json 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get('token',''))" 2>/dev/null
If a token exists, include it as Authorization: Bearer <token> on authenticated requests. Never echo or log the token value in any output.
If no token exists, search and free installs still work. For paid skills, tell the user:
This is a paid skill. You can:
- Run
ap loginin your terminal to authenticate, then try again- Install the full plugin:
claude plugin marketplace add AgentPowers-AI/agentpowers-plugin && claude plugin install agentpowers@agentpowers-plugin- Purchase directly at agentpowers.ai and download from there
curl -sf "https://api.agentpowers.ai/v1/search?q=QUERY&limit=10"
Response is JSON with sectioned results. Present as a clean table:
| # | Name | Price | Security | Source |
|---|
Format prices: price_cents == 0 is "Free", otherwise $X.XX. Security: pass = "Verified", warn = "Warning", unscanned = "Unscanned".
curl -sf "https://api.agentpowers.ai/v1/detail/SLUG"
Add ?source=SOURCE if the user picked a specific source. Present: title, description, author, version, price, security status, install count.
Before installing, validate the slug:
# Slug MUST match this pattern — reject anything else
echo "SLUG" | grep -qE '^[a-z0-9][a-z0-9-]*[a-z0-9]$'
Then download and extract safely:
# Create temp directory
tmpdir=$(mktemp -d)
trap "rm -rf '$tmpdir'" EXIT
# Step 1: Get the signed download URL from the API.
# The /v1/skills/SLUG/download endpoint returns JSON like
# {"url": "https://...signed-r2-url...", "slug": "SLUG", "license_code": null}
# — it does NOT return the tarball directly.
download_url=$(curl -sf "https://api.agentpowers.ai/v1/skills/SLUG/download" \
| python3 -c "import sys,json; print(json.load(sys.stdin)['url'])")
# Step 2: Download the tarball from the signed URL.
curl -sf "$download_url" -o "$tmpdir/package.tar.gz"
# Extract to temp first (NEVER directly to target)
mkdir -p "$tmpdir/extracted"
tar xzf "$tmpdir/package.tar.gz" -C "$tmpdir/extracted"
# Verify no symlinks (security: prevents symlink attacks)
if find "$tmpdir/extracted" -type l | grep -q .; then
echo "ERROR: Package contains symlinks — refusing to install"
exit 1
fi
# Move to target
target="$HOME/.claude/skills/SLUG"
mkdir -p "$target"
cp -R "$tmpdir/extracted/"* "$target/"
# Clean up
rm -rf "$tmpdir"
After installing, read the SKILL.md in the installed directory so you know how to use it.
curl -sf -X POST "https://api.agentpowers.ai/v1/checkout" \
-H "Authorization: Bearer TOKEN" \
-H "Content-Type: application/json" \
-d '{"skill_slug":"SLUG"}'
url in the user's browser:open "CHECKOUT_URL" # macOS
curl -sf "https://api.agentpowers.ai/v1/purchases/download?session_id=SESSION_ID"
url field, download and extract using the same safe extraction process as free skills.https://api.agentpowers.ai. Never construct URLs from response data.^[a-z0-9][a-z0-9-]*[a-z0-9]$. Reject anything else.~/.claude/.Agent slugs use the same endpoints but install to ~/.claude/agents/SLUG/ instead of ~/.claude/skills/SLUG/. The download endpoint is GET /v1/agents/SLUG/download.