Token导航 LogoToken导航TokenDH.com
开发规范执行命令github未标认证来源可访问clear审计未展示

sdk-tf-generation-best-practicesSDK TF generation 最佳实践

Agent Skill

sdk-tf-generation-best-practices 用于补充开发规范相关能力,适合在 Codex、Claude、Cursor、Gemini CLI 中需要让 Agent 承接开发规范相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

533

周安装

22

GitHub Stars

公开资料未说明

下载量

174
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sdk-tf-generation-best-practices(SDK TF generation 最佳实践)
来源仓库:https://github.com/speakeasy-api/skills
仓库路径:skills/sdk-tf-generation-best-practices
安装命令:
npx skills add speakeasy-api/skills --skill "sdk-tf-generation-best-practices"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add speakeasy-api/skills --skill "sdk-tf-generation-best-practices"

简介

sdk-tf-generation-best-practices 用于补充开发规范相关能力,适合在 Codex、Claude、Cursor、Gemini CLI 中需要让 Agent 承接开发规范相关任务时使用。

  • 适用于 SDK 生成、Terraform 配置和开发流程标准化场景。
  • 通过 npx skills add speakeasy-api/skills --skill "sdk-tf-generation-best-practices" 安装,需确认权限范围。
  • 建议结合原始 README 核验具体用法,注意维护状态和命令执行权限。
  • 使用前请检查是否会触发文件读写或外部服务调用,确保符合安全策略。

SKILL.md

name
sdk-tf-generation-best-practices
description
>-
license
Apache-2.0

sdk-tf-generation-best-practices

Comprehensive best-practices reference for generating SDKs and Terraform providers with Speakeasy. Covers the full lifecycle: OpenAPI spec preparation, code-first extraction, generation workflows, language-specific guides, customization, and testing.

When to Use

  • Generating an SDK from an OpenAPI spec
  • Generating a Terraform provider from an OpenAPI spec
  • Generating an MCP server from an OpenAPI spec
  • Extracting an OpenAPI spec from existing code (FastAPI, Flask, Django, Spring Boot, NestJS, Hono, Rails, Laravel)
  • Customizing SDK generation (hooks, auth, error handling, retries, pagination)
  • Fixing OpenAPI validation errors or applying overlays
  • Testing generated SDKs (integration, contract, Arazzo)
  • Understanding language-specific SDK patterns (TypeScript, Python, Go, Java, C#, Ruby, PHP)
  • Upgrading or bumping the Speakeasy CLI version in workflow.yaml
  • Regenerating an SDK after spec or version changes
  • Customizing SDK README documentation
  • Adding examples to an OpenAPI spec via overlays
  • Testing generated SDK endpoints
  • User says: "generate SDK", "regenerate SDK", "update SDK", "SDK best practices", "terraform provider", "generate MCP server", "SDK customization", "SDK testing", "test my SDK", "upgrade speakeasy", "bump version", "SDK readme", "SDK documentation", "add examples to spec"

How to Use

This skill contains detailed guides in the content/ subdirectory relative to this file. Read the specific guide for the user's task rather than trying to answer from this index alone.

These guides are also accessible via the Speakeasy CLI:

speakeasy agent context [path]

To find the right guide, use the routing table below or the decision tree.

Quick Routing Table

What are you trying to do?

GoalStart Here
Generate an SDK from an OpenAPI speccontent/plans/sdk-generation.md
Generate a Terraform providercontent/plans/tf-provider-generation.md
Extract OpenAPI from existing codecontent/code-first/[framework].md
Fix OpenAPI validation errorscontent/spec-first/validation.md
Customize SDK generationcontent/sdk-customization/
Generate multiple SDK variants (Azure, GCP, etc.)content/sdk-customization/multi-target-sdks.md
Set up a multi-SDK monorepocontent/plans/sdk-generation.md#advanced-multi-sdk-monorepos
Use overlay recipes (open enums, global headers)content/spec-first/overlays.md#overlay-recipes
Use multi-overlay workflowscontent/spec-first/overlays.md#multi-overlay-workflow-patterns
Track overlay changes with metadatacontent/spec-first/overlays.md#overlay-metadata-tracking
Implement custom security (HMAC, signatures)content/spec-first/overlays.md#custom-security-schemes-via-overlay
Add SDK hooks (user-agent, telemetry)content/sdk-customization/hooks.md
Implement HTTP signature authenticationcontent/sdk-customization/hooks.md#custom-security-hook-http-signature-authentication
Configure SDK retries, timeouts, paginationcontent/sdk-customization/runtime-configuration.md
Configure SDK authentication and securitycontent/sdk-customization/authentication-config.md
Customize SDK error handlingcontent/sdk-customization/error-handling.md
Persist custom code changes across regenerationscontent/sdk-customization/custom-code.md
Generate MCP server for AI assistantscontent/sdk-customization/mcp-server.md
Orchestrate multi-repo SDK generationcontent/sdk-customization/multi-repo-workflows.md
Understand SDK language specificscontent/sdk-languages/[language].md
Add custom utilities to Python SDKscontent/sdk-languages/python.md#extending-the-sdk-with-sidecar-utilities
Publish Java SDK to Maven Centralcontent/sdk-languages/java.md#maven-central-publishing
Add custom code to TypeScript SDKscontent/sdk-languages/typescript.md#custom-code-regions
Publish TypeScript SDK to JSR (Deno)content/sdk-languages/typescript.md#jsr-deno-publishing
Configure Ruby SDK with Sorbet typingcontent/sdk-languages/ruby.md#sorbet-type-checking
Publish Ruby SDK to RubyGemscontent/sdk-languages/ruby.md#rubygems-publishing
Configure PHP SDK with Laravel integrationcontent/sdk-languages/php.md#laravel-integration
Publish PHP SDK to Packagistcontent/sdk-languages/php.md#publishing-to-packagist
Generate Go SDK with interfaces for testingcontent/sdk-languages/go.md#interface-generation
Use Go SDK in Kubernetes operatorscontent/sdk-languages/go.md#kubernetes-operator-integration
Set up SDK integration testscontent/sdk-testing/integration-testing.md
Configure Arazzo API testingcontent/sdk-testing/arazzo-testing.md
Disable tests for specific endpointscontent/sdk-testing/arazzo-testing.md#disabling-tests-via-overlay
Run AI-powered contract testscontent/sdk-testing/contract-testing.md
Fix ResponseValidationError at runtimecontent/sdk-testing/contract-testing.md
Validate spec matches live APIcontent/spec-first/validation.md#dynamic-validation-contract-testing
Upgrade Speakeasy version in workflow.yamlcontent/plans/sdk-generation.md#version-management
Bump pinned speakeasyVersion to latestcontent/plans/sdk-generation.md#version-management
Regenerate SDK after spec or version changecontent/plans/sdk-generation.md
Customize SDK README with documentationcontent/sdk-customization/readme-customization.md
Add branding, examples, or guides to SDK READMEcontent/sdk-customization/readme-customization.md
Add examples to OpenAPI spec via overlaycontent/spec-first/overlays.md#add-examples
Add API-response-based examples to speccontent/spec-first/overlays.md#add-examples
Test SDK against live APIcontent/sdk-testing/integration-testing.md
Run contract tests for generated SDKcontent/sdk-testing/contract-testing.md

Directory Structure

content/
├── INDEX.md                    # This index (SKILL.md)
├── plans/                      # Decision trees for workflows
│   ├── sdk-generation.md       # Full SDK generation workflow
│   └── tf-provider-generation.md
├── code-first/                 # Extract OpenAPI from code
│   ├── fastapi.md
│   ├── flask.md
│   ├── django.md
│   ├── spring-boot.md
│   ├── nestjs.md
│   ├── hono.md
│   ├── rails.md
│   └── laravel.md
├── spec-first/                 # OpenAPI validation and fixes
│   ├── validation.md
│   ├── overlays.md             # OpenAPI overlays and recipes
│   ├── security-schemes.md
│   ├── pagination.md
│   └── schemas.md
├── sdk-languages/              # Language-specific SDK guides
│   ├── python.md
│   ├── typescript.md           # TS: code regions, extra modules, Zod
│   ├── go.md                   # Go: hooks, interfaces, mocks, K8s
│   ├── java.md
│   ├── csharp.md
│   ├── ruby.md                 # Ruby: Sorbet typing, RubyGems publishing
│   └── php.md
├── sdk-customization/          # Cross-language SDK customization
│   ├── hooks.md                # SDK hooks (UA, telemetry, custom security)
│   ├── runtime-configuration.md # Retries, timeouts, pagination, servers
│   ├── authentication-config.md # Global/per-op security, env vars
│   ├── error-handling.md       # Custom error classes and schemas
│   ├── custom-code.md          # Persist changes across regenerations
│   ├── multi-target-sdks.md    # Multiple variants from one repo
│   ├── multi-repo-workflows.md # Cross-repo SDK orchestration (CI/CD)
│   ├── mcp-server.md           # MCP server for AI assistant integration
│   └── readme-customization.md # SDK README branding
├── sdk-testing/                # SDK testing patterns
│   ├── integration-testing.md  # Integration test infrastructure
│   ├── arazzo-testing.md       # Arazzo API testing format
│   └── contract-testing.md     # AI-powered contract testing
├── terraform/                  # Terraform provider specifics
│   ├── crud-mapping.md
│   ├── customization.md
│   ├── testing-guide.md
│   └── publishing.md
└── CLI_REFERENCE.md            # Canonical CLI command documentation

Decision Tree: Where to Start

START
  │
  ├─ Do you have an OpenAPI/Swagger spec?
  │    │
  │    ├─ YES ──► Is the spec valid?
  │    │           │
  │    │           ├─ YES ──► What do you want to generate?
  │    │           │           │
  │    │           │           ├─ SDK ──► plans/sdk-generation.md
  │    │           │           └─ Terraform Provider ──► plans/tf-provider-generation.md
  │    │           │
  │    │           └─ NO/UNSURE ──► spec-first/validation.md
  │    │
  │    └─ NO ──► Do you have API code?
  │               │
  │               ├─ YES ──► What framework?
  │               │           ├─ FastAPI ──► code-first/fastapi.md
  │               │           ├─ Flask ──► code-first/flask.md
  │               │           ├─ Django ──► code-first/django.md
  │               │           ├─ Spring Boot ──► code-first/spring-boot.md
  │               │           ├─ NestJS ──► code-first/nestjs.md
  │               │           ├─ Hono ──► code-first/hono.md
  │               │           ├─ Rails ──► code-first/rails.md
  │               │           └─ Laravel ──► code-first/laravel.md
  │               │
  │               └─ NO ──► Cannot proceed without spec or code

Troubleshooting Tree

PROBLEM
  │
  ├─ Getting ResponseValidationError at runtime?
  │    │
  │    └─ SDK types don't match server responses
  │         ├─ Run contract tests to identify all mismatches
  │         │    → sdk-testing/contract-testing.md
  │         └─ Fix spec or create overlay to correct types
  │              → spec-first/validation.md#dynamic-validation-contract-testing
  │
  ├─ SDK doesn't match live API behavior?
  │    │
  │    ├─ Spec may have drifted from API
  │    │    → Run contract tests to detect drift
  │    │       sdk-testing/contract-testing.md
  │    │
  │    └─ Third-party spec may be inaccurate
  │         → Validate with contract testing before trusting
  │            sdk-testing/contract-testing.md
  │
  ├─ Type mismatch errors in generated SDK?
  │    │
  │    ├─ At compile time ──► Check spec schema definitions
  │    │                       spec-first/validation.md
  │    │
  │    └─ At runtime ──► Server returns unexpected types
  │                      → Contract testing required
  │                         sdk-testing/contract-testing.md
  │
  └─ Enum value not recognized?
       │
       └─ API returned value not in spec enum
            ├─ Add missing value to spec/overlay
            │    → spec-first/overlays.md
            └─ Or use open enums for anti-fragility
                 → spec-first/overlays.md#overlay-recipes

Working with Large OpenAPI Documents

OpenAPI specs can be thousands of lines. Do not load the full spec into context. Use yq (YAML) or jq (JSON) to extract only the sections you need.

# List all paths
yq '.paths | keys' spec.yaml

# Inspect a specific endpoint
yq '.paths["/users/{id}"]' spec.yaml

# List all schema names
yq '.components.schemas | keys' spec.yaml

# Inspect a specific schema
yq '.components.schemas.User' spec.yaml

# Check server URLs
yq '.servers' spec.yaml

# List all operationIds
yq '[.paths[][].operationId // empty] | unique' spec.yaml

# For JSON specs, use jq
jq '.paths | keys' spec.json
jq '.components.schemas.User' spec.json
Note: If yq/jq aren't available, use targeted grep searches instead of copying the full spec into context: ``bash grep -n 'operationId:' spec.yaml grep -n 'x-speakeasy-entity' spec.yaml ``

Common Workflows

Workflow A: First-Time SDK Generation

  1. Read content/plans/sdk-generation.md
  2. Run speakeasy quickstart --skip-interactive --output console -s spec.yaml -t python -o ./sdk
  3. SDK generated in output directory

Workflow B: Existing Codebase → SDK

  1. Identify framework in content/code-first/
  2. Extract OpenAPI spec
  3. Validate with speakeasy lint openapi --non-interactive -s spec.yaml
  4. Fix issues using content/spec-first/ guides
  5. Generate SDK via content/plans/sdk-generation.md

Workflow C: SDK Customization

  1. Ensure gen.yaml exists (from quickstart)
  2. Read content/sdk-customization/ guides
  3. Modify gen.yaml
  4. Regenerate with speakeasy run -y --output console

Workflow D: Multi-Target SDK (Azure, GCP, etc.)

  1. Read content/sdk-customization/multi-target-sdks.md
  2. Configure multiple sources in workflow.yaml
  3. Set up target outputs to packages/ subdirectories
  4. Create CI workflows per target

Workflow E: SDK Extensions (Hooks, Custom Methods)

  1. For persistent changes anywhere → content/sdk-customization/custom-code.md
  2. For cross-cutting concerns → content/sdk-customization/hooks.md
  3. For predefined extension points → content/sdk-languages/typescript.md#custom-code-regions
  4. For complex logic → content/sdk-languages/typescript.md#extra-modules-pattern

Workflow F: Upgrade and Regenerate

  1. Check current speakeasyVersion in .speakeasy/workflow.yaml
  2. Update speakeasyVersion to latest or a specific version → content/plans/sdk-generation.md#version-management
  3. Regenerate with speakeasy runcontent/plans/sdk-generation.md
  4. Test the regenerated SDK → content/sdk-testing/integration-testing.md or content/sdk-testing/contract-testing.md
  5. Commit changes

Essential CLI Commands

CommandPurpose
speakeasy quickstart --skip-interactive --output console -s spec.yaml -t python -o ./sdkNon-interactive SDK setup
speakeasy run -y --output consoleRegenerate SDK from gen.yaml
speakeasy lint openapi --non-interactive -s spec.yamlValidate OpenAPI spec
speakeasy auth loginAuthenticate with Speakeasy

Getting Help

  • Authentication issues: Run speakeasy auth login
  • Validation errors: See content/spec-first/validation.md
  • Unsupported feature: Check language guide in content/sdk-languages/
  • CLI errors: See content/CLI_REFERENCE.md or run speakeasy --help

Providing Feedback

If you encounter missing documentation, unclear instructions, or incorrect examples in this agent context, submit feedback directly:

# General feedback
speakeasy agent feedback -m "Description of the issue or suggestion"

# Feedback about a specific document
speakeasy agent feedback -m "Description of the issue" --context-path "path/to/document.md"

Feedback helps improve these documents for all agents. Submit feedback when:

  • A guide is missing steps needed to complete a task
  • An example does not work as documented
  • A CLI command behaves differently than described
  • You cannot find documentation for a supported feature

Related Skills

  • start-new-sdk-project - Quick interactive setup with speakeasy quickstart
  • regenerate-sdk - Re-run generation after config changes
  • validate-openapi-spec - Lint and validate OpenAPI specs
  • diagnose-generation-failure - Troubleshoot failed generation runs
  • create-openapi-overlay - Create overlays for spec customization
  • fix-validation-errors-with-overlays - Fix lint errors with overlays

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

29.23%
按下载量换算51

windsurf

22.18%
按下载量换算39

OpenCode

15.76%
按下载量换算27

Cursor

12.55%
按下载量换算22

Codex

7.01%
按下载量换算12

github-copilot

2.88%
按下载量换算5

安全审计

暂无安全审计结果可展示。

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add speakeasy-api/skills --skill "sdk-tf-generation-best-practices" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills