[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78F5PFP98A6RCB6TBB9RYTV":3,"skill-same:01M78F5PFP98A6RCB6TBB9RYTV":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M78F5PFP98A6RCB6TBB9RYTV","api2skill-creator",null,"Interview the user about an OpenAPI\u002FSwagger API (including multi-spec, base URL, and authorization), assemble exact api2skill CLI commands, guide secrets.json setup, and migrate existing generated skills after api2skill upgrades (update \u002F regenerate \u002F merge). Prefer Plan mode for multi-spec interviews and migrations.","angpysha\u002Fapi2skill","angpysha","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F7025170?v=4","01M721R7EB17NTYWEFV7KW1B3Q","Andrii","01M78F2DTB4D5VB2WXKXBN0VFT",0,"MIT","https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill\u002Fblob\u002Fmain\u002Fsrc\u002FApi2Skill\u002Ftemplates\u002Fapi2skill-creator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: api2skill-creator\ndescription: >-\n  Interview the user about an OpenAPI\u002FSwagger API (including multi-spec, base URL, and\n  authorization), assemble exact api2skill CLI commands, guide secrets.json setup, and migrate\n  existing generated skills after api2skill upgrades (update \u002F regenerate \u002F merge). Prefer Plan\n  mode for multi-spec interviews and migrations.\n---\n\n# api2skill-creator\n\nHelp the user turn a REST API (OpenAPI\u002FSwagger) into an agent skill using the **api2skill**\nCLI. Ask clarifying questions, emit **exact** shell commands, then walk through **base URL**,\n**authorization**, and **secrets** file setup. Do not invent flags, URLs, or credential values.\n\nProject docs: `README.md`, `wiki\u002F` (`wiki\u002FAuthentication.md`, `wiki\u002FGenerate-Command.md`,\n`wiki\u002FUpdate-Command.md`, `wiki\u002FMulti-Spec-Skills.md`, `wiki\u002FInteractive-Guides.md`,\n`wiki\u002FInstall-Creator.md`). Interactive multi-spec walkthrough:\n`docs\u002Finteractive\u002Fmulti-spec-guide.html`.\n\n## Prefer Plan mode (multi-spec, first setup, and migrations)\n\nWhen the user has **multiple** OpenAPI\u002FSwagger docs, existing separate skills to merge, an\nunclear auth\u002Fbase-URL setup, or **existing skills to migrate** after an api2skill upgrade:\n\n1. Prefer **Cursor Plan mode** (or any plan-first agent workflow) **before** emitting\n   `generate` \u002F `merge` \u002F `add-spec` \u002F `update` commands.\n2. In the plan, list the interview topics below (auth, base URL, secrets placement, which\n   workflow — including migrate vs fresh generate) and get answers — then switch to executing\n   the agreed commands.\n3. Optionally open or present `docs\u002Finteractive\u002Fmulti-spec-guide.html` (browser, Canvas,\n   Artifact, or Codex site — see `wiki\u002FInteractive-Guides.md`) so the user can click a\n   scenario and copy the same commands you will emit.\n4. Do **not** invent credentials or run destructive `--force` \u002F overwrite merges without\n   explicit user approval.\n\nSingle-spec, already-answered setups can go straight to a concrete command.\n\n## Interview order\n\nWork through these topics (skip any the user already answered). Ask **one topic at a time**\nwhen the user has not provided a batch answer.\n\n### 1. OpenAPI \u002F Swagger source(s)\n\n- **Single doc**: local file, `https:\u002F\u002F…` URL, or stdin (`-`).\n- **Multiple docs, same API host**: list each path\u002FURL; optional `--spec-id` \u002F `--spec-label`\n  per part.\n- **Workflow**:\n  - New composite → `generate --spec … --spec …`\n  - Existing separate skills → `merge --into \u003Ctarget> \u003Cskill-dir> …`\n  - Add one doc to existing skill → `add-spec \u003Cskill-path> \u003Cspec> --spec-id …` (not `merge`)\n  - Refresh → `update \u003Cskill-path>` or `update \u003Cpath> \u003Cnew-spec> --spec-id …` when N>1 parts\n\n### 2. Base URL (required — always ask)\n\nAsk explicitly:\n\n1. What **base URL** should API calls use? (e.g. `https:\u002F\u002Fapi.example.com\u002Fv1`)\n2. Do the spec(s) define the same `servers` URL, or none?\n3. Dev\u002Fstaging with self-signed TLS? → may need `--insecure` (dev only).\n\n**Emit `--base-url \u003Curl>` when**:\n\n- Spec has no `servers` entry.\n- Multiple parts disagree on URL but user wants one skill.\n- User's canonical URL differs from the spec.\n\nThe value is recorded in `.api2skill.json` (safe to commit). If the spec had no servers, the\nuser may also set top-level `baseUrl` in `secrets.json` at call time.\n\n### 3. Authorization (required — always ask)\n\nFor **each spec part** in a composite, ask:\n\n1. Public or authenticated operations?\n2. Auth type: API key, Bearer, Basic, OAuth2, Entra, custom headers, script, or mixed?\n3. One credential set or several (e.g. public key + admin OAuth)?\n\n**Generate flags**:\n\n- Simple single global profile: `--auth bearer|basic|custom`\n- OAuth2 \u002F Entra \u002F multi-profile \u002F per-tag: `--auth-config \u003Cpath-to-auth.json>`\n- `--auth` and `--auth-config` are **mutually exclusive**.\n- Scaffold path: generate without auth flags → edit inactive `auth.json` →\n  `generate … --auth-config .\u002Fauth.json --force`\n- OAuth authorization-code: `--login` after generate (needs `callbackUrl` in `auth.json`)\n\nMulti-part skills: scheme IDs may be prefixed on collision (`{specId}_{schemeId}`). Prefer\n**naming each `auth.json` profile after its OpenAPI security scheme id** so unscoped Bearer \u002F\nOAuth \u002F script profiles do not collide on the `Authorization` header (api2skill ≥ 0.7.1).\nUse `attach.scope: tags` when one profile must apply only to some tags. After merge, check\n`auth.json` → `_guidance.schemes` for every **final** (possibly prefixed) scheme id.\nSee `wiki\u002FAuthentication.md`. **Never invent** client IDs, secrets, or tokens.\n\n### 4. Output and tooling\n\n- **`--out` \u002F `-o`** — skill directory (default: slug of `info.title`).\n- **`--name`** — skill name override (optional).\n- **`--script`** — `cs` (default), `fsx`, or `csx`.\n- **`--force` \u002F `-f`** — overwrite existing output.\n- Optional: `--include` \u002F `--exclude`, `--format json|yaml`, filters.\n\n### 5. Update vs generate vs migrate\n\nIf `.api2skill.json` exists, prefer `update` unless merging or adding specs.\n\nIf the user has **skills generated by an older api2skill** (especially pre-0.7.1) or reports\nany of: tag `\u002F` crashes, empty `AuthProfileNames`, `file:\u002F\u002F` baseUrl, useless `login`, or\nmerge re-fetching remotes — follow **[Migrate existing skills](#migrate-existing-skills-071)**\nbefore inventing new flags.\n\n## Commands to emit\n\nPrint complete commands first. Examples (adapt to answers):\n\n```bash\n# Single spec\napi2skill generate .\u002Fopenapi.json --out .\u002Fskills\u002Fmy-api --name my-api --script cs\n\n# Multi-spec + shared base URL\napi2skill generate \\\n  --spec .\u002Fpublic.json --spec-id public \\\n  --spec .\u002Fadmin.json --spec-id admin \\\n  --base-url https:\u002F\u002Fapi.example.com \\\n  --out .\u002Fskills\u002Facme-api\n\n# Remote spec (dev cert)\napi2skill generate https:\u002F\u002Fsvc.local\u002Fswagger.json --insecure --base-url https:\u002F\u002Fsvc.local --out .\u002Fskills\u002Fmy-api\n\n# Bearer shorthand\napi2skill generate .\u002Fopenapi.json --auth bearer --out .\u002Fskills\u002Fmy-api\n\n# Explicit auth + OAuth login\napi2skill generate .\u002Fopenapi.json --auth-config .\u002Fauth.json --login --out .\u002Fskills\u002Fmy-api --force\n\n# Merge existing skills\napi2skill merge --into .\u002Fskills\u002Facme .\u002Fskills\u002Facme-public .\u002Fskills\u002Facme-admin\n\n# Append to existing skill\napi2skill add-spec .\u002Fskills\u002Facme .\u002Fbilling.json --spec-id billing\n\n# Refresh (same tool version \u002F options already in .api2skill.json)\napi2skill update .\u002Fskills\u002Fmy-api\napi2skill update .\u002Fskills\u002Facme .\u002Fnew-admin.json --spec-id admin\n```\n\n## Migrate existing skills (0.7.1+)\n\nUse this when the user already has generated skill directories and needs them to pick up fixes\nfrom **api2skill ≥ 0.7.1** (tag path sanitization, spec cache for merge, HTTP(S) baseUrl,\n`AuthProfileNames` wiring, scheme-scoped auth profiles, composite `_guidance.schemes`).\n\n**Old skills do not auto-heal** — regenerate or update with the new CLI. `--force` \u002F `update`\npreserves `secrets.json`, `.auth-cache.json`, and (unless a new `--auth-config` is supplied)\nexisting `auth.json` contents, then refreshes `_guidance` for final scheme ids.\n\n### When to migrate (symptoms → action)\n\n| Symptom | Likely cause | Action |\n|---------|--------------|--------|\n| Crash writing `reference\u002F…` with `\u002F` in a tag | Unsanitized tag file path | Regenerate \u002F `update` on 0.7.1+ |\n| `merge` re-fetches live URLs \u002F fails offline | No `.api2skill\u002Fspecs\u002F` cache | `update` each part skill, then `merge` |\n| Composite `.api2skill.json` has `\"baseUrl\": \"file:\u002F\u002F\"` | Server-less \u002F file part poisoned base | Regenerate\u002Fmerge with `--base-url https:\u002F\u002F…` |\n| `login` works but calls still 401 \u002F empty `AuthProfileNames` | Profiles not baked into dispatcher | Regenerate with `--auth-config` (see below) |\n| `generate --auth-config` rejects two `Authorization` profiles | Unscoped globals colliding | Rename profiles to match scheme ids, regenerate |\n\n### Interview before migrating\n\nAsk (skip answered):\n\n1. Single skill or multi-part \u002F merged composite?\n2. Spec sources still reachable (URLs\u002Ffiles)?\n3. Path to their `auth.json` (if any) and whether profile **names** match OpenAPI scheme ids?\n4. Canonical `--base-url` (required if any part lacks HTTP(S) `servers`)?\n5. Confirm overwrite: `update` or `generate … --force` \u002F `merge … --force`?\n\n### Commands to emit (pick one workflow)\n\n**A — Single-spec skill (preferred: bake auth)**\n\n```bash\ndotnet tool update -g api2skill   # or install the 0.7.1+ package the user uses\napi2skill creator check-update    # then install-creator if they approve\n\ncd .\u002Fskills\u002Fmy-api\napi2skill generate \u003Cspec-url-or-file> \\\n  --auth-config .\u002Fauth.json \\\n  --base-url https:\u002F\u002Fsvc.example.com \\\n  --out . --name my-api --script cs --force\n# secrets.json and .auth-cache.json are preserved\n```\n\nIf they have no `auth.json` yet: `update` first (gets cache + sanitized references), then\nscaffold\u002Fedit `auth.json`, then the `generate … --auth-config … --force` pass above.\n\n```bash\napi2skill update .\u002Fskills\u002Fmy-api\n```\n\n**B — Multi-spec composite (one-shot regenerate)**\n\n```bash\napi2skill generate \\\n  --spec https:\u002F\u002Fsvc.local\u002Fswagger\u002FApi1\u002Fswagger.json --spec-id api1 \\\n  --spec https:\u002F\u002Fsvc.local\u002Fswagger\u002FApi2\u002Fswagger.json --spec-id api2 \\\n  --on-conflict prefix \\\n  --base-url https:\u002F\u002Fsvc.local \\\n  --auth-config .\u002Fauth.json \\\n  --out .\u002Fskills\u002Fcomposite-api --name composite-api --script cs --force\n```\n\n**C — Separate part skills → merge (offline-friendly after 0.7.1+ refresh)**\n\n```bash\napi2skill update .\u002Fskills\u002Fapi1\napi2skill update .\u002Fskills\u002Fapi2\n# … each part; confirms .api2skill\u002Fspecs\u002F\u003Cid>.json exists\napi2skill merge --into .\u002Fskills\u002Fcomposite-api --on-conflict prefix --force \\\n  .\u002Fskills\u002Fapi1 .\u002Fskills\u002Fapi2\n# merge prefers cached specs under each source skill; still pass --base-url via regenerating\n# with generate if the composite baseUrl was file:\u002F\u002F — or fix .api2skill.json after merge\n```\n\nIf the composite still shows `file:\u002F\u002F` after merge, re-run workflow **B** with `--base-url`, or\nedit `.api2skill.json` `baseUrl` to the HTTPS root and regenerate once so the dispatcher embeds\nit.\n\n### Auth.json migration tips (emit to the user)\n\n1. Name profiles after scheme ids (`oauth2`, `api_key`, or prefixed `api2_oauth2` from\n   `_guidance.schemes` after merge).\n2. Two Bearer\u002FOAuth\u002Fscript profiles that both set `Authorization` are OK when each name matches\n   a different scheme id — do **not** leave two true-global profiles with unrelated names.\n3. After migrate, open `scripts\u002Fcall.cs` (or `.csx`\u002F`.fsx`) and confirm target operations have\n   **non-empty** `AuthProfileNames` (not `[]`). Then:\n   ```bash\n   api2skill login --skill . --profile \u003Cname>\n   ```\n   `\u003Cname>` must appear in some operation’s `AuthProfileNames`.\n\n### Post-migrate checklist (always walk through)\n\n1. `reference\u002F` writes succeed; tags with `\u002F` become sanitized files (e.g. `Group-Item.md`).\n2. `.api2skill.json` → `baseUrl` is `https:\u002F\u002F…` (never `file:\u002F\u002F`).\n3. `.api2skill\u002Fspecs\u002F\u003Cspec-id>.json` (or `.yaml`) exists after generate\u002Fupdate.\n4. Dispatcher `AuthProfileNames` non-empty for authenticated ops when `--auth-config` was used\n   (or after scaffold bake on 0.7.1+).\n5. Composite `auth.json` → `_guidance.schemes` lists every final scheme id (including prefixes).\n6. `secrets.json` \u002F `.auth-cache.json` still present; re-login if tokens expired.\n7. Remind: never commit `secrets.json` or `.auth-cache.json`.\n\n## After generate — secrets placement (required)\n\n**Always** walk through this after the user runs generate\u002Fmerge\u002Fadd-spec:\n\n1. `cd \u003Cskill-dir>`\n2. The generator wrote **`secrets.example.json`** (committed template, placeholders only).\n3. Create the real file (gitignored), either:\n   - `cp secrets.example.json secrets.json` then fill real values, **or**\n   - Create `secrets.json` with the **same keys and structure** as `secrets.example.json`\n     (empty strings as placeholders) so the user only replaces values locally.\n4. Explain the shape:\n   - Nested objects keyed by **security scheme ID** (from OpenAPI), e.g. `api_key.apiKey`.\n   - Top-level keys may come from `auth.json` `{secret:NAME}` references.\n5. **OAuth**: put `clientId` \u002F `clientSecret` in `secrets.json`; run\n   `api2skill login --skill . --profile \u003Cname>` for access tokens (stored in\n   `.auth-cache.json`, not `secrets.json`).\n6. **Never commit** `secrets.json` or `.auth-cache.json`.\n\nExample placeholder `secrets.json` (agent may draft — user fills real values):\n\n```json\n{\n  \"$comment\": \"Replace empty strings with real credentials. Never commit this file.\",\n  \"api_key\": { \"apiKey\": \"\" },\n  \"admin_oauth\": {\n    \"clientId\": \"\",\n    \"clientSecret\": \"\",\n    \"tokenUrl\": \"https:\u002F\u002Fapi.example.com\u002Foauth\u002Ftoken\",\n    \"scopes\": [\"api.read\"]\n  }\n}\n```\n\nIf the user needs `auth.json`, point to `wiki\u002FAuthentication.md` and use `{secret:KEY}` placeholders\nthat match keys you help them add to `secrets.json`.\n\nAfter merge, warn that duplicate keys in source `secrets.json` files keep the **first source's**\nvalue; check warnings in CLI output.\n\n## Auth JSON hints (for agents drafting auth.json)\n\nProfiles need `type`, endpoints, scopes, `{secret:…}` placeholders, and `callbackUrl` for\nauthorization-code flows. Do not invent secret values.\n\n## Self-update (session start — always ask the user)\n\nBefore interviewing about the user's API:\n\n1. From the **repository root**, run:\n   ```bash\n   api2skill creator check-update\n   ```\n2. If any line shows **`update available`**, tell the user which skill roots are outdated\n   (bundled version vs installed). **Ask explicitly** whether to update — **never** run\n   `install-creator` without their approval.\n3. If they agree, run (adapt the skills root from the check output):\n   ```bash\n   api2skill install-creator --target .cursor\u002Fskills\n   ```\n   On a TTY, `install-creator` prompts again: *\"Update available … Install update? [y\u002FN]\"*\n   — wait for the user to confirm there too unless they passed `--force` themselves.\n4. If they decline, continue with the current installed skill.\n5. **Never auto-update silently** — not in chat, not via `--force` unless the user explicitly\n   requested that flag.\n6. After the creator skill itself is updated to **≥ 0.7.1**, ask whether they also want to\n   **migrate existing generated API skills** (see [Migrate existing skills](#migrate-existing-skills-071)).\n\nInstalled version is recorded in `\u003Cskills-root>\u002Fapi2skill-creator\u002F.creator-version.json`\n(written on install; value matches the api2skill package `\u003CVersion>`). Legacy installs without\nthat file are treated as oldest and offered an update.\n\n## After install \u002F manual refresh\n\n```bash\napi2skill install-creator --target \u003Cskills-root> [--force]\n```\n\nRoots: `.cursor\u002Fskills\u002F`, `.claude\u002Fskills\u002F`, `.github\u002Fskills\u002F`, `.agents\u002Fskills\u002F` —\nsee `wiki\u002FInstall-Creator.md`.\n","# api2skill-creator\n\nHelp the user turn a REST API (OpenAPI\u002FSwagger) into an agent skill using the **api2skill**\nCLI. Ask clarifying questions, emit **exact** shell commands, then walk through **base URL**,\n**authorization**, and **secrets** file setup. Do not invent flags, URLs, or credential values.\n\nProject docs: `README.md`, `wiki\u002F` (`wiki\u002FAuthentication.md`, `wiki\u002FGenerate-Command.md`,\n`wiki\u002FUpdate-Command.md`, `wiki\u002FMulti-Spec-Skills.md`, `wiki\u002FInteractive-Guides.md`,\n`wiki\u002FInstall-Creator.md`). Interactive multi-spec walkthrough:\n`docs\u002Finteractive\u002Fmulti-spec-guide.html`.\n\n## Prefer Plan mode (multi-spec, first setup, and migrations)\n\nWhen the user has **multiple** OpenAPI\u002FSwagger docs, existing separate skills to merge, an\nunclear auth\u002Fbase-URL setup, or **existing skills to migrate** after an api2skill upgrade:\n\n1. Prefer **Cursor Plan mode** (or any plan-first agent workflow) **before** emitting\n   `generate` \u002F `merge` \u002F `add-spec` \u002F `update` commands.\n2. In the plan, list the interview topics below (auth, base URL, secrets placement, which\n   workflow — including migrate vs fresh generate) and get answers — then switch to executing\n   the agreed commands.\n3. Optionally open or present `docs\u002Finteractive\u002Fmulti-spec-guide.html` (browser, Canvas,\n   Artifact, or Codex site — see `wiki\u002FInteractive-Guides.md`) so the user can click a\n   scenario and copy the same commands you will emit.\n4. Do **not** invent credentials or run destructive `--force` \u002F overwrite merges without\n   explicit user approval.\n\nSingle-spec, already-answered setups can go straight to a concrete command.\n\n## Interview order\n\nWork through these topics (skip any the user already answered). Ask **one topic at a time**\nwhen the user has not provided a batch answer.\n\n### 1. OpenAPI \u002F Swagger source(s)\n\n- **Single doc**: local file, `https:\u002F\u002F…` URL, or stdin (`-`).\n- **Multiple docs, same API host**: list each path\u002FURL; optional `--spec-id` \u002F `--spec-label`\n  per part.\n- **Workflow**:\n  - New composite → `generate --spec … --spec …`\n  - Existing separate skills → `merge --into \u003Ctarget> \u003Cskill-dir> …`\n  - Add one doc to existing skill → `add-spec \u003Cskill-path> \u003Cspec> --spec-id …` (not `merge`)\n  - Refresh → `update \u003Cskill-path>` or `update \u003Cpath> \u003Cnew-spec> --spec-id …` when N>1 parts\n\n### 2. Base URL (required — always ask)\n\nAsk explicitly:\n\n1. What **base URL** should API calls use? (e.g. `https:\u002F\u002Fapi.example.com\u002Fv1`)\n2. Do the spec(s) define the same `servers` URL, or none?\n3. Dev\u002Fstaging with self-signed TLS? → may need `--insecure` (dev only).\n\n**Emit `--base-url \u003Curl>` when**:\n\n- Spec has no `servers` entry.\n- Multiple parts disagree on URL but user wants one skill.\n- User's canonical URL differs from the spec.\n\nThe value is recorded in `.api2skill.json` (safe to commit). If the spec had no servers, the\nuser may also set top-level `baseUrl` in `secrets.json` at call time.\n\n### 3. Authorization (required — always ask)\n\nFor **each spec part** in a composite, ask:\n\n1. Public or authenticated operations?\n2. Auth type: API key, Bearer, Basic, OAuth2, Entra, custom headers, script, or mixed?\n3. One credential set or several (e.g. public key + admin OAuth)?\n\n**Generate flags**:\n\n- Simple single global profile: `--auth bearer|basic|custom`\n- OAuth2 \u002F Entra \u002F multi-profile \u002F per-tag: `--auth-config \u003Cpath-to-auth.json>`\n- `--auth` and `--auth-config` are **mutually exclusive**.\n- Scaffold path: generate without auth flags → edit inactive `auth.json` →\n  `generate … --auth-config .\u002Fauth.json --force`\n- OAuth authorization-code: `--login` after generate (needs `callbackUrl` in `auth.json`)\n\nMulti-part skills: scheme IDs may be prefixed on collision (`{specId}_{schemeId}`). Prefer\n**naming each `auth.json` profile after its OpenAPI security scheme id** so unscoped Bearer \u002F\nOAuth \u002F script profiles do not collide on the `Authorization` header (api2skill ≥ 0.7.1).\nUse `attach.scope: tags` when one profile must apply only to some tags. After merge, check\n`auth.json` → `_guidance.schemes` for every **final** (possibly prefixed) scheme id.\nSee `wiki\u002FAuthentication.md`. **Never invent** client IDs, secrets, or tokens.\n\n### 4. Output and tooling\n\n- **`--out` \u002F `-o`** — skill directory (default: slug of `info.title`).\n- **`--name`** — skill name override (optional).\n- **`--script`** — `cs` (default), `fsx`, or `csx`.\n- **`--force` \u002F `-f`** — overwrite existing output.\n- Optional: `--include` \u002F `--exclude`, `--format json|yaml`, filters.\n\n### 5. Update vs generate vs migrate\n\nIf `.api2skill.json` exists, prefer `update` unless merging or adding specs.\n\nIf the user has **skills generated by an older api2skill** (especially pre-0.7.1) or reports\nany of: tag `\u002F` crashes, empty `AuthProfileNames`, `file:\u002F\u002F` baseUrl, useless `login`, or\nmerge re-fetching remotes — follow **[Migrate existing skills](#migrate-existing-skills-071)**\nbefore inventing new flags.\n\n## Commands to emit\n\nPrint complete commands first. Examples (adapt to answers):\n\n```bash\n# Single spec\napi2skill generate .\u002Fopenapi.json --out .\u002Fskills\u002Fmy-api --name my-api --script cs\n\n# Multi-spec + shared base URL\napi2skill generate \\\n  --spec .\u002Fpublic.json --spec-id public \\\n  --spec .\u002Fadmin.json --spec-id admin \\\n  --base-url https:\u002F\u002Fapi.example.com \\\n  --out .\u002Fskills\u002Facme-api\n\n# Remote spec (dev cert)\napi2skill generate https:\u002F\u002Fsvc.local\u002Fswagger.json --insecure --base-url https:\u002F\u002Fsvc.local --out .\u002Fskills\u002Fmy-api\n\n# Bearer shorthand\napi2skill generate .\u002Fopenapi.json --auth bearer --out .\u002Fskills\u002Fmy-api\n\n# Explicit auth + OAuth login\napi2skill generate .\u002Fopenapi.json --auth-config .\u002Fauth.json --login --out .\u002Fskills\u002Fmy-api --force\n\n# Merge existing skills\napi2skill merge --into .\u002Fskills\u002Facme .\u002Fskills\u002Facme-public .\u002Fskills\u002Facme-admin\n\n# Append to existing skill\napi2skill add-spec .\u002Fskills\u002Facme .\u002Fbilling.json --spec-id billing\n\n# Refresh (same tool version \u002F options already in .api2skill.json)\napi2skill update .\u002Fskills\u002Fmy-api\napi2skill update .\u002Fskills\u002Facme .\u002Fnew-admin.json --spec-id admin\n```\n\n## Migrate existing skills (0.7.1+)\n\nUse this when the user already has generated skill directories and needs them to pick up fixes\nfrom **api2skill ≥ 0.7.1** (tag path sanitization, spec cache for merge, HTTP(S) baseUrl,\n`AuthProfileNames` wiring, scheme-scoped auth profiles, composite `_guidance.schemes`).\n\n**Old skills do not auto-heal** — regenerate or update with the new CLI. `--force` \u002F `update`\npreserves `secrets.json`, `.auth-cache.json`, and (unless a new `--auth-config` is supplied)\nexisting `auth.json` contents, then refreshes `_guidance` for final scheme ids.\n\n### When to migrate (symptoms → action)\n\n| Symptom | Likely cause | Action |\n|---------|--------------|--------|\n| Crash writing `reference\u002F…` with `\u002F` in a tag | Unsanitized tag file path | Regenerate \u002F `update` on 0.7.1+ |\n| `merge` re-fetches live URLs \u002F fails offline | No `.api2skill\u002Fspecs\u002F` cache | `update` each part skill, then `merge` |\n| Composite `.api2skill.json` has `\"baseUrl\": \"file:\u002F\u002F\"` | Server-less \u002F file part poisoned base | Regenerate\u002Fmerge with `--base-url https:\u002F\u002F…` |\n| `login` works but calls still 401 \u002F empty `AuthProfileNames` | Profiles not baked into dispatcher | Regenerate with `--auth-config` (see below) |\n| `generate --auth-config` rejects two `Authorization` profiles | Unscoped globals colliding | Rename profiles to match scheme ids, regenerate |\n\n### Interview before migrating\n\nAsk (skip answered):\n\n1. Single skill or multi-part \u002F merged composite?\n2. Spec sources still reachable (URLs\u002Ffiles)?\n3. Path to their `auth.json` (if any) and whether profile **names** match OpenAPI scheme ids?\n4. Canonical `--base-url` (required if any part lacks HTTP(S) `servers`)?\n5. Confirm overwrite: `update` or `generate … --force` \u002F `merge … --force`?\n\n### Commands to emit (pick one workflow)\n\n**A — Single-spec skill (preferred: bake auth)**\n\n```bash\ndotnet tool update -g api2skill   # or install the 0.7.1+ package the user uses\napi2skill creator check-update    # then install-creator if they approve\n\ncd .\u002Fskills\u002Fmy-api\napi2skill generate \u003Cspec-url-or-file> \\\n  --auth-config .\u002Fauth.json \\\n  --base-url https:\u002F\u002Fsvc.example.com \\\n  --out . --name my-api --script cs --force\n# secrets.json and .auth-cache.json are preserved\n```\n\nIf they have no `auth.json` yet: `update` first (gets cache + sanitized references), then\nscaffold\u002Fedit `auth.json`, then the `generate … --auth-config … --force` pass above.\n\n```bash\napi2skill update .\u002Fskills\u002Fmy-api\n```\n\n**B — Multi-spec composite (one-shot regenerate)**\n\n```bash\napi2skill generate \\\n  --spec https:\u002F\u002Fsvc.local\u002Fswagger\u002FApi1\u002Fswagger.json --spec-id api1 \\\n  --spec https:\u002F\u002Fsvc.local\u002Fswagger\u002FApi2\u002Fswagger.json --spec-id api2 \\\n  --on-conflict prefix \\\n  --base-url https:\u002F\u002Fsvc.local \\\n  --auth-config .\u002Fauth.json \\\n  --out .\u002Fskills\u002Fcomposite-api --name composite-api --script cs --force\n```\n\n**C — Separate part skills → merge (offline-friendly after 0.7.1+ refresh)**\n\n```bash\napi2skill update .\u002Fskills\u002Fapi1\napi2skill update .\u002Fskills\u002Fapi2\n# … each part; confirms .api2skill\u002Fspecs\u002F\u003Cid>.json exists\napi2skill merge --into .\u002Fskills\u002Fcomposite-api --on-conflict prefix --force \\\n  .\u002Fskills\u002Fapi1 .\u002Fskills\u002Fapi2\n# merge prefers cached specs under each source skill; still pass --base-url via regenerating\n# with generate if the composite baseUrl was file:\u002F\u002F — or fix .api2skill.json after merge\n```\n\nIf the composite still shows `file:\u002F\u002F` after merge, re-run workflow **B** with `--base-url`, or\nedit `.api2skill.json` `baseUrl` to the HTTPS root and regenerate once so the dispatcher embeds\nit.\n\n### Auth.json migration tips (emit to the user)\n\n1. Name profiles after scheme ids (`oauth2`, `api_key`, or prefixed `api2_oauth2` from\n   `_guidance.schemes` after merge).\n2. Two Bearer\u002FOAuth\u002Fscript profiles that both set `Authorization` are OK when each name matches\n   a different scheme id — do **not** leave two true-global profiles with unrelated names.\n3. After migrate, open `scripts\u002Fcall.cs` (or `.csx`\u002F`.fsx`) and confirm target operations have\n   **non-empty** `AuthProfileNames` (not `[]`). Then:\n   ```bash\n   api2skill login --skill . --profile \u003Cname>\n   ```\n   `\u003Cname>` must appear in some operation’s `AuthProfileNames`.\n\n### Post-migrate checklist (always walk through)\n\n1. `reference\u002F` writes succeed; tags with `\u002F` become sanitized files (e.g. `Group-Item.md`).\n2. `.api2skill.json` → `baseUrl` is `https:\u002F\u002F…` (never `file:\u002F\u002F`).\n3. `.api2skill\u002Fspecs\u002F\u003Cspec-id>.json` (or `.yaml`) exists after generate\u002Fupdate.\n4. Dispatcher `AuthProfileNames` non-empty for authenticated ops when `--auth-config` was used\n   (or after scaffold bake on 0.7.1+).\n5. Composite `auth.json` → `_guidance.schemes` lists every final scheme id (including prefixes).\n6. `secrets.json` \u002F `.auth-cache.json` still present; re-login if tokens expired.\n7. Remind: never commit `secrets.json` or `.auth-cache.json`.\n\n## After generate — secrets placement (required)\n\n**Always** walk through this after the user runs generate\u002Fmerge\u002Fadd-spec:\n\n1. `cd \u003Cskill-dir>`\n2. The generator wrote **`secrets.example.json`** (committed template, placeholders only).\n3. Create the real file (gitignored), either:\n   - `cp secrets.example.json secrets.json` then fill real values, **or**\n   - Create `secrets.json` with the **same keys and structure** as `secrets.example.json`\n     (empty strings as placeholders) so the user only replaces values locally.\n4. Explain the shape:\n   - Nested objects keyed by **security scheme ID** (from OpenAPI), e.g. `api_key.apiKey`.\n   - Top-level keys may come from `auth.json` `{secret:NAME}` references.\n5. **OAuth**: put `clientId` \u002F `clientSecret` in `secrets.json`; run\n   `api2skill login --skill . --profile \u003Cname>` for access tokens (stored in\n   `.auth-cache.json`, not `secrets.json`).\n6. **Never commit** `secrets.json` or `.auth-cache.json`.\n\nExample placeholder `secrets.json` (agent may draft — user fills real values):\n\n```json\n{\n  \"$comment\": \"Replace empty strings with real credentials. Never commit this file.\",\n  \"api_key\": { \"apiKey\": \"\" },\n  \"admin_oauth\": {\n    \"clientId\": \"\",\n    \"clientSecret\": \"\",\n    \"tokenUrl\": \"https:\u002F\u002Fapi.example.com\u002Foauth\u002Ftoken\",\n    \"scopes\": [\"api.read\"]\n  }\n}\n```\n\nIf the user needs `auth.json`, point to `wiki\u002FAuthentication.md` and use `{secret:KEY}` placeholders\nthat match keys you help them add to `secrets.json`.\n\nAfter merge, warn that duplicate keys in source `secrets.json` files keep the **first source's**\nvalue; check warnings in CLI output.\n\n## Auth JSON hints (for agents drafting auth.json)\n\nProfiles need `type`, endpoints, scopes, `{secret:…}` placeholders, and `callbackUrl` for\nauthorization-code flows. Do not invent secret values.\n\n## Self-update (session start — always ask the user)\n\nBefore interviewing about the user's API:\n\n1. From the **repository root**, run:\n   ```bash\n   api2skill creator check-update\n   ```\n2. If any line shows **`update available`**, tell the user which skill roots are outdated\n   (bundled version vs installed). **Ask explicitly** whether to update — **never** run\n   `install-creator` without their approval.\n3. If they agree, run (adapt the skills root from the check output):\n   ```bash\n   api2skill install-creator --target .cursor\u002Fskills\n   ```\n   On a TTY, `install-creator` prompts again: *\"Update available … Install update? [y\u002FN]\"*\n   — wait for the user to confirm there too unless they passed `--force` themselves.\n4. If they decline, continue with the current installed skill.\n5. **Never auto-update silently** — not in chat, not via `--force` unless the user explicitly\n   requested that flag.\n6. After the creator skill itself is updated to **≥ 0.7.1**, ask whether they also want to\n   **migrate existing generated API skills** (see [Migrate existing skills](#migrate-existing-skills-071)).\n\nInstalled version is recorded in `\u003Cskills-root>\u002Fapi2skill-creator\u002F.creator-version.json`\n(written on install; value matches the api2skill package `\u003CVersion>`). Legacy installs without\nthat file are treated as oldest and offered an update.\n\n## After install \u002F manual refresh\n\n```bash\napi2skill install-creator --target \u003Cskills-root> [--force]\n```\n\nRoots: `.cursor\u002Fskills\u002F`, `.claude\u002Fskills\u002F`, `.github\u002Fskills\u002F`, `.agents\u002Fskills\u002F` —\nsee `wiki\u002FInstall-Creator.md`.\n",{"name":5,"description":7},"main","e2524bdd7bab86898b0f1d624b8152b4590a129b","src\u002FApi2Skill\u002Ftemplates\u002Fapi2skill-creator","https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill","https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002Fapi2skill","https:\u002F\u002Fgithub.com\u002Fangpysha",".NET Senior Software Engineer","2026-10-31 03:45:31",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add angpysha\u002Fapi2skill --skill api2skill-creator",{"tool":38,"command":39},"bunx","bunx skills add angpysha\u002Fapi2skill --skill api2skill-creator",{"tool":41,"command":42},"pnpm","pnpm dlx skills add angpysha\u002Fapi2skill --skill api2skill-creator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill\u002Fblob\u002Fmain\u002Fsrc\u002FApi2Skill\u002Ftemplates\u002Fapi2skill-creator\u002FSKILL.md",true,[],[47,54,59,64,71,78],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M78F622M7F4WW0H07FTQBFM1","petstore","Call the Swagger Petstore API. A sample API that uses a petstore as an example to demonstrate api2skill.","https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill\u002Fblob\u002Fmain\u002Ftests\u002FApi2Skill.Tests\u002Ffixtures\u002F__approved__\u002Fpetstore-fsx\u002FSKILL.md",[],[],{"skillNo":55,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M78F5YMTHX818MXVCNZRSAGD","https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill\u002Fblob\u002Fmain\u002Ftests\u002FApi2Skill.Tests\u002Ffixtures\u002F__approved__\u002Fpetstore-csx\u002FSKILL.md",[],[],{"skillNo":60,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M78F5VTFF0CCN3VNVVWJ5N33","https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill\u002Fblob\u002Fmain\u002Ftests\u002FApi2Skill.Tests\u002Ffixtures\u002F__approved__\u002Fpetstore-cs\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M78F5J49PSFJFDC003BHGYQM","speckit-taskstoissues","Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.","https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fspeckit-taskstoissues\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M78F5EH1C32843TGS23BGCSB","speckit-tasks","Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.","https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fspeckit-tasks\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M78F5C28NTMBTHBDG6XP3XH2","speckit-specify","Create or update the feature specification from a natural language feature description.","https:\u002F\u002Fgithub.com\u002Fangpysha\u002Fapi2skill\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fspeckit-specify\u002FSKILL.md",[],[]]