Skip to content

ondrej-merkun/skill-audit / test/fixtures/benign/json-validator

json-validator

Verified

FileKindSize
SKILL.mdskill md598 B
validate.pyscript1.1 KB

validate.py

View on GitHub
"""JSON syntax checking and schema validation helpers."""

import json
from pathlib import Path


def check_syntax(path: str) -> list[str]:
    try:
        json.loads(Path(path).read_text(encoding="utf-8"))
        return []
    except json.JSONDecodeError as exc:
        return [f"Line {exc.lineno}: {exc.msg}"]


def pretty(path: str) -> str:
    data = json.loads(Path(path).read_text(encoding="utf-8"))
    return json.dumps(data, indent=2, ensure_ascii=False)


def minify(path: str) -> str:
    data = json.loads(Path(path).read_text(encoding="utf-8"))
    return json.dumps(data, separators=(",", ":"), ensure_ascii=False)


def validate_schema(schema_path: str, data_path: str) -> list[str]:
    try:
        import jsonschema
    except ImportError:
        return ["jsonschema not installed — run: pip install jsonschema"]
    schema = json.loads(Path(schema_path).read_text(encoding="utf-8"))
    data = json.loads(Path(data_path).read_text(encoding="utf-8"))
    validator = jsonschema.Draft7Validator(schema)
    return [str(e.message) for e in validator.iter_errors(data)]
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall