brainstorming
Use this skill when you need to plan and scaffold the implementation of a new
Anthropic API as Terraform resources and data sources in this provider, without
using Vibe Kanban.
Trigger
The user says something like:
- "I'd like to implement /v1/environments APIs"
- "Plan the work for the Files API"
- "Create issues for the Sessions endpoints"
Workflow
Step 1 — Discover the API
Fetch the API overview and all relevant endpoint pages:
WebFetch: https://platform.claude.com/docs/en/api/overview
Then fetch each individual endpoint page to collect the full schema (request
body, path params, query params, response fields). Run all fetches in parallel.
For each endpoint, identify:
- HTTP method + path
- Required and optional request fields with types
- Response fields with types
- Whether it maps to a resource (Create/Read/Delete or CRUD) or a
data source (Read-only lookup or list)
Mapping heuristic:
POST+GET /{id}+DELETE /{id}→ resource (ForceNew if no PATCH/PUT)POST+GET /{id}+PATCH /{id}+DELETE /{id}→ resource (with Update)GET /{id}only → data source (single lookup)GET /(list) → data source (list)
Also check the Go SDK for existing types:
find $(go env GOPATH)/pkg/mod/github.com/anthropics/anthropic-sdk-go* -name "beta*.go" | xargs grep -l "<Resource>"
Step 2 — Plan issues
Create one issue per resource/data source. Each issue must include:
- API spec — endpoint, SDK method signatures, request/response fields
- Terraform schema — attribute table with types and R/W annotations
- Files to create/modify — Go source, test file, example, template, native test
- Go tests — the
TestAcc*functions for a standard-key resource, or thehttptestunit tests for an Admin API or OAuth resource, with what each verifies - Terraform native test:
.tftest.hclsnippet with the file-leveltest { parallel = true }block, a../examples/...module source and assert blocks
Do NOT create a separate issue for tests. Tests are part of every issue.
Step 3 — Create GitHub issues and branches
For each issue, in a single parallel message:
mcp__github__issue_write(method:create) — one GitHub issue per resource/data sourcemcp__github__create_branch(frommain) — one branch per issue
Branch naming convention:
anthropic_skillresource →feat/skill-resourceanthropic_skillsdata source →feat/skills-data-sourceanthropic_skill_versionresource →feat/skill-version-resourceanthropic_skill_versionsdata source →feat/skill-versions-data-source
Step 4 — Note on PRs
GitHub requires at least one commit before a PR can be opened. Always inform the user:
"Branches are created and ready. Open a draft PR on each branch once the first commit is pushed."
Invariants (never violate)
One PR per issue — no bundled PRs
Each GitHub issue must result in exactly one dedicated PR. Never batch
multiple issues into one PR, even if the changes seem small or related. Reviewers
need one PR per logical unit.
Branch isolation during parallel implementation
When implementing issues in parallel, each agent must only commit changes that
belong to its own issue onto its own branch. An agent must never:
- Check out or modify files on a sibling branch
- Leave untracked files in the main worktree that belong to a different issue
Use EnterWorktree / isolated worktrees to enforce this boundary.
Implementation guidance
Each issue description should reference:
- Conventions:
CLAUDE.md(Adding a resource or data source, Testing)
and the terraform-provider skill.
- Subagent for review: after implementation is complete on a branch, launch the
terraform-provider-review subagent pointing at the changed files.
Parallelization rules
| Step | Strategy |
|---|---|
| Fetch API docs pages | One WebFetch per page in a single message |
| Create GitHub issues + branches | All issue_write + create_branch calls in a single message |
| Implementation | All issues are independent — can be parallelized across agents |
Issue description template
<One-line summary of what this implements.>
## Branch
`<branch-name>` (open PR once first commit is pushed)
## API
- `METHOD /v1/<path>` — description
## SDK methods (anthropic-sdk-go)
- `client.Beta.<Service>.<Method>(ctx, params)` → `ResponseType`
## Terraform schema
| Attribute | Type | R/W |
|---|---|---|
| `id` | string | Computed |
| `...` | ... | ... |
## Files to create / modify
From `CLAUDE.md`, *Adding a resource or data source* (for a data source: `_data_source.go`, `dataSourceRegistrations()`, `examples/data-sources/<name>/data_source.tf`, `templates/data-sources/`, `docs/data-sources/`).
- `internal/services/<service>/<name>_resource.go`: `package <service>`
- `internal/services/<service>/<name>_resource_test.go`: Go acceptance tests, `package <service>_test` (standard-key objects and read-only Admin API data sources, see *Go tests*)
- `internal/services/<service>/<name>_resource_internal_test.go`: unit tests against an `httptest` server, `package <service>`, when they need unexported symbols, and always for an Admin API or OAuth resource
- `internal/provider/registry.go`: register the factory in `resourceRegistrations()`, declaring whether each cloud platform serves it
- `examples/resources/<name>/resource.tf`: resource blocks and outputs only (embedded in the Registry docs)
- `examples/resources/<name>/versions.tf`: the `terraform {}` block
- `templates/resources/<name>.md.tmpl`: non-empty `subcategory: "<Category>"`
- `tests/<name>.tftest.hcl`: Terraform native test
- `docs/resources/<name>.md`: generated by `make generate`, never edited by hand
## Go tests
Which tests run live depends on the credential (`CLAUDE.md`, *Testing*):
- Standard key: `TestAcc<Name>Resource_basic` creates the object with a minimal config, checks `id` is set, then runs an `ImportState` step; a `CheckDestroy` function verifies the object is gone (or archived) after destroy; gated on `acctest.PreCheck`.
- Admin API or OAuth resource: no live create test, since there is no test organization yet (#58) and OAuth-gated tests are not run. `httptest` tests in `<name>_resource_internal_test.go` (`admintest.NewClient` / `oauthtest.NewClient`) cover create, read, update, delete, import and 404s, and the native test stays at `command = plan`.
- Read-only Admin API data source: a smoke acceptance test gated on `acctest.PreCheckAdmin` that reads `terraform-tests` and asserts presence (`<list>.#`), not values, next to the `httptest` tests.
## Terraform native test (`tests/<name>.tftest.hcl`)
test {
parallel = true
}
run "<name>_resource_creates_<name>" {
module {
source = "../examples/resources/<name>"
}
assert {
condition = output.<name>_id != ""
error_message = "Expected <name>_id to be non-empty."
}
}
Admin API and OAuth resources plan only (`command = plan`, dummy credential in a `provider "anthropic"` block of the test file) and assert on configured values, since computed ones such as `id` are unknown at plan; self-contained list data sources use `mock_provider "anthropic" {}`. Details in `CLAUDE.md`, *Terraform native tests*.
Run `make` after implementation, then `make terraform-test`, then stage the new files and run `pre-commit run -a` (it skips untracked files).
Example invocation
User: "I'd like to implement /v1/environments APIs"
- Fetch
https://platform.claude.com/docs/en/api/overview+ all Environments endpoint pages in parallel - Identify:
anthropic_environmentresource +anthropic_environmentdata source +anthropic_environmentsdata source - Create 3 GitHub issues + 3 branches in parallel (all in one message)
- Report summary table to the user and remind them to open draft PRs after first commits