PluginBench
Skill
Official
Pass
Audit score 90

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
Prerequisites
  • 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
Claude Code
Cursor
Windsurf
Cline

How to use provider-docs

  1. 1.Confirm which provider objects (resources, data sources, functions, etc.) need documentation
  2. 2.Write or update schema field descriptions to be user-facing and precise
  3. 3.Create or update template files in docs/ using HashiCorp paths (docs/resources/, docs/data-sources/, etc.)
  4. 4.Place HCL examples in examples/ directory—one per file, referenced in templates with tffile
  5. 5.Run tfplugindocs generate to create markdown from schemas and templates
  6. 6.Validate generated docs: verify files match implementation, examples are valid HCL, and required/optional/computed semantics match schema
  7. 7.Apply Registry rules: use semantic version tags (v1.2.3), tag from default branch, include terraform-registry-manifest.json
  8. 8.Preview or publish docs to Terraform Registry

Use cases

Good for
  • 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
Who it's for
  • Terraform provider developers
  • DevOps engineers maintaining provider documentation
  • Contributors to HashiCorp or community Terraform providers
  • Teams preparing providers for Registry publication

provider-docs FAQ

When should I write schema descriptions vs. template content?

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.

Where should I put HCL examples?

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.

What happens if my docs don't appear in Terraform Registry after release?

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.

How do I validate my generated documentation?

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.

Do I need to manually write argument and attribute documentation?

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

  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.