@ruaruababa/vibe-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CATALOG.md +317 -0
- package/README.md +121 -0
- package/aliases.json +65 -0
- package/bin/vibe.js +2 -0
- package/bundles.json +265 -0
- package/catalog.json +1560 -0
- package/dist/antigravity-skills/bin/cli.js +438 -0
- package/dist/antigravity-skills/lib/skill-utils.js +158 -0
- package/dist/antigravity-skills/scripts/build-catalog.js +305 -0
- package/dist/antigravity-skills/scripts/normalize-frontmatter.js +144 -0
- package/dist/antigravity-skills/scripts/validate-skills.js +230 -0
- package/dist/bin/vibe.js +2 -0
- package/dist/dist/src/cli/index.js +26 -0
- package/dist/lib/skill-utils.js +158 -0
- package/dist/scripts/build-catalog.js +50 -0
- package/dist/scripts/normalize-frontmatter.js +144 -0
- package/dist/scripts/validate-skills.js +56 -0
- package/dist/src/cli/index.js +146 -0
- package/dist/src/types/index.js +13 -0
- package/dist/src/utils/fs.js +1 -0
- package/package.json +43 -0
- package/skills/accessibility-compliance-accessibility-audit/SKILL.md +42 -0
- package/skills/accessibility-compliance-accessibility-audit/resources/implementation-playbook.md +502 -0
- package/skills/agent-orchestration-improve-agent/SKILL.md +349 -0
- package/skills/agent-orchestration-multi-agent-optimize/SKILL.md +239 -0
- package/skills/agent-orchestrator/SKILL.md +24 -0
- package/skills/ai-engineer/SKILL.md +171 -0
- package/skills/airflow-dag-patterns/SKILL.md +41 -0
- package/skills/airflow-dag-patterns/resources/implementation-playbook.md +509 -0
- package/skills/angular-migration/SKILL.md +428 -0
- package/skills/anti-reversing-techniques/SKILL.md +42 -0
- package/skills/anti-reversing-techniques/resources/implementation-playbook.md +539 -0
- package/skills/api-design-principles/SKILL.md +37 -0
- package/skills/api-design-principles/assets/api-design-checklist.md +155 -0
- package/skills/api-design-principles/assets/rest-api-template.py +182 -0
- package/skills/api-design-principles/references/graphql-schema-design.md +583 -0
- package/skills/api-design-principles/references/rest-best-practices.md +408 -0
- package/skills/api-design-principles/resources/implementation-playbook.md +513 -0
- package/skills/api-documenter/SKILL.md +184 -0
- package/skills/api-testing-observability-api-mock/SKILL.md +46 -0
- package/skills/api-testing-observability-api-mock/resources/implementation-playbook.md +1327 -0
- package/skills/application-performance-performance-optimization/SKILL.md +154 -0
- package/skills/architect-review/SKILL.md +174 -0
- package/skills/architecture-decision-records/SKILL.md +441 -0
- package/skills/architecture-patterns/SKILL.md +37 -0
- package/skills/architecture-patterns/resources/implementation-playbook.md +479 -0
- package/skills/arm-cortex-expert/SKILL.md +306 -0
- package/skills/async-python-patterns/SKILL.md +39 -0
- package/skills/async-python-patterns/resources/implementation-playbook.md +678 -0
- package/skills/attack-tree-construction/SKILL.md +38 -0
- package/skills/attack-tree-construction/resources/implementation-playbook.md +671 -0
- package/skills/auth-implementation-patterns/SKILL.md +39 -0
- package/skills/auth-implementation-patterns/resources/implementation-playbook.md +618 -0
- package/skills/backend-architect/SKILL.md +333 -0
- package/skills/backend-development-feature-development/SKILL.md +180 -0
- package/skills/backend-security-coder/SKILL.md +156 -0
- package/skills/backtesting-frameworks/SKILL.md +39 -0
- package/skills/backtesting-frameworks/resources/implementation-playbook.md +647 -0
- package/skills/bash-defensive-patterns/SKILL.md +43 -0
- package/skills/bash-defensive-patterns/resources/implementation-playbook.md +517 -0
- package/skills/bash-pro/SKILL.md +310 -0
- package/skills/bats-testing-patterns/SKILL.md +34 -0
- package/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -0
- package/skills/bazel-build-optimization/SKILL.md +397 -0
- package/skills/billing-automation/SKILL.md +42 -0
- package/skills/billing-automation/resources/implementation-playbook.md +544 -0
- package/skills/binary-analysis-patterns/SKILL.md +450 -0
- package/skills/blockchain-developer/SKILL.md +208 -0
- package/skills/business-analyst/SKILL.md +182 -0
- package/skills/c-pro/SKILL.md +56 -0
- package/skills/c4-architecture-c4-architecture/SKILL.md +389 -0
- package/skills/c4-code/SKILL.md +244 -0
- package/skills/c4-component/SKILL.md +153 -0
- package/skills/c4-container/SKILL.md +171 -0
- package/skills/c4-context/SKILL.md +150 -0
- package/skills/changelog-automation/SKILL.md +38 -0
- package/skills/changelog-automation/resources/implementation-playbook.md +538 -0
- package/skills/cicd-automation-workflow-automate/SKILL.md +51 -0
- package/skills/cicd-automation-workflow-automate/resources/implementation-playbook.md +1333 -0
- package/skills/clean-markdown/SKILL.md +23 -0
- package/skills/cloud-architect/SKILL.md +135 -0
- package/skills/code-documentation-code-explain/SKILL.md +46 -0
- package/skills/code-documentation-code-explain/resources/implementation-playbook.md +802 -0
- package/skills/code-documentation-doc-generate/SKILL.md +48 -0
- package/skills/code-documentation-doc-generate/resources/implementation-playbook.md +640 -0
- package/skills/code-refactoring-context-restore/SKILL.md +179 -0
- package/skills/code-refactoring-refactor-clean/SKILL.md +51 -0
- package/skills/code-refactoring-refactor-clean/resources/implementation-playbook.md +879 -0
- package/skills/code-refactoring-tech-debt/SKILL.md +386 -0
- package/skills/code-review-ai-ai-review/SKILL.md +450 -0
- package/skills/code-review-excellence/SKILL.md +40 -0
- package/skills/code-review-excellence/resources/implementation-playbook.md +515 -0
- package/skills/code-reviewer/SKILL.md +178 -0
- package/skills/codebase-cleanup-deps-audit/SKILL.md +51 -0
- package/skills/codebase-cleanup-deps-audit/resources/implementation-playbook.md +766 -0
- package/skills/codebase-cleanup-refactor-clean/SKILL.md +51 -0
- package/skills/codebase-cleanup-refactor-clean/resources/implementation-playbook.md +879 -0
- package/skills/codebase-cleanup-tech-debt/SKILL.md +386 -0
- package/skills/competitive-landscape/SKILL.md +34 -0
- package/skills/competitive-landscape/resources/implementation-playbook.md +494 -0
- package/skills/comprehensive-review-full-review/SKILL.md +146 -0
- package/skills/comprehensive-review-pr-enhance/SKILL.md +46 -0
- package/skills/comprehensive-review-pr-enhance/resources/implementation-playbook.md +691 -0
- package/skills/conductor-implement/SKILL.md +388 -0
- package/skills/conductor-manage/SKILL.md +39 -0
- package/skills/conductor-manage/resources/implementation-playbook.md +1120 -0
- package/skills/conductor-new-track/SKILL.md +433 -0
- package/skills/conductor-revert/SKILL.md +372 -0
- package/skills/conductor-setup/SKILL.md +426 -0
- package/skills/conductor-status/SKILL.md +338 -0
- package/skills/conductor-validator/SKILL.md +62 -0
- package/skills/content-marketer/SKILL.md +170 -0
- package/skills/context-driven-development/SKILL.md +400 -0
- package/skills/context-management-context-restore/SKILL.md +179 -0
- package/skills/context-management-context-save/SKILL.md +177 -0
- package/skills/context-manager/SKILL.md +185 -0
- package/skills/cost-optimization/SKILL.md +286 -0
- package/skills/cpp-pro/SKILL.md +59 -0
- package/skills/cqrs-implementation/SKILL.md +35 -0
- package/skills/cqrs-implementation/resources/implementation-playbook.md +540 -0
- package/skills/csharp-pro/SKILL.md +59 -0
- package/skills/customer-support/SKILL.md +170 -0
- package/skills/data-engineer/SKILL.md +224 -0
- package/skills/data-engineering-data-driven-feature/SKILL.md +182 -0
- package/skills/data-engineering-data-pipeline/SKILL.md +201 -0
- package/skills/data-quality-frameworks/SKILL.md +40 -0
- package/skills/data-quality-frameworks/resources/implementation-playbook.md +573 -0
- package/skills/data-scientist/SKILL.md +199 -0
- package/skills/data-storytelling/SKILL.md +465 -0
- package/skills/database-admin/SKILL.md +165 -0
- package/skills/database-architect/SKILL.md +268 -0
- package/skills/database-cloud-optimization-cost-optimize/SKILL.md +44 -0
- package/skills/database-cloud-optimization-cost-optimize/resources/implementation-playbook.md +1441 -0
- package/skills/database-migration/SKILL.md +436 -0
- package/skills/database-migrations-migration-observability/SKILL.md +420 -0
- package/skills/database-migrations-sql-migrations/SKILL.md +53 -0
- package/skills/database-migrations-sql-migrations/resources/implementation-playbook.md +499 -0
- package/skills/database-optimizer/SKILL.md +167 -0
- package/skills/dbt-transformation-patterns/SKILL.md +34 -0
- package/skills/dbt-transformation-patterns/resources/implementation-playbook.md +547 -0
- package/skills/debugger/SKILL.md +49 -0
- package/skills/debugging-strategies/SKILL.md +34 -0
- package/skills/debugging-strategies/resources/implementation-playbook.md +511 -0
- package/skills/debugging-toolkit-smart-debug/SKILL.md +197 -0
- package/skills/defi-protocol-templates/SKILL.md +466 -0
- package/skills/dependency-management-deps-audit/SKILL.md +44 -0
- package/skills/dependency-management-deps-audit/resources/implementation-playbook.md +766 -0
- package/skills/dependency-upgrade/SKILL.md +421 -0
- package/skills/deployment-engineer/SKILL.md +170 -0
- package/skills/deployment-pipeline-design/SKILL.md +371 -0
- package/skills/deployment-validation-config-validate/SKILL.md +496 -0
- package/skills/devops-troubleshooter/SKILL.md +161 -0
- package/skills/distributed-debugging-debug-trace/SKILL.md +44 -0
- package/skills/distributed-debugging-debug-trace/resources/implementation-playbook.md +1307 -0
- package/skills/distributed-tracing/SKILL.md +450 -0
- package/skills/django-pro/SKILL.md +180 -0
- package/skills/docs-architect/SKILL.md +98 -0
- package/skills/documentation-generation-doc-generate/SKILL.md +48 -0
- package/skills/documentation-generation-doc-generate/resources/implementation-playbook.md +640 -0
- package/skills/dotnet-architect/SKILL.md +197 -0
- package/skills/dotnet-backend-patterns/SKILL.md +37 -0
- package/skills/dotnet-backend-patterns/assets/repository-template.cs +523 -0
- package/skills/dotnet-backend-patterns/assets/service-template.cs +336 -0
- package/skills/dotnet-backend-patterns/references/dapper-patterns.md +544 -0
- package/skills/dotnet-backend-patterns/references/ef-core-best-practices.md +355 -0
- package/skills/dotnet-backend-patterns/resources/implementation-playbook.md +799 -0
- package/skills/dummy-skill/SKILL.md +5 -0
- package/skills/dx-optimizer/SKILL.md +83 -0
- package/skills/e2e-testing-patterns/SKILL.md +41 -0
- package/skills/e2e-testing-patterns/resources/implementation-playbook.md +531 -0
- package/skills/elixir-pro/SKILL.md +59 -0
- package/skills/embedding-strategies/SKILL.md +491 -0
- package/skills/employment-contract-templates/SKILL.md +39 -0
- package/skills/employment-contract-templates/resources/implementation-playbook.md +493 -0
- package/skills/error-debugging-error-analysis/SKILL.md +47 -0
- package/skills/error-debugging-error-analysis/resources/implementation-playbook.md +1143 -0
- package/skills/error-debugging-error-trace/SKILL.md +43 -0
- package/skills/error-debugging-error-trace/resources/implementation-playbook.md +1361 -0
- package/skills/error-debugging-multi-agent-review/SKILL.md +216 -0
- package/skills/error-detective/SKILL.md +53 -0
- package/skills/error-diagnostics-error-analysis/SKILL.md +47 -0
- package/skills/error-diagnostics-error-analysis/resources/implementation-playbook.md +1143 -0
- package/skills/error-diagnostics-error-trace/SKILL.md +48 -0
- package/skills/error-diagnostics-error-trace/resources/implementation-playbook.md +1371 -0
- package/skills/error-diagnostics-smart-debug/SKILL.md +197 -0
- package/skills/error-handling-patterns/SKILL.md +35 -0
- package/skills/error-handling-patterns/resources/implementation-playbook.md +635 -0
- package/skills/event-sourcing-architect/SKILL.md +58 -0
- package/skills/event-store-design/SKILL.md +449 -0
- package/skills/fastapi-pro/SKILL.md +192 -0
- package/skills/fastapi-templates/SKILL.md +32 -0
- package/skills/fastapi-templates/resources/implementation-playbook.md +566 -0
- package/skills/final-test/SKILL.md +5 -0
- package/skills/firmware-analyst/SKILL.md +320 -0
- package/skills/flutter-expert/SKILL.md +200 -0
- package/skills/framework-migration-code-migrate/SKILL.md +48 -0
- package/skills/framework-migration-code-migrate/resources/implementation-playbook.md +1052 -0
- package/skills/framework-migration-deps-upgrade/SKILL.md +48 -0
- package/skills/framework-migration-deps-upgrade/resources/implementation-playbook.md +755 -0
- package/skills/framework-migration-legacy-modernize/SKILL.md +132 -0
- package/skills/frontend-developer/SKILL.md +171 -0
- package/skills/frontend-mobile-development-component-scaffold/SKILL.md +403 -0
- package/skills/frontend-mobile-security-xss-scan/SKILL.md +322 -0
- package/skills/frontend-security-coder/SKILL.md +170 -0
- package/skills/full-stack-orchestration-full-stack-feature/SKILL.md +135 -0
- package/skills/gdpr-data-handling/SKILL.md +33 -0
- package/skills/gdpr-data-handling/resources/implementation-playbook.md +615 -0
- package/skills/git-advanced-workflows/SKILL.md +412 -0
- package/skills/git-pr-workflows-git-workflow/SKILL.md +140 -0
- package/skills/git-pr-workflows-onboard/SKILL.md +416 -0
- package/skills/git-pr-workflows-pr-enhance/SKILL.md +48 -0
- package/skills/git-pr-workflows-pr-enhance/resources/implementation-playbook.md +701 -0
- package/skills/github-actions-templates/SKILL.md +345 -0
- package/skills/gitlab-ci-patterns/SKILL.md +283 -0
- package/skills/gitops-workflow/SKILL.md +303 -0
- package/skills/gitops-workflow/references/argocd-setup.md +134 -0
- package/skills/gitops-workflow/references/sync-policies.md +131 -0
- package/skills/go-concurrency-patterns/SKILL.md +33 -0
- package/skills/go-concurrency-patterns/resources/implementation-playbook.md +654 -0
- package/skills/godot-gdscript-patterns/SKILL.md +33 -0
- package/skills/godot-gdscript-patterns/resources/implementation-playbook.md +804 -0
- package/skills/golang-pro/SKILL.md +179 -0
- package/skills/grafana-dashboards/SKILL.md +381 -0
- package/skills/graphql-architect/SKILL.md +182 -0
- package/skills/haskell-pro/SKILL.md +56 -0
- package/skills/helm-chart-scaffolding/SKILL.md +34 -0
- package/skills/helm-chart-scaffolding/assets/Chart.yaml.template +42 -0
- package/skills/helm-chart-scaffolding/assets/values.yaml.template +185 -0
- package/skills/helm-chart-scaffolding/references/chart-structure.md +500 -0
- package/skills/helm-chart-scaffolding/resources/implementation-playbook.md +543 -0
- package/skills/helm-chart-scaffolding/scripts/validate-chart.sh +244 -0
- package/skills/hr-pro/SKILL.md +126 -0
- package/skills/hybrid-cloud-architect/SKILL.md +168 -0
- package/skills/hybrid-cloud-networking/SKILL.md +238 -0
- package/skills/hybrid-search-implementation/SKILL.md +32 -0
- package/skills/hybrid-search-implementation/resources/implementation-playbook.md +567 -0
- package/skills/incident-responder/SKILL.md +213 -0
- package/skills/incident-response-incident-response/SKILL.md +168 -0
- package/skills/incident-response-smart-fix/SKILL.md +29 -0
- package/skills/incident-response-smart-fix/resources/implementation-playbook.md +838 -0
- package/skills/incident-runbook-templates/SKILL.md +395 -0
- package/skills/ios-developer/SKILL.md +219 -0
- package/skills/istio-traffic-management/SKILL.md +337 -0
- package/skills/java-pro/SKILL.md +177 -0
- package/skills/javascript-pro/SKILL.md +57 -0
- package/skills/javascript-testing-patterns/SKILL.md +35 -0
- package/skills/javascript-testing-patterns/resources/implementation-playbook.md +1024 -0
- package/skills/javascript-typescript-typescript-scaffold/SKILL.md +361 -0
- package/skills/julia-pro/SKILL.md +209 -0
- package/skills/k8s-manifest-generator/SKILL.md +35 -0
- package/skills/k8s-manifest-generator/assets/configmap-template.yaml +296 -0
- package/skills/k8s-manifest-generator/assets/deployment-template.yaml +203 -0
- package/skills/k8s-manifest-generator/assets/service-template.yaml +171 -0
- package/skills/k8s-manifest-generator/references/deployment-spec.md +753 -0
- package/skills/k8s-manifest-generator/references/service-spec.md +724 -0
- package/skills/k8s-manifest-generator/resources/implementation-playbook.md +510 -0
- package/skills/k8s-security-policies/SKILL.md +346 -0
- package/skills/k8s-security-policies/assets/network-policy-template.yaml +177 -0
- package/skills/k8s-security-policies/references/rbac-patterns.md +187 -0
- package/skills/kpi-dashboard-design/SKILL.md +440 -0
- package/skills/kubernetes-architect/SKILL.md +170 -0
- package/skills/langchain-architecture/SKILL.md +350 -0
- package/skills/legacy-modernizer/SKILL.md +53 -0
- package/skills/legal-advisor/SKILL.md +70 -0
- package/skills/linkerd-patterns/SKILL.md +321 -0
- package/skills/llm-application-dev-ai-assistant/SKILL.md +35 -0
- package/skills/llm-application-dev-ai-assistant/resources/implementation-playbook.md +1236 -0
- package/skills/llm-application-dev-langchain-agent/SKILL.md +246 -0
- package/skills/llm-application-dev-prompt-optimize/SKILL.md +37 -0
- package/skills/llm-application-dev-prompt-optimize/resources/implementation-playbook.md +591 -0
- package/skills/llm-evaluation/SKILL.md +483 -0
- package/skills/machine-learning-ops-ml-pipeline/SKILL.md +314 -0
- package/skills/malware-analyst/SKILL.md +247 -0
- package/skills/market-sizing-analysis/SKILL.md +425 -0
- package/skills/market-sizing-analysis/examples/saas-market-sizing.md +349 -0
- package/skills/market-sizing-analysis/references/data-sources.md +360 -0
- package/skills/memory-forensics/SKILL.md +491 -0
- package/skills/memory-safety-patterns/SKILL.md +33 -0
- package/skills/memory-safety-patterns/resources/implementation-playbook.md +603 -0
- package/skills/mermaid-expert/SKILL.md +59 -0
- package/skills/microservices-patterns/SKILL.md +35 -0
- package/skills/microservices-patterns/resources/implementation-playbook.md +607 -0
- package/skills/minecraft-bukkit-pro/SKILL.md +126 -0
- package/skills/ml-engineer/SKILL.md +168 -0
- package/skills/ml-pipeline-workflow/SKILL.md +257 -0
- package/skills/mlops-engineer/SKILL.md +219 -0
- package/skills/mobile-developer/SKILL.md +205 -0
- package/skills/mobile-security-coder/SKILL.md +184 -0
- package/skills/modern-javascript-patterns/SKILL.md +35 -0
- package/skills/modern-javascript-patterns/resources/implementation-playbook.md +910 -0
- package/skills/monorepo-architect/SKILL.md +61 -0
- package/skills/monorepo-management/SKILL.md +35 -0
- package/skills/monorepo-management/resources/implementation-playbook.md +621 -0
- package/skills/mtls-configuration/SKILL.md +359 -0
- package/skills/multi-cloud-architecture/SKILL.md +189 -0
- package/skills/multi-platform-apps-multi-platform/SKILL.md +203 -0
- package/skills/network-engineer/SKILL.md +169 -0
- package/skills/nextjs-app-router-patterns/SKILL.md +33 -0
- package/skills/nextjs-app-router-patterns/resources/implementation-playbook.md +543 -0
- package/skills/nft-standards/SKILL.md +395 -0
- package/skills/node-expert/SKILL.md +23 -0
- package/skills/nodejs-backend-patterns/SKILL.md +35 -0
- package/skills/nodejs-backend-patterns/resources/implementation-playbook.md +1019 -0
- package/skills/nx-workspace-patterns/SKILL.md +464 -0
- package/skills/observability-engineer/SKILL.md +237 -0
- package/skills/observability-monitoring-monitor-setup/SKILL.md +48 -0
- package/skills/observability-monitoring-monitor-setup/resources/implementation-playbook.md +505 -0
- package/skills/observability-monitoring-slo-implement/SKILL.md +43 -0
- package/skills/observability-monitoring-slo-implement/resources/implementation-playbook.md +1077 -0
- package/skills/on-call-handoff-patterns/SKILL.md +453 -0
- package/skills/openapi-spec-generation/SKILL.md +33 -0
- package/skills/openapi-spec-generation/resources/implementation-playbook.md +1027 -0
- package/skills/payment-integration/SKILL.md +77 -0
- package/skills/paypal-integration/SKILL.md +479 -0
- package/skills/pci-compliance/SKILL.md +478 -0
- package/skills/performance-engineer/SKILL.md +180 -0
- package/skills/performance-testing-review-ai-review/SKILL.md +450 -0
- package/skills/performance-testing-review-multi-agent-review/SKILL.md +216 -0
- package/skills/php-pro/SKILL.md +63 -0
- package/skills/posix-shell-pro/SKILL.md +304 -0
- package/skills/postgresql/SKILL.md +230 -0
- package/skills/postmortem-writing/SKILL.md +386 -0
- package/skills/projection-patterns/SKILL.md +33 -0
- package/skills/projection-patterns/resources/implementation-playbook.md +501 -0
- package/skills/prometheus-configuration/SKILL.md +404 -0
- package/skills/prompt-engineer/SKILL.md +272 -0
- package/skills/prompt-engineering-patterns/SKILL.md +213 -0
- package/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
- package/skills/prompt-engineering-patterns/assets/prompt-template-library.md +246 -0
- package/skills/prompt-engineering-patterns/references/chain-of-thought.md +399 -0
- package/skills/prompt-engineering-patterns/references/few-shot-learning.md +369 -0
- package/skills/prompt-engineering-patterns/references/prompt-optimization.md +414 -0
- package/skills/prompt-engineering-patterns/references/prompt-templates.md +470 -0
- package/skills/prompt-engineering-patterns/references/system-prompts.md +189 -0
- package/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
- package/skills/protocol-reverse-engineering/SKILL.md +29 -0
- package/skills/protocol-reverse-engineering/resources/implementation-playbook.md +509 -0
- package/skills/python-development-python-scaffold/SKILL.md +331 -0
- package/skills/python-packaging/SKILL.md +36 -0
- package/skills/python-packaging/resources/implementation-playbook.md +869 -0
- package/skills/python-performance-optimization/SKILL.md +36 -0
- package/skills/python-performance-optimization/resources/implementation-playbook.md +868 -0
- package/skills/python-pro/SKILL.md +158 -0
- package/skills/python-testing-patterns/SKILL.md +37 -0
- package/skills/python-testing-patterns/resources/implementation-playbook.md +906 -0
- package/skills/quant-analyst/SKILL.md +53 -0
- package/skills/rag-implementation/SKILL.md +421 -0
- package/skills/react-modernization/SKILL.md +34 -0
- package/skills/react-modernization/resources/implementation-playbook.md +512 -0
- package/skills/react-native-architecture/SKILL.md +33 -0
- package/skills/react-native-architecture/resources/implementation-playbook.md +670 -0
- package/skills/react-state-management/SKILL.md +441 -0
- package/skills/reference-builder/SKILL.md +188 -0
- package/skills/reverse-engineer/SKILL.md +173 -0
- package/skills/risk-manager/SKILL.md +61 -0
- package/skills/risk-metrics-calculation/SKILL.md +33 -0
- package/skills/risk-metrics-calculation/resources/implementation-playbook.md +554 -0
- package/skills/ruby-pro/SKILL.md +56 -0
- package/skills/rust-async-patterns/SKILL.md +33 -0
- package/skills/rust-async-patterns/resources/implementation-playbook.md +516 -0
- package/skills/rust-pro/SKILL.md +178 -0
- package/skills/saga-orchestration/SKILL.md +496 -0
- package/skills/sales-automator/SKILL.md +55 -0
- package/skills/sast-configuration/SKILL.md +212 -0
- package/skills/scala-pro/SKILL.md +82 -0
- package/skills/screen-reader-testing/SKILL.md +33 -0
- package/skills/screen-reader-testing/resources/implementation-playbook.md +544 -0
- package/skills/search-specialist/SKILL.md +80 -0
- package/skills/secrets-management/SKILL.md +364 -0
- package/skills/security-auditor/SKILL.md +169 -0
- package/skills/security-compliance-compliance-check/SKILL.md +55 -0
- package/skills/security-compliance-compliance-check/resources/implementation-playbook.md +963 -0
- package/skills/security-requirement-extraction/SKILL.md +33 -0
- package/skills/security-requirement-extraction/resources/implementation-playbook.md +676 -0
- package/skills/security-scanning-security-dependencies/SKILL.md +43 -0
- package/skills/security-scanning-security-dependencies/resources/implementation-playbook.md +544 -0
- package/skills/security-scanning-security-hardening/SKILL.md +147 -0
- package/skills/security-scanning-security-sast/SKILL.md +495 -0
- package/skills/seo-authority-builder/SKILL.md +136 -0
- package/skills/seo-cannibalization-detector/SKILL.md +123 -0
- package/skills/seo-content-auditor/SKILL.md +83 -0
- package/skills/seo-content-planner/SKILL.md +108 -0
- package/skills/seo-content-refresher/SKILL.md +118 -0
- package/skills/seo-content-writer/SKILL.md +96 -0
- package/skills/seo-keyword-strategist/SKILL.md +95 -0
- package/skills/seo-meta-optimizer/SKILL.md +92 -0
- package/skills/seo-snippet-hunter/SKILL.md +114 -0
- package/skills/seo-structure-architect/SKILL.md +108 -0
- package/skills/service-mesh-expert/SKILL.md +58 -0
- package/skills/service-mesh-observability/SKILL.md +395 -0
- package/skills/shellcheck-configuration/SKILL.md +466 -0
- package/skills/similarity-search-patterns/SKILL.md +33 -0
- package/skills/similarity-search-patterns/resources/implementation-playbook.md +557 -0
- package/skills/slo-implementation/SKILL.md +341 -0
- package/skills/solidity-security/SKILL.md +34 -0
- package/skills/solidity-security/resources/implementation-playbook.md +524 -0
- package/skills/spark-optimization/SKILL.md +427 -0
- package/skills/sql-optimization-patterns/SKILL.md +35 -0
- package/skills/sql-optimization-patterns/resources/implementation-playbook.md +504 -0
- package/skills/sql-pro/SKILL.md +173 -0
- package/skills/startup-analyst/SKILL.md +328 -0
- package/skills/startup-business-analyst-business-case/SKILL.md +487 -0
- package/skills/startup-business-analyst-financial-projections/SKILL.md +353 -0
- package/skills/startup-business-analyst-market-opportunity/SKILL.md +240 -0
- package/skills/startup-financial-modeling/SKILL.md +467 -0
- package/skills/startup-metrics-framework/SKILL.md +34 -0
- package/skills/startup-metrics-framework/resources/implementation-playbook.md +500 -0
- package/skills/stride-analysis-patterns/SKILL.md +33 -0
- package/skills/stride-analysis-patterns/resources/implementation-playbook.md +655 -0
- package/skills/stripe-integration/SKILL.md +454 -0
- package/skills/systems-programming-rust-project/SKILL.md +440 -0
- package/skills/tailwind-design-system/SKILL.md +33 -0
- package/skills/tailwind-design-system/resources/implementation-playbook.md +665 -0
- package/skills/tdd-orchestrator/SKILL.md +205 -0
- package/skills/tdd-workflows-tdd-cycle/SKILL.md +221 -0
- package/skills/tdd-workflows-tdd-green/SKILL.md +73 -0
- package/skills/tdd-workflows-tdd-green/resources/implementation-playbook.md +870 -0
- package/skills/tdd-workflows-tdd-red/SKILL.md +164 -0
- package/skills/tdd-workflows-tdd-refactor/SKILL.md +187 -0
- package/skills/team-collaboration-issue/SKILL.md +37 -0
- package/skills/team-collaboration-issue/resources/implementation-playbook.md +640 -0
- package/skills/team-collaboration-standup-notes/SKILL.md +44 -0
- package/skills/team-collaboration-standup-notes/resources/implementation-playbook.md +768 -0
- package/skills/team-composition-analysis/SKILL.md +413 -0
- package/skills/temporal-python-pro/SKILL.md +370 -0
- package/skills/temporal-python-testing/SKILL.md +170 -0
- package/skills/temporal-python-testing/resources/integration-testing.md +455 -0
- package/skills/temporal-python-testing/resources/local-setup.md +553 -0
- package/skills/temporal-python-testing/resources/replay-testing.md +462 -0
- package/skills/temporal-python-testing/resources/unit-testing.md +328 -0
- package/skills/terraform-module-library/SKILL.md +261 -0
- package/skills/terraform-module-library/references/aws-modules.md +63 -0
- package/skills/terraform-specialist/SKILL.md +166 -0
- package/skills/test-automator/SKILL.md +224 -0
- package/skills/threat-mitigation-mapping/SKILL.md +33 -0
- package/skills/threat-mitigation-mapping/resources/implementation-playbook.md +744 -0
- package/skills/threat-modeling-expert/SKILL.md +60 -0
- package/skills/track-management/SKILL.md +38 -0
- package/skills/track-management/resources/implementation-playbook.md +591 -0
- package/skills/turborepo-caching/SKILL.md +419 -0
- package/skills/tutorial-engineer/SKILL.md +139 -0
- package/skills/typescript-advanced-types/SKILL.md +35 -0
- package/skills/typescript-advanced-types/resources/implementation-playbook.md +716 -0
- package/skills/typescript-pro/SKILL.md +55 -0
- package/skills/ui-minimal/SKILL.md +23 -0
- package/skills/ui-ux-designer/SKILL.md +209 -0
- package/skills/ui-visual-validator/SKILL.md +214 -0
- package/skills/unit-testing-test-generate/SKILL.md +319 -0
- package/skills/unity-developer/SKILL.md +230 -0
- package/skills/unity-ecs-patterns/SKILL.md +33 -0
- package/skills/unity-ecs-patterns/resources/implementation-playbook.md +625 -0
- package/skills/uv-package-manager/SKILL.md +37 -0
- package/skills/uv-package-manager/resources/implementation-playbook.md +830 -0
- package/skills/vector-database-engineer/SKILL.md +60 -0
- package/skills/vector-index-tuning/SKILL.md +42 -0
- package/skills/vector-index-tuning/resources/implementation-playbook.md +507 -0
- package/skills/wcag-audit-patterns/SKILL.md +41 -0
- package/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -0
- package/skills/web3-testing/SKILL.md +427 -0
- package/skills/workflow-orchestration-patterns/SKILL.md +333 -0
- package/skills/workflow-patterns/SKILL.md +38 -0
- package/skills/workflow-patterns/resources/implementation-playbook.md +621 -0
|
@@ -0,0 +1,1027 @@
|
|
|
1
|
+
# OpenAPI Spec Generation Implementation Playbook
|
|
2
|
+
|
|
3
|
+
This file contains detailed patterns, checklists, and code samples referenced by the skill.
|
|
4
|
+
|
|
5
|
+
# OpenAPI Spec Generation
|
|
6
|
+
|
|
7
|
+
Comprehensive patterns for creating, maintaining, and validating OpenAPI 3.1 specifications for RESTful APIs.
|
|
8
|
+
|
|
9
|
+
## When to Use This Skill
|
|
10
|
+
|
|
11
|
+
- Creating API documentation from scratch
|
|
12
|
+
- Generating OpenAPI specs from existing code
|
|
13
|
+
- Designing API contracts (design-first approach)
|
|
14
|
+
- Validating API implementations against specs
|
|
15
|
+
- Generating client SDKs from specs
|
|
16
|
+
- Setting up API documentation portals
|
|
17
|
+
|
|
18
|
+
## Core Concepts
|
|
19
|
+
|
|
20
|
+
### 1. OpenAPI 3.1 Structure
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
openapi: 3.1.0
|
|
24
|
+
info:
|
|
25
|
+
title: API Title
|
|
26
|
+
version: 1.0.0
|
|
27
|
+
servers:
|
|
28
|
+
- url: https://api.example.com/v1
|
|
29
|
+
paths:
|
|
30
|
+
/resources:
|
|
31
|
+
get: ...
|
|
32
|
+
components:
|
|
33
|
+
schemas: ...
|
|
34
|
+
securitySchemes: ...
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Design Approaches
|
|
38
|
+
|
|
39
|
+
| Approach | Description | Best For |
|
|
40
|
+
|----------|-------------|----------|
|
|
41
|
+
| **Design-First** | Write spec before code | New APIs, contracts |
|
|
42
|
+
| **Code-First** | Generate spec from code | Existing APIs |
|
|
43
|
+
| **Hybrid** | Annotate code, generate spec | Evolving APIs |
|
|
44
|
+
|
|
45
|
+
## Templates
|
|
46
|
+
|
|
47
|
+
### Template 1: Complete API Specification
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
openapi: 3.1.0
|
|
51
|
+
info:
|
|
52
|
+
title: User Management API
|
|
53
|
+
description: |
|
|
54
|
+
API for managing users and their profiles.
|
|
55
|
+
|
|
56
|
+
## Authentication
|
|
57
|
+
All endpoints require Bearer token authentication.
|
|
58
|
+
|
|
59
|
+
## Rate Limiting
|
|
60
|
+
- 1000 requests per minute for standard tier
|
|
61
|
+
- 10000 requests per minute for enterprise tier
|
|
62
|
+
version: 2.0.0
|
|
63
|
+
contact:
|
|
64
|
+
name: API Support
|
|
65
|
+
email: api-support@example.com
|
|
66
|
+
url: https://docs.example.com
|
|
67
|
+
license:
|
|
68
|
+
name: MIT
|
|
69
|
+
url: https://opensource.org/licenses/MIT
|
|
70
|
+
|
|
71
|
+
servers:
|
|
72
|
+
- url: https://api.example.com/v2
|
|
73
|
+
description: Production
|
|
74
|
+
- url: https://staging-api.example.com/v2
|
|
75
|
+
description: Staging
|
|
76
|
+
- url: http://localhost:3000/v2
|
|
77
|
+
description: Local development
|
|
78
|
+
|
|
79
|
+
tags:
|
|
80
|
+
- name: Users
|
|
81
|
+
description: User management operations
|
|
82
|
+
- name: Profiles
|
|
83
|
+
description: User profile operations
|
|
84
|
+
- name: Admin
|
|
85
|
+
description: Administrative operations
|
|
86
|
+
|
|
87
|
+
paths:
|
|
88
|
+
/users:
|
|
89
|
+
get:
|
|
90
|
+
operationId: listUsers
|
|
91
|
+
summary: List all users
|
|
92
|
+
description: Returns a paginated list of users with optional filtering.
|
|
93
|
+
tags:
|
|
94
|
+
- Users
|
|
95
|
+
parameters:
|
|
96
|
+
- $ref: '#/components/parameters/PageParam'
|
|
97
|
+
- $ref: '#/components/parameters/LimitParam'
|
|
98
|
+
- name: status
|
|
99
|
+
in: query
|
|
100
|
+
description: Filter by user status
|
|
101
|
+
schema:
|
|
102
|
+
$ref: '#/components/schemas/UserStatus'
|
|
103
|
+
- name: search
|
|
104
|
+
in: query
|
|
105
|
+
description: Search by name or email
|
|
106
|
+
schema:
|
|
107
|
+
type: string
|
|
108
|
+
minLength: 2
|
|
109
|
+
maxLength: 100
|
|
110
|
+
responses:
|
|
111
|
+
'200':
|
|
112
|
+
description: Successful response
|
|
113
|
+
content:
|
|
114
|
+
application/json:
|
|
115
|
+
schema:
|
|
116
|
+
$ref: '#/components/schemas/UserListResponse'
|
|
117
|
+
examples:
|
|
118
|
+
default:
|
|
119
|
+
$ref: '#/components/examples/UserListExample'
|
|
120
|
+
'400':
|
|
121
|
+
$ref: '#/components/responses/BadRequest'
|
|
122
|
+
'401':
|
|
123
|
+
$ref: '#/components/responses/Unauthorized'
|
|
124
|
+
'429':
|
|
125
|
+
$ref: '#/components/responses/RateLimited'
|
|
126
|
+
security:
|
|
127
|
+
- bearerAuth: []
|
|
128
|
+
|
|
129
|
+
post:
|
|
130
|
+
operationId: createUser
|
|
131
|
+
summary: Create a new user
|
|
132
|
+
description: Creates a new user account and sends welcome email.
|
|
133
|
+
tags:
|
|
134
|
+
- Users
|
|
135
|
+
requestBody:
|
|
136
|
+
required: true
|
|
137
|
+
content:
|
|
138
|
+
application/json:
|
|
139
|
+
schema:
|
|
140
|
+
$ref: '#/components/schemas/CreateUserRequest'
|
|
141
|
+
examples:
|
|
142
|
+
standard:
|
|
143
|
+
summary: Standard user
|
|
144
|
+
value:
|
|
145
|
+
email: user@example.com
|
|
146
|
+
name: John Doe
|
|
147
|
+
role: user
|
|
148
|
+
admin:
|
|
149
|
+
summary: Admin user
|
|
150
|
+
value:
|
|
151
|
+
email: admin@example.com
|
|
152
|
+
name: Admin User
|
|
153
|
+
role: admin
|
|
154
|
+
responses:
|
|
155
|
+
'201':
|
|
156
|
+
description: User created successfully
|
|
157
|
+
content:
|
|
158
|
+
application/json:
|
|
159
|
+
schema:
|
|
160
|
+
$ref: '#/components/schemas/User'
|
|
161
|
+
headers:
|
|
162
|
+
Location:
|
|
163
|
+
description: URL of created user
|
|
164
|
+
schema:
|
|
165
|
+
type: string
|
|
166
|
+
format: uri
|
|
167
|
+
'400':
|
|
168
|
+
$ref: '#/components/responses/BadRequest'
|
|
169
|
+
'409':
|
|
170
|
+
description: Email already exists
|
|
171
|
+
content:
|
|
172
|
+
application/json:
|
|
173
|
+
schema:
|
|
174
|
+
$ref: '#/components/schemas/Error'
|
|
175
|
+
security:
|
|
176
|
+
- bearerAuth: []
|
|
177
|
+
|
|
178
|
+
/users/{userId}:
|
|
179
|
+
parameters:
|
|
180
|
+
- $ref: '#/components/parameters/UserIdParam'
|
|
181
|
+
|
|
182
|
+
get:
|
|
183
|
+
operationId: getUser
|
|
184
|
+
summary: Get user by ID
|
|
185
|
+
tags:
|
|
186
|
+
- Users
|
|
187
|
+
responses:
|
|
188
|
+
'200':
|
|
189
|
+
description: Successful response
|
|
190
|
+
content:
|
|
191
|
+
application/json:
|
|
192
|
+
schema:
|
|
193
|
+
$ref: '#/components/schemas/User'
|
|
194
|
+
'404':
|
|
195
|
+
$ref: '#/components/responses/NotFound'
|
|
196
|
+
security:
|
|
197
|
+
- bearerAuth: []
|
|
198
|
+
|
|
199
|
+
patch:
|
|
200
|
+
operationId: updateUser
|
|
201
|
+
summary: Update user
|
|
202
|
+
tags:
|
|
203
|
+
- Users
|
|
204
|
+
requestBody:
|
|
205
|
+
required: true
|
|
206
|
+
content:
|
|
207
|
+
application/json:
|
|
208
|
+
schema:
|
|
209
|
+
$ref: '#/components/schemas/UpdateUserRequest'
|
|
210
|
+
responses:
|
|
211
|
+
'200':
|
|
212
|
+
description: User updated
|
|
213
|
+
content:
|
|
214
|
+
application/json:
|
|
215
|
+
schema:
|
|
216
|
+
$ref: '#/components/schemas/User'
|
|
217
|
+
'400':
|
|
218
|
+
$ref: '#/components/responses/BadRequest'
|
|
219
|
+
'404':
|
|
220
|
+
$ref: '#/components/responses/NotFound'
|
|
221
|
+
security:
|
|
222
|
+
- bearerAuth: []
|
|
223
|
+
|
|
224
|
+
delete:
|
|
225
|
+
operationId: deleteUser
|
|
226
|
+
summary: Delete user
|
|
227
|
+
tags:
|
|
228
|
+
- Users
|
|
229
|
+
- Admin
|
|
230
|
+
responses:
|
|
231
|
+
'204':
|
|
232
|
+
description: User deleted
|
|
233
|
+
'404':
|
|
234
|
+
$ref: '#/components/responses/NotFound'
|
|
235
|
+
security:
|
|
236
|
+
- bearerAuth: []
|
|
237
|
+
- apiKey: []
|
|
238
|
+
|
|
239
|
+
components:
|
|
240
|
+
schemas:
|
|
241
|
+
User:
|
|
242
|
+
type: object
|
|
243
|
+
required:
|
|
244
|
+
- id
|
|
245
|
+
- email
|
|
246
|
+
- name
|
|
247
|
+
- status
|
|
248
|
+
- createdAt
|
|
249
|
+
properties:
|
|
250
|
+
id:
|
|
251
|
+
type: string
|
|
252
|
+
format: uuid
|
|
253
|
+
readOnly: true
|
|
254
|
+
description: Unique user identifier
|
|
255
|
+
email:
|
|
256
|
+
type: string
|
|
257
|
+
format: email
|
|
258
|
+
description: User email address
|
|
259
|
+
name:
|
|
260
|
+
type: string
|
|
261
|
+
minLength: 1
|
|
262
|
+
maxLength: 100
|
|
263
|
+
description: User display name
|
|
264
|
+
status:
|
|
265
|
+
$ref: '#/components/schemas/UserStatus'
|
|
266
|
+
role:
|
|
267
|
+
type: string
|
|
268
|
+
enum: [user, moderator, admin]
|
|
269
|
+
default: user
|
|
270
|
+
avatar:
|
|
271
|
+
type: string
|
|
272
|
+
format: uri
|
|
273
|
+
nullable: true
|
|
274
|
+
metadata:
|
|
275
|
+
type: object
|
|
276
|
+
additionalProperties: true
|
|
277
|
+
description: Custom metadata
|
|
278
|
+
createdAt:
|
|
279
|
+
type: string
|
|
280
|
+
format: date-time
|
|
281
|
+
readOnly: true
|
|
282
|
+
updatedAt:
|
|
283
|
+
type: string
|
|
284
|
+
format: date-time
|
|
285
|
+
readOnly: true
|
|
286
|
+
|
|
287
|
+
UserStatus:
|
|
288
|
+
type: string
|
|
289
|
+
enum: [active, inactive, suspended, pending]
|
|
290
|
+
description: User account status
|
|
291
|
+
|
|
292
|
+
CreateUserRequest:
|
|
293
|
+
type: object
|
|
294
|
+
required:
|
|
295
|
+
- email
|
|
296
|
+
- name
|
|
297
|
+
properties:
|
|
298
|
+
email:
|
|
299
|
+
type: string
|
|
300
|
+
format: email
|
|
301
|
+
name:
|
|
302
|
+
type: string
|
|
303
|
+
minLength: 1
|
|
304
|
+
maxLength: 100
|
|
305
|
+
role:
|
|
306
|
+
type: string
|
|
307
|
+
enum: [user, moderator, admin]
|
|
308
|
+
default: user
|
|
309
|
+
metadata:
|
|
310
|
+
type: object
|
|
311
|
+
additionalProperties: true
|
|
312
|
+
|
|
313
|
+
UpdateUserRequest:
|
|
314
|
+
type: object
|
|
315
|
+
minProperties: 1
|
|
316
|
+
properties:
|
|
317
|
+
name:
|
|
318
|
+
type: string
|
|
319
|
+
minLength: 1
|
|
320
|
+
maxLength: 100
|
|
321
|
+
status:
|
|
322
|
+
$ref: '#/components/schemas/UserStatus'
|
|
323
|
+
role:
|
|
324
|
+
type: string
|
|
325
|
+
enum: [user, moderator, admin]
|
|
326
|
+
metadata:
|
|
327
|
+
type: object
|
|
328
|
+
additionalProperties: true
|
|
329
|
+
|
|
330
|
+
UserListResponse:
|
|
331
|
+
type: object
|
|
332
|
+
required:
|
|
333
|
+
- data
|
|
334
|
+
- pagination
|
|
335
|
+
properties:
|
|
336
|
+
data:
|
|
337
|
+
type: array
|
|
338
|
+
items:
|
|
339
|
+
$ref: '#/components/schemas/User'
|
|
340
|
+
pagination:
|
|
341
|
+
$ref: '#/components/schemas/Pagination'
|
|
342
|
+
|
|
343
|
+
Pagination:
|
|
344
|
+
type: object
|
|
345
|
+
required:
|
|
346
|
+
- page
|
|
347
|
+
- limit
|
|
348
|
+
- total
|
|
349
|
+
- totalPages
|
|
350
|
+
properties:
|
|
351
|
+
page:
|
|
352
|
+
type: integer
|
|
353
|
+
minimum: 1
|
|
354
|
+
limit:
|
|
355
|
+
type: integer
|
|
356
|
+
minimum: 1
|
|
357
|
+
maximum: 100
|
|
358
|
+
total:
|
|
359
|
+
type: integer
|
|
360
|
+
minimum: 0
|
|
361
|
+
totalPages:
|
|
362
|
+
type: integer
|
|
363
|
+
minimum: 0
|
|
364
|
+
hasNext:
|
|
365
|
+
type: boolean
|
|
366
|
+
hasPrev:
|
|
367
|
+
type: boolean
|
|
368
|
+
|
|
369
|
+
Error:
|
|
370
|
+
type: object
|
|
371
|
+
required:
|
|
372
|
+
- code
|
|
373
|
+
- message
|
|
374
|
+
properties:
|
|
375
|
+
code:
|
|
376
|
+
type: string
|
|
377
|
+
description: Error code for programmatic handling
|
|
378
|
+
message:
|
|
379
|
+
type: string
|
|
380
|
+
description: Human-readable error message
|
|
381
|
+
details:
|
|
382
|
+
type: array
|
|
383
|
+
items:
|
|
384
|
+
type: object
|
|
385
|
+
properties:
|
|
386
|
+
field:
|
|
387
|
+
type: string
|
|
388
|
+
message:
|
|
389
|
+
type: string
|
|
390
|
+
requestId:
|
|
391
|
+
type: string
|
|
392
|
+
description: Request ID for support
|
|
393
|
+
|
|
394
|
+
parameters:
|
|
395
|
+
UserIdParam:
|
|
396
|
+
name: userId
|
|
397
|
+
in: path
|
|
398
|
+
required: true
|
|
399
|
+
description: User ID
|
|
400
|
+
schema:
|
|
401
|
+
type: string
|
|
402
|
+
format: uuid
|
|
403
|
+
|
|
404
|
+
PageParam:
|
|
405
|
+
name: page
|
|
406
|
+
in: query
|
|
407
|
+
description: Page number (1-based)
|
|
408
|
+
schema:
|
|
409
|
+
type: integer
|
|
410
|
+
minimum: 1
|
|
411
|
+
default: 1
|
|
412
|
+
|
|
413
|
+
LimitParam:
|
|
414
|
+
name: limit
|
|
415
|
+
in: query
|
|
416
|
+
description: Items per page
|
|
417
|
+
schema:
|
|
418
|
+
type: integer
|
|
419
|
+
minimum: 1
|
|
420
|
+
maximum: 100
|
|
421
|
+
default: 20
|
|
422
|
+
|
|
423
|
+
responses:
|
|
424
|
+
BadRequest:
|
|
425
|
+
description: Invalid request
|
|
426
|
+
content:
|
|
427
|
+
application/json:
|
|
428
|
+
schema:
|
|
429
|
+
$ref: '#/components/schemas/Error'
|
|
430
|
+
example:
|
|
431
|
+
code: VALIDATION_ERROR
|
|
432
|
+
message: Invalid request parameters
|
|
433
|
+
details:
|
|
434
|
+
- field: email
|
|
435
|
+
message: Must be a valid email address
|
|
436
|
+
|
|
437
|
+
Unauthorized:
|
|
438
|
+
description: Authentication required
|
|
439
|
+
content:
|
|
440
|
+
application/json:
|
|
441
|
+
schema:
|
|
442
|
+
$ref: '#/components/schemas/Error'
|
|
443
|
+
example:
|
|
444
|
+
code: UNAUTHORIZED
|
|
445
|
+
message: Authentication required
|
|
446
|
+
|
|
447
|
+
NotFound:
|
|
448
|
+
description: Resource not found
|
|
449
|
+
content:
|
|
450
|
+
application/json:
|
|
451
|
+
schema:
|
|
452
|
+
$ref: '#/components/schemas/Error'
|
|
453
|
+
example:
|
|
454
|
+
code: NOT_FOUND
|
|
455
|
+
message: User not found
|
|
456
|
+
|
|
457
|
+
RateLimited:
|
|
458
|
+
description: Too many requests
|
|
459
|
+
content:
|
|
460
|
+
application/json:
|
|
461
|
+
schema:
|
|
462
|
+
$ref: '#/components/schemas/Error'
|
|
463
|
+
headers:
|
|
464
|
+
Retry-After:
|
|
465
|
+
description: Seconds until rate limit resets
|
|
466
|
+
schema:
|
|
467
|
+
type: integer
|
|
468
|
+
X-RateLimit-Limit:
|
|
469
|
+
description: Request limit per window
|
|
470
|
+
schema:
|
|
471
|
+
type: integer
|
|
472
|
+
X-RateLimit-Remaining:
|
|
473
|
+
description: Remaining requests in window
|
|
474
|
+
schema:
|
|
475
|
+
type: integer
|
|
476
|
+
|
|
477
|
+
examples:
|
|
478
|
+
UserListExample:
|
|
479
|
+
value:
|
|
480
|
+
data:
|
|
481
|
+
- id: "550e8400-e29b-41d4-a716-446655440000"
|
|
482
|
+
email: "john@example.com"
|
|
483
|
+
name: "John Doe"
|
|
484
|
+
status: "active"
|
|
485
|
+
role: "user"
|
|
486
|
+
createdAt: "2024-01-15T10:30:00Z"
|
|
487
|
+
pagination:
|
|
488
|
+
page: 1
|
|
489
|
+
limit: 20
|
|
490
|
+
total: 1
|
|
491
|
+
totalPages: 1
|
|
492
|
+
hasNext: false
|
|
493
|
+
hasPrev: false
|
|
494
|
+
|
|
495
|
+
securitySchemes:
|
|
496
|
+
bearerAuth:
|
|
497
|
+
type: http
|
|
498
|
+
scheme: bearer
|
|
499
|
+
bearerFormat: JWT
|
|
500
|
+
description: JWT token from /auth/login
|
|
501
|
+
|
|
502
|
+
apiKey:
|
|
503
|
+
type: apiKey
|
|
504
|
+
in: header
|
|
505
|
+
name: X-API-Key
|
|
506
|
+
description: API key for service-to-service calls
|
|
507
|
+
|
|
508
|
+
security:
|
|
509
|
+
- bearerAuth: []
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### Template 2: Code-First Generation (Python/FastAPI)
|
|
513
|
+
|
|
514
|
+
```python
|
|
515
|
+
# FastAPI with automatic OpenAPI generation
|
|
516
|
+
from fastapi import FastAPI, HTTPException, Query, Path, Depends
|
|
517
|
+
from pydantic import BaseModel, Field, EmailStr
|
|
518
|
+
from typing import Optional, List
|
|
519
|
+
from datetime import datetime
|
|
520
|
+
from uuid import UUID
|
|
521
|
+
from enum import Enum
|
|
522
|
+
|
|
523
|
+
app = FastAPI(
|
|
524
|
+
title="User Management API",
|
|
525
|
+
description="API for managing users and profiles",
|
|
526
|
+
version="2.0.0",
|
|
527
|
+
openapi_tags=[
|
|
528
|
+
{"name": "Users", "description": "User operations"},
|
|
529
|
+
{"name": "Profiles", "description": "Profile operations"},
|
|
530
|
+
],
|
|
531
|
+
servers=[
|
|
532
|
+
{"url": "https://api.example.com/v2", "description": "Production"},
|
|
533
|
+
{"url": "http://localhost:8000", "description": "Development"},
|
|
534
|
+
],
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
# Enums
|
|
538
|
+
class UserStatus(str, Enum):
|
|
539
|
+
active = "active"
|
|
540
|
+
inactive = "inactive"
|
|
541
|
+
suspended = "suspended"
|
|
542
|
+
pending = "pending"
|
|
543
|
+
|
|
544
|
+
class UserRole(str, Enum):
|
|
545
|
+
user = "user"
|
|
546
|
+
moderator = "moderator"
|
|
547
|
+
admin = "admin"
|
|
548
|
+
|
|
549
|
+
# Models
|
|
550
|
+
class UserBase(BaseModel):
|
|
551
|
+
email: EmailStr = Field(..., description="User email address")
|
|
552
|
+
name: str = Field(..., min_length=1, max_length=100, description="Display name")
|
|
553
|
+
|
|
554
|
+
class UserCreate(UserBase):
|
|
555
|
+
role: UserRole = Field(default=UserRole.user)
|
|
556
|
+
metadata: Optional[dict] = Field(default=None, description="Custom metadata")
|
|
557
|
+
|
|
558
|
+
model_config = {
|
|
559
|
+
"json_schema_extra": {
|
|
560
|
+
"examples": [
|
|
561
|
+
{
|
|
562
|
+
"email": "user@example.com",
|
|
563
|
+
"name": "John Doe",
|
|
564
|
+
"role": "user"
|
|
565
|
+
}
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
class UserUpdate(BaseModel):
|
|
571
|
+
name: Optional[str] = Field(None, min_length=1, max_length=100)
|
|
572
|
+
status: Optional[UserStatus] = None
|
|
573
|
+
role: Optional[UserRole] = None
|
|
574
|
+
metadata: Optional[dict] = None
|
|
575
|
+
|
|
576
|
+
class User(UserBase):
|
|
577
|
+
id: UUID = Field(..., description="Unique identifier")
|
|
578
|
+
status: UserStatus
|
|
579
|
+
role: UserRole
|
|
580
|
+
avatar: Optional[str] = Field(None, description="Avatar URL")
|
|
581
|
+
metadata: Optional[dict] = None
|
|
582
|
+
created_at: datetime = Field(..., alias="createdAt")
|
|
583
|
+
updated_at: Optional[datetime] = Field(None, alias="updatedAt")
|
|
584
|
+
|
|
585
|
+
model_config = {"populate_by_name": True}
|
|
586
|
+
|
|
587
|
+
class Pagination(BaseModel):
|
|
588
|
+
page: int = Field(..., ge=1)
|
|
589
|
+
limit: int = Field(..., ge=1, le=100)
|
|
590
|
+
total: int = Field(..., ge=0)
|
|
591
|
+
total_pages: int = Field(..., ge=0, alias="totalPages")
|
|
592
|
+
has_next: bool = Field(..., alias="hasNext")
|
|
593
|
+
has_prev: bool = Field(..., alias="hasPrev")
|
|
594
|
+
|
|
595
|
+
class UserListResponse(BaseModel):
|
|
596
|
+
data: List[User]
|
|
597
|
+
pagination: Pagination
|
|
598
|
+
|
|
599
|
+
class ErrorDetail(BaseModel):
|
|
600
|
+
field: str
|
|
601
|
+
message: str
|
|
602
|
+
|
|
603
|
+
class ErrorResponse(BaseModel):
|
|
604
|
+
code: str = Field(..., description="Error code")
|
|
605
|
+
message: str = Field(..., description="Error message")
|
|
606
|
+
details: Optional[List[ErrorDetail]] = None
|
|
607
|
+
request_id: Optional[str] = Field(None, alias="requestId")
|
|
608
|
+
|
|
609
|
+
# Endpoints
|
|
610
|
+
@app.get(
|
|
611
|
+
"/users",
|
|
612
|
+
response_model=UserListResponse,
|
|
613
|
+
tags=["Users"],
|
|
614
|
+
summary="List all users",
|
|
615
|
+
description="Returns a paginated list of users with optional filtering.",
|
|
616
|
+
responses={
|
|
617
|
+
400: {"model": ErrorResponse, "description": "Invalid request"},
|
|
618
|
+
401: {"model": ErrorResponse, "description": "Unauthorized"},
|
|
619
|
+
},
|
|
620
|
+
)
|
|
621
|
+
async def list_users(
|
|
622
|
+
page: int = Query(1, ge=1, description="Page number"),
|
|
623
|
+
limit: int = Query(20, ge=1, le=100, description="Items per page"),
|
|
624
|
+
status: Optional[UserStatus] = Query(None, description="Filter by status"),
|
|
625
|
+
search: Optional[str] = Query(None, min_length=2, max_length=100),
|
|
626
|
+
):
|
|
627
|
+
"""
|
|
628
|
+
List users with pagination and filtering.
|
|
629
|
+
|
|
630
|
+
- **page**: Page number (1-based)
|
|
631
|
+
- **limit**: Number of items per page (max 100)
|
|
632
|
+
- **status**: Filter by user status
|
|
633
|
+
- **search**: Search by name or email
|
|
634
|
+
"""
|
|
635
|
+
# Implementation
|
|
636
|
+
pass
|
|
637
|
+
|
|
638
|
+
@app.post(
|
|
639
|
+
"/users",
|
|
640
|
+
response_model=User,
|
|
641
|
+
status_code=201,
|
|
642
|
+
tags=["Users"],
|
|
643
|
+
summary="Create a new user",
|
|
644
|
+
responses={
|
|
645
|
+
400: {"model": ErrorResponse},
|
|
646
|
+
409: {"model": ErrorResponse, "description": "Email already exists"},
|
|
647
|
+
},
|
|
648
|
+
)
|
|
649
|
+
async def create_user(user: UserCreate):
|
|
650
|
+
"""Create a new user and send welcome email."""
|
|
651
|
+
pass
|
|
652
|
+
|
|
653
|
+
@app.get(
|
|
654
|
+
"/users/{user_id}",
|
|
655
|
+
response_model=User,
|
|
656
|
+
tags=["Users"],
|
|
657
|
+
summary="Get user by ID",
|
|
658
|
+
responses={404: {"model": ErrorResponse}},
|
|
659
|
+
)
|
|
660
|
+
async def get_user(
|
|
661
|
+
user_id: UUID = Path(..., description="User ID"),
|
|
662
|
+
):
|
|
663
|
+
"""Retrieve a specific user by their ID."""
|
|
664
|
+
pass
|
|
665
|
+
|
|
666
|
+
@app.patch(
|
|
667
|
+
"/users/{user_id}",
|
|
668
|
+
response_model=User,
|
|
669
|
+
tags=["Users"],
|
|
670
|
+
summary="Update user",
|
|
671
|
+
responses={
|
|
672
|
+
400: {"model": ErrorResponse},
|
|
673
|
+
404: {"model": ErrorResponse},
|
|
674
|
+
},
|
|
675
|
+
)
|
|
676
|
+
async def update_user(
|
|
677
|
+
user_id: UUID = Path(..., description="User ID"),
|
|
678
|
+
user: UserUpdate = ...,
|
|
679
|
+
):
|
|
680
|
+
"""Update user attributes."""
|
|
681
|
+
pass
|
|
682
|
+
|
|
683
|
+
@app.delete(
|
|
684
|
+
"/users/{user_id}",
|
|
685
|
+
status_code=204,
|
|
686
|
+
tags=["Users", "Admin"],
|
|
687
|
+
summary="Delete user",
|
|
688
|
+
responses={404: {"model": ErrorResponse}},
|
|
689
|
+
)
|
|
690
|
+
async def delete_user(
|
|
691
|
+
user_id: UUID = Path(..., description="User ID"),
|
|
692
|
+
):
|
|
693
|
+
"""Permanently delete a user."""
|
|
694
|
+
pass
|
|
695
|
+
|
|
696
|
+
# Export OpenAPI spec
|
|
697
|
+
if __name__ == "__main__":
|
|
698
|
+
import json
|
|
699
|
+
print(json.dumps(app.openapi(), indent=2))
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
### Template 3: Code-First (TypeScript/Express with tsoa)
|
|
703
|
+
|
|
704
|
+
```typescript
|
|
705
|
+
// tsoa generates OpenAPI from TypeScript decorators
|
|
706
|
+
|
|
707
|
+
import {
|
|
708
|
+
Controller,
|
|
709
|
+
Get,
|
|
710
|
+
Post,
|
|
711
|
+
Patch,
|
|
712
|
+
Delete,
|
|
713
|
+
Route,
|
|
714
|
+
Path,
|
|
715
|
+
Query,
|
|
716
|
+
Body,
|
|
717
|
+
Response,
|
|
718
|
+
SuccessResponse,
|
|
719
|
+
Tags,
|
|
720
|
+
Security,
|
|
721
|
+
Example,
|
|
722
|
+
} from "tsoa";
|
|
723
|
+
|
|
724
|
+
// Models
|
|
725
|
+
interface User {
|
|
726
|
+
/** Unique identifier */
|
|
727
|
+
id: string;
|
|
728
|
+
/** User email address */
|
|
729
|
+
email: string;
|
|
730
|
+
/** Display name */
|
|
731
|
+
name: string;
|
|
732
|
+
status: UserStatus;
|
|
733
|
+
role: UserRole;
|
|
734
|
+
/** Avatar URL */
|
|
735
|
+
avatar?: string;
|
|
736
|
+
/** Custom metadata */
|
|
737
|
+
metadata?: Record<string, unknown>;
|
|
738
|
+
createdAt: Date;
|
|
739
|
+
updatedAt?: Date;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
enum UserStatus {
|
|
743
|
+
Active = "active",
|
|
744
|
+
Inactive = "inactive",
|
|
745
|
+
Suspended = "suspended",
|
|
746
|
+
Pending = "pending",
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
enum UserRole {
|
|
750
|
+
User = "user",
|
|
751
|
+
Moderator = "moderator",
|
|
752
|
+
Admin = "admin",
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
interface CreateUserRequest {
|
|
756
|
+
email: string;
|
|
757
|
+
name: string;
|
|
758
|
+
role?: UserRole;
|
|
759
|
+
metadata?: Record<string, unknown>;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
interface UpdateUserRequest {
|
|
763
|
+
name?: string;
|
|
764
|
+
status?: UserStatus;
|
|
765
|
+
role?: UserRole;
|
|
766
|
+
metadata?: Record<string, unknown>;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
interface Pagination {
|
|
770
|
+
page: number;
|
|
771
|
+
limit: number;
|
|
772
|
+
total: number;
|
|
773
|
+
totalPages: number;
|
|
774
|
+
hasNext: boolean;
|
|
775
|
+
hasPrev: boolean;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
interface UserListResponse {
|
|
779
|
+
data: User[];
|
|
780
|
+
pagination: Pagination;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
interface ErrorResponse {
|
|
784
|
+
code: string;
|
|
785
|
+
message: string;
|
|
786
|
+
details?: { field: string; message: string }[];
|
|
787
|
+
requestId?: string;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
@Route("users")
|
|
791
|
+
@Tags("Users")
|
|
792
|
+
export class UsersController extends Controller {
|
|
793
|
+
/**
|
|
794
|
+
* List all users with pagination and filtering
|
|
795
|
+
* @param page Page number (1-based)
|
|
796
|
+
* @param limit Items per page (max 100)
|
|
797
|
+
* @param status Filter by user status
|
|
798
|
+
* @param search Search by name or email
|
|
799
|
+
*/
|
|
800
|
+
@Get()
|
|
801
|
+
@Security("bearerAuth")
|
|
802
|
+
@Response<ErrorResponse>(400, "Invalid request")
|
|
803
|
+
@Response<ErrorResponse>(401, "Unauthorized")
|
|
804
|
+
@Example<UserListResponse>({
|
|
805
|
+
data: [
|
|
806
|
+
{
|
|
807
|
+
id: "550e8400-e29b-41d4-a716-446655440000",
|
|
808
|
+
email: "john@example.com",
|
|
809
|
+
name: "John Doe",
|
|
810
|
+
status: UserStatus.Active,
|
|
811
|
+
role: UserRole.User,
|
|
812
|
+
createdAt: new Date("2024-01-15T10:30:00Z"),
|
|
813
|
+
},
|
|
814
|
+
],
|
|
815
|
+
pagination: {
|
|
816
|
+
page: 1,
|
|
817
|
+
limit: 20,
|
|
818
|
+
total: 1,
|
|
819
|
+
totalPages: 1,
|
|
820
|
+
hasNext: false,
|
|
821
|
+
hasPrev: false,
|
|
822
|
+
},
|
|
823
|
+
})
|
|
824
|
+
public async listUsers(
|
|
825
|
+
@Query() page: number = 1,
|
|
826
|
+
@Query() limit: number = 20,
|
|
827
|
+
@Query() status?: UserStatus,
|
|
828
|
+
@Query() search?: string
|
|
829
|
+
): Promise<UserListResponse> {
|
|
830
|
+
// Implementation
|
|
831
|
+
throw new Error("Not implemented");
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Create a new user
|
|
836
|
+
*/
|
|
837
|
+
@Post()
|
|
838
|
+
@Security("bearerAuth")
|
|
839
|
+
@SuccessResponse(201, "Created")
|
|
840
|
+
@Response<ErrorResponse>(400, "Invalid request")
|
|
841
|
+
@Response<ErrorResponse>(409, "Email already exists")
|
|
842
|
+
public async createUser(
|
|
843
|
+
@Body() body: CreateUserRequest
|
|
844
|
+
): Promise<User> {
|
|
845
|
+
this.setStatus(201);
|
|
846
|
+
throw new Error("Not implemented");
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
/**
|
|
850
|
+
* Get user by ID
|
|
851
|
+
* @param userId User ID
|
|
852
|
+
*/
|
|
853
|
+
@Get("{userId}")
|
|
854
|
+
@Security("bearerAuth")
|
|
855
|
+
@Response<ErrorResponse>(404, "User not found")
|
|
856
|
+
public async getUser(
|
|
857
|
+
@Path() userId: string
|
|
858
|
+
): Promise<User> {
|
|
859
|
+
throw new Error("Not implemented");
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Update user attributes
|
|
864
|
+
* @param userId User ID
|
|
865
|
+
*/
|
|
866
|
+
@Patch("{userId}")
|
|
867
|
+
@Security("bearerAuth")
|
|
868
|
+
@Response<ErrorResponse>(400, "Invalid request")
|
|
869
|
+
@Response<ErrorResponse>(404, "User not found")
|
|
870
|
+
public async updateUser(
|
|
871
|
+
@Path() userId: string,
|
|
872
|
+
@Body() body: UpdateUserRequest
|
|
873
|
+
): Promise<User> {
|
|
874
|
+
throw new Error("Not implemented");
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Delete user
|
|
879
|
+
* @param userId User ID
|
|
880
|
+
*/
|
|
881
|
+
@Delete("{userId}")
|
|
882
|
+
@Tags("Users", "Admin")
|
|
883
|
+
@Security("bearerAuth")
|
|
884
|
+
@SuccessResponse(204, "Deleted")
|
|
885
|
+
@Response<ErrorResponse>(404, "User not found")
|
|
886
|
+
public async deleteUser(
|
|
887
|
+
@Path() userId: string
|
|
888
|
+
): Promise<void> {
|
|
889
|
+
this.setStatus(204);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
### Template 4: Validation & Linting
|
|
895
|
+
|
|
896
|
+
```bash
|
|
897
|
+
# Install validation tools
|
|
898
|
+
npm install -g @stoplight/spectral-cli
|
|
899
|
+
npm install -g @redocly/cli
|
|
900
|
+
|
|
901
|
+
# Spectral ruleset (.spectral.yaml)
|
|
902
|
+
cat > .spectral.yaml << 'EOF'
|
|
903
|
+
extends: ["spectral:oas", "spectral:asyncapi"]
|
|
904
|
+
|
|
905
|
+
rules:
|
|
906
|
+
# Enforce operation IDs
|
|
907
|
+
operation-operationId: error
|
|
908
|
+
|
|
909
|
+
# Require descriptions
|
|
910
|
+
operation-description: warn
|
|
911
|
+
info-description: error
|
|
912
|
+
|
|
913
|
+
# Naming conventions
|
|
914
|
+
operation-operationId-valid-in-url: true
|
|
915
|
+
|
|
916
|
+
# Security
|
|
917
|
+
operation-security-defined: error
|
|
918
|
+
|
|
919
|
+
# Response codes
|
|
920
|
+
operation-success-response: error
|
|
921
|
+
|
|
922
|
+
# Custom rules
|
|
923
|
+
path-params-snake-case:
|
|
924
|
+
description: Path parameters should be snake_case
|
|
925
|
+
severity: warn
|
|
926
|
+
given: "$.paths[*].parameters[?(@.in == 'path')].name"
|
|
927
|
+
then:
|
|
928
|
+
function: pattern
|
|
929
|
+
functionOptions:
|
|
930
|
+
match: "^[a-z][a-z0-9_]*$"
|
|
931
|
+
|
|
932
|
+
schema-properties-camelCase:
|
|
933
|
+
description: Schema properties should be camelCase
|
|
934
|
+
severity: warn
|
|
935
|
+
given: "$.components.schemas[*].properties[*]~"
|
|
936
|
+
then:
|
|
937
|
+
function: casing
|
|
938
|
+
functionOptions:
|
|
939
|
+
type: camel
|
|
940
|
+
EOF
|
|
941
|
+
|
|
942
|
+
# Run Spectral
|
|
943
|
+
spectral lint openapi.yaml
|
|
944
|
+
|
|
945
|
+
# Redocly config (redocly.yaml)
|
|
946
|
+
cat > redocly.yaml << 'EOF'
|
|
947
|
+
extends:
|
|
948
|
+
- recommended
|
|
949
|
+
|
|
950
|
+
rules:
|
|
951
|
+
no-invalid-media-type-examples: error
|
|
952
|
+
no-invalid-schema-examples: error
|
|
953
|
+
operation-4xx-response: warn
|
|
954
|
+
request-mime-type:
|
|
955
|
+
severity: error
|
|
956
|
+
allowedValues:
|
|
957
|
+
- application/json
|
|
958
|
+
response-mime-type:
|
|
959
|
+
severity: error
|
|
960
|
+
allowedValues:
|
|
961
|
+
- application/json
|
|
962
|
+
- application/problem+json
|
|
963
|
+
|
|
964
|
+
theme:
|
|
965
|
+
openapi:
|
|
966
|
+
generateCodeSamples:
|
|
967
|
+
languages:
|
|
968
|
+
- lang: curl
|
|
969
|
+
- lang: python
|
|
970
|
+
- lang: javascript
|
|
971
|
+
EOF
|
|
972
|
+
|
|
973
|
+
# Run Redocly
|
|
974
|
+
redocly lint openapi.yaml
|
|
975
|
+
redocly bundle openapi.yaml -o bundled.yaml
|
|
976
|
+
redocly preview-docs openapi.yaml
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
## SDK Generation
|
|
980
|
+
|
|
981
|
+
```bash
|
|
982
|
+
# OpenAPI Generator
|
|
983
|
+
npm install -g @openapitools/openapi-generator-cli
|
|
984
|
+
|
|
985
|
+
# Generate TypeScript client
|
|
986
|
+
openapi-generator-cli generate \
|
|
987
|
+
-i openapi.yaml \
|
|
988
|
+
-g typescript-fetch \
|
|
989
|
+
-o ./generated/typescript-client \
|
|
990
|
+
--additional-properties=supportsES6=true,npmName=@myorg/api-client
|
|
991
|
+
|
|
992
|
+
# Generate Python client
|
|
993
|
+
openapi-generator-cli generate \
|
|
994
|
+
-i openapi.yaml \
|
|
995
|
+
-g python \
|
|
996
|
+
-o ./generated/python-client \
|
|
997
|
+
--additional-properties=packageName=api_client
|
|
998
|
+
|
|
999
|
+
# Generate Go client
|
|
1000
|
+
openapi-generator-cli generate \
|
|
1001
|
+
-i openapi.yaml \
|
|
1002
|
+
-g go \
|
|
1003
|
+
-o ./generated/go-client
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
## Best Practices
|
|
1007
|
+
|
|
1008
|
+
### Do's
|
|
1009
|
+
- **Use $ref** - Reuse schemas, parameters, responses
|
|
1010
|
+
- **Add examples** - Real-world values help consumers
|
|
1011
|
+
- **Document errors** - All possible error codes
|
|
1012
|
+
- **Version your API** - In URL or header
|
|
1013
|
+
- **Use semantic versioning** - For spec changes
|
|
1014
|
+
|
|
1015
|
+
### Don'ts
|
|
1016
|
+
- **Don't use generic descriptions** - Be specific
|
|
1017
|
+
- **Don't skip security** - Define all schemes
|
|
1018
|
+
- **Don't forget nullable** - Be explicit about null
|
|
1019
|
+
- **Don't mix styles** - Consistent naming throughout
|
|
1020
|
+
- **Don't hardcode URLs** - Use server variables
|
|
1021
|
+
|
|
1022
|
+
## Resources
|
|
1023
|
+
|
|
1024
|
+
- [OpenAPI 3.1 Specification](https://spec.openapis.org/oas/v3.1.0)
|
|
1025
|
+
- [Swagger Editor](https://editor.swagger.io/)
|
|
1026
|
+
- [Redocly](https://redocly.com/)
|
|
1027
|
+
- [Spectral](https://stoplight.io/open-source/spectral)
|