
New Terraform Provider
Scaffold a new HashiCorp Terraform Plugin Framework provider repo with Go module, main.go, tidy, build, and test steps so your agent does not miss HashiCorp conventions.
Install
npx skills add https://github.com/hashicorp/agent-skills --skill new-terraform-providerWhat is this skill?
- Step-by-step scaffold: workspace naming, Go module, Plugin Framework dependency
- Pins terraform-plugin-framework via go get -u @latest
- Bootstraps main.go from the bundled example asset pattern
- Runs go mod tidy, go build -o /dev/null, and go test ./... as completion gates
- Guards against accidental overwrite when already inside a provider workspace
Adoption & trust: 1.6k installs on skills.sh; 654 GitHub stars; 3/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
Recommended Skills
Journey fit
Building a provider is core product/integration work before you ship infra tooling to users. Terraform providers are third-party API integrations expressed as IaC resources—integrations subphase is the correct shelf.
Common Questions / FAQ
Is New Terraform Provider safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - New Terraform Provider
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.. 1. Run `go get -u github.com/hashicorp/terraform-plugin-framework@latest`. 1. Write a main.go file that follows [the example](assets/main.go). 1. Remove TODO comments from `main.go` 1. Run `go mod tidy` 1. Run `go build -o /dev/null` 1. Run `go test ./...` // Copyright IBM Corp. 2025, 2026 // SPDX-License-Identifier: MPL-2.0 package main import ( "context" "flag" "log" "example.org/terraform-provider-demo/internal/provider" "github.com/hashicorp/terraform-plugin-framework/providerserver" ) var ( // these will be set by the goreleaser configuration // to appropriate values for the compiled binary. version string = "dev" // goreleaser can pass other information to the main package, such as the specific commit // https://goreleaser.com/cookbooks/using-main.version/ ) func main() { var debug bool flag.BoolVar(&debug, "debug", false, "set to true to run the provider with support for debuggers like delve") flag.Parse() opts := providerserver.ServeOpts{ // TODO: Update this string with the published name of your provider. // Also update the tfplugindocs generate command to either remove the // -provider-name flag or set its value to the updated provider name. Address: "registry.terraform.io/example/demo", Debug: debug, } err := providerserver.Serve(context.Background(), provider.New(version), opts) if err != nil { log.Fatal(err.Error()) } }