Http post json
Skill MauricioPerera/agent-skills-pack/skills/http-post-json
A curated pack of 7 practical agent-skills demonstrating real-world patterns: HTTP, GitHub CLI, ripgrep, file ops, JSON processing, encoding. Each SKILL.md validated against the v0.1 spec.
npx -y skills add MauricioPerera/agent-skills-pack --skill http-post-jsonAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Performs an HTTP POST request with a JSON body. Sets Content-Type and Accept headers. Body is composed via jq from a structured object passed as args.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
4.6 KB, as published. Nobody here has run it
HTTP POST with JSON body
Demonstrates the agent-skills composition pattern from SPEC §2.6: a JSON object arg becomes a properly-quoted shell argument that the bank inserts after curl's --data.
How the substitution works
The {body} arg is declared as type: object. At resolve time, the bank:
- Validates that
bodyis a JSON object. - Encodes it as a JSON string (using
JSON.stringify). - Single-quotes the result for shell-safe insertion.
For an arg like {"name":"Alice","age":30}, the resolved command is:
curl -fsSL ... --data '{"name":"Alice","age":30}' 'https://...'
The single quotes are at the SHELL level — once bash parses, curl receives the literal JSON string as one argument. No quoting trickery needed in the template.
Behavior
- Sets
Content-Type: application/jsonandAccept: application/jsonheaders (most JSON APIs require both). - Uses
-fso HTTP 4xx/5xx exit non-zero with the body suppressed. -Lfor redirect following;--max-timefor hard timeout.
Output
- stdout: the response body (typically JSON; agent should parse if needed).
- stderr: curl errors.
- exit code: 0 on 2xx; 22 on HTTP error; 28 on timeout.
Pairing with credential isolation
For authenticated APIs, do not put credentials in args. Either:
- Use a domain-specific skill that reads
$STRIPE_KEYetc. from env (seecharge-customerfor the pattern). - Wrap this skill in a derived skill that adds
--header 'Authorization: Bearer $TOKEN'to the template and declaresrequired_env: ["TOKEN"].
This generic skill leaves auth out of scope on purpose; mixing auth into a generic POST is a footgun.
Caveats
- The
bodyarg is JSON-encoded withJSON.stringify, which produces compact JSON (no indentation). If the API requires human-readable formatting, the agent must format upstream. - File uploads (
multipart/form-data) are NOT covered; usecurl -Fdirectly or a dedicated skill. - Streaming bodies (e.g., NDJSON over a long-lived connection) are NOT covered.