Skip to main content
ClaudeWave
Skill536 repo starsupdated yesterday

ralph-specum-cancel

The ralph-specum-cancel skill stops execution of Ralph Specum specifications and optionally removes spec files. Use it when users explicitly request cancellation of spec execution or removal of a specification within the Ralph Specum workflow. The skill safely halts execution by clearing state files, confirms before permanent deletion, and maintains epic planning files unless explicitly requested otherwise.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/tzachbon/smart-ralph /tmp/ralph-specum-cancel && cp -r /tmp/ralph-specum-cancel/plugins/ralph-specum-codex/skills/ralph-specum-cancel ~/.claude/skills/ralph-specum-cancel
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# Ralph Specum Cancel

Use this to stop execution safely and optionally remove a spec. Safe cancel preserves the spec and every prototype source path.

Derive `RALPH_CODEX_PLUGIN_ROOT` from this loaded skill by resolving two parent directories from the `SKILL.md` directory. Never derive it from the project working directory.

## Contract

- Resolve the target by explicit path, exact name, or `.current-spec`
- Treat a missing `activePrototypes` field as an empty map
- Publish reviewed immutable cancellation evidence before removing active state
- Confirm the exact local target before any deletion
- Never delete a remote branch or perform another remote action
- Do not guess on ambiguous names

## Action

1. Resolve the target spec. If none exists, report that there is nothing to cancel.
2. Read `.ralph-state.json` when present and summarize the current phase and progress.
3. If `activePrototypes` is non-empty, use the resolved `basePath` and run `"$RALPH_CODEX_PLUGIN_ROOT/scripts/prototype_records.py" reconcile` before cancellation. Process active IDs by `created`, then ID, at the next safe tool boundary.
4. For each active prototype:
   - Inspect its `owner`, `leaseToken`, and `harnessRun.id`. When `owner` and `leaseToken` are both null or absent, verify that `harnessRun.id` is also null or absent and no builder is associated, then skip interrupt and release and continue cancellation. If those fields disagree, treat the entry as inconsistent builder ownership: retain the lease and active entry and stop for that ID. Otherwise, interrupt only its recorded child builder through the bounded harness contract. Release through `locked_state.py release-lease --id <id> --lease-token <leaseToken>` only after the harness verifies that the recorded builder and descendants stopped. If interruption is unavailable or unverified, or reports any failed termination attempt, retain the lease and active entry and stop cancellation for that ID.
   - Preserve its question, blocker, return phase and task, timestamps, local branch, isolation pointers, partial implementation, run evidence, stale metadata, and downstream artifacts.
   - Render an exclusive terminal candidate with `verdict: cancelled`, `gateApproved: false`, and `sourceDisposition: retained`. Never overwrite existing candidate or final bytes; allocate a new publication ID with `supersedes: ["<original-id>"]` on collision.
   - Before review, store the exact returned `candidateHash`. Update the existing original entry through compare-and-set `transition`, or reserve a separate superseding ID through create-only `locked_state.py upsert-prototype` with the copied recovery fields and exact `candidateHash`. Retain the original active entry unchanged while the superseding record is reviewed. A reservation collision preserves both entries and candidates and allocates another ID.
   - Send the exact candidate bytes and source pointers to the reviewer. Continue only after `REVIEW_PASS`, then call `review-candidate` and `publish` with the publication ID and exact candidate hash.
   - Re-read and parse the immutable final and verify its hash. Publication removes its own active publication entry. When a superseding ID was used, remove the original active entry only after final verification succeeds; any earlier failure retains it. Reconcile, then restore the recorded main phase and task index through `locked_state.py` without changing unrelated state.
5. Safe cancel is the default. After every active prototype has a verified immutable `cancelled` record, delete only `.ralph-state.json` through `locked_state.py delete-state`. Keep the spec directory, `.current-spec`, terminal records, prototype source, partial work, scratch paths, worktrees, and local branches.
6. If full removal was explicitly requested, show the resolved spec directory and every prototype isolation path and branch. Require confirmation naming the exact spec directory before removing it. Prototype paths and local branches require separate exact confirmations and are never included in recursive spec cleanup. Never delete a remote branch.
7. If no state exists, report that no active loop exists and remove nothing unless the exact full-removal confirmation is complete.
8. Keep active epic files unless the user separately requests their removal. Report exactly what was removed and what was preserved.
Command DevelopmentSkill

This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.

Hook DevelopmentSkill

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.

MCP IntegrationSkill

This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.

Plugin SettingsSkill

This skill should be used when the user asks about "plugin settings", "store plugin configuration", "user-configurable plugin", ".local.md files", "plugin state files", "read YAML frontmatter", "per-project plugin settings", or wants to make plugin behavior configurable. Documents the .claude/plugin-name.local.md pattern for storing plugin-specific configuration with YAML frontmatter and markdown content.

Plugin StructureSkill

This skill should be used when the user asks to "create a plugin", "scaffold a plugin", "understand plugin structure", "organize plugin components", "set up plugin.json", "use ${CLAUDE_PLUGIN_ROOT}", "add commands/agents/skills/hooks", "configure auto-discovery", or needs guidance on plugin directory layout, manifest configuration, component organization, file naming conventions, or Claude Code plugin architecture best practices.

Skill DevelopmentSkill

This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.

speckit.analyzeSlash Command

Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.

speckit.checklistSlash Command

Generate a custom checklist for the current feature based on user requirements.