.agents/skills/existing-entity-requirements/SKILL.md
Examines an existing Terraform resource or data source implementation and produces an OpenSpec requirements document under openspec/specs/. Use when the user asks to document requirements for a Terraform entity, capture behavior from code, or write a requirements doc for a resource/data source.
npx skillsauth add elastic/terraform-provider-elasticstack entity-requirementsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce an OpenSpec spec (spec.md) for an existing Terraform resource or data source by examining its code path and capturing behavior. Follow dev-docs/high-level/openspec-requirements.md and the OpenSpec shape: ## Purpose, optional ## Schema, ## Requirements with ### Requirement: and #### Scenario: blocks; use SHALL / MUST in requirement text.
elasticstack_elasticsearch_security_role) or the implementation path (e.g. internal/elasticsearch/security/role).req.ProviderTypeName + "_...".internal/provider/provider.go.Locate implementation
internal/ containing resource.Resource and Schema, Create, Read, Update, Delete (and optionally ImportState, UpgradeState).*_data_source.go) containing a data source Schema and Read.Examine code path
Use the checklist in reference.md so nothing is missed:
id is set, how errors and “not found” are handled.elasticsearch_connection).RequiresReplace).Write the spec
openspec/specs/<capability>/spec.md (e.g. openspec/specs/elasticsearch-security-role/spec.md). Use a stable capability id: <backend>-<area>-<resource> (see authoring guide).Resource implementation: or Data source implementation: with the Go package path (as in legacy docs).## Purpose paragraph.## Schema with HCL-style block listing each attribute/block with <required|optional|optional+computed|computed>, types, and notes. Example reference: openspec/specs/elasticsearch-security-role/spec.md.### Requirement: … sections (group related behaviors; reference legacy REQ ids in titles like (REQ-001–REQ-003) when useful). Each requirement body MUST contain SHALL or MUST. Add #### Scenario: blocks (Given/When/Then) for verifiable behavior. Derive everything from the code; do not invent behavior. Categories: API, Identity, Import, Lifecycle, Connection, Compatibility, Create/Update, Read, Delete, Mapping, Plan/State, State, StateUpgrade. See reference.md.Quality
description optional with a version note, there must be a Compatibility requirement for that version).Use this OpenSpec-oriented structure:
# `<name>` — Schema and Functional Requirements
Resource implementation: `<GO_PACKAGE_OR_DIR>`
## Purpose
...
## Schema
\`\`\`hcl
...
\`\`\`
## Requirements
### Requirement: Short name (REQ-xxx)
The resource SHALL ...
#### Scenario: ...
- GIVEN ...
- WHEN ...
- THEN ...
dev-docs/high-level/openspec-requirements.mdopenspec/specs/elasticsearch-security-role/spec.mdtools
Guides migration of Terraform resources from Plugin SDK to Plugin Framework. Use when migrating SDK resources to PF, planning SDK-to-PF migrations, or when the user asks to migrate a resource to the Plugin Framework.
testing
Analyzes a Terraform resource schema and compares it to attributes used in the acceptance test suite (configs + assertions). Produces a prioritized report of missing and poor coverage (set-only assertions, single-value coverage, missing unset/empty cases, missing update coverage). Use when the user asks about schema coverage, test coverage gaps, or improving Terraform acceptance tests for a resource.
testing
Analyzes an OpenSpec requirements spec for internal consistency, implementation compliance, and test opportunities; when a shell is available, run openspec validate first for structural checks. Use when reviewing specs, verifying implementation against requirements, or identifying test gaps.
testing
Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.