Skip to content
OpenSmartRoute
Skillv1.0.0

cfn-careful

PreToolUse hook. Warns before destructive bash commands (rm -rf, DROP TABLE, git push --force, etc). Activates via /careful. Whitelists safe deletions (node_modules, .next, dist).

by masharratt(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from masharratt/claude-flow-novice (.claude/skills/cfn-careful/SKILL.md). Install upstream with npx skills add masharratt/claude-flow-novice --skill cfn-careful. Copyright stays with the author.

CFN Careful

Purpose: Prevent accidental destructive operations by intercepting dangerous bash commands before execution.

Dangerous Patterns Detected

File Operations

  • rm -rf / rm -r (except whitelisted dirs)
  • dd if=/dev/zero

Database

  • DROP TABLE
  • DROP DATABASE
  • TRUNCATE

Git

  • git push --force / git push -f
  • git reset --hard
  • git checkout -- . / git checkout .
  • git clean -f

Container/Orchestration

  • kubectl delete
  • docker system prune
  • docker rm -f

Whitelisted Safe Deletions

These directories are safely regenerated and do not contain user data:

  • node_modules, .next, dist, pycache, .cache, .turbo
  • *.pyc, *.o, .DS_Store
  • Build artifacts in /tmp/

How It Works

PreToolUse hook on Bash tool. Parses command from stdin JSON, checks against dangerous patterns. Returns exit 2 (block) with warning message if matched, exit 0 (allow) otherwise.

Activation

The hook is registered in settings.json and always active. No /careful command needed to activate.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/masharratt-claude-flow-novice-cfn-careful/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

masharratt-claude-flow-novice-cfn-careful.ocm.jsonjson
{
  "ocm": "1",
  "id": "masharratt-claude-flow-novice-cfn-careful",
  "kind": "skill",
  "name": "cfn-careful",
  "description": "PreToolUse hook. Warns before destructive bash commands (rm -rf, DROP TABLE, git push --force, etc). Activates via /careful. Whitelists safe deletions (node_modules, .next, dist).",
  "publisher": "masharratt",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding",
      "data_analysis"
    ],
    "tags": [
      "skill-md",
      "safety",
      "guardrails",
      "hooks",
      "destructive-commands",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "PreToolUse hook. Warns before destructive bash commands (rm -rf, DROP TABLE, git push --force, etc). Activates via /careful. Whitelists safe deletions (node_modules, .next, dist)."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/masharratt/claude-flow-novice",
      "path": ".claude/skills/cfn-careful/SKILL.md",
      "ref": "c9816b2c9f400db14b74fc215bb6b8e9909790b5",
      "url": "https://github.com/masharratt/claude-flow-novice/blob/c9816b2c9f400db14b74fc215bb6b8e9909790b5/.claude/skills/cfn-careful/SKILL.md",
      "key": "masharratt/claude-flow-novice/.claude/skills/cfn-careful/SKILL.md"
    }
  },
  "instructions": "# CFN Careful\n\n**Purpose:** Prevent accidental destructive operations by intercepting dangerous bash commands before execution.\n\n## Dangerous Patterns Detected\n\n### File Operations\n- `rm -rf` / `rm -r` (except whitelisted dirs)\n- `dd if=/dev/zero`\n\n### Database\n- `DROP TABLE`\n- `DROP DATABASE`\n- `TRUNCATE`\n\n### Git\n- `git push --force` / `git push -f`\n- `git reset --hard`\n- `git checkout -- .` / `git checkout .`\n- `git clean -f`\n\n### Container/Orchestration\n- `kubectl delete`\n- `docker system prune`\n- `docker rm -f`\n\n## Whitelisted Safe Deletions\nThese directories are safely regenerated and do",
  "cost": {
    "context_tokens": 260
  }
}

Fetch it by URL: GET /api/v1/registry/masharratt-claude-flow-novice-cfn-careful/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.