provider-test-patterns — Claude Code skill: setup and patterns
A skill that guides acceptance testing for Terraform providers using terraform-plugin-testing and the Plugin Framework.
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a claude-codeWhat provider-test-patterns does
This skill provides test patterns for Terraform providers built on the Plugin Framework. It organizes acceptance test structures around TestCase and TestStep definitions, configuring ProtoV6ProviderFactories and destroy verification via CheckDestroy. Tests run concurrently using resource.ParallelTest by default.
Modern assertions rely on ConfigStateChecks using typed matchers from knownvalue and path selectors from tfjsonpath. Never combine legacy Check functions with ConfigStateChecks inside the same test step. Doing so breaks test assertions, which means you need to migrate steps cleanly rather than mixing styles. The reference also covers import verification with ImportStateKind and tests for ephemeral resources using echoprovider.
The test harness automatically executes plan, apply, refresh, and a final plan step. If the final plan shows any drift, the test fails. The process catches drift without extra code.
What it helps with
- write Terraform provider acceptance tests with Plugin Framework
- assert resource state using type-safe
ConfigStateChecks - test resource import workflows using
ImportStateVerify - verify resource teardown with
CheckDestroy
Example prompts for the agent
- Write an acceptance test for a Terraform resource using ConfigStateChecks
- How do I configure an import test step with ImportStateVerifyIgnore?
- Create a multi-step test that updates an existing resource without drift
How to install provider-test-patterns
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a claude-code2Manually: put the files in place
~/.claude/skills/provider-test-patterns/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/provider-test-patterns/
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a codex2Manually: put the files in place
.agents/skills/provider-test-patterns/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a cursor2Manually: put the files in place
.cursor/skills/provider-test-patterns/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hashicorp/agent-skills provider-test-patterns2Manually: put the files in place
.github/skills/provider-test-patterns/SKILL.md1Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a gemini-cli2Platform CLI
gemini skills install https://github.com/hashicorp/agent-skills --path plugins/terraform/skills/provider-test-patternsManually: put the files in place
.devin/skills/provider-test-patterns/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hashicorp/agent-skills --skill provider-test-patterns -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 provider-test-patterns
How to install provider-test-patterns in Claude Code?
Run npx skills add hashicorp/agent-skills --skill provider-test-patterns -a claude-code in your terminal to add the skill to Claude Code.
What does provider-test-patterns do?
It supplies standard patterns and best practices for writing provider acceptance tests with the terraform-plugin-testing framework.
Can I combine Check and ConfigStateChecks in one TestStep?
No, you must not mix legacy Check and modern ConfigStateChecks within the same step. Migrate step checks to ConfigStateChecks and reserve TestCheckFunc for CheckDestroy.