一键导入
opsx-verify
Verify implementation matches change artifacts before archiving
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Verify implementation matches change artifacts before archiving
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | opsx-verify |
| description | Verify implementation matches change artifacts before archiving |
| metadata | {"category":"Workflow","tags":["workflow","verify","experimental"]} |
Check the active model from your system context (it appears as "You are powered by the model named…").
"This command requires Sonnet or Opus — verifying implementation against specs and running tests needs stronger reasoning than Haiku can reliably provide. Please switch to Sonnet (
/model sonnet) or Opus (/model opus) and re-run."
Verify that an implementation matches the change artifacts (specs, tasks, design).
Input: Optionally specify a change name after /opsx-verify (e.g., /opsx-verify add-auth). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Steps
If no change name provided, prompt for selection
Run openspec list --json to get available changes. Use the AskUserQuestion tool to let the user select.
Show changes that have implementation tasks (tasks artifact exists). Include the schema used for each change if available. Mark changes with incomplete tasks as "(In Progress)".
IMPORTANT: Do NOT guess or auto-select a change. Always let the user choose.
Check status to understand the schema
openspec status --change "<name>" --json
Parse the JSON to understand:
schemaName: The workflow being used (e.g., "spec-driven")Get the change directory and load artifacts
openspec instructions apply --change "<name>" --json
This returns the change directory and context files. Read all available artifacts from contextFiles.
Additionally, load optional artifacts if present:
openspec/changes/<name>/test-plan.md — pre-defined test cases mapped to spec scenarios; use as the primary oracle for scenario coverage and testingopenspec/changes/<name>/contract.md — formal API contract; if present, it is the authoritative interface definition and takes precedence over design.md for API verificationInitialize verification report structure
Create a report structure with three dimensions:
Each dimension can have CRITICAL, WARNING, or SUGGESTION issues.
Verify Completeness
Task Completion:
- [ ] (incomplete) vs - [x] (complete)[x] in tasks.md but whose plan.json status is not "done", treat it as just-completed and run the full GitHub sync below. If plan.json does not exist, skip all GitHub sync steps silently.[x] in tasks.md[x] in tasks.md[x] in tasks.md (whether already complete before this run, or just completed above), if plan.json exists and that task's status in plan.json is not "done":
- [ ] **1.1 Task title**), change it to - [x]; then scan every immediately following line — for each line starting with - [ ] (2-space indent), change it to - [x]; stop scanning at any line that is NOT an indented sub-checkbox (blank line, new parent checkbox, section header, etc.)get_issue → {owner, repo, issue_number: <tracking_issue>} → apply the above changes for all tasks → update_issue → {owner, repo, issue_number: <tracking_issue>, body: <updated_body>}gh issue view <tracking_issue> --repo <repo> --json body --jq '.body' → apply the above changes for all tasks → gh issue edit <tracking_issue> --repo <repo> --body "<updated_body>"update_issue call — fetch the body once, apply all checkbox changes, then write it back once.plan.json: set "status": "done" for that taskSpec Coverage:
openspec/changes/<name>/specs/:
Verify Correctness
Requirement Implementation Mapping:
Scenario Coverage:
test command field — use it in step 8 to run the right test typeVerify Coherence
Contract Adherence (checked first if contract.md exists):
Design Adherence:
Code Pattern Consistency:
Test Coverage:
tests/Unit/ or tests/unit/Documentation:
Ask about API and browser testing
After the code-level verification, use AskUserQuestion to ask: "Would you also like to run API and/or browser tests against the specs and implementation?"
Options:
If API testing selected:
a. Discover endpoints — Read {app}/appinfo/routes.php to find endpoints affected by this change. Cross-reference with the specs to identify which endpoints should exist.
b. Test CRUD operations — For each affected resource endpoint, test with curl:
# CREATE
curl -s -u admin:admin -X POST -H "Content-Type: application/json" \
-d '{"name":"Verify Test"}' http://localhost:8080/index.php/apps/{app}/api/{resource}
# Returns 201 with created object including id
# READ
curl -s -u admin:admin http://localhost:8080/index.php/apps/{app}/api/{resource}/{id}
# Returns 200 with full object; 404 for non-existent
# LIST
curl -s -u admin:admin http://localhost:8080/index.php/apps/{app}/api/{resource}
# Returns 200 with array and pagination metadata
# UPDATE
curl -s -u admin:admin -X PUT -H "Content-Type: application/json" \
-d '{"name":"Updated"}' http://localhost:8080/index.php/apps/{app}/api/{resource}/{id}
# DELETE
curl -s -u admin:admin -X DELETE http://localhost:8080/index.php/apps/{app}/api/{resource}/{id}
c. Verify against spec scenarios — For each GIVEN/WHEN/THEN scenario in the specs, craft a curl request that exercises it. Check response codes, payloads, and error messages match expectations.
d. NLGov compliance spot-check — Verify the basics:
total, page, pages)message or detail field with proper HTTP statusContent-Type: application/json on all responsese. Add findings as CRITICAL (endpoint broken/missing), WARNING (non-compliant), or SUGGESTION (improvement).
If browser testing selected:
a. Set up browser session — Use browser-1 tools (mcp__browser-1__*):
1. browser_resize → width: 1920, height: 1080
2. browser_navigate → http://localhost:8080/index.php/apps/{app}
3. If redirected to login:
- browser_fill_form with username: admin, password: admin
- Submit the form
4. browser_snapshot → confirm app loaded
b. Test spec scenarios via browser — For each GIVEN/WHEN/THEN scenario from the specs:
browser_click, browser_type, browser_fill_formbrowser_snapshot to verify expected outcome, browser_take_screenshot with filename: test-results/verify/{change-name}-{scenario-slug}.pngc. Monitor for errors during testing:
browser_console_messages (level: "error") after each actionbrowser_network_requests to catch failed API calls (4xx/5xx)d. Test core flows relevant to the change:
e. Add findings with screenshot evidence. CRITICAL for broken flows, WARNING for degraded UX, SUGGESTION for polish.
Generate Verification Report
Summary Scorecard:
## Verification Report: <change-name>
### Summary
| Dimension | Status |
|--------------|------------------|
| Completeness | X/Y tasks, N reqs|
| Correctness | M/N reqs covered |
| Coherence | Followed/Issues |
| API Tests | Passed/Failed/Skipped |
| Browser Tests| Passed/Failed/Skipped |
Issues by Priority:
CRITICAL (Must fix before archive):
WARNING (Should fix):
SUGGESTION (Nice to fix):
Fix loop — resolve issues and re-verify
If CRITICAL or WARNING issues found:
If fixing:
FIRST: Re-check task completion — regardless of other findings, re-read tasks.md and count - [ ] items:
- [ ]: do NOT offer archive. Show:
⚠️ N task(s) still incomplete — archive is blocked until all tasks are done:
- Task X: <description> (incomplete criteria: ...)
End the session without offering archive.If all tasks [x] AND CRITICAL issues remain (user chose not to fix):
If all tasks [x] AND only SUGGESTION issues or all clear:
## Pipeline Progress, update via PATCH if found, create if not):
## Pipeline Progress
| Stage | Status | Details |
|-------|--------|---------|
| Implementation | ✓ Complete | All N tasks done |
| Quality Checks | ✓ Pass | lint, phpcs, phpstan clean |
| Verification | ✓ Pass | Completeness, correctness, coherence |
| Archive | ready | |
*Updated: YYYY-MM-DD HH:MM UTC*
add_issue_comment → {owner, repo, issue_number: <tracking_issue>, body: "✓ Verified by /opsx-verify — all checks passed"}gh issue comment <tracking_issue> --repo <repo> --body "✓ Verified by /opsx-verify — all checks passed"/opsx-archive for this change/opsx-sync then /opsx-archiveIf all tasks [x] AND only WARNING issues remain (user chose not to fix):
/opsx-archive for this change/opsx-sync then /opsx-archiveAfter verification completes, review what happened and append any new observations to learnings.md:
Each entry must include today's date. One insight per bullet. Skip if nothing new was learned.
Verification Heuristics
Graceful Degradation
Fix Loop Behavior
Output Format
Use clear markdown with:
file.ts:123💡 If you switched models to run this command, don't forget to switch back to your preferred model with
/model <name>(e.g./model defaultor/model sonnet) when done.
Reset the OpenRegister development environment (stop, remove volumes, restart, install apps)
Create a Pull Request from the current branch — runs local checks, picks target branch, and opens the PR on GitHub
Analyze a project's OpenSpec from 8 persona perspectives and suggest additional features
Iteratively run apply→verify in a loop until verify passes, then auto-archive — runs per-app in Docker context
Implement tasks from an OpenSpec change (Experimental)
Archive a completed change in the experimental workflow