opsx-apply
/opsx-apply
Implement an OpenSpec change in an isolated worktree using the Superpowers executor, then write the apply.md receipt. Also handles PR review feedback after a PR is open. Use when the user wants to start or continue implementation.
- Author
- ttdua ↗
- Repository
- pi-superspec ↗
- Licence
- MIT
- Last repository change
- 08.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 1
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 08.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.
What it does and when to use it
Implement an OpenSpec change in an isolated worktree using the Superpowers executor, then write the apply.md receipt. Also handles PR review feedback after a PR is open. Use when the user wants to start or continue implementation.
Original author description
Implement an OpenSpec change in an isolated worktree using the Superpowers executor, then write the apply.md receipt. Also handles PR review feedback after a PR is open. Use when the user wants to start or continue implementation.
How it works
SKILL.md has no level-two headings · 118 lines, 1,955 words
SKILL.md preview
---
name: opsx-apply
description: Implement an OpenSpec change in an isolated worktree using the Superpowers executor, then write the apply.md receipt. Also handles PR review feedback after a PR is open. Use when the user wants to start or continue implementation.
---
<!-- Adapted from OpenSpec 1.4.1 openspec-apply-change (MIT) for pi, synced with 1.16.0. Not adopted: store selection, project-root guard, optionalWorkflow handoffs, mv archive. -->
Implement the tasks of an OpenSpec change. The CLI returns the apply instruction at runtime; this skill wraps it and adds the executor choice, the receipt, and the post-PR loop.
**Input**: Optionally a change name. If omitted, infer it from conversation context. If vague or ambiguous you MUST ask which change.
**Steps**
1. **Select the change**
- Use the given name, or infer it from conversation context.
- Auto-select if only one active change exists.
- If ambiguous, run `openspec list --json` and ask the user to pick. Ask as the routing note's Interaction channel paragraph describes (plain text with numbered options, recommended first, when it names no tool) and wait.
Always announce: "Using change: <name>" and how to override (e.g., `/opsx-apply <other>`).
2. **Locate an existing worktree**
A re-run (verify FAIL loop, post-PR) may start from the main checkout. Before any other `openspec` call, look for the worktree:
```bash
git worktree list --porcelain
```
Pick the entry whose `branch` line is `branch refs/heads/<change-name>` and take its `worktree` path. If found, reuse it: run every `openspec` call below with that worktree as working directory, skip step 0 and worktree creation, and read `apply.md` there (iteration increments from its `Iteration:` value). Being already inside it is fine. If none matches, this is a first run (or a finalized change, see **Post-PR mode**): continue in the current checkout.
3. **Check status and get apply instructions**
```bash
openspec status --change "<name>" --json
openspec instructions apply --change "<name>" --json
```
From status, read `schemaName`, `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`. The apply instructions return `contextFiles`, progress, the task list, a `state`, and the instruction text.
**Handle states** (check in this order):
- **Post-PR trigger:** `apply.md` and `finalize.md` both exist and the user is addressing PR review feedback. Skip the `blocked` / `all_done` stops and go to **Post-PR mode** (a finalized change normally reports `all_done`).
- **Fix-iteration trigger:** `apply.md` exists and `verify.md` reports `FAIL`. Skip the `all_done` stop (a code-fixable FAIL usually has every box ticked) and go to **Fix-iteration mode**.
- `state: "blocked"`: show the message and handle it by cause, with no code changes. If artifacts are missing, point to `/opsx-continue`. If the tracking file is missing, report it, offer to repair it, and start no implementation. Do not assume another artifact is ready. Then STOP.
- `state: "all_done"` (no trigger above): report that the tracked tasks are complete, suggest `/opsx-verify` and then `/opsx-archive`, and STOP.
- Otherwise proceed.
**Workspace guard:** If status reports `actionContext.mode: "workspace-planning"` and `allowedEditRoots` is empty, explain that full workspace apply is not supported here, treat linked repos as read-only context, and STOP before editing files.
4. **Read context and follow the apply instruction**
Read every file path listed under `contextFiles`. Then follow the instruction returned by `openspec instructions apply` for the setup: step 0 commit, the worktree on branch `<change-name>`, the executor, and the `apply.md` receipt (when step 2 found a worktree, skip step 0 and worktree creation). Do not copy the schema's step text into your own plan; the CLI output is the source of truth. Show progress as "N/M tasks complete" and the remaining tasks. Track tasks with the `todo` tool if available; otherwise state the checklist in your reply.
If `instruction` names `superpowers:<x>`, follow the **Superpowers rule** below.
5. **Choose the executor**
Read [subagent routing](../references/subagent-routing.md) and follow that shared policy before choosing the executor. It covers activation, availability, agent selection and handoff through the Subagent integration paragraph; do not copy it here.
- If delegation is available through the Subagent integration paragraph, use the delegated executor (schema step 2a): read the `subagent-driven-development` skill and execute `plan.md` through it. Select an agent for the implementer role and one for the task reviewer role as the reference's Selection section describes, announce the choice, and give each child the handoff the reference describes:
- the implementer for each task is the agent chosen for the implementer role;
- the review seat after each task is one combined spec and quality review by the agent chosen for the task reviewer role;
- the final whole-branch review is one more seat for the task reviewer role over the full commit range;
- dispatch no duplicate generic reviewer beside these seats.
Keep one implementation writer per worktree and use the configured models: omit per-dispatch model overrides, and pass a thinking level only as the reference's Lanes section allows. This explicitly overrides any conflicting generic model-pinning advice in `subagent-driven-development`; do not rewrite or edit Superpowers. The parent keeps the `todo` progress and ticks `tasks.md`, and gives each reviewer the exact BASE..HEAD range plus the diff or file package, because shell-free reviewers cannot obtain committed ranges themselves.
- **Lanes:** schedule plan tasks as the reference's Lanes section describes, one lane per plan task (one group of the tasks list, run whole by one implementer). A task starts when every task in its `Blocked by` is merged into `<change-name>`; ready tasks with overlapping files run one after another, and a plan without `Blocked by` metadata runs its tasks one after another in plan order. When the plan has metadata, the plan governs scheduling whatever the tasks list holds. Parallel writer lanes each get their own child worktree. This overrides the Superpowers `subagent-driven-development` rule against dispatching several implementation children in parallel: parallel writer lanes are allowed only in separate child worktrees as the reference's Lanes section defines; inside one worktree SDD's sequential rule stands. The task reviewer reviews each lane, and the lane is merged only after its review passes, then the parent ticks that group's boxes in `tasks.md`. An escalated lane waits: the parent does neither merge nor tick it until the implementer's escalation is answered and the lane finishes. Record `## Lanes` in `apply.md` as the reference's Receipt item describes.
- If the Subagent integration paragraph says delegation is unavailable, use the inline executor (schema step 2b): read the `executing-plans` skill, tell the user that TDD and review are not enforced for you, follow TDD manually, and request a whole-branch review (`requesting-code-review`) over the full commit range before writing `apply.md`.
- If no available agent meets a role, the integration is incompatible, a child launch fails, or a child fails mid-run (runtime failure), report the named cause, the run identity and any partial state, and STOP the affected lane. Use no generic replacement or substitute and never silently go inline.
- Fix-iteration and post-PR modes use the same policy and seats wherever they delegate to children.
- Never invent subagent calls.
- Whichever executor runs, brief it to read the Contracts section of `plan.md` and to follow the apply instruction's per-task contract order and stop rule. A contract change is never silent: a `public` contract stops the executor and goes to the user for a decision; after that decision, and for an internal contract straight away, the entry is updated in `plan.md` with the reason and recorded in `apply.md` under "Contract deviations".
**Change-directory authority:** step 0 commits the change directory on the feature branch and creates the worktree on branch `<change-name>`. From then until finalize the worktree copy of the change directory is authoritative: `tasks.md` ticks, `apply.md`, and `verify.md` are written and committed there, and every `openspec` call runs with the worktree as working directory.
Record the executor actually used in `apply.md`. The tracking file is authoritative for progress: tick each task in the worktree copy as it completes, at the `sourcePath` and `line` the apply instruction returns, after checking that the checkbox there still matches the task. If it does not, re-read the tracking file and do not tick a different task. Mark a task `[x]` only when its behavior is fully implemented; if only part is done, leave it unticked.
**Pause if:** a task is unclear (ask), implementation reveals a design issue (suggest updating artifacts), or an error or blocker occurs (report and wait). Also pause and ask when a task adds scope no artifact specifies (add it to the artifacts, or leave it out), or would narrow or defer specified behavior. Do not guess.
6. **Write the receipt and STOP**
After the final whole-branch review, write `apply.md` as the schema's receipt directs (worktree path, branch facts, commit range, iteration, executor, tasks X of Y) and commit it in the worktree. Carry the "Contract deviations" list over from the existing `apply.md` (it is cumulative; do not reset it) and add this run's entries. Then STOP. Do NOT invoke `finishing-a-development-branch`; finishing belongs to the later finalize step. Tell the user to run `/opsx-verify`.
7. **Post-PR mode**
Entered from the post-PR trigger in step 3, when a PR is open and the user brings review feedback.
- Read the `receiving-code-review` skill and follow it.
- Which copy is current: finalize removes the worktree, so the change directory (including `apply.md`, `verify.md`, `finalize.md`) now lives on the feature branch in the main checkout; work and run `openspec` calls there. If step 2 found a worktree anyway, it is still authoritative; use it instead.
- Fix on the feature branch, using TDD for each fix.
- Append a `post-PR iteration N+1` entry with the new commit range to `apply.md`. Keep the existing "Contract deviations" and add any new ones.
- Tell the user to run `/opsx-verify`, then update `finalize.md`.
- Push and reviewer-comment follow the policy in `finalize.md`; a policy in the project `AGENTS.md` overrides it.
8. **Fix-iteration mode**
Entered from the fix-iteration trigger in step 3, in the worktree from step 2.
- Read `Iteration:` in `apply.md`. If it is already 5, do not continue: report the remaining CRITICAL items from `verify.md` and what was tried, then wait for the user.
- Read the `systematic-debugging` skill and find the root cause of each CRITICAL item in `verify.md`. For artifact-level items (spec, design, or tasks are wrong), fix the artifact first.
- Fix the cause with TDD, keeping changes scoped to the CRITICAL items.
- Raise `Iteration:` by one, rewrite `apply.md` (new commit range, executor, tasks X of Y), keeping the existing "Contract deviations" and adding new ones, and commit it in the worktree.
- STOP. Do NOT invoke `finishing-a-development-branch`. Tell the user to run `/opsx-verify`.
**Superpowers rule**
If an instruction says to use `superpowers:<x>`, drop the prefix and read the `SKILL.md` of skill `<x>` from the available skills list. Follow it, but write output only where the apply instruction says (never under `docs/superpowers/`) and ignore that skill's own closing handoff (invoking another skill or a next-step handoff). If skill `<x>` is not available, STOP and tell the user to install Superpowers.
**Output**
On completion:
- Change name, schema, and "N/M tasks complete"
- Executor used and the commit range
- "Run `/opsx-verify` to verify the change."
On pause: describe the issue, offer options (ask as the routing note's Interaction channel paragraph describes; numbered options when it names no tool), and wait.
**Guardrails**
- A `blocked` change gets no code changes; an `all_done` change gets none either, except in Fix-iteration mode (apply.md exists and verify.md reports `FAIL`) or Post-PR mode
- Re-runs reuse the existing `<change-name>` worktree; never redo step 0 or recreate the branch
- Stop at 5 fix iterations and report to the user
- Always read the `contextFiles` before starting
- Keep changes minimal and scoped to each task; update the task checkbox right after finishing it
- Pause on errors, blockers, or unclear requirements; do not guess
- Pause and ask before adding scope the change does not specify, or narrowing or deferring behavior it does
- Never invoke `finishing-a-development-branch`
- Use `contextFiles` from the CLI output; do not assume file names
- If implementation reveals issues, suggest artifact updates rather than working around them
Versions
The database has no other skills named opsx-apply.
Database snapshot: 13.11.2026 · package version c72a10782a2e (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. Also use when the user says "openspec apply", "opsx apply", or "openspec implement". - 100openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. Also use when the user says "openspec apply", "opsx apply", or "openspec implement". - 100openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. Also use when the user says "openspec apply", "opsx apply", or "openspec implement". - 100openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. Also use when the user says "openspec apply", "opsx apply", or "openspec implement". - 100openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. Also use when the user says "openspec apply", "opsx apply", or "openspec implement". - 100openspec-apply-change
Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks. Also use when the user says "openspec apply", "opsx apply", or "openspec implement".