turbo-repo/skills/api-client-sync/SKILL.md
Propagate OpenAPI spec changes through all three layers: (1) the hand-authored TypeScript client package — types, resource methods, tests, version bump; (2) the CLI package — commands, flags, table columns, tests, version bump; (3) the agent skill — SKILL.md workflows, business rules, and reference.md sections. Use when the user says the openapi.json has changed and needs to be reflected end-to-end. Triggers on phrases like "update the client from the new openapi", "sync the client with the API spec", "implement the api changes in the client", "the openapi.json changed, update the client package", "propagate the API changes", or "update all layers from the spec".
npx skillsauth add microboxlabs/modulariot api-client-syncInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Propagate OpenAPI spec changes into a hand-authored TypeScript client package. The change flows bottom-up: spec → types → resource methods → tests → version bump → commit.
git diff <base-branch> -- <path/to>/openapi.json
Categorize every addition in the diff:
| Category | Example | Impact |
|---|---|---|
| New endpoint | DELETE /calendars/{id}/purge | New method in resource file |
| New request field | autoSlotManager on CalendarRequest | Add optional field to request interface |
| New response field | hasSlotManager on CalendarResponse | Add optional field to response interface |
| New schema | New FooRequest/FooResponse pair | New interfaces + export |
| Removed/changed | Removed field or status code | Breaking — confirm with user before proceeding |
Ignore documentation-only changes (description text, examples with no schema impact).
Before writing anything, read:
src/types.ts — all request/response interfacessrc/resources/<resource>.ts — the relevant resource file(s)src/__tests__/<resource>.test.ts — existing tests for the resourceRead references/client-conventions.md for this package's specific patterns (fetcher signature, test utilities, file layout).
State explicitly what will change before touching any file:
types.ts need new fieldsConfirm with the user before proceeding if any removals or breaking changes are involved.
Apply changes in this exact order.
src/types.tsAdd new fields as optional (?) on existing interfaces. New schemas become new exported interfaces placed in the appropriate section alongside related types.
src/resources/<resource>.tsAdd new methods. Each calls the shared fetcher with the correct HTTP verb and path. Return type must match the interface from types.ts. Mirror the style of existing methods in the file exactly — don't introduce new patterns.
src/__tests__/<resource>.test.tsFor each new method, add a describe block with tests covering:
void / undefined return for 204 responsessrc/index.tsExport any new types not already covered by a bulk export.
npm run test --workspace=packages/<package-name>
All tests must pass before proceeding. Do not bump the version or commit if tests fail.
Update version in package.json, then commit:
feat(<package-name>): <one-line summary of changes>
- <bullet per change: new method, new field, etc.>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
| Change | Bump | |---|---| | New method(s) added | minor | | Only new optional fields on existing interfaces | patch | | Removed or renamed anything | major — confirm with user first |
Check if a CLI package (e.g. miot-cli) consumes this client. Read references/cli-conventions.md for the exact file layout, handler pattern, and test structure, then:
commands/<resource>/ file and register it in index.ts.--flag (or --no-flag for booleans) to the relevant command.npm run test --workspace=packages/miot-cliRead references/skill-update.md for templates and commit conventions, then update the miot-calendar skill (or whichever skill wraps this API):
SKILL.md under ## Common Workflows.SKILL.md under ## Business Rules.references/reference.md: add the new command to the TOC, add its full section (flag table + JSON output example).Skills are committed directly to trunk — no npm version bump required.
?) for anything not in the OpenAPI schema's required array.void return type for 204 No Content responses.tools
Query and manage ModularIoT Calendar services via the miot CLI. List calendars, check slot availability, create bookings, manage time windows, and run slot managers. Use when the user asks about schedules, appointments, bookings, availability, calendar configuration, time slots, capacity, or calendar services in their ModularIoT organization.
tools
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
tools
Tag and release a monorepo package following the project's scoped-tag convention. Use when the user wants to publish a new version of a package, create a release tag, or bump a package version.
development
Reviews the current pull request against SonarCloud and fixes reported issues. Fetches PR issues with rule documentation, then applies code changes per rule guidance. Use when the user asks to review the PR, fix SonarCloud issues, or address SonarCloud findings.