hashicorp/agent-skills

new-terraform-provider

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 with schema and Configure.

View source

How to use

  1. Copy the installation command and review the source package before installing it in your own agent environment.
  2. Check the source document for required tools, credentials and supported hosts.
  3. Describe your input and desired deliverable; review the output against the source material.
npx skills add https://github.com/hashicorp/agent-skills --skill new-terraform-provider

Before you start

  • Installation does not include a model subscription, API allowance or permission to access your files.
  • Repository stars and installation counts describe activity, not an independent quality or security test.
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

To scaffold a new Terraform provider with Plugin Framework:

  1. If I am already in a Terraform provider workspace, then confirm that I want

to create a new workspace. If I do not want to create a new workspace, then skip all remaining steps.

  1. Create a new workspace root directory. The root directory name should be

prefixed with "terraform-provider-". Perform all subsequent steps in this new workspace.

  1. Initialize a new Go module.
  2. Run go get -u github.com/hashicorp/terraform-plugin-framework@latest.
  3. Write a main.go file that follows the example.
  4. Write an internal/provider/provider.go file that follows

the example. Rename the demo provider, the DEMO_* environment variables, and the authentication attributes to match the target API.

  1. Remove TODO comments from main.go and provider.go.
  2. Run go mod tidy
  3. Run go build -o /dev/null
  4. Run go test ./...

The scaffold resolves credentials as explicit config with environment variable fallback. To grow that into a full credential provider chain (shared credentials files, profiles, platform identity, configure-time validation), use the provider-configuration skill (if available). To add the first resource or data source, use the provider-resources skill (if available).

from this repository

More skills

All skills
hashicorp
Official

terraform-style-guide

Generate Terraform HCL code following HashiCorp's official style conventions and best practices. Use when writing, reviewing, or generating Terraform configurations.

1h installs
2
GitHub stars
936
Updated
Nov 4
hashicorp
Official

terraform-test

Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.

1h installs
2
GitHub stars
936
Updated
Nov 4
hashicorp
Official

provider-docs

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.

1h installs
1
GitHub stars
922
Updated
Nov 4
hashicorp
Official

provider-resources

Implement Terraform Provider resources and data sources using the Plugin Framework: CRUD operations, schema design, plan modifiers and validators, not-found handling, waiters for eventually consistent APIs, import support, resource design principles, and required acceptance test coverage. Use when adding or changing a resource or data source, deciding whether an API concept should be a resource, wiring a resource to the provider's configured client, handling drift or resource-not-found, or revie

1h installs
1
GitHub stars
922
Updated
Nov 4