provider-docs
hashicorp/agent-skills
Create and validate Terraform provider documentation for Registry using HashiCorp patterns and tfplugindocs.
What is provider-docs?
This skill guides you through writing and maintaining Terraform provider documentation for the Terraform Registry. Use it when adding or modifying provider resources, data sources, functions, actions, or guides—from schema descriptions through template creation to validation and publication.
- Map code changes to documentation targets (resources, data sources, ephemeral resources, functions, actions, guides)
- Write schema descriptions that auto-generate field documentation
- Create and update template files in HashiCorp-recommended directory structure
- Generate documentation using tfplugindocs and validate output
- Verify examples are valid HCL and match current argument/attribute names
- Apply Registry publication rules and troubleshoot missing docs
How to install provider-docs
npx skills add https://github.com/hashicorp/agent-skills --skill provider-docs- Terraform provider codebase with schema definitions
- tfplugindocs installed (via go generate or direct invocation)
- Understanding of Terraform provider structure (resources, data sources, etc.)
- Access to provider repository and documentation directory
How to use provider-docs
- 1.Confirm which provider objects (resources, data sources, functions, etc.) need documentation
- 2.Write or update schema field descriptions to be user-facing and precise
- 3.Create or update template files in docs/ using HashiCorp paths (docs/resources/, docs/data-sources/, etc.)
- 4.Place HCL examples in examples/ directory—one per file, referenced in templates with tffile
- 5.Run tfplugindocs generate to create markdown from schemas and templates
- 6.Validate generated docs: verify files match implementation, examples are valid HCL, and required/optional/computed semantics match schema
- 7.Apply Registry rules: use semantic version tags (v1.2.3), tag from default branch, include terraform-registry-manifest.json
- 8.Preview or publish docs to Terraform Registry
Use cases
- Adding a new resource or data source to a Terraform provider
- Updating schema descriptions to improve auto-generated documentation
- Creating provider guides and examples for Registry publication
- Validating generated docs match implementation before release
- Troubleshooting missing or incorrect documentation in Terraform Registry
- Terraform provider developers
- DevOps engineers maintaining provider documentation
- Contributors to HashiCorp or community Terraform providers
- Teams preparing providers for Registry publication
provider-docs FAQ
Write schema descriptions first for all field-level details (purpose, constraints, defaults, computed behavior). Use templates for overview, examples, and narrative guidance. Generated sections auto-populate from schema; avoid duplicating them in templates.
Store examples in the examples/ directory—one example per file. Reference them in templates using tffile. Examples must not contain terraform, provider, or output blocks.
Check that you used semantic version tags prefixed with v (e.g., v1.2.3), tagged from the default branch, included terraform-registry-manifest.json in the repo root, and that the provider is published to Registry.
Run tfplugindocs generate, then verify files in docs/ match your provider implementation, examples are valid HCL with current argument names, and required/optional/computed semantics match your schema.
No. tfplugindocs auto-generates argument and attribute sections from your schema descriptions. Focus templates on overview, examples, and guides instead.
Full instructions (SKILL.md)
Source of truth, from hashicorp/agent-skills.
name: provider-docs description: Create, update, and review Terraform provider documentation for Terraform Registry using HashiCorp-recommended patterns, tfplugindocs templates, and schema descriptions. Use when adding or changing provider configuration, resources, data sources, ephemeral resources, list resources, functions, actions, or guides; when validating generated docs; and when troubleshooting missing or incorrect Registry documentation. metadata: lifecycle-status: active
Terraform Provider Docs
Follow This Workflow
- 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.
- 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.
- Add or update template files in
docs/.
- Create only files that map to implemented provider objects.
- Use HashiCorp-recommended template paths:
docs/index.md.tmpldocs/data-sources/<name>.md.tmpldocs/resources/<name>.md.tmpldocs/ephemeral-resources/<name>.md.tmpldocs/list-resources/<name>.md.tmpldocs/functions/<name>.md.tmpldocs/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 withtffile— rather than inlined in templates (see Example File Conventions inreferences/hashicorp-provider-docs.md). Examples must not containterraform,provider, oroutputblocks. - For action pages, follow the structure in
references/hashicorp-provider-docs.md(Action Pages section): examples must show both theactionblock and theaction_triggerlifecycle wiring, and actions get no attribute/output section.
- 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.
- 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.
- Apply Registry publication rules before release.
- Use semantic version tags prefixed with
v(for examplev1.2.3). - Create release tags from the default branch.
- Keep
terraform-registry-manifest.jsonin the repository root. - Expect docs to be versioned in Registry and switchable with the version selector.
- 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.mdfor source-backed rules and official links. - Load only the sections needed for the current change to keep context lean.
Related skills
More from hashicorp/agent-skills and the wider catalog.

provider-resources
Implement Terraform Provider resources and data sources using the Plugin Framework with CRUD operations, schema design, and acceptance tests.

provider-test-patterns
Terraform provider acceptance test patterns using terraform-plugin-testing with the Plugin Framework.

push-to-registry
Push Packer build metadata to HCP Packer registry for image lifecycle tracking and governance.

refactor-module
Transform monolithic Terraform configurations into reusable, maintainable modules following HashiCorp best practices.

run-acceptance-tests
Run and diagnose Terraform provider acceptance tests with proper environment setup and debugging.

terraform-search-import
Discover and bulk import existing cloud resources into Terraform using declarative search queries.