import-openapi-microservice
БесплатноБез исполняемых скриптовНе проверенTRIGGER when the user asks to delegate to or integrate an external/third-party REST API, import an OpenAPI/Swagger document, or generate a microservice from…
от microbus-io★ 173 звезды на GitHubОб этом скилле
CRITICAL: This skill does NOT define the shape of generated code. It delegates every feature to the
add-microservice, add-function, add-web, and add-config skills, the single source of truth for code
shape. This skill only scaffolds the microservice, produces the specs file, picks endpoints, and fills the
one-line delegation body.
CRITICAL: The microservice is a faithful one-for-one delegator. Do NOT reshape the remote API: never split a request body into separate arguments, rename routes, or collapse status codes. Body-bearing operations use the magic HTTP arguments so the microservice is byte-transparent to its callers.
CRITICAL: openapispecs.json lives in the microservice's directory and is tracked in source control
(never git-ignored). It is the durable record of the remote API. Re-running this skill imports more
endpoints from the present specs without re-fetching, and skips endpoints already scaffolded.
Workflow
Copy this checklist and track your progress:
- [ ] Step 1: Locate or scaffold the microservice
- [ ] Step 2: Acquire the OpenAPI document
- [ ] Step 3: Generate openapispecs.json
- [ ] Step 4: Add the base-URL and credential configs
- [ ] Step 5: Add the shared request helpers (once)
- [ ] Step 6: Select which endpoints to import
- [ ] Step 7: Generate the complex types
- [ ] Step 8: Declare the endpoints in definition.go
- [ ] Step 9: Generate the boilerplate
- [ ] Step 10: Implement the handler bodies
- [ ] Step 11: Wire the HTTP egress proxy into the app
- [ ] Step 12: Housekeeping
The placeholders myservice, MyService, myserviceapi stand for the microservice being generated.
Step 1: Locate or Scaffold the Microservice
If a delegator for this API already exists, its openapispecs.json and local CLAUDE.md record what is
already imported. If the user only wants more endpoints, skip to Step 6 (the specs are already present;
do not re-fetch unless the user wants a newer version of the document).
Otherwise follow the add-microservice skill. Name the microservice after the remote API itself
(petstore, not petstorewrap/petstoreproxy/petstoreclient): in the mesh this microservice is that
API's representation, and a suffix leaks an implementation detail into a hostname every caller sees.
"Delegator" describes what it does, never what it is named. Give it a one-line description
(MyService delegates to the Petstore API.); Step 3 appends the API's own overview.
Step 2: Acquire the OpenAPI Document
Place the document in the microservice directory as myservice/openapi.src:
- By URL:
curl -fsSL '<url>' -o myservice/openapi.src. Remember the URL for Step 3. - Pasted: write the pasted content verbatim to
myservice/openapi.src.
Do not hand-edit it. JSON and YAML are both accepted.
Step 3: Generate openapispecs.json
go run github.com/microbus-io/fabric/cmd/genopenapispecs -base-url 'ORIGIN' < myservice/openapi.src > myservice/openapispecs.json
rm myservice/openapi.src
The tool is a pure offline filter (stdin to stdout; never touches the network).
-base-url is optional and defaults to the document's first servers URL. Real documents often declare a
relative server (e.g. /api/v3); the tool then warns on stderr. Set -base-url to that URL's origin
(scheme://host) joined with the relative server path, e.g. https://petstore3.swagger.io/api/v3. If the
document was pasted with no absolute server and you have no URL, ask the user for the base URL.
The specs file has info, remote{baseURL,security}, types{} (raw JSON Schema keyed by name), and
endpoints[] (each with name, feature, method, route, summary, description, params, requestBody, response).
feature is function (JSON or empty body) or web (non-JSON body); trust it unless an endpoint is obviously misclassified.
If the specs info.description is non-empty, append it to the Service godoc and svc.SetDescription
after the one-line summary from Step 1, separated by a blank line so it renders as a second godoc
paragraph.
Step 4: Add the Base-URL and Credential Configs
Follow the add-config skill:
RemoteBaseURL: defaultremote.baseURLfrom the specs, validationurl.- Credential,
secret: true, no default. Only whenremote.securityis present. Name it for the scheme:APIKey(apiKey),BearerToken(http-bearer/oauth2), orBasicAuth(http-basic, value is theuser:passwordpair).
Step 5: Add the Shared Request Helpers (Once)
Add these helpers to service.go exactly once, not per endpoint. They are the only delegation logic;
every handler becomes a single call into them. Add imports bytes, context, encoding/json, io,
net/http, strings, errors, github.com/microbus-io/fabric/httpx, and the httpegressapi package.
// remoteURL joins the configured base with an operation path, tolerating a configured base that
// has (or lacks) a trailing slas
Установить import-openapi-microservice в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл import-openapi-microservice?
TRIGGER when the user asks to delegate to or integrate an external/third-party REST API, import an OpenAPI/Swagger document, or generate a microservice from an OpenAPI spec (by URL or pasted JSON/YAML). Produces a one-for-one delegating microservice and stores openapispecs.json in its directory so more endpoints can be imported later.
Как установить скилл import-openapi-microservice?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл import-openapi-microservice запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic