Guard
npx -y skills add PJuniszewski/cook --skill guardAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 13 stars13 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Analyze and prepare prompts with JSON for safe context submission
SKILL.md
2.1 KB, as published. Nobody here has run it
Context Guard Skill
Epistemic safety analysis for JSON data in prompts. Prevents LLMs from reasoning with unjustified certainty when input data is incomplete.
Features
- Lossless reduction - Minify, columnar transform, remove nulls
- Token counting - API or heuristic fallback
- Decision engine - ALLOW / SAMPLE / BLOCK
- Intelligent trimming - First + last + evenly-spaced sampling
- Forensic detection - Warns when specific record queries detected
Usage
When /guard is invoked, execute the guard script:
For file paths:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/guard_cmd.py" "<file_path>" [options]
For inline JSON data:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/guard_cmd.py" - [options] <<'GUARD_INPUT'
<json_data>
GUARD_INPUT
Options
| Option | Description |
|---|---|
--mode | analysis|summary|forensics (default: auto-detect) |
--force | Bypass blocks, emit warnings only |
--allow-sampling | Permit sampling for forensic queries |
--no-reduce | Skip lossless reduction phase |
--budget-tokens N | Token budget (default: 3500) |
--print-only | Output report only, never auto-send |
--json | Output result as JSON |
Semantic Modes
| Mode | Sampling | Use Case |
|---|---|---|
analysis | Allowed | "What categories exist?", "Price range?" |
summary | Aggressive | "Describe the data structure" |
forensics | BLOCKED | "Why did request id=X fail?" |
Output
============================================================
CONTEXT GUARD ANALYSIS
============================================================
Decision: [OK] ALLOW | [~] SAMPLE | [X] BLOCK
Mode: analysis | summary | forensics
TOKEN ANALYSIS:
Original: 5,234 tokens
After reduce: 4,891 tokens (-343)
Budget: 3,500 tokens
============================================================
Requirements
- Python 3.8+
ANTHROPIC_API_KEYenvironment variable (for token counting)