agentleFS
intent-driven-devintent-driven-dev/intent-driven-template/.agents/skills/openspec-bulk-apply-change/SKILL.md

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.

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
  1. Very specific:

    REQUIRED SUB-SKILL: Use openspec-git-discipline before any apply or worktree workflow.

    line 16
  2. Very specific:

    Use this skill for requests to apply multiple OpenSpec changes in parallel.

    line 20
  3. Distinctive:

    If the user named changes, limit analysis to those changes.

    line 32
  4. Very specific:

    If one active candidate remains, stop and direct the user to openspec-apply-change for that change.

    line 33
  5. Distinctive:

    Do not ask the user to choose one change when 2 or more candidates remain and the request is clearly bulk apply.

    line 34
  6. Very specific:

    Verify openspec/changes/<change>/ has no uncommitted proposal files.

    line 41
  7. Distinctive:

    Verify the proposal change exists on main before applying from any branch or worktree.

    line 42
  8. Distinctive:

    If any candidate fails the gate, exclude it from execution and report the reason.

    line 44
  9. Very specific:

    Read all listed contextFiles.

    line 57
  10. Distinctive:

    Read the tasks artifact and summarize pending work.

    line 58
  11. Very specific:

    Read applicable project instructions and the apply/verify skills to determine whether each worker may implement and verify the change …

    line 64
  12. Very specific:

    When no further delegation is required, default to the built-in general worker to implement and verify its assigned change itself.

    line 65
  13. Distinctive:

    Codex and other harnesses: Use their native subagents and check their own delegation capabilities, nesting limits, and permissions.

    line 69
  14. Very specific:

    Create a git worktree under .worktrees/<change> unless the user specified another root.

    line 77
  15. Distinctive:

    Keep the parent agent out of direct implementation work in the main workspace.

    line 79
  16. Distinctive:

    Do not create commits, branches, or merges unless the user explicitly approved them.

    line 80
  17. Distinctive:

    Run all delegated apply flows in parallel.

    line 87
  18. Distinctive:

    Do not apply any change directly in the parent agent.

    line 88
  19. Very specific:

    Use openspec-git-discipline before applying.

    line 95
  20. Distinctive:

    Follow applicable project role routing: implement and verify directly only when further delegation is not required.

    line 98
  21. Distinctive:

    Do not merge, archive, or commit unless explicitly instructed by the parent prompt.

    line 100
  22. Very specific:

    Verify status: ready, warnings, critical, or failed

    line 109
  23. Distinctive:

    Do not bulk-apply when only one candidate change remains.

    line 154
  24. Distinctive:

    Do not perform apply work in the parent agent.

    line 155
  25. Distinctive:

    Do not run bulk apply in the main workspace.

    line 156
  26. Very specific:

    Keep .worktrees/ as the default worktree root unless the user specifies another location.

    line 157

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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-change for 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.
  2. 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 main before 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.

  3. Collect change context

    For each executable candidate change:

    openspec status --change "<name>" --json
    openspec instructions apply --change "<name>" --json

    Then:

    • 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-dev and senior-qa.
    • When no further delegation is required, default to the built-in general worker 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 general subagent cannot launch children. The default experimental.subagent_depth is 1; a direct parent → worker → specialist flow needs at least 2 (and more if the current session is already nested or further levels are required). Depth alone is insufficient: the relevant agents' subagent permissions 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-dev or senior-qa cannot 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.
  4. 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.
  5. 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-toplevel with the shell tool's workdir explicitly 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 workdir explicitly to that worktree. Resolve paths before use; do not follow symlinks outside it or rely on inherited directories, a previous cd, 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 workdir requirements 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-discipline before applying.
    • Load and follow openspec-apply-change for the assigned change.
    • Load and follow openspec-verify-change for 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.
  6. Collect and normalize reports

    For each executed change, capture:

    • Worktree path
    • Apply status: complete, paused, or failed
    • Verify status: ready, warnings, critical, or failed
    • Files changed summary
    • Blockers or unresolved warnings
  7. 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

SituationAction
2+ active candidatesBulk apply in isolated worktrees
Explicit list of 2+ changesBulk apply only those changes
1 candidateStop and direct the user to openspec-apply-change
Proposal not on mainExclude or stop before apply
Blocked or all-done changeSkip execution and report status
Subagent finishes applyRequire openspec-verify-change before reporting ready for review
User asks to merge/archiveStop and require explicit follow-up approval

Common Mistakes

MistakeFix
Asking user to pick one change for a bulk requestKeep all executable candidates when 2+ remain
Running apply in the parent workspaceDispatch one subagent per worktree
Processing changes sequentiallyDispatch independent apply flows in parallel
Reporting ready after apply onlyRequire openspec-verify-change first
Treating verify as permission to mergeReport only; merge needs explicit approval
Archiving after verifyNever 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.