entity-requirements
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.
Best use case
entity-requirements is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using entity-requirements should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/existing-entity-requirements/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How entity-requirements Compares
| Feature / Agent | entity-requirements | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Entity Requirements Documentation 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`](../../../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. ## Input - **Entity**: User specifies the Terraform entity (e.g. `elasticstack_elasticsearch_security_role`) or the implementation path (e.g. `internal/elasticsearch/security/role`). - Resolve the implementation package: * For Plugin Framework based entities, search for `req.ProviderTypeName + "_..."`. * For SDK based entities, this is defined in `internal/provider/provider.go`. ## Workflow 1. **Locate implementation** - **Resource**: Package under `internal/` containing `resource.Resource` and `Schema`, `Create`, `Read`, `Update`, `Delete` (and optionally `ImportState`, `UpgradeState`). - **Data source**: Package or file (e.g. `*_data_source.go`) containing a data source `Schema` and `Read`. 2. **Examine code path** Use the checklist in [reference.md](reference.md) so nothing is missed: - Schema (attributes, blocks, required/optional/computed, plan modifiers, validators). - Metadata: type name, import, state upgrade. - CRUD: which APIs are called, how `id` is set, how errors and “not found” are handled. - Connection: default client vs resource-level override (e.g. `elasticsearch_connection`). - Compatibility: version checks and “Unsupported Feature” behavior. - Mapping: config/API/state (JSON parsing, empty vs null, preserve-unknown behavior). - Lifecycle: replacement vs in-place update (e.g. `RequiresReplace`). 3. **Write the spec** - **Path**: `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). - **Title and implementation**: H1 title and a line `Resource implementation:` or `Data source implementation:` with the Go package path (as in legacy docs). - **Purpose**: Short `## Purpose` paragraph. - **Schema**: Optional `## 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`. - **Requirements**: `### 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](reference.md). 4. **Quality** - Every requirement must be traceable to the implementation (file/function or logic). - Schema and requirements must be consistent (e.g. if schema has `description` optional with a version note, there must be a Compatibility requirement for that version). - For resources with state upgrade, include StateUpgrade requirements describing each version transition and error behavior. ## Output format Use this OpenSpec-oriented structure: ```markdown # `<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 ... ``` ## Reference - Authoring: `dev-docs/high-level/openspec-requirements.md` - Example: `openspec/specs/elasticsearch-security-role/spec.md` - Full code-path checklist and requirement categories: [reference.md](reference.md)
Related Skills
requirements-verification
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.
new-entity-requirements
Gathers initial requirements for a new Terraform resource or data source by examining API clients (go-elasticsearch, generated kbapi), Elastic API docs (Elastic docs MCP server and/or web), then interviewing the user for gaps. Produces an OpenSpec proposal (change with proposal, design, tasks, and delta specs)—not a hand-written spec under openspec/specs/ alone. Use when designing a new entity, drafting requirements from an API, or before implementing a new resource/data source.
sdk-to-pf-migration
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.
schema-coverage
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.
openspec-verify-change
Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.
openspec-sync-specs
Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta spec, without archiving the change.
openspec-propose
Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.
openspec-new-change
Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.
openspec-implementation-loop
Orchestrates an end-to-end implementation loop for a single OpenSpec change: select a change, delegate implementation to a dedicated subagent, run review and verification subagents, feed findings back for fixes, push to origin, and watch GitHub Actions until the branch is green or blocked. Use when the user wants to implement an approved OpenSpec proposal/change with iterative review and CI feedback.
openspec-explore
Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.
openspec-continue-change
Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.
openspec-archive-change
Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.