.agents/skills/openspec-implementation-loop/SKILL.md
--- name: openspec-implementation-loop description: Orchestrates an end-to-end implementation loop for a single OpenSpec change: select a change, ask commit-only vs PR delivery, delegate implementation to a dedicated subagent, run review and verification subagents, feed findings back for fixes, push to origin, then either watch GitHub Actions on the branch (commit mode) or create a PR and watch PR checks while polling for and addressing PR reviews (PR mode). Use when the user wants to implement
npx skillsauth add elastic/terraform-provider-elasticstack .agents/skills/openspec-implementation-loopInstall 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.
Orchestrate an implementation loop around a single OpenSpec change.
Input: Optionally specify a change name. If omitted, you MUST ask the user which change to implement.
High-level flow
originverify-openspec label after PR checks are successful, poll for PR reviews six times at 10-minute intervals, and address review feedbackSteps
Select exactly one change
If a name is provided, use it.
Otherwise:
openspec list --jsonIMPORTANT:
Always announce: Using change: <name>.
Choose delivery mode (ask immediately — before loading context or starting the implementor)
Use AskUserQuestion (or an equivalent explicit user prompt) right after step 1. Do not defer this until after implementation or push.
Offer two options:
origin on the current branch. After each push, monitor GitHub Actions for the branch / commits you pushed (same behavior as the historical workflow).gh pr create). Then monitor PR workflow runs (checks on the PR), and actively handle PR reviews as described in step 10.Record the user’s choice and refer to it from push onward (steps 8–10).
Load OpenSpec status and context
Run:
openspec status --change "<name>" --json
openspec instructions apply --change "<name>" --json
Parse the outputs to determine:
schemaNamestatecontextFilesRead every file listed in contextFiles.
Handle states:
state: "blocked": stop and explain what artifact is missing; suggest continuing the change artifacts firststate: "all_done": skip directly to the review stageStart the implementor subagent
Launch a dedicated write-capable subagent and keep reusing the same subagent for the full loop.
The implementor prompt should instruct it to:
openspec-apply-change skill/process for the changeAsk the implementor to report back with:
If the implementor is blocked, stop and surface the blocker to the user.
Determine the review strategy
Inspect the change artifacts and implementation to decide whether this is a Terraform entity change.
Treat it as a Terraform entity change when the change is centered on a Terraform resource or data source, for example:
Resource implementation: or Data source implementation:Run review subagents in parallel
Launch the following review subagents at the same time after the implementor reports completion of a reviewable chunk:
a. Critical code review
b. Proposal compliance review
openspec-verify-change skill/process for the same changec. Coverage review for Terraform entities
schema-coverage skill/processd. Coverage review for non-entity changes
go test -coverAsk every reviewer to return:
Aggregate findings and decide whether to loop
Combine the review outputs into a single actionable list.
If there are no actionable findings:
If there are actionable findings:
Repeat until:
If the loop stalls, pause and ask the user how to proceed.
Push the branch
After local review is clear:
originExample:
git push -u origin HEAD
Guardrails:
Commit-only mode: watch GitHub Actions (branch / commits)
If the user chose commit-only in step 2:
After pushing:
gh run list filtered by branch, or gh against the latest commit SHA)If CI succeeds:
If CI fails:
Repeat until:
PR mode: create PR, watch PR checks, poll reviews, address feedback
If the user chose pull request in step 2:
Create the PR after the initial push (step 8), if it does not already exist:
gh pr create (or equivalent) with an appropriate title and body tied to the OpenSpec changeWatch GitHub Actions in PR context:
gh pr checks <pr> and/or workflow runs associated with the PR’s head branch or PR eventAdd verify-openspec label after successful Github Actions:
gh pr edit <pr> --add-label verify-openspecverify-openspec.verify-openspec automatically after activation, so if later pushes need another verify pass, wait for checks on the new head commit to go green and then add the label again.PR reviews — six checks, ten minutes apart:
gh pr view <pr> --json reviews,commentsgh api repos/{owner}/{repo}/pulls/<number>/reviews and review comments as neededIf CI fails on the PR:
Repeat until:
Report final outcome
Summarize:
Recommended subagent responsibilities
Guardrails
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.