openspec-bulk-apply-change
Skill234 starsChanged 8 days agoMITView on GitHub
Use when multiple active OpenSpec changes should be applied concurrently in isolated worktrees with delegated verification and no merge.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- acceptance-test-authoringSkill
- adversarial-authoringSkill
- architectural-decision-recordsSkill
- c4-diagramsSkill
- gherkin-authoringSkill
- glossarySkill
- grill-meSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-bulk-archive-changeSkill
- openspec-continue-changeSkill
- openspec-exploreSkill
- openspec-git-disciplineSkill
- openspec-new-changeSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-verify-changeSkill
- spec-as-sourceSkill
- test-driven-developmentSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 15 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 16
REQUIRED SUB-SKILL: Use openspec-git-discipline before any apply or worktree workflow.
- Very specific: line 20
Use this skill for requests to apply multiple OpenSpec changes in parallel.
- Distinctive: line 32
If the user named changes, limit analysis to those changes.
- Very specific: line 33
If one active candidate remains, stop and direct the user to openspec-apply-change for that change.
- Distinctive: line 34
Do not ask the user to choose one change when 2 or more candidates remain and the request is clearly bulk apply.
- Very specific: line 41
Verify openspec/changes/<change>/ has no uncommitted proposal files.
- Distinctive: line 42
Verify the proposal change exists on main before applying from any branch or worktree.
- Distinctive: line 44
If any candidate fails the gate, exclude it from execution and report the reason.
- Very specific: line 57
Read all listed contextFiles.
- Distinctive: line 58
Read the tasks artifact and summarize pending work.
- Very specific: line 64
Read applicable project instructions and the apply/verify skills to determine whether each worker may implement and verify the change …
- Very specific: line 65
When no further delegation is required, default to the built-in general worker to implement and verify its assigned change itself.
- Distinctive: line 69
Codex and other harnesses: Use their native subagents and check their own delegation capabilities, nesting limits, and permissions.
- Very specific: line 77
Create a git worktree under .worktrees/<change> unless the user specified another root.
- Distinctive: line 79
Keep the parent agent out of direct implementation work in the main workspace.
- Distinctive: line 80
Do not create commits, branches, or merges unless the user explicitly approved them.
- Distinctive: line 87
Run all delegated apply flows in parallel.
- Distinctive: line 88
Do not apply any change directly in the parent agent.
- Very specific: line 95
Use openspec-git-discipline before applying.
- Distinctive: line 98
Follow applicable project role routing: implement and verify directly only when further delegation is not required.
- Distinctive: line 100
Do not merge, archive, or commit unless explicitly instructed by the parent prompt.
- Very specific: line 109
Verify status: ready, warnings, critical, or failed
- Distinctive: line 154
Do not bulk-apply when only one candidate change remains.
- Distinctive: line 155
Do not perform apply work in the parent agent.
- Distinctive: line 156
Do not run bulk apply in the main workspace.
- Very specific: line 157
Keep .worktrees/ as the default worktree root unless the user specifies another location.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenSpec Bulk Apply
Apply multiple active OpenSpec changes by creating isolated worktrees, dispatching delegated apply flows in parallel subagents, running verification in each flow, and reporting back without merging or archiving.
REQUIRED SUB-SKILL: Use openspec-git-discipline before any apply or worktree workflow.
Input
Use this skill for requests to apply multiple OpenSpec changes in parallel. The user can name the changes, for example Use openspec-bulk-apply-change for add-auth and improve-search, or omit the names to discover all active changes.
Steps
Get candidate changes
Run:
openspec list --json- If the user named changes, limit analysis to those changes.
- If one active candidate remains, stop and direct the user to
openspec-apply-changefor that change. If none remain, report that there are no active candidates. - Do not ask the user to choose one change when 2 or more candidates remain and the request is clearly bulk apply.
Run git discipline checks
For each candidate change, verify apply is allowed before creating worktrees:
- Run
git status --short. - Verify
openspec/changes/<change>/has no uncommitted proposal files. - Verify the proposal change exists on
mainbefore applying from any branch or worktree.
If any candidate fails the gate, exclude it from execution and report the reason. If fewer than 2 executable candidates remain, stop and report that bulk apply is not appropriate.
- Run
Collect change context
For each executable candidate change:
openspec status --change "<name>" --json openspec instructions apply --change "<name>" --jsonThen:
- Read all listed
contextFiles. - Read the tasks artifact and summarize pending work.
- Note the implementation scope needed by the delegated apply flow.
- Exclude blocked or all-done changes from execution and include them in the final report.
Check worker routing before creating worktrees:
- Read applicable project instructions and the apply/verify skills to determine whether each worker may implement and verify the change itself or must delegate to roles such as
senior-devandsenior-qa. - When no further delegation is required, default to the built-in
generalworker to implement and verify its assigned change itself. Do not invent specialist routing where the project does not require it. - When project instructions require nested delegation, select an already configured custom worker capable of launching the required specialists, rather than
general. Verify that the parent can launch that worker and that the worker can launch the required roles. Do not silently replace required specialists with self-implementation or self-verification. - OpenCode V2-specific: The built-in
generalsubagent cannot launch children. The defaultexperimental.subagent_depthis1; a direct parent → worker → specialist flow needs at least2(and more if the current session is already nested or further levels are required). Depth alone is insufficient: the relevant agents'subagentpermissions must also permit each required child. Use native subagents, not plugins. - Claude Code-specific: Subagents cannot launch other subagents. A worker that must call
senior-devorsenior-qacannot itself be a subagent; run those roles from the main session instead, or dispatch the specialists directly from the parent. - Codex and other harnesses: Use their native subagents and check their own delegation capabilities, nesting limits, and permissions; OpenCode configuration keys and built-in restrictions are not portable settings.
- If a required worker, nesting depth, or permission is missing or cannot be confirmed, pause the affected change before dispatch. Report the required roles, the missing capability, and the action needed: ask the user to identify an existing delegation-capable worker, enable sufficient depth, or permit the specific parent/worker child launches, as applicable. Resume only after those prerequisites are confirmed. Do not add a dedicated worker or change global configuration by default, and do not bypass project routing as a fallback.
- Include routing pauses in the final report. If fewer than 2 executable candidates remain, stop rather than dispatching a single-change bulk flow.
- Read all listed
Create isolated worktrees
For each executable candidate change:
- Create a git worktree under
.worktrees/<change>unless the user specified another root. - Resolve each created worktree directory to its absolute canonical path (resolving symlinks) and record it as the worker's expected root. Do not infer that root from the worker's inherited directory.
- Keep the parent agent out of direct implementation work in the main workspace.
- Do not create commits, branches, or merges unless the user explicitly approved them.
- Create a git worktree under
Dispatch subagents in parallel
For each executable candidate change:
- Dispatch one subagent per change using the worker selected by the routing check. Pass its expected canonical root and set its working directory when supported. A path in prompt text does not automatically change any tool's working directory; require explicit tool targeting as described below. If reliable worktree targeting is unavailable, pause the affected change rather than falling back to the parent workspace.
- Run all delegated apply flows in parallel.
- Do not apply any change directly in the parent agent.
Subagent prompt requirements:
- Before implementation, run
git rev-parse --show-toplevelwith the shell tool'sworkdirexplicitly set to the assigned worktree. Canonicalize the returned path and compare it with the expected canonical root supplied by the parent. On command failure or mismatch, halt the assigned work and report both paths or the error; do not continue in another workspace. - For all delegated project work, including reading project instructions and tooling, use absolute file-tool paths scoped to the assigned worktree and set every shell operation's
workdirexplicitly to that worktree. Resolve paths before use; do not follow symlinks outside it or rely on inherited directories, a previouscd, or prompt text. These worker requirements do not apply to the parent's discovery or worktree creation steps. - Propagate the expected canonical root, absolute-path boundary, and explicit shell
workdirrequirements to every nested delegate, including implementation and verification specialists. Require each child to perform the same git-root check before its assigned work; pause if a child cannot reliably target the worktree or halt if its check fails. - Use
openspec-git-disciplinebefore applying. - Load and follow
openspec-apply-changefor the assigned change. - Load and follow
openspec-verify-changefor that change after apply work is complete. - Follow applicable project role routing: implement and verify directly only when further delegation is not required; otherwise use the required specialists through the confirmed native delegation path. If a required child launch is unavailable, pause and report the blocker instead of bypassing it.
- Stop after verification.
- Do not merge, archive, or commit unless explicitly instructed by the parent prompt.
- Return implementation outcome, verification status, changed files, blockers, and unresolved warnings.
Collect and normalize reports
For each executed change, capture:
- Worktree path
- Apply status:
complete,paused, orfailed - Verify status:
ready,warnings,critical, orfailed - Files changed summary
- Blockers or unresolved warnings
Report back without merging
Present a final bulk-apply report:
- Changes analyzed
- Changes skipped and why
- Worktrees created
- Apply result per change
- Verification result per change
- Which changes are ready for human review
End with: "No merge or archive was performed. Explicit user approval is required before any merge or archive."
Quick Reference
| Situation | Action |
| 2+ active candidates | Bulk apply in isolated worktrees |
| Explicit list of 2+ changes | Bulk apply only those changes |
| 1 candidate | Stop and direct the user to openspec-apply-change |
Proposal not on main | Exclude or stop before apply |
| Blocked or all-done change | Skip execution and report status |
| Subagent finishes apply | Require openspec-verify-change before reporting ready for review |
| User asks to merge/archive | Stop and require explicit follow-up approval |
Common Mistakes
| Mistake | Fix |
| Asking user to pick one change for a bulk request | Keep all executable candidates when 2+ remain |
| Running apply in the parent workspace | Dispatch one subagent per worktree |
| Processing changes sequentially | Dispatch independent apply flows in parallel |
| Reporting ready after apply only | Require openspec-verify-change first |
| Treating verify as permission to merge | Report only; merge needs explicit approval |
| Archiving after verify | Never archive during bulk apply |
Guardrails
- Worktree checks and explicit paths are operational guardrails against accidental cross-workspace work, not a security sandbox or filesystem access control.
- Do not auto-merge.
- Do not auto-archive.
- Do not bulk-apply when only one candidate change remains.
- Do not perform apply work in the parent agent; use subagents only.
- Do not run bulk apply in the main workspace; use isolated worktrees only.
- Keep
.worktrees/as the default worktree root unless the user specifies another location. - Require verification in every delegated apply flow before reporting a change as ready for review.
- Preserve OpenSpec git discipline: apply only changes whose proposal state has reached
main.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

