.agents/skills/new-entity-requirements/SKILL.md
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.
npx skillsauth add elastic/terraform-provider-elasticstack new-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.
Gather initial requirements for an entirely new Terraform resource or data source, then materialize them as an OpenSpec proposal: a change under openspec/changes/<name>/ with proposal.md, design.md, tasks.md, and delta capability specs. Sources: repo API client code, Elastic API documentation (via the Elastic docs MCP server when available, otherwise web fetch/search), and user input for decisions the code and docs cannot answer.
For the CLI sequence (create change, resolve artifact order, run openspec instructions, write files), follow openspec-propose. This skill adds what to research and what to put in each artifact for a new Terraform entity.
openspec new change (e.g. add-elasticsearch-security-api-key-resource). If missing, derive one from the entity and confirm with the user if ambiguous.internal/clients/elasticsearch/ (e.g. security.go, cluster.go). They call apiClient.GetESClient() and use the go-elasticsearch client (e.g. esClient.Security.PutUser). Shared models: internal/models/. If no wrapper exists yet, search the go-elasticsearch API (dependency github.com/elastic/go-elasticsearch/v8) for the relevant namespace (e.g. Security, Watcher, Transform).generated/kbapi/kibana.gen.go. Higher-level wrappers: internal/clients/kibanaoapi/ and internal/clients/fleet/ (e.g. alerting_rule.go, connector.go). Use kbapi types and ClientWithResponses methods for the target API.Identify: create/update (PUT/POST), read (GET), delete (DELETE), request/response shapes, identifiers (name, id, composite id). Note any version or feature flags in the client or API.
mcp_web_fetch for a known URL, or web search for the API name).Do not write directly to canonical openspec/specs/<capability>/spec.md as the primary deliverable. Instead:
Create the change
Run openspec new change "<name>" (requires OpenSpec CLI; make setup installs it). This creates openspec/changes/<name>/ with .openspec.yaml.
Build all apply-ready artifacts
Follow openspec-propose steps 3–4: openspec status --change "<name>" --json, then for each artifact in dependency order use openspec instructions <artifact-id> --change "<name>" --json, read dependencies, write to outputPath using template and instruction, re-run status until every id in applyRequires is done.
Entity-specific content
dev-docs/high-level/.openspec/changes/<name>/specs/.../spec.md): Normative requirements per dev-docs/high-level/openspec-requirements.md: ## Purpose, optional ## Schema, ## Requirements with ### Requirement: / #### Scenario:; bodies MUST include SHALL or MUST (for openspec validate). Draft HCL-style schema, API/identity/import/connection/compatibility requirements from steps 1–2. Mark unknowns as “TBD” or “(to confirm)”.Use TodoWrite to track artifact creation, as in openspec-propose.
openspec status --change "<name>" and confirm the change is apply-ready. Validate per project docs (make check-openspec / openspec validate as appropriate for specs in the change).openspec/changes/<name>/ with all artifacts required for implementation (applyRequires), including delta capability specs—not a standalone file only under openspec/specs/.dev-docs/high-level/openspec-requirements.mdopenspec/specs/elasticsearch-security-role/spec.mdopenspec/changes/archive/ (proposal, design, tasks, specs/…/spec.md)tools
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.