safety-validator

Analyze bash command safety risks using the schlock AST validation engine.

3|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/27Bslash6/schlock --skill safety-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: safety-validator
Source: https://github.com/27Bslash6/schlock/tree/main/skills/safety-validator
Command: npx skills add https://github.com/27Bslash6/schlock --skill safety-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides expert analysis of bash command safety using the schlock validation engine. It helps you understand risks, identify which safety rules are triggered, and communicate safe alternatives. It is designed for read-only analysis and to assist in decision-making before any command is executed.

Core Features & Use Cases

  • AST-based validation: Analyze commands using schlock's AST engine to detect unsafe patterns.
  • Rule citation: Cite specific safety rules from the rule database to explain why a command is risky.
  • Safer alternatives: Suggest safer, concrete alternative commands.
  • Project configuration awareness: Read and respect project-level safety overrides when present.

Quick Start

Ask the skill to evaluate a command, for example: "Is this safe: rm -rf /?"

Frequently Asked Questions about safety-validator

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

FAQPage Schema
How do I analyze bash command safety before running it?

Bash command safety analysis uses AST-based parsing to detect unsafe patterns without execution. This Skill parses your command through the schlock validation engine, identifies triggered safety rules, and returns a risk assessment with safer alternatives before you run anything.

What bash patterns are considered unsafe and why?

Unsafe bash patterns include recursive deletion, privilege escalation, unquoted variables, and command injection vectors. This Skill cites specific rules from its safety rule database to explain which patterns triggered warnings and the risk each one poses.

Can I check bash command safety during code review or CI/CD?

Yes. This Skill applies to development projects, CI/CD reviews, and code audits. It reads project-specific safety configurations when available, respects policy overrides, and provides human-readable assessments to support decision-making in automated pipelines.

How does AST-based validation detect command risks?

AST-based validation parses bash syntax into an abstract syntax tree, then matches patterns against a rule database without executing the command. This enables detection of dangerous operations like file removal, permission changes, and injection vulnerabilities before runtime.

What alternative commands does this Skill suggest for risky operations?

After identifying safety risks, this Skill suggests concrete safer alternatives tailored to your intent. For example, instead of `rm -rf`, it might recommend scoped deletion with explicit paths and confirmation prompts.

Does this work with project-level safety configuration?

Yes. This Skill reads and respects project-specific safety overrides and configuration files when present, allowing teams to define custom rules and policy compliance requirements alongside the default rule set.