Agent skill

Safe Remove

by sd0xdev in sd0xdev/sd0x-harness

Safely remove plugin assets (skill/agent/rule/script/hook) with dependency detection and reference cleanup.

MITAuto-check passedDevelopment

Install Safe Remove

skills CLI
$ npx skills add sd0xdev/sd0x-harness --skill safe-remove -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sd0xdev/sd0x-harness safe-remove --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sd0xdev/sd0x-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/safe-remove .claude/skills/safe-remove && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
safe-remove
GitHub stars
192
Token cost
~1.5k tokens
SKILL.md length
357 words
Files
2 (incl. references)
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Safely remove plugin assets (skill/agent/rule/script/hook) with dependency detection and reference cleanup.

  • Works in 5 steps: Resolve Target → Build Reference Graph → Classify Impacts → …
  • : user says remove skill
  • SKILL.md covers Input, Workflow, Output Format and Prohibited, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Safe Remove is an agent skill from sd0xdev/sd0x-harness. Safely remove plugin assets (skill/agent/rule/script/hook) with dependency detection and reference cleanup. Use when: user says 'remove skill', 'delete skill', 'deprecate', 'clean up unused', or /safe-remove. Not for: code refactoring (use /simplify), feature removal requiring architecture changes (manual).

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/removal-policy.md`).

It sits in Development, covering Agent instruction files and Refactoring. The repository describes itself as: The harness layer for Claude Code — a reference implementation of harness engineering with hook-enforced dual review, state-machine gates that survive context compaction, and… The licence is MIT.

When your agent uses it

  • : user says remove skill
  • Clean up unused

Example prompts

  • “remove skill”
  • “delete skill”
  • “deprecate”
  • “/safe-remove”

Requirements

  • Pre-approved tools (allowed-tools): Bash(bash:*), Bash(git:*), Read, Grep, Glob, Edit, Write, AskUserQuestion

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Resolve Target
  2. Build Reference Graph
  3. Classify Impacts
  4. Apply (--execute only)
  5. Verify

What it can do on your machine

Read from SKILL.md and the folder at commit c9a2036. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(bash:*)
    • Bash(git:*)
    • Read
    • Grep
    • Glob
    • Edit
    • Write
    • AskUserQuestion

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash, mermaid and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Safe Remove loads about 1.5k tokens when it runs, and up to ~2.7k if it reads all its reference files. Until then it costs about 80 tokens; SKILL.md has 357 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sd0xdev/sd0x-harness at commit c9a2036, republished under its MIT licence (© sd0xdev). 357 words, ~1,540 tokens.

Download SKILL.mdSave it as .claude/skills/safe-remove/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
safe-remove
description
Safely remove plugin assets (skill/agent/rule/script/hook) with dependency detection and reference cleanup. Use when: user says 'remove skill', 'delete skill', 'deprecate', 'clean up unused', or /safe-remove. Not for: code refactoring (use /simplify), feature removal requiring architecture changes (manual).
allowed-tools
Bash(bash:*), Bash(git:*), Read, Grep, Glob, Edit, Write, AskUserQuestion
disable-model-invocation
true

Safe Remove

Safely remove plugin assets by discovering dependencies, classifying impact, and executing removal with verification.

Input

/safe-remove <type> <name> [--execute] [--dry-run]

ArgumentDescriptionDefault
<type>Asset type: skill, agent, rule, script, hookRequired
<name>Asset name (e.g., create-skill, strict-reviewer)Required
--executeApply removal (with AskUserQuestion confirmation)off
--dry-runOutput plan only (default behavior)on

If both --dry-run and --execute are provided, --dry-run wins (safe default).

Workflow

mermaid
sequenceDiagram
    participant U as User
    participant S as /safe-remove
    participant C as Codebase

    S->>C: Phase 1: Resolve target files
    S->>C: Phase 2: Build reference graph
    S->>S: Phase 3: Classify (BLOCKER/PATCHABLE)
    alt Has BLOCKER
        S->>U: HALT — show blockers with file:line
    else Dry-run (default)
        S->>U: Output removal plan
    else --execute
        U->>S: AskUserQuestion approval
        S->>C: Phase 4: Patch → Delete
        S->>C: Phase 5: Verify
        S->>U: Removal complete
    end
Phase 1: Resolve Target

Validate <type> and locate canonical files for the asset.

TypePrimary FilesSecondary Files
skillskills/<name>/ (entire directory)—
agentagents/<name>.md—
rulerules/<name>.md.claude/rules/<name>.md (mirror)
scriptscripts/<name>.*—
hookEntry in hooks/hooks.jsonHook script file

If target not found, output error: Target not found: <type> <name> and stop.

Phase 2: Build Reference Graph

Scan the entire codebase for references to the target. Use type-specific patterns from references/removal-policy.md.

bash
# Core scan — find all references
grep -rn "^skills:.*<name>" agents/ --include="*.md"
grep -rn "/<name>" CLAUDE.md .claude/CLAUDE.md CLAUDE.template.md
grep -rn "/<name>" README*.md
grep -rn "/<name>\|<name>" rules/ skills/ --include="*.md"
grep -rn "<name>" hooks/hooks.json
grep -rn "<name>" test/ --include="*.test.js"
Phase 3: Classify Impacts

Apply 2-tier classification per references/removal-policy.md:

TierDefinitionAction
BLOCKERStructured runtime binding — removal breaks executionHALT with file:line details
PATCHABLEProse/documentation reference — safe to auto-editInclude in patch plan
Show full SKILL.md (188 more words)Show less
Phase 4: Apply (--execute only)

Requires AskUserQuestion confirmation before any changes.

Execution order (patches first, deletes last):

  1. Patch PATCHABLE references:
    • Remove the skill's entry from docs/skill-catalog.yml (tracked CLAUDE files carry no command table since R3; still grep them for prose mentions)
    • Remove/update entries in README.md + locale variants (count + detail row)
    • Update prose mentions in other skills/rules
  2. Delete target files:
    • For skill type: remove entire skills/<name>/ directory + test/skills/<name>*.test.js
    • For script type: remove scripts/<name>.* + test/scripts/<name>.test.js
    • For hook type: remove hook script + JSON entry + test/hooks/<name>.test.js
    • For other types: remove primary + secondary files per Phase 1 table
    • Remove empty directories after deletion

Note: .claude/CLAUDE.md must be patched directly — do not rely on hook auto-sync for content removal.

Phase 5: Verify

Run type-specific verification from references/removal-policy.md:

bash
# Verify no residual references (excluding archived docs)
grep -rn "^skills:.*<name>" agents/ --include="*.md"
grep -rn "/<name>" CLAUDE.md .claude/CLAUDE.md CLAUDE.template.md README*.md skills/ --include="*.md" | grep -v "archived/"
grep -n "command: /<name>" docs/skill-catalog.yml   # canonical registration surface — must be empty

If residual references found, report them. If clean, output Verification passed.

Output Format

Dry-run Plan
markdown
## Safe Remove Plan: <type> <name>

### Target Files (to delete)
| File | Status |
|------|--------|
| skills/<name>/SKILL.md | DELETE |
| test/skills/<name>*.test.js | DELETE (if exists) |

### BLOCKER References (must resolve first)
| File:Line | Pattern | Why |
|-----------|---------|-----|
| agents/foo.md:3 | skills: <name> | Agent skills field |

### PATCHABLE References (auto-fix)
| File:Line | Current | Patch |
|-----------|---------|-------|
| CLAUDE.md:90 | \| /name \| desc \| | REMOVE ROW |
| README.md:308 | \| /name \| desc \| | REMOVE ROW |

### Verdict
- BLOCKER count: N → ⛔ HALT (resolve blockers first)
- BLOCKER count: 0, PATCHABLE count: M → ✅ Ready to execute

Prohibited

  • Auto-triggering (always explicit invocation only)
  • Deleting without --execute flag + user confirmation
  • Removing assets referenced in auto-loop rules without user acknowledgment
  • Force-deleting when BLOCKERs exist
  • Modifying files outside the removal scope (no side-effect changes)

References

FilePurposeWhen to Read
references/removal-policy.mdBLOCKER/PATCHABLE classification rules + per-asset-type matrixAlways (Phase 2-5)

Examples

/safe-remove skill create-skill
→ Dry-run plan showing skill dir + tests to delete + 12 PATCHABLE references

/safe-remove skill create-skill --execute
→ AskUserQuestion → patch 12 refs → delete skill dir + test/skills → verify clean

/safe-remove agent unused-agent
→ Dry-run: 1 file to delete, check for BLOCKER in agents skills: field

© sd0xdev, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/safe-remove of sd0xdev/sd0x-harness.

  • SKILL.md
  • references/removal-policy.md

Open the folder on GitHubat commit c9a2036

Compare with similar skills

Safe Remove next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Safe Remove compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Safe Remove this skillsd0xdev/sd0x-harness192—~1.5kAutomated safety check: PassMIT
Ss Cpp ModernSerial-Studio/Serial-Studio7.2k—~1.6kAutomated safety check: PassCustom licence
Go Rigmudrii/openclaw-dashboard457—~2.8kAutomated safety check: PassMIT
Docslatitude-dev/latitude-llm4.7k—~2.5kAutomated safety check: PassMIT
Steadyagent WorkflowKhalilzhang0825/boring-is-all-you-need173—~1kAutomated safety check: PassMIT
Go Rigmudrii/openclaw-dashboard457—~682Automated safety check: PassMIT

Similar skills

  • Ss Cpp Modern

    Serial-Studio/Serial-Studio

    Modern C++20 authoring guidance for Serial Studio (Qt 6.11, C++20): concepts, ranges, move/RAII, std smart pointers, constexpr, lock-free SPSC atomics.

    7.2k GitHub stars~1.6k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Go Rig

    mudrii/openclaw-dashboard

    A skill your agent uses when building, reviewing, or refactoring Go code that must follow strict design discipline — ATDD/TDD workflow, explicit dependency injection, package-boundary discipline…

    457 GitHub stars~2.8k tokensUpdated 14 days ago
    DevelopmentAuto-check passed
  • Docs

    latitude-dev/latitude-llm

    Review the current conversation context and git changes, then persist durable repository knowledge into dev-docs/.md by domain and into AGENTS.md for cross-cutting repo rules.

    4.7k GitHub stars~2.5k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Steadyagent Workflow

    Khalilzhang0825/boring-is-all-you-need

    Local-first Codex workflow for planning, debugging, reviewing, refactoring, improving AGENTS.md, building skills, publishing agent harness repositories, or running complex multi-step coding tasks…

    173 GitHub stars~1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Go Rig

    mudrii/openclaw-dashboard

    A skill your agent uses when building, reviewing, or refactoring Go code in this repository.

    457 GitHub stars~682 tokensUpdated 14 days ago
    DevelopmentAuto-check passed
  • Py Rig

    mudrii/hermesd

    A skill your agent uses when building, reviewing, or refactoring Python code that requires strong maintainability discipline: SRP, DRY, OCP, explicit dependency injection, TDD/ATDD workflow, strict…

    119 GitHub stars~6.3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed

More from sd0xdev/sd0x-harness

All 91 skills in this repo
  • Adr

    sd0xdev/sd0x-harness

    Write an Architecture Decision Record (ADR) for a feature — Context / Decision / Status / Consequences / Alternatives, filed as docs/features/<feature/adr-<NNN-<title.md with a 3-digit zero-padded…

    192 GitHub stars~4.8k tokensUpdated yesterday
    Auto-check passed
  • Load PR Review

    sd0xdev/sd0x-harness

    Load GitHub PR review comments into AI session — analyze, triage, plan.

    192 GitHub stars~4.4k tokensUpdated yesterday
    Auto-check passed
  • Next Step

    sd0xdev/sd0x-harness

    Change-aware next step advisor. An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Obsidian CLI

    sd0xdev/sd0x-harness

    Obsidian vault integration via official CLI. An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Orchestrate

    sd0xdev/sd0x-harness

    Agent-driven workflow orchestration (v1 report-only). An agent skill from sd0xdev/sd0x-harness.

    192 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • PR Comment

    sd0xdev/sd0x-harness

    Post friendly review comments to a GitHub PR — prepare locally, preview, then submit as atomic review.

    192 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Questions about Safe Remove

What does Safe Remove do?

Safely remove plugin assets (skill/agent/rule/script/hook) with dependency detection and reference cleanup. Safe Remove is an agent skill from sd0xdev/sd0x-harness. Safely remove plugin assets (skill/agent/rule/script/hook) with dependency detection and reference cleanup.

When should I use Safe Remove?

Safe Remove fits situations like: : user says remove skill; clean up unused.

How do I install Safe Remove in Claude Code?

Run `npx skills add sd0xdev/sd0x-harness --skill safe-remove -a claude-code`. Or copy the skill folder (skills/safe-remove in sd0xdev/sd0x-harness) into .claude/skills/safe-remove in your project. Claude Code loads it when a task matches its description.

How do I install Safe Remove in Codex?

Run `npx skills add sd0xdev/sd0x-harness --skill safe-remove -a codex`. Or copy the skill folder (skills/safe-remove in sd0xdev/sd0x-harness) into .agents/skills/safe-remove in your project. Codex loads it when a task matches its description.

Can I use Safe Remove in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sd0xdev/sd0x-harness --skill safe-remove -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/safe-remove, .gemini/skills/safe-remove, .github/skills/safe-remove and .opencode/skills/safe-remove in your project.

What does Safe Remove need to run?

SKILL.md names no scripts, command-line tools or credentials: Safe Remove is instructions for the agent only. Its frontmatter pre-approves these tools: Bash(bash:*), Bash(git:*), Read, Grep, Glob, Edit, Write, AskUserQuestion.

Does Safe Remove access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Safe Remove safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Safe Remove use?

Safe Remove is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Safe Remove use?

About 1.5k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.2k tokens, read only when the agent opens those files.

What are the alternatives to Safe Remove?

Skills that share tags, products or a category with Safe Remove: Ss Cpp Modern (Serial-Studio/Serial-Studio, 7.2k stars), Go Rig (mudrii/openclaw-dashboard, 457 stars), Docs (latitude-dev/latitude-llm, 4.7k stars) and Steadyagent Workflow (Khalilzhang0825/boring-is-all-you-need, 173 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Safe Remove?

sd0xdev (a GitHub user) maintains it in sd0xdev/sd0x-harness, which has 192 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 6, 2026.

Source: sd0xdev/sd0x-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.