path-sensitive-shell-safety

Validates shell filesystem paths to prevent destructive commands on unintended locations.

4|Updated Jun 24, 2026
One-click install
npx skills add https://github.com/giang6283623/minimal-vibe-coding-kit --skill path-sensitive-shell-safety
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: path-sensitive-shell-safety
Source: https://github.com/giang6283623/minimal-vibe-coding-kit/tree/main/.cursor/skills/path-sensitive-shell-safety
Command: npx skills add https://github.com/giang6283623/minimal-vibe-coding-kit --skill path-sensitive-shell-safety

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents catastrophic data loss and system corruption caused by unsafe shell commands like rm, mv, or git clean when they interact with variable-based file paths.

Core Features & Use Cases

  • Path Validation: Ensures all filesystem paths are absolute, non-empty, and free from traversal attacks or dangerous characters.
  • Containment Assertions: Verifies that target directories are strictly contained within authorized base paths, preventing operations on system roots or home directories.
  • Safe Deletion Wrappers: Provides a standardized, recoverable deletion workflow that requires explicit confirmation and path canonicalization.

Quick Start

Use the path-sensitive-shell-safety skill to audit my deployment script for unsafe path variables and implement the required guardrail functions.

Frequently Asked Questions about path-sensitive-shell-safety

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

FAQPage Schema
How do I prevent accidental data loss from rm and mv commands in deployment shell scripts?

Prevent accidental data loss by validating shell script filesystem operations to stop destructive commands from acting on unintended paths. This requires strict path canonicalization and containment assertions to ensure target directories stay within authorized base paths.

What is the best way to secure variable-based file paths in automation scripts?

Securing variable-based file paths requires path validation to ensure all filesystem targets are absolute, non-empty, and free from traversal attacks. Safe deletion wrappers provide a standardized, recoverable workflow that requires explicit confirmation before executing high-blast-radius commands.

How do I add guardrails to shell cleanup workflows using remote repository synchronization?

Add guardrails to cleanup workflows by applying explicit confirmation protocols before executing destructive git clean or synchronization commands. This ensures variable-based path construction targets only authorized directories, preventing broad system path corruption during remote repository synchronization.

Does this shell safety approach work for deployment and repair workflows on broad system paths?

Yes, this shell safety approach works for deployment and repair workflows by validating filesystem operations to prevent destructive commands from acting on broad system paths. It applies strict containment assertions to verify target directories remain safely contained within authorized base paths.

Why do shell scripts accidentally delete system root or home directories during cleanup?

Shell scripts accidentally delete system root or home directories when variable-based path construction resolves to unintended or empty paths. Implementing containment assertions and path canonicalization verifies that target directories are strictly contained within authorized base paths before execution.

What are the limitations of using path canonicalization for safe deletion wrappers?

Path canonicalization for safe deletion wrappers requires explicit confirmation and strict adherence to containment assertions. Limitations include the necessity of validating all variable-based paths as absolute and non-empty, as any unvalidated traversal characters can bypass the authorized base path boundaries.