new-terraform-provider — Claude Code skill: scaffold a Terraform
A skill that walks the agent through bootstrapping a Terraform provider on the Plugin Framework, from directory layout to a passing build.
npx skills add hashicorp/agent-skills --skill new-terraform-provider -a claude-codeWhat new-terraform-provider does
This skill lays out the order of work for a fresh terraform-provider-* project. The agent creates a root directory with that prefix, sets up a Go module, pulls in github.com/hashicorp/terraform-plugin-framework@latest, and writes main.go following the sample in assets/main.go.
Next comes internal/provider/provider.go, again from a sample. You rename the demo provider, the DEMO_* environment variables and the authentication attributes to fit your API, then strip the TODO comments from both files. Credentials are read from explicit config, falling back to environment variables.
Wrapping up: go mod tidy, go build -o /dev/null, go test ./.... Run the skill inside an existing provider workspace and it first asks whether to make a new one — say no and the rest is skipped. Growing the credential chain or adding a first resource is left to the provider-configuration and provider-resources skills, which have to be present in your setup.
What it helps with
- lay out the directory structure for a new Terraform provider
- set up a Go module with terraform-plugin-framework
- write
main.gofor the provider server - create
provider.gowith schema and Configure - verify the scaffold with a build and tests
Example prompts for the agent
- Scaffold a new Terraform provider with the Plugin Framework
- Start a terraform-provider project for my API
- Set up the provider skeleton and run go test ./...
How to install new-terraform-provider
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill new-terraform-provider -a claude-code2Manually: put the files in place
~/.claude/skills/new-terraform-provider/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/new-terraform-provider/
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill new-terraform-provider -a codex2Manually: put the files in place
.agents/skills/new-terraform-provider/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill new-terraform-provider -a cursor2Manually: put the files in place
.cursor/skills/new-terraform-provider/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hashicorp/agent-skills new-terraform-provider2Manually: put the files in place
.github/skills/new-terraform-provider/SKILL.md1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill new-terraform-provider -a gemini-cli2Platform CLI
gemini skills install https://github.com/hashicorp/agent-skills --path plugins/terraform/skills/new-terraform-providerManually: put the files in place
.devin/skills/new-terraform-provider/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill new-terraform-provider -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about new-terraform-provider
How do I install new-terraform-provider in Claude Code?
Run npx skills add hashicorp/agent-skills --skill new-terraform-provider -a claude-code. The skill file then sits at ~/.claude/skills/new-terraform-provider/SKILL.md.
What does new-terraform-provider do?
It steps the agent through creating a Terraform provider on the Plugin Framework: directory, Go module, main.go, provider.go with schema and Configure, then build and tests.
Which skills handle the next steps?
The description points to provider-configuration for a full credential chain and provider-resources for a first resource or data source. Both need to be available in your setup.