opsx-apply-resume
Skill2 starsChanged 8 days agoMITView on GitHub
Save and resume a long-running OpenSpec apply session from a live worktree, preserving optional gates and host-specific handoff artifacts. Not for: starting a new proposal, changing the external OpenSpec workflow, or treating a commit as a prerequisite. Output: a saved/resumed handoff report with lifecycle and next-action evidence.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- change-verdictSkill
- code-simplifySkill
- code-traceSkill
- create-prSkill
- deploy-listSkill
- doc-maintainSkill
- feature-verifySkill
- flow-driveSkill
- flow-guideSkill
- git-smart-commitSkill
- git-worktreeSkill
- harness-setupSkill
- issue-analyzeSkill
- js-static-checksSkill
- laravelSkill
- legacy-characterization-testsSkill
- library-authorSkill
- merge-prepSkill
- module-designSkill
- nextjsSkill
- openspec-artifact-guardSkill
- phpSkill
- phpunitSkill
- precommitSkill
- project-auditSkill
- project-briefSkill
- proposal-analyzeSkill
- pr-summarySkill
- pythonSkill
- reactSkill
- release-creatorSkill
- repo-intakeSkill
- repo-verifySkill
- swiftSkill
- tdd-workflowSkill
- ui-ux-verifySkill
- vue-2-notesSkill
- yii1Skill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Use one Host-neutral handoff path on every Host: .scratch/<change-id>/apply-resume.md.
- Very specific: line 69
Run the package-local phase detector with the explicit handoff path.
- Distinctive: line 72
Follow exactly one phase reference.
- Distinctive: line 75
Keep optional commit, precommit, compact, and memory providers visibly optional.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Apply Resume
$opsx-apply-resume is the explicit handoff capability behind
/dhpk:opsx-apply-resume. It snapshots enough live state to cross a context
boundary and restores it later; the live worktree remains the source of truth.
$SKILL_DIR denotes the physical directory containing the selected SKILL.md;
it is path notation, not an ambient environment variable or repository-root
lookup. Resolve it once before invoking a package-local helper and keep the
consumer's current working directory unchanged.
When to Use
- An explicit invocation requests Save while a long-running apply session is approaching its context limit.
- An explicit invocation requests Resume after a context/session boundary.
- A previous handoff is in
savedorconsumingstate and needs recovery.
When NOT to Use
- Creating, designing, verifying, or archiving an OpenSpec change.
- Replacing the external
openspec-apply-changeSkill or modifying its files. - Reverting, deleting, or stashing uncommitted work to make a handoff look clean.
Host and package resolution
- Use one Host-neutral handoff path on every Host:
.scratch/<change-id>/apply-resume.md; do not add a public host flag. On resume, when that file is absent, read the legacy.claude/artifacts/apply-resume/latest.md, then.dhpk/artifacts/apply-resume/latest.md. Without a change ID, resume selects the single.scratch/*/apply-resume.mdinsavedorconsumingstate (archivedconsumed-*.mdfiles are ignored); when none exists it tries the two legacy files, else asks. - Resolve the handoff path once and pass it explicitly to every package-local
helper and context loader. Resolve helper executors from
"$SKILL_DIR/scripts/"; helpers must never rediscover a path from their current directory or a parent/peer Skill. A missing helper/reference isBLOCKED_RESOURCE_MISSING. The helpers' built-in default path is a legacy fallback for direct manual use only; this Skill always passes the resolved path. - Load only Save or Resume after phase detection. Keep optional providers undisclosed until their branch is selected.
Workflow
- Interpret the requested task: saving current apply progress selects Save;
restoring saved progress selects Resume. Optional
saveandresumewords express the same tasks. With only a change ID, detect the phase. Parse an optionalchange-id; priority is argument, latest visible apply invocation, then the Host's native selection prompt. If no change can be selected, stopBLOCKED. - Run the package-local phase detector with the explicit handoff path. Honor
the requested phase after checking existing state: a recent save is a
confirmation boundary;
consumingis a recovery boundary. - Follow exactly one phase reference. Save writes a new handoff file; Resume loads it, validates the change, and archives it only after successful continuation.
- Keep optional commit, precommit, compact, and memory providers visibly optional. Their absence or failure never erases live files or invalidates a handoff summary.
- Hand successful continuation to the available canonical
openspec-apply-changeSkill. Claude may use native Skill dispatch; Codex invokes the available projected skill directly. If it is unavailable, reportUNAVAILABLEand keep the handoff recoverable; never edit the external skill or substitute/opsx:applyas a Skill ID.
Host boundary
Claude may recommend /fork, /new, and /model in its save report. Codex
does not require or emit those Claude commands: its report names the next
session/turn and optional model metadata without changing models. Both Hosts
must preserve the same handoff frontmatter, phase states, optional-provider
semantics, and live-worktree rule.
Output
Return:
Phase → Save | Resume → explicit handoff path → change-id
State → saved | consuming | consumed | BLOCKED | UNAVAILABLE | NOT_RUN
Evidence → commit/precommit/compact/memory/provider details
Next action → one recoverable Host-appropriate continuationInclude commit: SKIPPED when no explicit commit was requested; it is valid
evidence, not a failure. A failed apply leaves the handoff in consuming
state for manual recovery. Redact observation content, credentials, and
private paths beyond the declared artifact path.
Verification
- Host path and explicit handoff path were resolved before helper calls.
- Exactly one phase ran and its state transition is recorded.
- Live worktree truth and uncommitted files were preserved.
- Optional provider states are distinct from required apply evidence.
- External OpenSpec continuation used an available canonical skill only; no external skill or alias was modified.
- The terminal state and one next action are explicit.
References
- references/save.md — snapshot, optional gates, and handoff write contract.
- references/resume.md — load, context fallback, consuming state, external continuation, and archive contract.
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.

