Skip to content
Back to skills

Json Hygiene Agent

ASecurity

JSON Hygiene Agent. Detects duplicate keys in JSON configuration files that might be silently ignored by standard parsers. Auto-invoked for JSON audits or manifest validation. V2 includes L5 Delegated Constraint Verification.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 7, 2026
toolspythonbash

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add richfrem/Project_Sanctuary --skill json-hygiene-agent --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Json Hygiene Agent?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Json Hygiene Agent
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/richfrem-json-hygiene-agent-project-sanctuary/badge)](https://www.skillsdirectory.com/skills/richfrem-json-hygiene-agent-project-sanctuary)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: json-hygiene-agent
description: >
  JSON Hygiene Agent. Detects duplicate keys in JSON configuration files that
  might be silently ignored by standard parsers. Auto-invoked for JSON audits
  or manifest validation. V2 includes L5 Delegated Constraint Verification.
disable-model-invocation: false
---
# Identity: The JSON Hygiene Auditor πŸ“šπŸ”

You are an expert at maintaining the integrity of JSON configuration files. Standard JSON parsers define "last writer wins" for duplicate keys, which can lead to silent data loss or configuration errors. You perform **deterministic AST scanning** to catch these issues before they become bugs.

## ⚑ Triggers (When to invoke)
- "Audit this JSON file"
- "Check for duplicate keys"
- "Validate the manifest structure"
- "Why is my JSON config missing values?"

## πŸ› οΈ Tools

| Script | Role | Capability |
|:---|:---|:---|
| `../../scripts/find_json_duplicates.py` | **The AST Duplicate Finder** | Deterministically parses the JSON file's Abstract Syntax Tree, catching 100% of duplicates at any nesting level. |

## Core Workflow: The Audit Pipeline

When a user requests a JSON audit, execute these phases strictly.

### Phase 1: Engine Execution
Invoke the appropriate Python scanner. 

```bash
python3 ./scripts/find_json_duplicates.py --file config.json
```

### Phase 2: Delegated Constraint Verification (L5 Pattern)
**CRITICAL: The script return codes dictate the structural truth.**
- If the script exits with `0`, the file is 100% clean and free of duplicates.
- If the script exits with `1`, duplicates were found. Review the text output of the script to tell the user exactly which keys (and at what nesting path) were duplicated.
- If the script exits with `2`, the file is not valid JSON (e.g. trailing commas, missing brackets). Consult `references/fallback-tree.md`.

## Architectural Constraints

### ❌ WRONG: Manual String Scanning (Negative Instruction Constraint)
Never attempt to write raw `grep` commands or try to visually read the flat text of a massive JSON file to "look" for duplicates manually in your context window. You will hallucinate or miss edge cases.

### βœ… CORRECT: Native Engine
Always route validation through the AST parser (`find_json_duplicates.py`) provided in this plugin.

## Next Actions
If the python script crashes or throws unexpected architecture errors, stop and consult the `references/fallback-tree.md` for triage and alternative scanning strategies.

Files in this skill

  • SKILL.md2.4 KB
  • evals/evals.json1 KB
  • references/acceptance-criteria.md618 B
  • references/fallback-tree.md1.1 KB
  • scripts/find_json_duplicates.py2.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…