crates/skill-auditor/testdata/fixtures/skill-full/SKILL.md
Validates, sanitizes, normalizes user inputs before processing. Prevents injection attacks, data corruption, runtime errors in production. Enforces schema-driven validation at entry points with explicit rejection policies for malformed payloads.
npx skillsauth add pantheon-org/tekhne input-validation-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Enforce strict input validation before any processing to prevent security vulnerabilities and data corruption. See references/deep-reference.md for schema details.
ALWAYS treat external input as untrusted. Validate at the boundary, not deep in business logic. Every gotcha in production traces back to skipped validation.
Core rules:
NEVER bypass the validation boundary for performance reasons without an explicit security review.
import { z } from "zod";
const InputSchema = z.object({
name: z.string().min(1).max(100),
email: z.string().email(),
age: z.number().int().min(0).max(150),
});
export const validateInput = (raw: unknown) => {
const result = InputSchema.safeParse(raw);
if (!result.success) {
throw new Error(`Validation failed: ${result.error.message}`);
}
return result.data;
};
bun run validate --input ./data/input.json
try {
const validated = validateInput(req.body);
await process(validated);
} catch (err) {
return res.status(400).json({ error: err.message });
}
BAD: Skipping validation in a "trusted" internal path
// BAD
function processInternal(data: any) {
db.insert(data); // no validation
}
WHY: Internal paths are often reachable from untrusted callers via indirection. NEVER assume trust without verifying the call chain.
GOOD:
// GOOD
function processInternal(data: unknown) {
const safe = InternalSchema.parse(data);
db.insert(safe);
}
BAD: Validating after side effects
// BAD
await db.insert(data);
validate(data); // too late
WHY: Side effects are already applied when validation fails. ALWAYS validate before any mutation.
tools
A skill that produces warnings but no errors.
testing
A well-formed example skill for testing the validator.
development
A skill with code blocks and imperative instructions for testing content and contamination analysis.
tools