cancel
Skill0 starsChanged 7 months agoMITView on GitHub
Cancel any active copilot-omni mode (autopilot, ralph, ultrawork, ultraqa, swarm, ultrapilot, pipeline, team)
- Deletes or force-pushes
We split this skill into the rules it gives an agent
34 rules. 0 are common, 6 are distinctive, and 28 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
28
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
When the stop hook detects work is complete, it instructs the LLM to invoke this skill for proper state cleanup.
- Very specific: line 50
If state_clear is unavailable or fails, use this bash fallback as an emergency escape from the stop hook loop.
- Very specific: line 57
WARNING: Do NOT use this fallback for autopilot.
- Very specific: line 76
When a session id is provided or already known, that session-scoped row is authoritative.
- Very specific: line 94
Use --force or --all when you need to erase every session plus legacy artifacts, e.g., to reset the workspace entirely.
- Very specific: line 110
Every state_clear call uses the MCP state table.
- Distinctive: line 114
When you invoke this skill:
- Very specific: line 129
Call state_read(list=true) to enumerate every (mode, session_id) row and discover all active sessions.
- Very specific: line 131
If a session_id was supplied to /copilot-omni:cancel, operate solely within that session's rows.
- Very specific: line 136
Use force mode to clear every session plus legacy artifacts via state_clear.
- Distinctive: line 177
After cleanup, verify no agent processes remain using the Python orchestrator:
- Very specific: line 184
Use --force to remove even workers that have not reached a terminal state.
- Very specific: line 198
Read team state via state_read(mode="team", session_id) to get the run_id
- Very specific: line 201
Wait up to 15s for worker status.json files to transition to state="cancelled"
- Very specific: line 212
Read autopilot state via state_read(mode="autopilot", session_id) to get current phase
- Very specific: line 213
Check for linked ralph via state_read(mode="ralph", session_id):
- Very specific: line 214
If ralph is active and has linked_ultrawork: true, clear ultrawork first: state_clear(mode="ultrawork", session_id)
- Very specific: line 216
Check for linked ultraqa via state_read(mode="ultraqa", session_id):
- Very specific: line 217
If active, clear it: state_clear(mode="ultraqa", session_id)
- Very specific: line 222
Read ralph state via state_read(mode="ralph", session_id) to check for linked ultrawork
- Very specific: line 224
Read ultrawork state to verify linked_to_ralph: true
- Very specific: line 225
If linked, clear ultrawork: state_clear(mode="ultrawork", session_id)
- Very specific: line 230
Read ultrawork state via state_read(mode="ultrawork", session_id)
- Very specific: line 231
If linked_to_ralph: true, warn user to cancel ralph instead (which cascades)
- Very specific: line 246
Use state_read to enumerate known session ids and learn the active mode (autopilot, ralph, ultrawork, etc.) for each session.
- Very specific: line 247
When operating in default mode, call state_clear(mode=..., session_id=$OMNI_SESSION_ID) to remove only that session’s rows, then run …
- Distinctive: line 292
Safe: Only clears linked Ultrawork, preserves standalone Ultrawork
- Distinctive: line 299
When cancelling modes that may have spawned MCP workers (team bridge daemons), the cancel skill should also:
- Very specific: line 301
Check for active MCP workers: Look for heartbeat files at .omni/state/team-bridge/{team}/*.heartbeat.json
- Distinctive: line 302
Send shutdown signals: Write shutdown signal files for each active worker
- Very specific: line 303
Kill tmux sessions: Run tmux kill-session -t omni-team-{team}-{worker} for each worker
- Distinctive: line 304
Clean up heartbeat files: Remove all heartbeat files for the team
- Very specific: line 305
Clean up shadow registry: Remove .omni/state/team-mcp-workers.json
- Very specific: line 309
When --force is used, also clean up:
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cancel Skill
Intelligent cancellation that detects and cancels the active copilot-omni mode.
The cancel skill is the standard way to complete and exit any copilot-omni mode.
When the stop hook detects work is complete, it instructs the LLM to invoke
this skill for proper state cleanup. If cancel fails or is interrupted,
retry with --force flag, or wait for the 2-hour staleness timeout as
a last resort.
What It Does
Automatically detects which mode is active and cancels it:
- Autopilot: Stops workflow, preserves progress for resume
- Ralph: Stops persistence loop, clears linked ultrawork if applicable
- Ultrawork: Stops parallel execution (standalone or linked)
- UltraQA: Stops QA cycling workflow
- Swarm: Stops coordinated agent swarm, releases claimed tasks
- Ultrapilot: Stops parallel autopilot workers
- Pipeline: Stops sequential agent pipeline
- Team: Signals all workers via cancel cascade (
omni_team.py cancel), waits for responses, runs cleanup, clears linked ralph if present - Team+Ralph (linked): Cancels team first (graceful shutdown), then clears ralph state. Cancelling ralph when linked also cancels team first.
Usage
/copilot-omni:cancelOr say: "cancelomc", "stopomc"
Critical: Deferred Tool Handling
The state management tools (state_clear, state_read, state_write) may be registered as deferred tools. Before calling
any state tool, you MUST first load all of them:
# Load state MCP tools before calling any state_* function
# (Fallback: use scripts/subagent.py state_clear / state_read / state_write)
python3 scripts/subagent.py state_read "check active mode" 2>/dev/null || trueIf state_clear is unavailable or fails, use this bash fallback as an emergency
escape from the stop hook loop. This is NOT a full replacement for the cancel flow —
it only removes state files to unblock the session. Linked modes (e.g. ralph→ultrawork,
autopilot→ralph/ultraqa) must be cleared separately by running the fallback once per mode.
Replace MODE with the specific mode (e.g. ralplan, ralph, ultrawork, ultraqa).
WARNING: Do NOT use this fallback for autopilot. Autopilot requires
state_write(active=false) to preserve resume data.
# Fallback: use scripts/subagent.py to invoke state_clear when the MCP tool is unavailable
SESSION_ID="${OMNI_SESSION_ID:-}"
MODE="ralplan" # <-- replace with the target mode
# Clear session-scoped state for the specific mode via MCP state tool
python3 scripts/subagent.py state_clear "{\"mode\": \"$MODE\", \"session_id\": \"$SESSION_ID\"}"
# Also write the process-level cancel signal so the stop hook detects cancellation in progress
python3 scripts/cancel_signal.py --session-id "$SESSION_ID" --mode "$MODE"Auto-Detection
/copilot-omni:cancel follows the session-aware state contract:
- By default the command inspects the current session via
state_read(list=true), filtering rows bysession_idto discover which mode is active. - When a session id is provided or already known, that session-scoped row is authoritative. The empty-session (
session_id="") slot is consulted only as a compatibility fallback if the session id is missing or empty. - Swarm is a shared SQLite/marker mode and is not session-scoped.
- The default cleanup flow calls
state_clear(mode=..., session_id=$OMNI_SESSION_ID)to remove only the matching session row; modes stay bound to their originating session.
Active modes are still cancelled in dependency order:
- Autopilot (includes linked ralph/ultraqa/ cleanup)
- Ralph (cleans its linked ultrawork or )
- Ultrawork (standalone)
- UltraQA (standalone)
- Swarm (standalone)
- Ultrapilot (standalone)
- Pipeline (standalone)
- Team
- Plan Consensus (standalone)
- Self-Improve (standalone — clear state, clean orphaned worktrees, preserve iteration_state for resume, set status: "user_stopped" in .omni/self-improve/state/agent-settings.json)
Force Clear All
Use --force or --all when you need to erase every session plus legacy artifacts, e.g., to reset the workspace entirely.
/copilot-omni:cancel --force/copilot-omni:cancel --allSteps under the hood:
state_read(list=true)enumerates every(mode, session_id)row to find all known sessions.state_clear(session_id=<id>)runs once per session to drop all rows for that session.state_clear(all=true)removes every remaining row (global/empty-session rows and any stragglers).- Team run directories (
.omni/runs/team-*) are best-effort removed viapython3 scripts/omni_team.py cleanup.
Every state_clear call uses the MCP state table; no direct file removal is needed for state rows.
Implementation Steps
When you invoke this skill:
1. Parse Arguments
# Check for --force or --all flags
FORCE_MODE=false
if [[ "$*" == *"--force"* ]] || [[ "$*" == *"--all"* ]]; then
FORCE_MODE=true
fi2. Detect Active Modes
The skill relies on the MCP state table rather than hard-coded file paths:
- Call
state_read(list=true)to enumerate every(mode, session_id)row and discover all active sessions. - Filter rows by
session_id=$OMNI_SESSION_IDto learn which mode is running (autopilot,ralph,ultrawork, etc.) and whether dependent modes exist. - If a
session_idwas supplied to/copilot-omni:cancel, operate solely within that session's rows; otherwise, also check the empty-session (session_id="") slot as a compatibility fallback if no session-scoped rows are found. Swarm remains a global mode outside session scoping. - Any cancellation logic in this doc mirrors the dependency order discovered via state tools (autopilot → ralph → …).
3A. Force Mode (if --force or --all)
Use force mode to clear every session plus legacy artifacts via state_clear. Direct file removal is reserved for legacy cleanup when the state tools report no active sessions.
3B. Smart Cancellation (default)
If Team Active
Teams are detected by checking for active run directories:
# Check for active team runs
TEAM_RUNS=$(find .omni/runs -name "team-*" -type d 2>/dev/null)Cancellation protocol (WS6 — omni_team.py):
Pass 1: Signal workers via cancel cascade
# Write cancel.signal at team root + every worker run-dir
python3 scripts/omni_team.py cancel <run_id> --reason "user-cancel"
# -> workers poll PARENT_RUN_DIR/cancel.signal and stop
# -> worker status.json transitions to state="cancelled"
# -> team status.json transitions to state="cancelled"Pass 2: Cleanup
python3 scripts/omni_team.py cleanup <run_id>
# -> removes worktrees, prunes git state, clears transient artifactsState Cleanup:
1. state_clear(mode="team", session_id)
2. For each worker slug: state_clear(mode="team.<slug>", session_id)
3. If linked ralph: state_clear(mode="ralph", session_id)
4. If linked ultrawork: state_clear(mode="ultrawork", session_id)
5. Emit structured cancel reportOrphan Detection (Post-Cleanup):
After cleanup, verify no agent processes remain using the Python orchestrator:
# Check for orphan workers (processes still running after cancel+cleanup)
python3 scripts/omni_team.py cleanup <run_id> --forceThe cleanup command removes worktrees, prunes git state, and clears transient artifacts.
Use --force to remove even workers that have not reached a terminal state.
Structured Cancel Report:
Team "{team_name}" cancelled:
- Members signaled: N
- Responses received: M
- Unresponsive: K (list names if any)
- Cleanup: success/failed
- Manual cleanup needed: yes/no
Path: .omni/runs/team-{run_id}/Implementation note: The cancel skill is executed by the LLM, not as a bash script. When you detect an active team (WS6 runtime):
- Read team state via
state_read(mode="team", session_id)to get therun_id - Cancel via orchestrator:
python3 scripts/omni_team.py cancel <run_id> --reason "user-cancel"(This writes cancel.signal at team root + each worker dir; workers poll and stop) - Wait up to 15s for worker status.json files to transition to
state="cancelled" - Cleanup:
python3 scripts/omni_team.py cleanup <run_id>(Removes worktrees, prunes git state) - Clear team state:
state_clear(mode="team", session_id) - For each worker slug found in manifest:
state_clear(mode="team.<slug>", session_id) - Report structured summary to user
If Autopilot Active
Autopilot handles its own cleanup including linked ralph and ultraqa.
- Read autopilot state via
state_read(mode="autopilot", session_id)to get current phase - Check for linked ralph via
state_read(mode="ralph", session_id):- If ralph is active and has
linked_ultrawork: true, clear ultrawork first:state_clear(mode="ultrawork", session_id) - Clear ralph:
state_clear(mode="ralph", session_id)
- If ralph is active and has
- Check for linked ultraqa via
state_read(mode="ultraqa", session_id):- If active, clear it:
state_clear(mode="ultraqa", session_id)
- If active, clear it:
- Mark autopilot inactive (preserve state for resume) via
state_write(mode="autopilot", session_id, state={active: false, ...existing})
If Ralph Active (but not Autopilot)
- Read ralph state via
state_read(mode="ralph", session_id)to check for linked ultrawork - If
linked_ultrawork: true:- Read ultrawork state to verify
linked_to_ralph: true - If linked, clear ultrawork:
state_clear(mode="ultrawork", session_id)
- Read ultrawork state to verify
- Clear ralph:
state_clear(mode="ralph", session_id)
If Ultrawork Active (standalone, not linked)
- Read ultrawork state via
state_read(mode="ultrawork", session_id) - If
linked_to_ralph: true, warn user to cancel ralph instead (which cascades) - Otherwise clear:
state_clear(mode="ultrawork", session_id)
If UltraQA Active (standalone)
Clear directly: state_clear(mode="ultraqa", session_id)
No Active Modes
Report: "No active copilot-omni modes detected. Use --force to clear all state files anyway."
Implementation Notes
The cancel skill runs as follows:
- Parse the
--force/--allflags, tracking whether cleanup should span every session or stay scoped to the current session id. - Use
state_readto enumerate known session ids and learn the active mode (autopilot,ralph,ultrawork, etc.) for each session. - When operating in default mode, call
state_clear(mode=..., session_id=$OMNI_SESSION_ID)to remove only that session’s rows, then run mode-specific cleanup (autopilot → ralph → …) based on the state tool signals. - In force mode, call
state_clear(session_id=<id>)for every active session, then runstate_clear(all=true)to drop any remaining global/empty-session rows and report success. Swarm remains a global mode outside session scoping. - Team run directories (
.omni/runs/team-*) remain best-effort cleanup items invoked during the global pass viapython3 scripts/omni_team.py cleanup. - Always clear skill-active state as the final step, regardless of which mode was active or whether
--forcewas used:
This ensures the stop hook does not keep firing skill-protection reinforcements after cancel due to a stale skill-active row in the state table. See issue #2118.state_clear(mode="skill-active", session_id="$OMNI_SESSION_ID")
State tools always honor the session_id argument, so even force mode still clears the session-scoped paths before deleting compatibility-only legacy state.
Mode-specific subsections below describe what extra cleanup each handler performs after the state-wide operations finish.
Messages Reference
| Mode | Success Message |
| Autopilot | "Autopilot cancelled at phase: {phase}. Progress preserved for resume." |
| Ralph | "Ralph cancelled. Persistent mode deactivated." |
| Ultrawork | "Ultrawork cancelled. Parallel execution mode deactivated." |
| UltraQA | "UltraQA cancelled. QA cycling workflow stopped." |
| Swarm | "Swarm cancelled. Coordinated agents stopped." |
| Ultrapilot | "Ultrapilot cancelled. Parallel autopilot workers stopped." |
| Pipeline | "Pipeline cancelled. Sequential agent chain stopped." |
| Team | "Team cancelled. Teammates shut down and cleaned up." |
| Plan Consensus | "Plan Consensus cancelled. Planning session ended." |
| Force | "All copilot-omni modes cleared. You are free to start fresh." |
| None | "No active copilot-omni modes detected." |
What Gets Preserved
| Mode | State Preserved | Resume Command |
| Autopilot | Yes (phase, files, spec, plan, verdicts) | /copilot-omni:autopilot |
| Ralph | No | N/A |
| Ultrawork | No | N/A |
| UltraQA | No | N/A |
| Swarm | No | N/A |
| Ultrapilot | No | N/A |
| Pipeline | No | N/A |
| Plan Consensus | Yes (plan file path preserved) | N/A |
Notes
- Dependency-aware: Autopilot cancellation cleans up Ralph and UltraQA
- Link-aware: Ralph cancellation cleans up linked Ultrawork
- Safe: Only clears linked Ultrawork, preserves standalone Ultrawork
- Local-only: Clears state files in
.omni/state/directory - Resume-friendly: Autopilot state is preserved for seamless resume
- Team-aware: Detects active team runs and performs graceful shutdown
MCP Worker Cleanup
When cancelling modes that may have spawned MCP workers (team bridge daemons), the cancel skill should also:
- Check for active MCP workers: Look for heartbeat files at
.omni/state/team-bridge/{team}/*.heartbeat.json - Send shutdown signals: Write shutdown signal files for each active worker
- Kill tmux sessions: Run
tmux kill-session -t omni-team-{team}-{worker}for each worker - Clean up heartbeat files: Remove all heartbeat files for the team
- Clean up shadow registry: Remove
.omni/state/team-mcp-workers.json
Force Clear Addition
When --force is used, also clean up:
rm -rf .omni/state/team-bridge/ # Heartbeat files
rm -f .omni/state/team-mcp-workers.json # Shadow registry
# Kill all omni-team-* tmux sessions
tmux list-sessions -F '#{session_name}' 2>/dev/null | grep '^omni-team-' | while read s; do tmux kill-session -t "$s" 2>/dev/null; doneOther versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- zereight/gitlab-mcp★ 2.1k16% same
Wrote their own version · 9
- Yeachan-Heo/oh-my-claudecode★ 40ksame name
- Yeachan-Heo/oh-my-claude-sisyphus★ 40ksame name
- Yeachan-Heo/oh-my-codex★ 34ksame name
- Q00/ouroboros★ 6.3ksame name
- AGMO-Inc/agmo-everywhere★ 4same name
- ibahgat/oh-my-iflow★ 2same name
- Jkudjo/oh-my-cursor★ 1same name
- MacWulf/claude-in-codex★ 1same name
- Gopyr/gopyr-skills-hub★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use ultragoal and self-improve.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Yeachan-HeoSkillultragoal
Create and execute durable repo-native multi-goal plans over Codex goal mode artifacts.
Also in 3 projects that use this
markmdevSkillself-improve
Analyze Claude Code sessions to find workflow frictions, underused tools, stale instructions, documentation gaps, and opportunities for new skills or automation. Produces actionable improvement suggestions with prioritized recommendations. Use when the user says "self-improve", "analyze my workflow", "what can we improve", "find frictions", "optimize workflow", or asks about improving their Claude Code setup. Also suggest running this after long sessions, multi-session projects, or when the user seems frustrated with repetitive work.
Also in 3 projects that use this
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- ai-slop-cleanerSkill
- autopilotSkill
- configure-notificationsSkill
- debugSkill
- deep-diveSkill
- deepinitSkill
- deep-interviewSkill
- external-contextSkill
- mcp-setupSkill
- omni-doctorSkill
- omni-referenceSkill
- omni-setupSkill
- omni-planSkill
- ralphSkill
- ralplanSkill
- releaseSkill
- rememberSkill
- setupSkill
- skillifySkill
- skillSkill
- teamSkill
- traceSkill
- ultraqaSkill
- ultraworkSkill
- verifySkill
- wikiSkill
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.

