Api2skill creator
Skill angpysha/api2skill/src/Api2Skill/templates/api2skill-creator
Convert OpenAPI/Swagger into Agent Skills–compatible packages (SKILL.md + scripts + reference) for Claude, Cursor, and other skill hosts — .NET NuGet CLI with auth-aware dispatcher.
npx -y skills add angpysha/api2skill --skill api2skill-creatorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 25 days oldThe repository was created 25 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 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
Interview the user about an OpenAPI/Swagger API (including multi-spec, base URL, and authorization), assemble exact api2skill CLI commands, then guide secrets.json setup from secrets.example.json placeholders. Prefer Plan mode for multi-spec interviews.
SKILL.md
8.6 KB, as published. Nobody here has run it
api2skill-creator
Help the user turn a REST API (OpenAPI/Swagger) into an agent skill using the api2skill CLI. Ask clarifying questions, emit exact shell commands, then walk through base URL, authorization, and secrets file setup. Do not invent flags, URLs, or credential values.
Project docs: README.md, wiki/ (wiki/Authentication.md, wiki/Generate-Command.md,
wiki/Update-Command.md, wiki/Multi-Spec-Skills.md, wiki/Interactive-Guides.md,
wiki/Install-Creator.md). Interactive multi-spec walkthrough:
docs/interactive/multi-spec-guide.html.
Prefer Plan mode (multi-spec and first setup)
When the user has multiple OpenAPI/Swagger docs, existing separate skills to merge, or an unclear auth/base-URL setup:
- Prefer Cursor Plan mode (or any plan-first agent workflow) before emitting
generate/merge/add-spec/updatecommands. - In the plan, list the interview topics below (auth, base URL, secrets placement, which workflow) and get answers — then switch to executing the agreed commands.
- Optionally open or present
docs/interactive/multi-spec-guide.html(browser, Canvas, Artifact, or Codex site — seewiki/Interactive-Guides.md) so the user can click a scenario and copy the same commands you will emit. - Do not invent credentials or run destructive
--force/ overwrite merges without explicit user approval.
Single-spec, already-answered setups can go straight to a concrete command.
Interview order
Work through these topics (skip any the user already answered). Ask one topic at a time when the user has not provided a batch answer.
1. OpenAPI / Swagger source(s)
- Single doc: local file,
https://…URL, or stdin (-). - Multiple docs, same API host: list each path/URL; optional
--spec-id/--spec-labelper part. - Workflow:
- New composite →
generate --spec … --spec … - Existing separate skills →
merge --into <target> <skill-dir> … - Add one doc to existing skill →
add-spec <skill-path> <spec> --spec-id …(notmerge) - Refresh →
update <skill-path>orupdate <path> <new-spec> --spec-id …when N>1 parts
- New composite →
2. Base URL (required — always ask)
Ask explicitly:
- What base URL should API calls use? (e.g.
https://api.example.com/v1) - Do the spec(s) define the same
serversURL, or none? - Dev/staging with self-signed TLS? → may need
--insecure(dev only).
Emit --base-url <url> when:
- Spec has no
serversentry. - Multiple parts disagree on URL but user wants one skill.
- User's canonical URL differs from the spec.
The value is recorded in .api2skill.json (safe to commit). If the spec had no servers, the
user may also set top-level baseUrl in secrets.json at call time.
3. Authorization (required — always ask)
For each spec part in a composite, ask:
- Public or authenticated operations?
- Auth type: API key, Bearer, Basic, OAuth2, Entra, custom headers, script, or mixed?
- One credential set or several (e.g. public key + admin OAuth)?
Generate flags:
- Simple single global profile:
--auth bearer|basic|custom - OAuth2 / Entra / multi-profile / per-tag:
--auth-config <path-to-auth.json> --authand--auth-configare mutually exclusive.- Scaffold path: generate without auth flags → edit inactive
auth.json→generate … --auth-config ./auth.json --force - OAuth authorization-code:
--loginafter generate (needscallbackUrlinauth.json)
Multi-part skills: recommend tag-level or global profiles in auth.json; scheme IDs may
be prefixed on collision ({specId}_{schemeId}). See wiki/Authentication.md.
Never invent client IDs, secrets, or tokens.
4. Output and tooling
--out/-o— skill directory (default: slug ofinfo.title).--name— skill name override (optional).--script—cs(default),fsx, orcsx.--force/-f— overwrite existing output.- Optional:
--include/--exclude,--format json|yaml, filters.
5. Update vs generate
If .api2skill.json exists, prefer update unless merging or adding specs.
Commands to emit
Print complete commands first. Examples (adapt to answers):
# Single spec
api2skill generate ./openapi.json --out ./skills/my-api --name my-api --script cs
# Multi-spec + shared base URL
api2skill generate \
--spec ./public.json --spec-id public \
--spec ./admin.json --spec-id admin \
--base-url https://api.example.com \
--out ./skills/acme-api
# Remote spec (dev cert)
api2skill generate https://svc.local/swagger.json --insecure --base-url https://svc.local --out ./skills/my-api
# Bearer shorthand
api2skill generate ./openapi.json --auth bearer --out ./skills/my-api
# Explicit auth + OAuth login
api2skill generate ./openapi.json --auth-config ./auth.json --login --out ./skills/my-api --force
# Merge existing skills
api2skill merge --into ./skills/acme ./skills/acme-public ./skills/acme-admin
# Append to existing skill
api2skill add-spec ./skills/acme ./billing.json --spec-id billing
# Refresh
api2skill update ./skills/my-api
api2skill update ./skills/acme ./new-admin.json --spec-id admin
After generate — secrets placement (required)
Always walk through this after the user runs generate/merge/add-spec:
cd <skill-dir>- The generator wrote
secrets.example.json(committed template, placeholders only). - Create the real file (gitignored), either:
cp secrets.example.json secrets.jsonthen fill real values, or- Create
secrets.jsonwith the same keys and structure assecrets.example.json(empty strings as placeholders) so the user only replaces values locally.
- Explain the shape:
- Nested objects keyed by security scheme ID (from OpenAPI), e.g.
api_key.apiKey. - Top-level keys may come from
auth.json{secret:NAME}references.
- Nested objects keyed by security scheme ID (from OpenAPI), e.g.
- OAuth: put
clientId/clientSecretinsecrets.json; runapi2skill login --skill . --profile <name>for access tokens (stored in.auth-cache.json, notsecrets.json). - Never commit
secrets.jsonor.auth-cache.json.
Example placeholder secrets.json (agent may draft — user fills real values):
{
"$comment": "Replace empty strings with real credentials. Never commit this file.",
"api_key": { "apiKey": "" },
"admin_oauth": {
"clientId": "",
"clientSecret": "",
"tokenUrl": "https://api.example.com/oauth/token",
"scopes": ["api.read"]
}
}
If the user needs auth.json, point to wiki/Authentication.md and use {secret:KEY} placeholders
that match keys you help them add to secrets.json.
After merge, warn that duplicate keys in source secrets.json files keep the first source's
value; check warnings in CLI output.
Auth JSON hints (for agents drafting auth.json)
Profiles need type, endpoints, scopes, {secret:…} placeholders, and callbackUrl for
authorization-code flows. Do not invent secret values.
Self-update (session start — always ask the user)
Before interviewing about the user's API:
- From the repository root, run:
api2skill creator check-update - If any line shows
update available, tell the user which skill roots are outdated (bundled version vs installed). Ask explicitly whether to update — never runinstall-creatorwithout their approval. - If they agree, run (adapt the skills root from the check output):
On a TTY,api2skill install-creator --target .cursor/skillsinstall-creatorprompts again: "Update available … Install update? [y/N]" — wait for the user to confirm there too unless they passed--forcethemselves. - If they decline, continue with the current installed skill.
- Never auto-update silently — not in chat, not via
--forceunless the user explicitly requested that flag.
Installed version is recorded in <skills-root>/api2skill-creator/.creator-version.json
(written on install; value matches the api2skill package <Version>). Legacy installs without
that file are treated as oldest and offered an update.
After install / manual refresh
api2skill install-creator --target <skills-root> [--force]
Roots: .cursor/skills/, .claude/skills/, .github/skills/, .agents/skills/ —
see wiki/Install-Creator.md.