# provider-test-patterns

A skill that guides acceptance testing for Terraform providers using terraform-plugin-testing and the Plugin Framework.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3300 installs · ★ 909
- Author: hashicorp
- License: MPL-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hashicorp/agent-skills/tree/HEAD/plugins/terraform/skills/provider-test-patterns/SKILL.md
- Updated: 2026-10-05
- HTML: https://affpapa.org/en/nevibecode/skills/provider-test-patterns

## What it 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.

## Requirements
- Works with: Terraform

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/provider-test-patterns/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/provider-test-patterns/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/provider-test-patterns/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/provider-test-patterns/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install hashicorp/agent-skills provider-test-patterns
```

2. **Manually: put the files in place**
- File: `.github/skills/provider-test-patterns/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/hashicorp/agent-skills --path plugins/terraform/skills/provider-test-patterns
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/provider-test-patterns/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add hashicorp/agent-skills --skill provider-test-patterns -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hashicorp/agent-skills/tree/HEAD/plugins/terraform/skills/provider-test-patterns/SKILL.md

## When to use it
- 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
- 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

## Similar
- [terraform-patterns](https://affpapa.org/en/nevibecode/skills/terraform-patterns.md) — skill · 617 installs
- [synthetic-monitoring-checks](https://affpapa.org/en/nevibecode/skills/synthetic-monitoring-checks.md) — skill · 2300 installs
- [bigquery-basics](https://affpapa.org/en/nevibecode/skills/bigquery-basics.md) — skill · 17678 installs
- [huawei-cloud-terraform-installer](https://affpapa.org/en/nevibecode/skills/huawei-cloud-terraform-installer.md) — skill · 17400 installs
- [huawei-cloud-terraform-generator](https://affpapa.org/en/nevibecode/skills/huawei-cloud-terraform-generator.md) — skill · 17000 installs
- [terraform-module-library](https://affpapa.org/en/nevibecode/skills/terraform-module-library.md) — skill · 15615 installs

From the same set: [hashicorp/agent-skills](https://affpapa.org/en/nevibecode/by/hashicorp/agent-skills.md) — 20 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
