<< All versions

Skill v0.1.0

currentAutomated scan100/100
mrkhachaturov/rkstack/careful
──Details
PublishedOctober 3, 2026 at 02:44 PM
Content Hashsha256:07dbef11667e338a...
Git SHA
──Files
Files (1 file, 5.0 KB)
SKILL.md5.0 KBactive
SKILL.md · 117 lines · 5.0 KB

name: careful preamble-tier: 1 version: 0.1.0 description: | Safety guardrails for destructive commands. Warns before rm -rf, DROP TABLE, force-push, git reset --hard, kubectl delete, and similar destructive operations. User can override each warning. Use when touching prod, debugging live systems, or working in a shared environment. Use when asked to "be careful", "safety mode", "prod mode", or "careful mode". allowed-tools:

  • Bash
  • Read

hooks: PreToolUse:

  • matcher: "Bash"

hooks:

  • type: command

command: "bash ${CLAUDE_SKILL_DIR}/bin/check-careful.sh" statusMessage: "Checking for destructive commands..."


<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: just build -->

Preamble (run first)

bash
# === RKstack Preamble (careful) ===
# Read detection cache (written by session-start via rkstack detect)
if [ -f .rkstack/settings.json ]; then
cat .rkstack/settings.json
else
echo "WARNING: .rkstack/settings.json not found — detection cache missing"
fi
# Session-volatile checks (can change mid-session)
_BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
_HAS_CLAUDE_MD=$([ -f CLAUDE.md ] && echo "yes" || echo "no")
echo "BRANCH: $_BRANCH"
echo "CLAUDE_MD: $_HAS_CLAUDE_MD"

Use the detection cache and preamble output to adapt your behavior:

  • TypeScript/JavaScript — see detection.flowType (web or default). If web: check React/Vue/Svelte patterns, responsive design, component architecture. If default: CLI tools, MCP servers, backend scripts.
  • Python — backend/ML/scripts. Check PEP8 conventions, pytest for testing.
  • Go — backend/infra. Check error handling patterns, go test.
  • Rust — systems. Check ownership patterns, cargo test.
  • Java/C# — enterprise. Check build tool (Maven/Gradle/.NET), framework conventions.
  • Ruby — web/scripting. Check Gemfile, Rails conventions if present.
  • Terraform/HCL — infrastructure as code. Plan before apply, extra caution with state.
  • Ansible — configuration management. Check inventory, role conventions, vault usage.
  • Docker/Compose — containerized. Check service dependencies, .env patterns.
  • justfile — task runner present. Use just commands instead of raw shell.
  • mise — tool version manager. Versions are pinned — don't suggest global installs.
  • CLAUDE.md exists — read it for project-specific commands and conventions.
  • Read detection.stack for what's in the project and detection.stats for scale (files, code, complexity).
  • Read detection.repoMode for solo vs collaborative.
  • Read detection.services for Supabase and other service integrations.

Completion Status

When completing a skill workflow, report status using one of:

  • DONE — All steps completed successfully. Evidence provided for each claim.
  • DONE_WITH_CONCERNS — Completed, but with issues the user should know about. List each concern.
  • BLOCKED — Cannot proceed. State what is blocking and what was tried.
  • NEEDS_CONTEXT — Missing information required to continue. State exactly what you need.

Escalation

It is always OK to stop and say "this is too hard for me" or "I'm not confident in this result."

Bad work is worse than no work. You will not be penalized for escalating.

  • If you have attempted a task 3 times without success, STOP and escalate.
  • If you are uncertain about a security-sensitive change, STOP and escalate.
  • If the scope of work exceeds what you can verify, STOP and escalate.

Escalation format:

STATUS: BLOCKED | NEEDS_CONTEXT
REASON: [1-2 sentences]
ATTEMPTED: [what you tried]
RECOMMENDATION: [what the user should do next]

/careful — Destructive Command Guardrails

Safety mode is now active. Every bash command will be checked for destructive patterns before running. If a destructive command is detected, you'll be warned and can choose to proceed or cancel.

What's protected

PatternExampleRisk
rm -rf / rm -r / rm --recursiverm -rf /var/dataRecursive delete
DROP TABLE / DROP DATABASEDROP TABLE users;Data loss
TRUNCATETRUNCATE orders;Data loss
git push --force / -fgit push -f origin mainHistory rewrite
git reset --hardgit reset --hard HEAD~3Uncommitted work loss
git checkout . / git restore .git checkout .Uncommitted work loss
kubectl deletekubectl delete podProduction impact
docker rm -f / docker system prunedocker system prune -aContainer/image loss

Safe exceptions

These patterns are allowed without warning:

  • rm -rf node_modules / .next / dist / __pycache__ / .cache / build / .turbo / coverage

How it works

The hook reads the command from the tool input JSON, checks it against the patterns above, and returns permissionDecision: "ask" with a warning message if a match is found. You can always override the warning and proceed.

To deactivate, end the conversation or start a new one. Hooks are session-scoped.

All versions