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.

206 stars

Best use case

requirements-verification is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using requirements-verification 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

$curl -o ~/.claude/skills/requirements-verification/SKILL.md --create-dirs "https://raw.githubusercontent.com/elastic/terraform-provider-elasticstack/main/.agents/skills/requirements-verification/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/requirements-verification/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How requirements-verification Compares

Feature / Agentrequirements-verificationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

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

# Requirements Document Analysis

Analyze an OpenSpec requirements spec (from `openspec/specs/<capability>/spec.md`, or a delta spec under `openspec/changes/**/specs/`) and produce three outputs:

1. **Internal consistency** — whether requirements contradict each other or the schema.
2. **Implementation compliance** — whether the implementation meets each requirement.
3. **Test opportunities** — concrete unit or acceptance tests that would verify requirements programmatically.

## Input

- **Requirements document**: User specifies the path (e.g. `openspec/specs/elasticsearch-security-role/spec.md`) or the entity name/implementation path. Resolve to the `spec.md` under `openspec/specs/<capability>/` (or the relevant delta spec path).
- **Implementation**: From the doc’s “Resource implementation” or “Data source implementation” line (e.g. `internal/elasticsearch/security/role`). Use that package for compliance and test analysis.

## Workflow

### 0. OpenSpec structural validation (recommended when a shell is available)

Before deep analysis, run the OpenSpec CLI so the spec matches what CI enforces. This checks **structure** (e.g. `### Requirement:` / `#### Scenario:` shape, **SHALL** / **MUST** in requirement bodies)—not semantic consistency or implementation compliance.

- **Repo root**, after `make setup` (or `make setup-openspec` / `npm ci`):  
  `make check-openspec`  
  or: `OPENSPEC_TELEMETRY=0 ./node_modules/.bin/openspec validate --specs`
- **Single spec** (optional): `OPENSPEC_TELEMETRY=0 ./node_modules/.bin/openspec validate <capability> --type spec` (e.g. `elasticsearch-security-role`)
- **Active change deltas** (optional): `openspec validate --all` to include `openspec/changes/**`

If validation **fails**, report the CLI errors first and fix the markdown before spending effort on sections 1–3. If no terminal is available, proceed with manual review and note that `openspec validate` was not run.

### 1. Parse the requirements document

- Read the doc and extract: **title/type name**, **implementation path** (from `Resource implementation:` / `Data source implementation:` / `Workflow implementation:` / `Script implementation:`), **Purpose**, **Schema** (HCL/YAML block if present).
- List every `### Requirement:` section: **id** (use `(REQ-NNN)` or `(REQ-001–REQ-003)` from the heading if present; otherwise derive a short id from the heading), **category** (infer from content: API, Identity, Import, etc.), and **text** (full SHALL/MUST statements in that section). Normalize references (e.g. “id format”, “cluster_uuid/name”) for consistency checks.

### 2. Internal consistency

Apply the checks in [reference.md](reference.md) (Consistency checks):

- **Identity/Import**: Same id format in Identity and Import requirements; no conflicting formats.
- **Schema vs requirements**: Required/optional/computed in schema matches what requirements imply (e.g. “when X is configured” implies X is optional or optional+computed).
- **Lifecycle**: No requirement that X triggers replace and another that X is updated in place.
- **Compatibility**: Version numbers and feature names aligned across requirements; no conflicting minimum versions for the same feature.
- **State/Plan**: No requirement that the resource “preserve null” and another that it “store empty list” for the same field.
- **StateUpgrade**: Referenced prior schema version exists; upgrade steps are ordered and non-conflicting.

Output: **Consistent** or list **Inconsistencies** with requirement ids and short explanation.

### 3. Implementation compliance

- Resolve implementation package from the doc (e.g. `internal/elasticsearch/security/role`). Locate `resource.go`, `schema.go`, `create.go`, `read.go`, `update.go`, `delete.go`, `models.go`, state upgrade code, and any validators/plan modifiers.
- For **each requirement**, determine where the behavior would be implemented (see [reference.md](reference.md) “Requirement → implementation mapping”). Search or read that code and verify the behavior.
- Classify each requirement: **Met** (code clearly implements it), **Not met** (code contradicts or omits it), **Unclear** (cannot determine from code or tests).
- Output: Table or list: REQ-ID, Category, Status (Met / Not met / Unclear), Evidence (file/function or “not found”).

### 4. Test opportunities

- Locate **unit tests**: `*_test.go` in the implementation package (e.g. `resource_test.go`, `state_upgrade_test.go`) and **acceptance tests**: `acc_test.go` (or `*_acc_test.go`) for the resource.
- For each requirement, decide whether it is **verifiable by unit test** (e.g. state upgrade logic, id parsing, validation) or **verifiable by acceptance test** (e.g. create/read/update/delete, import, error diagnostics). See [reference.md](reference.md) “Test opportunity patterns”.
- Identify requirements that are **not** covered by existing tests (or only weakly covered). Suggest **concrete test cases**: unit test name + scenario, or acceptance test step (config + checks) that would assert the requirement.
- Output: List of **Suggested tests**, each with: requirement id(s), type (unit / acceptance), description, and how it would verify the requirement.

### 5. Report

Produce a single report with three sections:

1. **Internal consistency**: Result + any inconsistencies.
2. **Implementation compliance**: Summary (e.g. X/Y met, Z unclear) + per-requirement status table.
3. **Test opportunities**: List of suggested tests with requirement ids and verification approach.

## Output format

```markdown
# Requirements analysis: <entity name>

**Document**: `openspec/specs/.../spec.md`  
**Implementation**: `internal/...` (or workflow/script path from the spec)

## 1. Internal consistency

- **Result**: Consistent | Inconsistent
- **Inconsistencies** (if any): [REQ-xxx] vs [REQ-yyy]: ...

## 2. Implementation compliance

| REQ-ID | Category   | Status   | Evidence |
|--------|------------|----------|----------|
| REQ-001| API        | Met      | create.go, update.go call PutRole |
...

**Summary**: X met, Y not met, Z unclear.

## 3. Test opportunities

| REQ-ID(s) | Type       | Suggested test | Verifies |
|-----------|------------|----------------|----------|
| REQ-008   | Acceptance | Import with invalid id; expect error diagnostic | Import validation |
...
```

## Reference

- OpenSpec authoring and CLI overview: [`dev-docs/high-level/openspec-requirements.md`](../../../dev-docs/high-level/openspec-requirements.md)
- Requirement categories and implementation mapping: [reference.md](reference.md)
- Existing entity code-path checklist (for locating implementation): `.agents/skills/existing-entity-requirements/reference.md`
- Schema/acceptance test coverage (for test patterns): `.cursor/skills/schema-coverage/` if analyzing attribute-level coverage alongside requirements.

Related Skills

new-entity-requirements

206
from elastic/terraform-provider-elasticstack

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.

entity-requirements

206
from elastic/terraform-provider-elasticstack

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.

sdk-to-pf-migration

206
from elastic/terraform-provider-elasticstack

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

206
from elastic/terraform-provider-elasticstack

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

206
from elastic/terraform-provider-elasticstack

Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete, correct, and coherent before archiving.

openspec-sync-specs

206
from elastic/terraform-provider-elasticstack

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

206
from elastic/terraform-provider-elasticstack

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

206
from elastic/terraform-provider-elasticstack

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

206
from elastic/terraform-provider-elasticstack

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

206
from elastic/terraform-provider-elasticstack

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

206
from elastic/terraform-provider-elasticstack

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

206
from elastic/terraform-provider-elasticstack

Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.