sanity-validators

Route CLI, env, and config strings through domain-specific sanitizers and validators.

3|Updated Aug 19, 2024
One-click install
npx skills add https://github.com/hashgraph/solo-weaver --skill sanity-validators
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sanity-validators
Source: https://github.com/hashgraph/solo-weaver/tree/main/.claude/skills/sanity-validators
Command: npx skills add https://github.com/hashgraph/solo-weaver --skill sanity-validators

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use this skill to enforce safe handling of untrusted inputs by separating and enforcing domain-specific string sanitizers and validators, preventing common mistakes that lead to injection or misinterpretation.

Core Features & Use Cases

  • Distinguish Sanitize* vs Validate* usage to preserve correctness.
  • Provide domain-specific predicates for identifiers, usernames, and file paths.
  • Document the decision matrix and recommended usage patterns to guide code changes.

Quick Start

Use the sanity-validators skill to ensure that all inputs from CLI/env/config are routed through appropriate validators before use.

Frequently Asked Questions about sanity-validators

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

FAQPage Schema
How do I validate and sanitize untrusted strings from CLI flags and environment variables?

Validate and sanitize untrusted strings by routing all user- or environment-derived inputs through domain-specific Sanitize* and Validate* helpers, enforcing correct string handling across code paths to prevent injection and unsafe usage.

What is the difference between string sanitization and validation for preventing code injection?

String sanitization cleans untrusted inputs, while validation checks them against domain-specific predicates. Separating Sanitize* and Validate* helpers preserves correctness and establishes an explicit boundary between empty input rejection, per-domain character checks, and shell-metachar checks.

How do I enforce safe input handling for file paths and usernames to prevent directory traversal?

Enforce safe input handling by applying domain-specific predicates for identifiers, usernames, and file paths. This routing through dedicated validators prevents directory traversal, injection, and misinterpretation of untrusted config or CLI inputs.

Does this string validation approach apply to config files and environment variables?

Yes, this string validation approach applies across code paths that ingest strings from CLI flags, config files, and environment variables. It guides validators and sanitizers in the repo to prevent injection and unsafe usage.

What's the best way to document decision matrices for shell-metachar checks and string sanitizers?

The best way to document decision matrices for shell-metachar checks is to use a skill that imposes an explicit boundary between empty input rejection, per-domain char predicates, and separate shell-metachar checks, while providing a documented test strategy.

Why should I separate empty input rejection from domain-specific character predicates?

Separating empty input rejection from domain-specific character predicates imposes an explicit boundary that prevents common mistakes leading to injection. This structured validation decision matrix ensures correct string handling and safer code changes.