PluginBench
Skill
Official
Review
Audit score 70

new-terraform-provider

hashicorp/agent-skills

Scaffold a new Terraform provider project with Plugin Framework boilerplate.

What is new-terraform-provider?

Creates the workspace layout, Go module setup, main.go server, and provider.go schema for a new Terraform provider. Use this when starting a terraform-provider-* project for a new API or infrastructure platform.

  • Generates terraform-provider-* directory structure with proper naming conventions
  • Initializes Go module and fetches terraform-plugin-framework dependency
  • Creates main.go with provider server setup following HashiCorp patterns
  • Generates internal/provider/provider.go with schema and Configure method
  • Sets up credential resolution via explicit config and environment variables
  • Validates the scaffold with go build and go test

How to install new-terraform-provider

npx skills add https://github.com/hashicorp/agent-skills --skill new-terraform-provider
Prerequisites
  • Go 1.x installed and configured
  • Basic familiarity with Terraform provider concepts
  • Target API documentation or endpoint details
Claude Code
Cursor
Windsurf
Cline

How to use new-terraform-provider

  1. 1.Confirm you want to create a new workspace if already in a provider project
  2. 2.Create a new directory prefixed with 'terraform-provider-'
  3. 3.The skill initializes the Go module and fetches terraform-plugin-framework
  4. 4.Review and customize the generated main.go and internal/provider/provider.go files
  5. 5.Rename 'demo' provider references and DEMO_* environment variables to match your API
  6. 6.Remove TODO comments from generated files
  7. 7.Run 'go mod tidy' to finalize dependencies
  8. 8.Run 'go build -o /dev/null' to verify compilation

Use cases

Good for
  • Starting a new Terraform provider for a custom API or SaaS platform
  • Scaffolding provider boilerplate before implementing resources and data sources
  • Setting up the foundation for a terraform-provider-* open-source project
  • Creating a provider that manages infrastructure on a proprietary platform
  • Establishing the correct Plugin Framework structure for HashiCorp compatibility
Who it's for
  • Infrastructure engineers building Terraform providers
  • DevOps teams creating providers for internal APIs
  • Open-source maintainers publishing new Terraform providers
  • Platform teams exposing their APIs via Terraform

new-terraform-provider FAQ

What credential methods does the scaffold support?

The scaffold supports explicit configuration and environment variable fallback. Use the provider-configuration skill to add shared credentials files, profiles, platform identity, and configure-time validation.

How do I add resources or data sources after scaffolding?

After scaffolding, use the provider-resources skill to add your first resource or data source to the provider.

Can I use this for an existing Terraform provider project?

This skill is designed for new providers. If you're already in a provider workspace, it will confirm before creating a new one.

What Go version is required?

The skill uses the latest terraform-plugin-framework; check HashiCorp's documentation for minimum Go version requirements.

Does this generate any resources or data sources?

No, this skill only scaffolds the provider foundation. Use provider-resources skill to add actual resources and data sources.

Full instructions (SKILL.md)

Source of truth, from hashicorp/agent-skills.


name: new-terraform-provider description: >- 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. Also use when a user wants to start building a provider for a new API or asks how to begin a terraform-provider-* project. license: MPL-2.0 metadata: lifecycle-status: active copyright: Copyright IBM Corp. 2026 version: "0.0.1"

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.
  2. Create a new workspace root directory. The root directory name should be prefixed with "terraform-provider-". Perform all subsequent steps in this new workspace.
  3. Initialize a new Go module.
  4. Run go get -u github.com/hashicorp/terraform-plugin-framework@latest.
  5. Write a main.go file that follows the example.
  6. 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.
  7. Remove TODO comments from main.go and provider.go.
  8. Run go mod tidy
  9. Run go build -o /dev/null
  10. 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).