agentleFS
manastalukdarmanastalukdar/ai-devstudio/skills/careful/SKILL.md

careful

Skill1 starsChanged 7 months agoMITView on GitHub

Intercept destructive commands before execution — rm -rf, DROP TABLE, force-push, git reset --hard, and similar irreversible operations. Prompts for confirmation and suggests safer alternatives. Inspired by gstack's careful skill.

  • Deletes or force-pushes
  • Installs packages
  • Commits and pushes

46 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use plan-tune, ios-clean and 10 more.

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.
  • ShreyRaviSkill

    plan-tune

    Self-tuning question sensitivity + developer psychographic for gstack (v1: observational). Review which AskUserQuestion prompts fire across gstack skills, set per-question preferences (never-ask / always-ask / ask-only-for-one-way), inspect the dual-track profile (what you declared vs what your behavior suggests), and enable/disable question tuning. Conversational interface — no CLI syntax required.

    Also in 9 projects that use this

  • Saqlain-811Skill

    ios-clean

    Remove the DebugBridge SPM package and all #if DEBUG wiring from an iOS app. (gstack)

    Also in 5 projects that use this

  • Saqlain-811Skill

    ios-fix

    Autonomous iOS bug fixer. (gstack)

    Also in 5 projects that use this

  • ShreyRaviSkill

    landing-report

    Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots are currently claimed by open PRs, which sibling Conductor workspaces have WIP work likely to ship soon, and what slot /ship would pick next. No mutations — just a snapshot. Use when asked to "landing report", "what's in the queue", "show me open PRs", or "which version do I claim next". (gstack)

    Also in 8 projects that use this

  • ayudaySkill

    unfreeze

    Clear the freeze boundary set by /freeze, allowing edits to all directories again. Use when you want to widen edit scope without ending the session. Use when asked to "unfreeze", "unlock edits", "remove freeze", or "allow all edits".

    Also in 19 projects that use this

  • timurgaleevSkill

    document-generate

    Generate missing docs for a feature, module or project as tutorials, how-tos, reference and explanation.

    Also in 7 projects that use this

  • +1 more from Saqlain-811
  • +2 more from ShreyRavi

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Early exit: If no destructive pattern is found in the proposed command, exit immediately without comment.

    line 17
  2. Distinctive:

    If no pattern matches: exit silently (the command is not flagged).

    line 60
  3. Distinctive:

    Wait for user response before proceeding.

    line 90
  4. Very specific:

    CI/CD environment: if $CI=true is set, emit a machine-readable warning and exit non-zero rather than prompting

    line 118
  5. Distinctive:

    Already stashed/committed: if the working tree is clean before the destructive op, note that recovery is easier

    line 119

“Common” is measured: kept by at least 6 in 10 of the 15 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Careful

I'll catch destructive commands before they run and give you a moment to confirm — or choose a safer path. Inspired by gstack's careful skill.

Token Optimization

Expected range: 100–300 tokens per intercept, 20 tokens (no destructive pattern detected)

Patterns used: Grep-based pattern matching, early exit (no match), progressive disclosure (warning → alternatives)

Early exit: If no destructive pattern is found in the proposed command, exit immediately without comment.

When to Use

Invoke before running a command you're unsure about, or configure as a pre-execution hook:

/careful rm -rf dist/
/careful git push --force
/careful "DROP TABLE users;"

Or paste a multi-line script and I'll scan the whole thing.

Step 1 — Scan for Destructive Patterns

Match the input against known high-risk patterns:

# Filesystem destruction
rm -rf | rmdir | shred | find.*-delete | find.*-exec rm

# Git irreversible operations
git push --force | git push -f | git reset --hard | git clean -fd | git rebase.*--force
git branch -D | git tag -d | git reflog expire

# Database
DROP TABLE | DROP DATABASE | TRUNCATE | DELETE FROM.*WHERE 1=1 | DELETE FROM.*no WHERE

# Process/infrastructure
kill -9 | pkill -9 | killall
docker rm -f | docker system prune | kubectl delete.*--force
terraform destroy | ansible.*state=absent

# Package/dependency
npm run clean | pip uninstall -y | pip install --force-reinstall
rm.*node_modules | rm.*__pycache__ | rm.*\.venv

# Data overwrite
dd if=.*of= | mkfs | fdisk | parted
truncate -s 0 | > file  (redirect clobber)

If no pattern matches: exit silently (the command is not flagged).

Step 2 — Risk Assessment

Rate the detected operation:

LevelColorDescription
CRITICALREDData loss with no recovery path (DROP TABLE, rm -rf /)
HIGHORANGEData loss recoverable with backups (git reset --hard, force push)
MEDIUMYELLOWReversible but annoying to undo (npm clean, docker prune)

Step 3 — Warn and Offer Alternatives

⚠ CAREFUL — HIGH RISK — git push --force

This will overwrite the remote branch history. Team members with local checkouts
will have diverged histories.

Safer alternatives:
  git push --force-with-lease    ← only force if no one else pushed
  git push --force-if-includes   ← safer still (Git 2.30+)

What's your intent?
  [1] I understand the risk — run it
  [2] Use --force-with-lease instead
  [3] Cancel and explain more

Wait for user response before proceeding.

Step 4 — Alternatives Reference

File deletion:

  • rm -rf dist/ → trash dist/ (recoverable via Trash) or mv dist/ dist.bak/
  • find . -name "*.log" -delete → dry run first: find . -name "*.log" without -delete

Git resets:

  • git reset --hard → git stash first (recoverable), then reset if needed
  • git push --force → git push --force-with-lease
  • git clean -fd → git clean -nfd (dry run preview)

Database:

  • DROP TABLE → rename first: ALTER TABLE users RENAME TO users_backup_20260427
  • DELETE FROM without WHERE → add LIMIT 1 first to verify filter, then remove limit

Docker:

  • docker system prune → docker system prune --filter "until=24h" (only old images)

Kubernetes:

  • kubectl delete → kubectl get first to verify target, then delete with explicit name

Edge Cases

  • Pipeline commands (cmd1 && rm -rf): scan the full pipeline, flag any destructive step
  • Shell scripts: scan all lines, report all flagged lines with line numbers
  • Aliases: note that alias rm='rm -i' provides interactive prompts by default
  • CI/CD environment: if $CI=true is set, emit a machine-readable warning and exit non-zero rather than prompting
  • Already stashed/committed: if the working tree is clean before the destructive op, note that recovery is easier

Safety Note

This skill intercepts at the description layer — it does not actually block shell execution. For enforced guardrails in a CI pipeline, use a pre-commit hook or shell alias.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.