Agent skill
openapi-gen
Generate and validate Python clients from OpenAPI specs. Use for generation, validation, or troubleshooting.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/openapi-gen
SKILL.md
OpenAPI Client Generation
Workflow
- Activate:
source .venv/bin/activate - Generate:
pyopenapi-gen <spec> --project-root <path> --output-package <pkg> --force --verbose - Validate:
- Check warnings in output
- Test:
python -c "from <pkg> import *" - Type check:
mypy <path>/<pkg> --ignore-missing-imports
Options
| Option | Purpose |
|---|---|
--force |
Overwrite existing files |
--no-postprocess |
Skip Black/mypy (faster iteration) |
--core-package |
Shared core for multi-client setups |
--verbose |
Show detailed progress |
Common Issues
| Symptom | Fix |
|---|---|
| Import error | Check --project-root and --output-package alignment |
| Missing module | Check --verbose for cycle warnings |
| Type error | Review OpenAPI spec |
| Empty dataclass | Ensure schema has type field |
Multi-Client Setup
For shared core module:
# First client with core
pyopenapi-gen api1.yaml --project-root . --output-package clients.api1 --core-package clients.core
# Additional clients sharing core
pyopenapi-gen api2.yaml --project-root . --output-package clients.api2 --core-package clients.core
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?