Careful

Intercepts destructive commands like rm -rf, DROP TABLE, and force-push with safety warnings

What Is This?

Overview

Careful is a development skill that adds a protective layer between you and irreversible operations. It intercepts destructive commands before execution and prompts for confirmation, giving developers a critical moment to review what they are about to run. Whether you are managing production databases, working in shared environments, or debugging live systems, Careful ensures that high-risk operations do not execute silently.

The skill operates as a pre-execution hook on Bash commands. When a potentially destructive pattern is detected, such as rm -rf, DROP TABLE, git push --force, git reset --hard, or kubectl delete, the system surfaces a warning and waits for explicit user confirmation. This behavior can be overridden on a per-command basis, so it never blocks legitimate work, it simply adds a deliberate checkpoint.

Careful is designed to be activated contextually. You can invoke it by asking your AI assistant to enter "careful mode," "safety mode," or "prod mode," or simply by saying "be careful." This makes it easy to toggle protective behavior when the stakes are higher than usual.

Who Should Use This

  • Backend developers who regularly run database migrations or schema changes against live environments
  • DevOps and platform engineers who manage Kubernetes clusters and need a safeguard before deleting namespaces, pods, or deployments
  • Full-stack developers working across multiple Git branches who want protection against accidental force-pushes
  • Junior developers who are still building familiarity with destructive CLI patterns and benefit from an extra confirmation step
  • Team leads and senior engineers who share terminal sessions or pair-program and want consistent safety behavior across contributors
  • On-call engineers debugging production incidents under pressure, where mistakes are most likely to occur

Why Use It?

Problems It Solves

  • Prevents accidental deletion of files and directories through unguarded rm -rf calls
  • Stops unintended database table drops or truncations that can cause immediate data loss
  • Blocks force-pushes to shared or protected branches that overwrite remote history
  • Catches git reset --hard commands that discard uncommitted local changes without warning
  • Intercepts kubectl delete operations that could remove running workloads in production clusters

Core Highlights

  • Pre-execution hook architecture that intercepts commands before they run
  • Covers a broad set of destructive patterns across file systems, databases, Git, and Kubernetes
  • User-overridable warnings so legitimate operations are never permanently blocked
  • Activates on natural language cues such as "be careful" or "prod mode"
  • Lightweight and non-intrusive during normal development workflows
  • Works with Bash and Read tool integrations
  • Contextually appropriate for production, staging, and shared environments
  • Pairs well with existing CI/CD safety checks as a local development complement

How to Use It?

Basic Usage

Activate Careful by telling your AI assistant to enter careful mode before running sensitive operations:

"Switch to careful mode before we touch the database."

Once active, any destructive Bash command will trigger a warning prompt:

## Attempting to run:
rm -rf /var/app/uploads

## Careful warning:
## This command will permanently delete /var/app/uploads and all contents.
## Confirm? [y/N]

Specific Scenarios

Scenario 1: Database schema changes

When running a migration that includes a DROP TABLE statement, Careful intercepts the SQL before execution and displays the affected table name, giving you a chance to verify the target database connection string and environment.

Scenario 2: Kubernetes cluster management

Before running kubectl delete deployment api-server --namespace production, Careful surfaces the namespace and resource name, preventing accidental deletion of the wrong deployment in a multi-cluster setup.

Real-World Examples

## Force-push interception
git push origin main --force
## Careful:

Force-push detected on branch 'main'. Confirm? [y/N]

## Hard reset interception
git reset --hard HEAD~3
## Careful:

This will discard 3 commits. Confirm? [y/N]

## Kubectl delete interception
kubectl delete namespace staging
## Careful:

Deleting namespace 'staging' removes all resources within it. Confirm? [y/N]

When to Use It?

Use Cases

  • Deploying schema migrations to production databases
  • Managing live Kubernetes workloads during incidents
  • Cleaning up file system directories on remote servers
  • Resetting Git history on shared repositories
  • Running bulk delete operations in cloud storage buckets
  • Debugging live systems where command errors have immediate user impact
  • Onboarding new team members to production tooling

Important Notes

Requirements

  • Bash tool access must be enabled in your AI assistant environment
  • Read tool access is required for hook configuration
  • The skill version 0.1.0 is an early release and pattern coverage may expand in future versions