recover-prowl-agents
ALWAYS invoke this skill when preparing for or recovering coding-agent sessions after a Prowl restart. NEVER restart Prowl without a prepared exact-session manifest.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 1
- Forks
- 1
01 前言 Front Matter
- name
- recover-prowl-agents
- description
- ALWAYS invoke this skill when preparing for or recovering coding-agent sessions after a Prowl restart. NEVER restart Prowl without a prepared exact-session manifest.
- allowed-tools
- Read, Write, {{! tool('use_skill') !}}, Bash(python3 "${CLAUDE_SKILL_DIR}/scripts/recover_agents.py":*), {{! tool('ask_user') !}}
- argument-hint
- <prepare|recover> <absolute-manifest-path> [<absolute-writable-roots-path>]
02 资源文件 2
- 脚本scripts/agent_tokens.py261 B
- 脚本scripts/recover_agents.py56.4 KB
03 SKILL.md 正文
<objective> A durable pre-restart allowlist or an idempotent post-restart recovery in which every prepared native session has one exact Prowl pane correlation, every verified pane is read before any continuation is planned, every non-controller session receives one separately submitted context-reconciled continuation instruction, and no unprepared agent is running. </objective>
<dependencies>
- Python 3.13+, the plugin's published shipped-script interpreter floor.
- Use skill
coding-agents:operate-prowlfor every public Prowl operation. - A Prowl-native input-ready prompt for any session whose exact identity or launch context is unavailable from high-confidence public process or agent evidence.
- One absolute manifest path supplied through
$ARGUMENTS. - For
recover, an optional absolute path to a JSON file mapping a prepared candidate's absolute worktree path to a list of absolute writable roots.
</dependencies>
<routing>
Parse $ARGUMENTS as exactly one mode, one absolute manifest path, and for recover alone an optional absolute writable-roots file path:
| Mode | Workflow |
|---|---|
prepare |
Run <prepare_workflow> before Prowl stops. |
recover |
Run <recover_workflow> after Prowl restarts. |
Reject an absent mode, unsupported mode, relative path, extra positional value, a writable-roots path supplied to prepare, or a recover manifest path that does not contain a schema-5 prepared manifest.
</routing>
<identity_evidence>
A candidate requires one exact evidence source:
| Source | Required observation |
|---|---|
process-argument |
The live native process argument contains the complete session identity. |
open-session-file |
The live process holds an open native session file whose name contains the identity. |
native-status |
The exact pane's native status surface displays the session identity and cwd. |
current-session |
The running controller exposes its own complete session identity. |
public-agent |
/operate-prowl agents reports an exact high-confidence session in the pane. |
operator-confirmed |
The operator explicitly confirms the exact pane, worktree, agent type, and session. |
A pane title, terminal presentation, saved transcript, rollout existence, recent file, session-file timestamp, or sessionless roster entry is never identity evidence. Prowl's working, idle, blocked, and done values are advisory workflow projections, never native-session eligibility or completion evidence. Preserve a status value when reporting it, but never include or exclude a candidate from that value alone.
Record launch context separately from identity evidence:
resumeLocatoris the exact Claude session ID or open JSONL path, and equalssessionIdfor Codex and Pi.nativeHomeis the absoluteCODEX_HOMEowning the exact Codex rollout when applicable; it is null for Claude and Pi.- Derive both from the live process, its open session file, or operator-confirmed exact storage. NEVER select either by recency.
</identity_evidence>
<native_status_protocol>
Use this bounded protocol only when exact process or high-confidence public-agent evidence is unavailable:
- Use skill
coding-agents:operate-prowlto runreadwith the exact pane UUID and stable-screen mode. - When a selection dialog is visibly open, use skill
coding-agents:operate-prowlto runkeywithEscape. Theprepareinvocation authorizes this exact dialog dismissal; NEVER sendEscapeto active generation. - Use skill
coding-agents:operate-prowlto runsendwith/statusfor Claude or Codex and/sessionfor Pi, using immediate return. - Use skill
coding-agents:operate-prowlto runreadonce with stable-screen mode. When slash-command autocomplete consumed the firstEnter, use skillcoding-agents:operate-prowlto runkeywithEnteronce and read once more. - Record the complete displayed session identity and cwd with
source: native-status. - Use skill
coding-agents:operate-prowlto runkeywithEscapeonce to close the status surface.
Stop preparation when an active session cannot safely reach its native status surface. Never queue a status command into active work or infer the identity from recency instead.
</native_status_protocol>
<prepare_workflow>
- Invoke
/operate-prowlonce forlistand once foragents; preserve both complete checked results. - Select every positively identified native session represented by an instantiated pre-restart pane. Require exact evidence from
<identity_evidence>and exclude ordinary shells and unconfirmed ambiguous identities. NEVER filter on Prowl status: adoneprojection can still carry an unfinished native conversation, as the live restart test established. - Establish every selected pane's complete worktree, agent type (
claude,codex, orpi), native session, exactresumeLocator, applicablenativeHome, evidence source, role, and secondary authorization through<identity_evidence>. Use<native_status_protocol>only for unresolved exact identity. - Reconcile by worktree. Require exactly one primary; every distinct secondary requires
secondaryAuthorized: trueafter explicit operator authorization. Reject duplicate native sessions globally. - Build the script input with checked public
items,agents, exactcandidates, and exactcorrelationEvidence. Each candidate usespaneId,worktreePath,sessionId,resumeLocator,nativeHome,agentType,evidence,role, andsecondaryAuthorized; each evidence item usespaneId,worktreePath,sessionId,agentType, andsource. - Run
prepare, repeating--panefor every selected pre-restart pane UUID. Accept onlystatus: preparedand schema version 5. - Write the complete prepared result to the absolute manifest path. Preserve the checked list and agent responses beside it when the caller requests a snapshot directory; never replace the script's candidate result with a hand-authored summary.
- Report the full manifest path and candidate count. Prowl may restart only after every intended live session appears exactly once and unresolved identity count is zero.
</prepare_workflow>
<recover_workflow>
- Read the schema-5
preparedmanifest from the exact absolute path. Never substitute another snapshot, a historical roster, or post-restart inference. - When a writable-roots path is supplied, read it and hold its object unchanged as
writableRoots; the prepared manifest never records a root. Treat an already resumed controller as a normal prepared candidate. Its post-restart pane UUID may differ; never launch a duplicate controller. - Invoke
/operate-prowlonce forlistand once foragents, then runactivatewith the prepared manifest and checked public arrays. - Read the activation plan exactly:
readycarries complete existing bindings and no activation.activation-requiredcarries existing bindings plus orderedopenortab-createactions.pane-occupied,invalid-target, orinvalid-schemastops before mutation.
- Treat
listas the instantiated-terminal inventory, not the visible sidebar-worktree inventory. For everyopenaction, invoke/operate-prowlopenwith the complete prepared worktree path andmutationAuthorized: true; the operator's exactrecoverinvocation authorizes the visible focus switch and first-tab creation for that prepared path. NEVER enumerate Git worktrees or filesystem directories to invent activation targets. For everytab-createaction, require the prepared authorized secondary and use the same exact-worktree authorization. Preserve every complete checked result in action order. - Run
bindwith the activation plan and ordered{originalPaneId, transport}results. Anopenresult passes only withresolution: exact-root, an exact returned worktree path, and a complete returned pane;new-root,inside-root, path mismatch, or missing target stops recovery. Preservecreated_tabas evidence rather than requiring one value: false can identify an existing exact target and must not trigger an extra pane. Accept onlyready; every binding preserves one original pane and one distinct Prowl-returned post-restart pane. - Invoke
/operate-prowlonce forlistand once foragents, then runrecoverwith the unchanged prepared manifest and exact bindings, addingwritableRootswhen held. Stop on any occupied, missing, duplicate, or mismatched target, a non-absolute root, or a launching candidate whose agent type accepts no writable-root option while a root is supplied for its worktree, without partial delivery. - Launch one planned native session at a time. Invoke
/operate-prowlonce forsendusing its completepaneId, exact source-owned native command, and immediate-return mode, then require checked transport evidence that a trailingEnterwas sent. The command contains only the prepared agent type, exact resume locator or session identity, applicable native home, and one writable-root option for each root supplied for the candidate's worktree; NEVER append reassessment prose or replace it with a recency selector. Serialize Codex launches sharing onenativeHomeand wait for the prior Codex TUI to become input-ready before starting the next, preventing shared SQLite initialization locks. - Run
settlewith the exact launch plan and ordered checked transports. Accept onlyresumedoralready-current; never retry a transport that may have delivered. A transport with noresponse.data.input.trailing_enter_sent: trueis not settled. - Wait for each launched native TUI to become input-ready through one bounded stable-screen read. When Claude presents its exact old-session resume-mode prompt, select the recommended
Resume from summaryoption with one authorizedEnter; this preserves the exact native identity while avoiding a full-history reload. Resolve update, trust, authentication, account-selection, or any other usage-affecting dialog only within explicit operator authority; stop that candidate when exact recovery remains unavailable. - Invoke
/operate-prowlonce more forlistandagents. Build exact post-restartcorrelationEvidence: use exact high-confidence public-agent identity where available and<native_status_protocol>or process-backed evidence otherwise. - Run
verifywith the prepared manifest, exact bindings, checked public arrays, and correlation evidence. Accept onlyverified, with target count equal to the prepared candidate count and empty missing, duplicate, and unexpected arrays. - Establish one global context-read barrier before planning or sending any continuation. In prepared-manifest order, invoke
/operate-prowlreadwith stable-screen mode for every verified binding, including the active controller and every already-correlated pane. Preserve each complete checked result as{originalPaneId, paneId, transport}. Finish all reads before the first reassessment send; NEVER interleave a pane read with continuation delivery. If any pane cannot be read, stop reassessment for the entire set with zero sends. - Run
reassesswith the verified result and the complete orderedpaneReadResults.already-currentemits no delivery.reassessment-readyemits one source-owned continuation instruction for each verified non-controller session absent fromreassessedSessionIds. The instruction requires the resumed agent to reconcile the native conversation and every explicitly presented plan or context artifact against the work actually delivered before continuing or marking anything complete; separate useful work never absorbs an unreconciled plan. - For every reassessment delivery, invoke
/operate-prowlonce forsendusing its completepaneId, exact source-owned text, and immediate-return mode. These sends occur only after verification and the global context-read barrier and contain no native launch command. Require checked transport evidence that trailingEnterwas sent; visible text still sitting in an editor is not delivery. - Run
settlewith the reassessment plan and ordered checked transports. Accept onlyreassessment-sent, then perform one bounded stable-screen read per recipient to establish that the submitted turn left the editor or began a response. Replace the manifest with the returnedpreparedobject only after that submission check so repeated recovery emits no duplicate reassessment. - Preserve the activation plan, bindings, launch plan, checked launch transports, verification result, complete pane-read barrier, reassessment plan, checked reassessment transports, and updated manifest together. Report every full old-pane/new-pane/worktree/agent/session correlation.
</recover_workflow>
<command_forms>
Every operation takes its JSON input from stdin. Write the input with the file-write tool to a file in the scratch directory the harness names for this session, under a file name unique to the agent and the operation, and submit it through the input redirect < <input-file>. Where the harness names no scratch directory, use the one the environment designates, such as $RUNNER_TEMP on a hosted runner. An input carries pane reads, transports, and JSON that the dangerous-command guard refuses in a heredoc, a pipe, or an inline argument. The input shapes:
prepare:{"items":[],"agents":[],"candidates":[],"correlationEvidence":[]}, with--pane <pre-restart-pane-uuid>repeated per selected paneactivate:{"prepared":{},"items":[],"agents":[]}bind:{"plan":{},"activationResults":[]}recover:{"prepared":{},"bindings":[],"items":[],"agents":[],"writableRoots":{}}, wherewritableRootsis optional and maps an absolute worktree path to its list of absolute rootssettle:{"plan":{},"deliveryResults":[]}verify:{"prepared":{},"bindings":[],"items":[],"agents":[],"correlationEvidence":[]}reassess:{"prepared":{},"bindings":[],"verification":{},"paneReadResults":[]}
python3 "${CLAUDE_SKILL_DIR}/scripts/recover_agents.py" <operation> < <input-file>
</command_forms>
<constraints>
- ALWAYS: Use skill
coding-agents:operate-prowlfor public Prowl operations and preserve complete checked results. - ALWAYS preserve original and post-restart pane UUIDs, absolute worktree paths, agent types, native session IDs, exact resume locators, applicable native homes, evidence sources, roles, authorization values, and reassessed-session identities verbatim.
- NEVER reconstruct eligibility or identity from Prowl status, transcript content, saved-history recency, rollout recency, pane presentation, or a latest-session selector.
- NEVER enumerate worktrees blindly; activation targets only complete worktree paths already preserved by prepared native-session candidates.
- NEVER type into an occupied mismatched pane, close a pane, launch an unprepared identity, or execute one native session in multiple panes or worktrees.
- NEVER pass an operation input through a heredoc, a pipe, or an inline argument, and NEVER remove an input file; the harness clears its scratch directory.
- ALWAYS take writable roots from the recover request, preserve each absolute root verbatim, and record none in the prepared manifest.
- NEVER start a watcher, polling loop, daemon, background process, or open-ended wait.
- NEVER plan or send reassessment before every verified pane has one checked context read; one unreadable pane blocks all continuation sends.
- NEVER combine native launch and reassessment in one send, treat interruption metadata as cancellation, substitute repository completion for an unanswered operator request, treat distinct delivered work as satisfying an unreconciled plan, ask again for existing authority, or silently exit when a pending interaction can be restored.
</constraints>
<testing>
Exercise schema-5 preparation, exact Claude resume locators, applicable Codex homes, lazy activation, checked binding, launch-only native command selection for Claude/Codex/Pi with supplied writable roots, all-pane context-read barriers, strict launch and reassessment settlement, durable reassessment idempotence, secondary authorization, duplicate rejection, path preservation, external exact correlation evidence, extra-agent rejection, and CLI dispatch through the linked mapping, property, and compliance evidence.
</testing>
<failure_modes>
Sidebar worktrees disappeared from list. Claude treated prowl list as the sidebar inventory and concluded Prowl had lost its topology. The live GUI still showed known worktree rows; list contained only instantiated terminal panes. Activate only prepared paths with open, require exact-root, and bind the returned new pane.
A done session was unfinished. Claude excluded a pane because Prowl reported done, but its exact native session resumed into concrete unfinished implementation work. Treat every Prowl status as advisory and decide eligibility from exact native identity evidence.
Concurrent Codex launches locked SQLite. Six exact Codex resumes sharing one CODEX_HOME started together; three returned to the shell with a database-lock failure. Serialize launches sharing one native home and wait for each prior TUI to become input-ready.
Claude required summary resumption. An old exact session opened a native choice between summary and full-history resumption. Accept the recommended summary option with one Enter; do not mistake the prompt for failed identity correlation or send continuation prose into it.
Continuation text looked delivered but remained editable. A transport return alone did not prove the turn was submitted. Require the checked public response's trailing_enter_sent value and one bounded post-send read before recording durable reassessment.
A plan was declared absorbed without reading its pane. A resumed session received a generic continuation instruction before the controller read its visible context. It merged a useful but separate change, then treated an explicit unfinished cutover plan as already covered. Read every verified pane before sending any continuation to any recovered session, then require plan-by-plan acceptance-scope reconciliation; distinct work never completes an unread plan.
SPX selected another session. spx agent resume --latest selected Pi in a worktree whose prepared candidate was Codex and selected a different Claude session elsewhere. Select the exact native command from the prepared agent type and complete session ID; recency never chooses recovery identity.
Slash autocomplete consumed Enter. /status remained in the editor because the first Enter selected autocomplete instead of opening Status. Detect the visible autocomplete state, send one additional Enter, capture identity, and close Status with Escape.
Launch prose remained buffered. Claude sent the native resume command and reassessment prose as one terminal input. The interactive TUI consumed the launch while the prose remained buffered until the session quit. Send only the native launch command, verify native identity, then send reassessment separately.
A pending selection became an exit. The reassessment instruction told a restored Codex session to stop when continuation was unclear. The prior turn was waiting for an operator disposition, so Codex stopped instead of restoring the structured question. Re-present pending questions, selections, approvals, and blockers without choosing for the operator.
Authentication interruption looked complete. A Claude response failed with invalid credentials after an explicit operator correction. After login, reassessment inspected Git, declared the repository work complete, and asked for authorization already supplied instead of answering the unsatisfied turn. Retry the last substantive operator request after authentication or tool repair, preserving its original constraints; repository completion never satisfies an unanswered response.
Native storage used another lookup root. Claude required an exact JSONL path after its project location changed, and Codex required the account-specific CODEX_HOME containing its rollout. Preserve the exact resume locator and applicable native home during preparation; never rediscover either by recency after restart.
The environment adapter leaked its request pipe. prowl send rejected text with “Cannot provide text as both argument and stdin” because the adapter child inherited the JSON request stream. /operate-prowl binds absent operation input to null-device stdin; preserve that boundary before recovery delivery.
</failure_modes>
<success_criteria>
- Preparation persists one schema-5 candidate per intended exact native session, including exact launch context, with zero unresolved, duplicate, or unauthorized identity; Prowl status never filters the set.
- Recovery binds every original pane to one distinct post-restart pane in the same worktree and launches only prepared exact native sessions through launch-only sends, each carrying one writable-root option per root the recover request supplies for its worktree.
- Settlement proves every planned launch and reassessment transport once without caller-supplied delivery claims or retries.
- Verification reports
verified, the prepared target count, and empty missing, duplicate, and unexpected agent arrays before reassessment begins. - Every verified pane has one checked stable-screen context read before any reassessment delivery is planned or sent; one failed read produces zero continuation sends.
- Every non-controller session receives one separately settled reassessment instruction that reconciles explicit plans against delivered scope, restores unsatisfied operator work or its pending interaction, and prevents duplicate delivery through the updated manifest.
</success_criteria>
04 同仓库更多 Skills
plugin
暂无简介
sanitize-powerpoint
ALWAYS invoke this skill when sanitizing, cleaning up, auditing, or aligning a PowerPoint (.pptx) deck — slide-master and layout structure, layout type attributes, stray fonts, non-theme colors, or layout naming. NEVER hand-edit pptx XML without this skill.
draw-excalidraw
ALWAYS invoke this skill when creating Excalidraw diagrams, visualizing workflows, architectures, or concepts. NEVER generate Excalidraw JSON without this skill.
typescript-test-standards
TypeScript test standards enforced across all skills. Loaded by other skills, not invoked directly.
typescript-code-standards
TypeScript code standards enforced across all skills. Loaded by other skills, not invoked directly.
typescript-architecture-standards
TypeScript ADR conventions enforced across architect and auditor skills. Loaded by other skills, not invoked directly.