Generated banner for Provider Docs
Generated logo for Provider Docs

Provider Docs

HashiCorpOfficialPublished by HashiCorp

  • Skill
  • Content generator
  • Cloud and DevOps
  • MPL-2.0
  • No issues found

From the author

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.
— the description by HashiCorp

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a standardized process for authoring, generating, and validating documentation for Terraform providers. It focuses on using HashiCorp-recommended patterns and the tfplugindocs tool to ensure documentation remains synchronized with provider schema changes. The workflow covers the lifecycle from writing schema descriptions and template files to generating markdown and preparing for Registry publication.

What it does

  • Maps provider code changes to documentation targets like resources, data sources, and actions.
  • Guides the creation of template files in the docs/ directory.
  • Standardizes the inclusion of HCL examples from the examples/ directory.
  • Automates documentation generation using tfplugindocs.
  • Provides validation steps to ensure docs match schema behavior.
  • Outlines requirements for Registry publication including versioning and manifest management.

When to use it

  • When adding or updating provider configuration, resources, or data sources.
  • When implementing new ephemeral resources, list resources, functions, or actions.
  • When troubleshooting missing or incorrect documentation on the Terraform Registry.
  • When preparing a provider release for publication.

Advantages

  • Ensures documentation stays aligned with actual provider schema definitions.
  • Promotes consistent documentation structure across different provider objects.
  • Separates HCL examples from documentation templates for better maintainability.
  • Supports automated generation to reduce manual documentation overhead.

Usage examples

“How do I document a new resource for my Terraform provider?”
The agent will guide you to add schema descriptions, create a corresponding .md.tmpl file in docs/resources/, add a minimal HCL example in examples/resources/, and run go generate to produce the final documentation.
“My provider documentation is missing from the Registry, what should I check?”
The agent will help you verify your semantic version tags, the presence of the terraform-registry-manifest.json file, and ensure the tag was created from the default branch.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/hashicorp/provider-docs/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip provider-docs.zip -d .agents/skills

Documentation by HashiCorp

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.

Files

references/hashicorp-provider-docs.md

HashiCorp Provider Documentation Reference

Source of truth for this skill:

Core Rules

  • Publish provider docs through Terraform Registry using tfplugindocs.

  • Generate provider docs from schema descriptions and markdown templates.

  • Store templates under the repository docs/ directory with expected naming conventions.

  • Keep release tags and manifest metadata valid so Registry can render and display docs.

Template Paths

Use these template paths when the corresponding provider objects exist:

  • 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

  • docs/guides/<name>.md.tmpl

The Registry renders action pages from docs/actions/<action>.md, and tfplugindocs generates action documentation (including missing template scaffolds) with Terraform v1.14.0+. Action example files follow the convention examples/actions/<action_type>/action*.tf.

Example File Conventions

Keep example HCL in the examples/ directory and pull it into templates, instead of inlining HCL in .tmpl files:

examples/
├── provider/provider.tf                      # provider block for the index page only
├── resources/<type>/resource.tf              # picked up by generated templates
├── data-sources/<type>/data-source.tf
└── actions/<type>/action.tf
  • One example per file, referenced from templates with {{ tffile "examples/resources/examplecloud_widget/resource.tf" }} — named variants get their own files (resource-with-tags.tf), each behind its own heading in the template.

  • No terraform, provider, or output blocks in resource, data source, or action examples. Version constraints and provider configuration belong on the provider index page only; outputs distract from the object being documented. (The one exception is examples/provider/provider.tf, which exists to show provider configuration.)

  • Keep each example minimal, runnable, and formatted with terraform fmt — generated docs render the file verbatim.

Generation Workflow

HashiCorp recommends wiring generator execution through go generate:

//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name <provider_name>

Run from repository root:

go generate ./...

Alternative direct execution:

go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-name <provider_name>

Action Pages

Structure modeled on the largest production example, terraform-provider-aws (website/docs/actions/ — hand-written there because that provider predates tfplugindocs action support; new providers should generate instead):

  • One page per action. H1 uses an Action: prefix — # Action: examplecloud_restart_widget — parallel to # Resource: / # Data Source: on sibling pages.

  • Intro paragraph states what the action does and whether it is synchronous or asynchronous, then links to the upstream service documentation for the operation it invokes.

  • ## Example Usage starts with ### Basic Usage and must show both halves of using an action: the action block and the resource-side lifecycle { action_trigger { ... } } wiring — an action example without a trigger is not runnable:

    action "examplecloud_restart_widget" "example" {
      config {
        widget_id = examplecloud_widget.example.id
      }
    }
    
    resource "terraform_data" "trigger" {
      lifecycle {
        action_trigger {
          events  = [after_create, after_update]
          actions = [action.examplecloud_restart_widget.example]
        }
      }
    }
  • ## Argument Reference lists config arguments (either flat, or split into required/optional groups). No attribute/output reference section — actions produce no state, and including one misleads readers.

  • Callout conventions (while actions remain experimental):

    • ~> **Note:** for the preview disclaimer, e.g. "<action> is in alpha. Its interface and behavior may change as the feature evolves, and breaking changes are possible."

    • !> **Warning:** when the action causes changes Terraform does not reconcile (e.g. it mutates a resource whose state attributes will be stale until the next refresh) — name the affected attribute and the consequence.

  • If the repo tracks release notes with go-changelog, new actions use the release-note:new-action entry type.

Release and Publication Constraints

  • Use semantic version tags prefixed with v.

  • Create tags from the default branch.

  • Keep terraform-registry-manifest.json in the repository root.

  • Understand docs appear by provider version in Registry once the provider release is published.

Preview and Troubleshooting

  • Use HashiCorp's preview process to verify rendering before release when needed.

  • If docs are missing or stale in Registry, verify:

    • tag naming and tag branch source

    • manifest file presence and validity

    • provider version publication state

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
HashiCorp
Publisher
HashiCorp (Official)
Source
hashicorp/agent-skills · plugins/terraform/skills/provider-docs · commit 5e30fa5
Licence
Mozilla Public License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by HashiCorp or HashiCorp.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download provider-docs.zip