careful

Detect destructive Bash command patterns and request confirmation before execution.

8|2|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/MFS-code/gstack --skill careful-mfs-code
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: careful
Source: https://github.com/MFS-code/gstack/tree/main/careful
Command: npx skills add https://github.com/MFS-code/gstack --skill careful-mfs-code

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Prevents accidental destructive terminal or infrastructure commands that could wipe data, rewrite git history, or impact production systems.

Core Features & Use Cases

  • Destructive Command Detection: Scans Bash command strings for high-risk operations like recursive deletes, SQL DROP/TRUNCATE, git force-push/reset --hard, kubectl delete, and destructive Docker pruning.
  • Session-Scoped Safety Warnings: Intercepts execution and asks the user to confirm when a destructive pattern is detected.
  • Safe Exception Handling: Allows common build-artifact deletions (for example node_modules, dist, build) without triggering warnings.
  • Use Case: Imagine you are debugging a live service and you are about to run a command that might delete critical data; use /careful to get prompted before executing.

Quick Start

Type /careful when you are about to run a potentially destructive command and ask the agent to perform your requested change carefully.

Frequently Asked Questions about careful

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent accidental destructive bash commands in automated agent workflows?

To prevent destructive bash commands, you can use safety guardrails that scan command strings for high-risk operations like recursive deletes and prompt for confirmation before execution. This intercepts dangerous patterns during automated workflows.

What destructive git and database commands should safety guardrails intercept?

Safety guardrails should intercept destructive patterns including git force-push, git reset --hard, SQL DROP and TRUNCATE statements, kubectl delete operations, and destructive Docker pruning commands to prevent data loss.

Can I safely delete build artifacts like node_modules without triggering destructive command warnings?

Yes, safety guardrails support safe exception handling that allows common build-artifact deletions such as node_modules, dist, and build directories without triggering confirmation warnings during your development workflow.

How do I add a confirmation prompt before executing potentially dangerous shell commands?

To add a confirmation prompt, implement a PreToolUse hook that extracts the Bash tool_input command, checks it against defined destructive patterns, and returns a permission decision asking the user to confirm before executing.

Does this safety check work with kubernetes and docker infrastructure operations?

Yes, the safety check works with Kubernetes and Docker by detecting destructive infrastructure actions like kubectl delete commands and destructive Docker pruning, prompting for confirmation before impacting production or shared environments.

What are the limitations of using pattern matching for destructive command detection?

Pattern matching limitations include relying on predefined destructive patterns with explicit safe exceptions, meaning novel or obfuscated destructive commands may not be detected unless they match the defined pattern set.