generate-sdk
Skill16 starsChanged 3 days agoApache-2.0View on GitHub
Regenerate the frontend TypeScript API client from the OpenAPI spec using openapi-ts. Verifies API server is running, runs the code generator against openapi-ts.config.ts, and lints the output into sdk/client/. Use when user says 'regenerate SDK', 'update API client', 'sync frontend types', 'generate TypeScript client', 'API changed, update frontend', or 'openapi-ts'. Do NOT use for scaffolding frontend pages or composables (use scaffold-frontend-page, scaffold-composable), backend API endpoint creation (use scaffold-api-endpoint), or manual SDK file edits (sdk/client/ is fully generated).
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Any other code or connection refused: Stop and display this message:
- Distinctive: line 65
Check for TypeScript compilation errors in the generated output:
- Very specific: line 85
API not running: Start it with make run-dev in packages/api/
- Very specific: line 86
pnpm not found: Run corepack enable or install pnpm globally
- Distinctive: line 92
Run this skill after any of these changes:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
Frontend API SDK Generation
Regenerate the TypeScript API client from the live OpenAPI specification.
Step 1: Verify API Server Is Running
curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/api/v1/openapi.json- 200: Proceed to Step 2
- Any other code or connection refused: Stop and display this message:
API server not running at http://localhost:8000. Start it with:
make run-devinpackages/api/(the API is not part ofinfra/docker-compose.dev.yml)
Stop every agent runner first
The API registers an endpoint pair per discovered agent class, so the spec depends on which runners happen to be
attached. Regenerating with a local agent running bakes that agent into the shared client — a RAG agent alone adds four
…ToRAGAgent… endpoints plus the ChatMessage_Input/Output and *Block_Input/Output schemas they pull in, roughly
2,900 lines of diff that belong to nobody's change. The committed SDK carries no agent-specific endpoints, which is
the baseline to reproduce.
pkill -f "app/.*_agent/main.py"
curl -s -H "Authorization: Bearer $SUPERUSER_TOKEN" http://localhost:8000/api/v1/openapi.json | grep -c "RagAgent"Expect 0 before generating. Restart the runners afterwards.
Step 2: Generate the SDK
Run from packages/web/:
cd packages/web && pnpm generate-sdkThis uses the config at packages/web/openapi-ts.config.ts to fetch the OpenAPI spec from
http://localhost:8000/api/v1/openapi.json and regenerate TypeScript files into packages/web/sdk/client/
(types.gen.ts, sdk.gen.ts, schemas.gen.ts, client.gen.ts, transformers.gen.ts). The admin plane
(packages/sysadmin-web, backend packages/sysadmin-api on :8001) has its own client; a packages/core change affects
both. To reproduce CI without a running stack use /verify-sdk-sync.
Step 3: Do Not Lint the Output
eslint.config.js globally ignores sdk/** and the generator already runs prettier (postProcess), so pnpm lint
over the output is a no-op. Commit the files exactly as generated.
Step 4: Verify and Report
- Confirm generated files exist and are non-empty:
ls -la packages/web/sdk/client/types.gen.ts packages/web/sdk/client/sdk.gen.ts- Check for TypeScript compilation errors in the generated output:
cd packages/web && pnpm nuxi typecheck 2>&1 | head -30- Report what changed:
git diff --stat -- packages/web/sdk/client/Summarize: new endpoints added, modified request/response types, removed endpoints, number of files changed.
Examples
/generate-sdk— Full regeneration workflow (verify, generate, lint, report)
Troubleshooting
- API not running: Start it with
make run-devinpackages/api/ - pnpm not found: Run
corepack enableor install pnpm globally - Generation produces no changes: The API spec may not have changed. Verify your API changes are deployed to the running server.
When to Run
Run this skill after any of these changes:
- Adding new API endpoints (new routes in FastAPI)
- Modifying DTOs or Pydantic response/request models
- Changing route paths or HTTP methods
- Updating query parameters or path parameters
In this repository50 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- .github/actions/CLAUDE.mdCLAUDE.md
- arc42Skill
- audit-frontendSkill
- bot-frameworkSkill
- create-or-audit-claude-mdSkill
- create-or-audit-skillSkill
- create-or-audit-subagentSkill
- create-prSkill
- dagster-pipelinesSkill
- debug-agentSkill
- debug-frontendSkill
- debug-pipelineSkill
- design-systemSkill
- docker-devSkill
- document-decisionSkill
- document-featureSkill
- explainSkill
- i18nSkill
- implement-feedback-from-prSkill
- likec4-dslSkill
- lintSkill
- merge-mainSkill
- nats-eventsSkill
- plan-issueSkill
- pr-demo-videoSkill
- primevue-lookupSkill
- rclone-guideSkill
- reflectSkill
- review-diffSkill
- scaffold-agentSkill
- scaffold-api-endpointSkill
- scaffold-api-repositorySkill
- scaffold-api-serviceSkill
- scaffold-bot-handlerSkill
- scaffold-composableSkill
- scaffold-event-displaySkill
- scaffold-frontend-componentSkill
- scaffold-frontend-pageSkill
- scaffold-frontend-subpageSkill
- scaffold-pipelineSkill
- setup-bot-connectionSkill
- splice-issueSkill
- sync-agent-docsSkill
- test-scopeSkill
- update-docSkill
- verify-sdk-syncSkill
- write-docSkill
- write-issueSkill
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.

