provider-docs

Create, update, and review Terraform provider documentation for Terraform Registry using HashiCorp-recommended patterns, tfplugindocs templates, and schema…

npx skills add https://github.com/hashicorp/agent-skills --skill provider-docs

Terraform Provider Docs

Follow This Workflow

  1. Confirm scope and documentation targets.
  • Map code changes to the exact doc targets: provider index, resources, data sources, ephemeral resources, list resources, functions, actions, or guides.
  • Decide whether content should come from schema descriptions, templates, or both.
  1. Write schema descriptions first.
  • Add precise user-facing descriptions to schema fields so generated docs stay aligned with behavior.
  • Keep wording specific to argument purpose, constraints, defaults, and computed behavior.
  1. Add or update template files in docs/.
  • Create only files that map to implemented provider objects.
  • Use HashiCorp-recommended template paths:
    • docs/index.md.tmpl
    • docs/data-sources/<name>.md.tmpl
    • docs/resources/<name>.md.tmpl
    • docs/ephemeral-resources/<name>.md.tmpl
    • docs/list-resources/<name>.md.tmpl
    • docs/functions/<name>.md.tmpl
    • docs/actions/<name>.md.tmpl (tfplugindocs generates action docs with Terraform v1.14.0+)
    • docs/guides/<name>.md.tmpl
  • Keep templates focused on overview and examples; rely on generated sections for field-by-field details.
  • Keep HCL examples in the examples/ directory — one example per file, pulled into templates with tffile — rather than inlined in templates (see Example File Conventions in references/hashicorp-provider-docs.md). Examples must not contain terraform, provider, or output blocks.
  • For action pages, follow the structure in references/hashicorp-provider-docs.md (Action Pages section): examples must show both the action block and the action_trigger lifecycle wiring, and actions get no attribute/output section.
  1. Generate documentation with tfplugindocs.
  • Prefer repository defaults when configured:
go generate ./...
  • Otherwise run the generator directly:
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name <provider_name>
  • Re-run generation after every schema or template edit.
  1. Validate the generated markdown.
  • Verify files in docs/ match the current provider implementation.
  • Verify examples are valid HCL and reflect current argument/attribute names.
  • Verify required/optional/computed semantics in docs match schema behavior.
  1. Apply Registry publication rules before release.
  • Use semantic version tags prefixed with v (for example v1.2.3).
  • Create release tags from the default branch.
  • Keep terraform-registry-manifest.json in the repository root.
  • Expect docs to be versioned in Registry and switchable with the version selector.
  1. Preview or troubleshoot publication when needed.
  • Use the HashiCorp preview process to inspect rendered docs before release when accuracy risk is high.
  • If docs are missing in Registry, check tag format, tag source branch, manifest file presence, and provider publication status.

Enforce Quality Bar

  • Keep documentation behaviorally accurate; never describe unsupported arguments or attributes.
  • Keep examples minimal, realistic, and runnable.
  • Keep terminology and naming consistent across provider, resources, and data sources.
  • Avoid duplicating generated argument/attribute blocks in manual templates.
  • Keep doc changes tied to the same PR as schema/API changes whenever possible.

Load References On Demand

  • Read references/hashicorp-provider-docs.md for source-backed rules and official links.
  • Load only the sections needed for the current change to keep context lean.

More skills from hashicorp

provider-actions
hashicorp
Implement Terraform Provider actions using the Plugin Framework. Use when developing imperative operations that execute at lifecycle events (before/after…
official
new-terraform-provider
hashicorp
Use this when scaffolding a new Terraform provider with the Plugin Framework: workspace layout, go module setup, provider server main.go, and a provider.go…
official
terraform-test
hashicorp
Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating…
official
terraform-test
hashicorp
Comprehensive guide for writing and running Terraform tests with assertions, mocking, and module validation. Write test files using .tftest.hcl syntax with run blocks that execute in plan or apply mode, supporting sequential and parallel execution with optional state isolation Assert conditions on resource attributes, outputs, and data sources; use expect_failures to validate that invalid inputs are properly rejected Mock providers (Terraform 1.7.0+) simulate infrastructure behavior without...
official
provider-actions
hashicorp
Implement imperative Terraform Provider actions at resource lifecycle events using the Plugin Framework. Supports before/after create and before/after update lifecycle triggers (destroy events not available in Terraform 1.14.0) Requires proper schema definition with correct framework types, ElementType for collections, and validators for input validation Includes progress reporting, timeout management, and comprehensive error handling for long-running operations Implements polling and...
official
aws-ami-builder
hashicorp
Build custom Amazon Machine Images with Packer's amazon-ebs builder. Automates AMI creation from source AMIs using HCL templates with provisioners for customization (shell scripts, file uploads, configuration management) Supports multi-region AMI distribution via ami_regions and flexible source AMI filtering by name, owner, and virtualization type Authenticates via environment variables, AWS credentials file, or IAM instance profiles; includes validation and build commands for template...
official
new-terraform-provider
hashicorp
Scaffold a new Terraform provider using the Plugin Framework. Generates a new Go module workspace with the standard "terraform-provider-" naming convention and initializes required dependencies Provides a template main.go file following HashiCorp's Plugin Framework patterns, with TODO markers for customization Validates the setup by running build and test commands to ensure the provider compiles and passes initial checks Handles workspace management by confirming intent before creating a new...
official
azure-verified-modules
hashicorp
Certification requirements and best practices for Azure Terraform modules seeking AVM compliance. Enforces provider version constraints (azurerm >= 4.0, < 5.0; azapi >= 2.0, < 3.0) and prohibits git-based module references in favor of pinned Terraform registry sources Mandates lower snake_casing for all identifiers, precise variable types, discrete output attributes via anti-corruption layer pattern, and alphabetically ordered locals Requires feature toggle variables for new resources added...
official