api-to-example
Skill8 starsChanged 5 months agoMITView on GitHub
Turns REST API documentation into a runnable curl, fetch, or code example with required headers, request body, and placeholders for secrets. Use when the user wants to generate a request from API docs, an endpoint, or a Swagger/OpenAPI spec — "give me a curl for this", "show a fetch example", "how do I call this API".
- Reads credentials
In this repository46 other files it gives its agents.
- answerSkill
- bilingual-readerSkill
- calendar-prepSkill
- caption-assistantSkill
- chart-explainerSkill
- code-translatorSkill
- competitor-snapshotSkill
- coupon-hunterSkill
- course-fit-checkSkill
- cover-letter-builderSkill
- deal-checkerSkill
- draft-from-notesSkill
- explainSkill
- fact-checkSkill
- fix-grammarSkill
- hook-generatorSkill
- improve-writingSkill
- interview-prepSkill
- job-application-assistantSkill
- job-fit-reviewSkill
- job-offer-compareSkill
- landing-page-critiqueSkill
- linkedin-outreachSkill
- localize-textSkill
- meeting-follow-upSkill
- outline-builderSkill
- paper-readerSkill
- portfolio-project-reviewSkill
- product-review-summarizerSkill
- pronunciation-and-usageSkill
- regex-decoderSkill
- reply-assistantSkill
- repo-onboarderSkill
- rewrite-longerSkill
- rewrite-shorterSkill
- social-post-generatorSkill
- source-finderSkill
- source-listSkill
- study-planSkill
- style-matchSkill
- summarizeSkill
- table-to-csvSkill
- term-explainerSkill
- terminology-keeperSkill
- tone-rewriterSkill
- translateSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Verify the example carries every required header and parameter the docs list before presenting it.
- Distinctive: line 19
Add the expected response and the one or two errors a caller is most likely to hit (bad auth, missing field).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
API to Example
Turn the documented API endpoint into the smallest runnable example the user can paste and run — curl, fetch, or a language-specific snippet — complete with the required headers, request body shape, and placeholders for every secret. Work only from what the docs show; don't invent undocumented fields or claim a parameter is required when the docs don't say so.
- Extract the endpoint, method, auth scheme, required headers, parameters, request body schema, and the success response shape from the visible docs or OpenAPI/Swagger spec.
- Build the minimal example that would actually succeed, using placeholders like
$API_KEYor<account-id>for secrets and private values. - Verify the example carries every required header and parameter the docs list before presenting it; note any required field the docs leave unspecified.
- Add the expected response and the one or two errors a caller is most likely to hit (bad auth, missing field).
Return concise headings and include these sections when they fit: Runnable example, Required inputs, Expected response, Common mistakes. Preserve exact endpoint paths, header names, and field names. Be specific but don't overclaim; never include real secrets, and if the docs are incomplete, say what's missing and give the best supported example. Respond in the same language as the user's request.
Example
Docs (an endpoint that creates a charge):
POST /v1/charges— requiresAuthorization: Bearer <key>. Body:amount(integer, required),currency(string, required),description(string, optional).
Example:
Runnable example (curl):
curl https://api.example.com/v1/charges \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"amount": 2000, "currency": "usd", "description": "Test charge"}'Required inputs:
$API_KEY(secret bearer token);amountin the smallest currency unit; a supportedcurrencycode.Expected response:
200with the created charge object, including itsidandstatus.Common mistakes: Omitting
Content-Type: application/json(the body is ignored); sendingamountas a decimal instead of an integer; a stale key returns401.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

