From jkit
Generates Dart code from OpenAPI 3.x specs. Use for requests like "Generate API client", "Create models from spec", "Set up API from swagger".
How this skill is triggered — by the user, by Claude, or both
Slash command
/jkit:flutter-openapi-gen <spec> <api_name> --output-dir <path> [--dry-run]<spec> <api_name> --output-dir <path> [--dry-run]The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<!--
Generates BuiltValue models, LeafDioService services, endpoints, and client initialization code from an OpenAPI 3.x specification.
spec (required): OpenAPI spec file path or URLapi_name (required): API name in snake_case (e.g., main, auth)--output-dir <path> (required): Code generation output path (e.g., packages/myapp_network/lib/)--dry-run (optional): Preview only, no files generated$ARGUMENTSyaml, nunjucks):
(cd ${CLAUDE_PLUGIN_ROOT} && { [ -d node_modules/yaml ] && [ -d node_modules/nunjucks ]; } || npm install)
${CLAUDE_PLUGIN_ROOT}가 ~/.pub-cache/git/...처럼 fresh checkout인 경우 node_modules가 없어 후속 node 스크립트가 실패한다. 누락 시 자동 설치한다.cd ${CLAUDE_PLUGIN_ROOT} && node scripts/flutter/openapi/update-pubspec.mjs {package_pubspec_path}
{package_pubspec_path}: output-dir 기준 ../pubspec.yaml (예: packages/myapp_network/pubspec.yaml)flutter pub get
cd ${CLAUDE_PLUGIN_ROOT} && node scripts/flutter/openapi/generate-api.mjs {spec} {api_name} --output-dir {output_dir} [--dry-run]
(cd {package_dir} && dart run build_runner clean && dart run build_runner build --delete-conflicting-outputs)
(...) 로 감싸서 cd가 이후 단계의 작업 디렉토리에 영향을 주지 않도록 할 것dart format {output_dir}/src/api/{api_name}/
{output-dir}/
├── src/
│ ├── api/
│ │ └── {api_name}/
│ │ ├── {api_name}_api.dart # ← LeafDioClient init wrapper
│ │ ├── endpoints.dart # ← baseUrl + paths constants
│ │ ├── models/
│ │ │ ├── index.dart # ← models barrel export
│ │ │ └── src/ # ← API별 BuiltValue DTOs
│ │ │ ├── user_model.dart # ← schemas.User
│ │ │ ├── error_body_model.dart # ← schemas.ErrorBody
│ │ │ ├── status_enum.dart # ← schemas.Status (enum)
│ │ │ └── serializers/
│ │ │ └── serializers.dart # ← @SerializersFor registry
│ │ └── services/
│ │ ├── index.dart # ← services barrel export
│ │ └── src/ # ← 태그별 서비스 파일
│ │ ├── user_management_service.dart # ← tags["User Management"]
│ │ └── post_service.dart # ← tags["Post"]
│ │
│ └── network.dart # All API clients entry point
│
└── {package_name}.dart # barrel exports
| Swagger | Dart |
|---|---|
servers[].url | endpoints.dart baseUrl |
tags[].name | Service class name ("User Management" → UserManagementService) |
components/schemas | BuiltValue model (User → UserModel) |
schemas (enum) | EnumClass with @BuiltValueEnumConst(wireName:) |
paths | Service methods + endpoint constants |
responses.2xx.schema | R type in get<R, E>() |
responses.4xx/5xx.schema | E type or errorParser |
requestBody.schema | BuiltValue request model with serializers.serializeWith() |
| Error Definition | Generated Code |
|---|---|
| No error schema | get<R, Null>(path) |
| All errors same schema | get<R, E>(path) |
| Different schemas per status | get<R, Null>(path, errorParser: ...) |
/flutter-openapi-gen specs/main.json main --output-dir packages/myapp_network/lib/
/flutter-openapi-gen https://api.example.com/v3/api-docs main --output-dir packages/myapp_network/lib/
/flutter-openapi-gen specs/auth.yaml auth --output-dir packages/myapp_network/lib/
/flutter-openapi-gen specs/main.json main --output-dir packages/myapp_network/lib/ --dry-run
// GENERATED CODE - DO NOT MODIFY BY HAND header--dry-run shows planned files without creating themspecs/ for version control (JSON→.json, YAML→.yaml)npx claudepluginhub josephnk/jkit-code-plugin --plugin jkitProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.