Agent skill

curl-api

Make HTTP API requests with curl. Use when calling REST APIs, making HTTP requests, testing endpoints, or working with web services via curl.

Stars 2
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/jclfocused/claude-agents/tree/main/skills/curl-api

SKILL.md

curl API Requests

Overview

Guidelines for making curl requests that work reliably in Claude Code's shell environment.

Critical Rules

NEVER use backslash line continuations (\) - They don't work reliably in this environment.

ALWAYS write single-line commands or use shell variables for complex requests.

Patterns

Simple GET

bash
curl -s https://api.example.com/endpoint | jq

GET with Auth Header

bash
curl -s -H "Authorization: Bearer $TOKEN" https://api.example.com/endpoint | jq

POST with Form Data

Use multiple -d flags on a single line:

bash
curl -s -X POST https://api.example.com/endpoint -H "Authorization: Bearer $TOKEN" -d "name=value" -d "other=data" | jq

POST with JSON Body

bash
curl -s -X POST https://api.example.com/endpoint -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{"key":"value"}' | jq

Using Variables for Readability

When commands get long, use variables:

bash
TOKEN="your_api_key_here"
BASE="https://api.example.com"

# Then use them
curl -s -X POST "$BASE/products" -H "Authorization: Bearer $TOKEN" -d "name=Test" | jq

Chaining Requests

Store IDs from responses:

bash
TOKEN="your_key"

# Create and capture ID
PRODUCT_ID=$(curl -s -X POST https://api.stripe.com/v1/products -H "Authorization: Bearer $TOKEN" -d "name=My Product" | jq -r '.id')
echo "Created: $PRODUCT_ID"

# Use ID in next request
curl -s -X POST https://api.stripe.com/v1/prices -H "Authorization: Bearer $TOKEN" -d "product=$PRODUCT_ID" -d "unit_amount=999" -d "currency=usd" | jq

Common Headers

Purpose Flag
Bearer Auth -H "Authorization: Bearer $TOKEN"
Basic Auth -u "user:pass" or -u "$KEY:" (colon for password-less)
JSON Content -H "Content-Type: application/json"
Accept JSON -H "Accept: application/json"

Useful Flags

Flag Purpose
-s Silent mode (no progress)
-X POST HTTP method
-d "k=v" Form data (multiple allowed)
-H "..." Header (multiple allowed)
-o file Output to file
-w '%{http_code}' Print status code

Anti-Patterns (Don't Do This)

bash
# BAD - Line continuations break
curl -s \
  -X POST \
  -H "Auth: Bearer $TOKEN" \
  https://api.example.com

# GOOD - Single line
curl -s -X POST -H "Auth: Bearer $TOKEN" https://api.example.com

Stripe API Example

bash
SK="sk_test_your_key"

# Create product
PROD=$(curl -s -X POST https://api.stripe.com/v1/products -H "Authorization: Bearer $SK" -d "name=My Product" -d "description=A great product" | jq -r '.id')

# Create price for product
PRICE=$(curl -s -X POST https://api.stripe.com/v1/prices -H "Authorization: Bearer $SK" -d "product=$PROD" -d "unit_amount=999" -d "currency=eur" -d "recurring[interval]=month" | jq -r '.id')

echo "Product: $PROD, Price: $PRICE"

Expand your agent's capabilities with these related and highly-rated skills.

jclfocused/claude-agents

graphite-workflow

Use this skill when working with Graphite (gt) for stacked PRs, using execute-issue-graphite agent, or when the user mentions Graphite, stacking, or gt commands. Ensures proper use of gt commands instead of raw git for stack-aware operations.

2 0
Explore
jclfocused/claude-agents

vertical-slice-planning

Use this skill when discussing feature breakdown, PR structure, implementation ordering, or how to decompose work. Guides thinking about vertical slices (end-to-end functionality) rather than horizontal layers (all of one layer first). Triggers on "how should we break this down?", "what order should we implement?", "how many PRs?", or decomposition discussions.

2 0
Explore
jclfocused/claude-agents

issue-writing

Use this skill when writing, reviewing, or discussing issue descriptions, acceptance criteria, or task breakdowns. Ensures consistent, high-quality issue structure that any developer or AI can pick up and execute. Triggers when drafting issues, defining requirements, or when users ask "how should I write this issue?" or "what should the acceptance criteria be?"

2 0
Explore
jclfocused/claude-agents

mvp-scoping

Use this skill when discussing features, planning work, or when users describe what they want to build. Guides MVP thinking - focusing on "what's the minimum to make this work?" rather than comprehensive solutions. Triggers on phrases like "help me think through this feature", "what should we build first?", "how should we scope this?", or any feature planning discussion.

2 0
Explore
jclfocused/claude-agents

atomic-design-planning

Use this skill when discussing UI components, design systems, frontend implementation, or component architecture. Guides thinking about Atomic Design methodology - atoms, molecules, organisms - and promotes component reuse over creation. Triggers on UI/frontend discussions, "what components do we need?", "should I create a new component?", or design system questions.

2 0
Explore
jclfocused/claude-agents

linear-discipline

Use this skill when discussing code changes, implementation work, feature status, or when starting/completing development tasks. Reminds about Linear issue tracking discipline - always having an issue in progress before writing code, marking work as done, and creating issues for unexpected scope. Triggers when users mention implementing features, writing code, or checking on work status.

2 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results