بنقرة واحدة
opsx-apply
Implement tasks from an OpenSpec change (Experimental)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Implement tasks from an OpenSpec change (Experimental)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | opsx-apply |
| description | Implement tasks from an OpenSpec change (Experimental) |
| metadata | {"category":"Workflow","tags":["workflow","artifacts","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 — implementing tasks from OpenSpec changes needs stronger reasoning than Haiku can reliably provide. Please switch to Sonnet (
/model sonnet) or Opus (/model opus) and re-run."
This skill is also used by the Hydra builder container (images/builder/entrypoint.sh) in headless CI mode. When the prompt explicitly says "HEADLESS" or sets HYDRA_HEADLESS=1, apply these overrides:
| Step | Interactive behavior | Headless override |
|---|---|---|
| Model gate (top of file) | Block Haiku | Ignore — proceed on any model |
| Step 6 (confirm before start) | AskUserQuestion prompt | Skip — auto-proceed with all pending tasks |
| Step 7 pause points | Pause and ask user | Skip asking — implement best effort; on true blocker, exit 1 with clear error |
| Step 10 ("what's next") | AskUserQuestion menu | Skip entirely — orchestrator schedules next phase |
| Capture Learnings | Append to learnings.md | Skip — container filesystem is disposable |
All other steps (load ADRs, read context files, implement tasks, update tasks.md checkboxes, update GitHub issue checkboxes, update plan.json, post pipeline progress comment, run quality checks) are MANDATORY in headless mode — these are the steps the CI pipeline depends on.
If you add a new interactive pause to this skill, add it to this table and to the override list in images/builder/entrypoint.sh (build-mode prompt). Drift between the two breaks Hydra silently.
Implement tasks from an OpenSpec change.
Input: Optionally specify a change name (e.g., /opsx-apply add-auth). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Steps
Select the change
If a name is provided, use it. Otherwise:
openspec list --json to get available changes and use the AskUserQuestion tool to let the user selectAlways announce: "Using change: " and how to override (e.g., /opsx-apply <other>).
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 apply instructions
openspec instructions apply --change "<name>" --json
This returns:
Handle states:
state: "blocked" (missing artifacts): show message, suggest using /opsx-continuestate: "all_done": congratulate, suggest archiveLoad architectural context
Before reading change-specific files, load ALL applicable ADRs. These are hard constraints on implementation — violating an ADR is a bug.
| Location | What | Priority |
|---|---|---|
openspec/changes/<name>/context-brief.md | Specter intelligence brief — features, user stories, stakeholders, schemas, standards. Contains market research data that informed the spec. | Load if present — provides domain context for implementation decisions |
../../../openspec/architecture/adr-*.md (relative to skill base dir) | Company-wide ADRs (17 Conduction-wide decisions: data layer, API patterns, frontend, security, i18n, testing, etc.) — these live in the Hydra repo that contains this skill | Always load — these are non-negotiable |
openspec/architecture/adr-*.md | Repo-specific ADRs (app's data model, workflows, standards compliance, security model) | Always load if present |
docs/ARCHITECTURE.md | App-specific technology decisions and component structure | Load if present |
Read these silently. Key ADRs to enforce during implementation:
Read context files
Read the files listed in contextFiles from the apply instructions output.
The files depend on the schema being used:
Additionally, load optional artifacts if present:
openspec/changes/<name>/contract.md — if it exists, treat it as the authoritative interface definition. Do not deviate from its declared endpoints, schemas, or error codes during implementation.openspec/changes/<name>/test-plan.md — if it exists, use it to guide verification steps for each task. Each TC's acceptance criteria tell you how to verify the task is done.Show current progress and confirm
Display:
Then use AskUserQuestion to ask:
"Ready to implement remaining tasks for
<change-name>?"
Options:
Implement tasks (loop until done or blocked)
For each pending task:
tests/Unit/ or tests/unit/ with at least 3 test methods covering the happy path, error handling, and edge cases- [ ] → - [x]plan.json exists):
openspec/changes/<name>/plan.json, find the tracking_issue number- [ ] **1.1 Task title**)- [ ] to - [x] - [ ] (2-space indent), change it to - [x]get_issue → {owner, repo, issue_number: <tracking_issue>} → apply the above changes to the body → 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 → gh issue edit <tracking_issue> --repo <repo> --body "<updated_body>"plan.json: set "status": "done" for that taskSeed data requirement (ADR-001):
lib/Settings/{app}_register.jsondesign.md as the source — it defines objects, field values, and related items@self envelope pattern (register, schema, slug) per ADR-001design.md has no Seed Data section, flag this and suggest adding one before continuingPause if:
On completion or pause, show status and update progress comment
Display:
Pipeline progress comment (if plan.json exists with tracking_issue):
Post or update a single progress comment on the GitHub issue. Search existing comments for one starting with ## Pipeline Progress — if found, update it via PATCH; if not, create a new one. This keeps progress in one place instead of spamming multiple comments.
Format:
## Pipeline Progress
| Stage | Status | Details |
|-------|--------|---------|
| Implementation | ✓ N/M tasks | Completed tasks X, Y, Z |
| Quality Checks | pending | |
| Verification | pending | |
| Archive | pending | |
*Updated: YYYY-MM-DD HH:MM UTC*
list_issue_comments to find existing progress comment, then update_issue_comment or add_issue_commentgh api repos/{owner}/{repo}/issues/{n}/comments to search, then PATCH or POSTIf all tasks done: proceed to Step 8 (quality checks). Update the progress comment with Implementation = "✓ Complete" and Quality Checks = "running...".
If plan.json exists and all tasks are now done: also add a separate brief comment:
add_issue_comment → {owner, repo, issue_number: <tracking_issue>, body: "✓ All tasks implemented. Running quality checks."}gh issue comment <tracking_issue> --repo <repo> --body "✓ All tasks implemented. Running quality checks."Run code quality checks
After all tasks are complete, run the full quality suite from the project directory.
PHP quality (if the project has a composer.json with quality scripts):
cd <project-dir> && composer check:strict 2>&1
This runs: lint + named-args check + phpcs + phpmd + psalm + phpstan + unit tests.
If check:strict is not available, fall back to running individually:
composer phpcs 2>&1
composer phpmd 2>&1
composer psalm 2>&1
Frontend quality (if the project has a package.json with lint scripts):
cd <project-dir> && npm run lint 2>&1
npm run stylelint 2>&1
Handle failures:
composer phpcs:fix (PHPCBF auto-fixes ~60% of PHPCS issues)npm run lint -- --fix (ESLint auto-fix)Show quality results:
## Quality Checks
| Tool | Status |
|------|--------|
| PHPCS | ✓ Pass (or X errors fixed) |
| PHPMD | ✓ Pass |
| Psalm | ✓ Pass |
| PHPStan | ✓ Pass |
| ESLint | ✓ Pass |
| Stylelint | ✓ Pass |
| Unit Tests | ✓ Pass (N tests) |
Ask what's next
After quality checks pass (or remaining issues are reported), show the completion summary, then use AskUserQuestion to ask:
"Implementation complete! What would you like to do next?"
Options:
/opsx-verify) — recommended: check the code matches specs and run API/browser tests/team-reviewer) — have a reviewer look at the code before verifying/opsx-sync) — sync this change's specs to main specs first/opsx-archive) — skip verification if already reviewed externallyOutput During Implementation
## Implementing: <change-name> (schema: <schema-name>)
Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete
Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
Output On Completion
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
### Quality Checks
| Tool | Status |
|------|--------|
| PHPCS | ✓ Pass |
| PHPMD | ✓ Pass |
| Psalm | ✓ Pass |
| ESLint | ✓ Pass |
| Unit Tests | ✓ 42 tests passed |
**What's Next**
Recommended: `/opsx-verify` | Optional: `/team-reviewer`, `/opsx-sync` | Alternative: `/opsx-archive`
Output On Pause (Issue Encountered)
## Implementation Paused
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete
### Issue Encountered
<description of the issue>
**Options:**
1. <option 1>
2. <option 2>
3. Other approach
What would you like to do?
After completing tasks, 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.
Guardrails
Fluid Workflow Integration
This skill supports the "actions on a change" model:
💡 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
Detect admin settings Vue components registered in the vue-router. Admin settings are rendered by Nextcloud's settings framework via `AdminSettings.php`; adding their Vue components to the in-app router exposes them as publicly-accessible frontend routes, bypassing all server-side access checks. ADR-004 hard rule. Observed 2026-04-30 on doriath where `/settings → AdminRoot` was a route in `src/router/index.js` (commit c7c72e9).
Run `composer audit` to check composer.lock dependencies for known CVEs. Invoked by the builder before push and the reviewer's mandatory block. Mirrors the orchestrator's `composer-audit` quality gate.
Scan lib/ for forbidden debug helpers (var_dump / die / error_log / print_r / dd / dump) that should not ship. Invoked by the builder before push, by the reviewer as Mandatory Step 2, and by the fixer during a retry. Mirrors the orchestrator's `forbidden-patterns` quality gate.