Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/provider-test-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/provider-test-patterns/

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.

Similar skills

Everything for DevOps and infrastructure →

From the same set16

provider-resources This skill guides Terraform resource and data source work with the Plugin Framework. Use it when adding resources, handling drift, or reviewing provider code. CX Codex +1 4,100installs provider-actions Guides implementation of Terraform Actions with the Plugin Framework for operations run around resource create, update, and destroy events. CX Codex +1 3,900installs new-terraform-provider A skill that walks the agent through bootstrapping a Terraform provider on the Plugin Framework, from directory layout to a passing build. CX Codex +1 3,900installs run-acceptance-tests Runs and investigates Terraform provider acceptance tests with the TestAcc prefix. Use it for missing environment variables, failed runs, or tests that pass when they should not. CX Codex +1 3,700installs azure-verified-modules A skill that carries the Azure Verified Modules requirements, so your agent can write and review Terraform modules that pass AVM certification. CX Codex +1 3,300installs aws-ami-builder A skill that walks your agent through building Amazon Machine Images with Packer and the amazon-ebs builder — template, source AMI filters, build commands. CX Codex +1 3,200installs provider-docs Guides Terraform provider documentation workflows for the Terraform Registry. It coordinates schema descriptions, docs templates, and tfplugindocs generation. CX Codex +1 3,200installs push-to-registry Teaches AI assistants how to register Packer build details in HCP. Useful for tracking machine image lifecycles and linking artifacts directly to Terraform. CX Codex +1 3,000installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor