json-validation

Validate AGENT_SUCCESS_CRITERIA JSON with strict schema enforcement.

14|2|Updated Sep 23, 2025
One-click install
npx skills add https://github.com/masharratt/claude-flow-novice --skill json-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: json-validation
Source: https://github.com/masharratt/claude-flow-novice/tree/main/.claude/skills/cfn-validation-framework/lib/json
Command: npx skills add https://github.com/masharratt/claude-flow-novice --skill json-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Centralizes JSON validation to prevent injection and parsing vulnerabilities across agents.

Core Features & Use Cases

  • Defends AGENT_SUCCESS_CRITERIA parsing
  • Exposes get_test_suite and get_test_command helpers
  • Robust structure validation across suites

Quick Start

source .claude/skills/json-validation/validate-success-criteria.sh validate_success_criteria

Frequently Asked Questions about json-validation

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

FAQPage Schema
How do I validate JSON to prevent injection attacks in agent workflows?

JSON validation defends against injection and parsing vulnerabilities by enforcing strict schema compliance. This Skill centralizes validation logic to catch malicious or malformed input before it reaches agent decisioning logic, ensuring safe, consistent parsing across all agents.

Can I use jq to validate AGENT_SUCCESS_CRITERIA structure?

Yes. This Skill uses jq to perform defensive JSON parsing and strict schema enforcement on AGENT_SUCCESS_CRITERIA. It exposes utilities like validate_success_criteria and validate_criteria_structure to verify structure, extract test suite data, and handle missing fields gracefully.

How do I extract test commands and pass thresholds from JSON test suite definitions?

Use the exported helper functions: get_test_suite retrieves suite metadata, get_test_command extracts per-suite commands, and get_pass_threshold retrieves numeric thresholds. These utilities parse JSON safely while preventing injection attacks.

What happens if my JSON test criteria has missing or invalid fields?

The Skill implements graceful handling of missing fields and provides secure error messaging. Invalid structure is caught during validation; validate_criteria_structure confirms compliance before use, preventing downstream failures in test orchestration.

Does JSON validation work across all CFN Loop agents?

Yes. Validation is applied at startup and during test orchestration across all 21 CFN Loop agents. The centralized approach ensures consistent, secure parsing of AGENT_SUCCESS_CRITERIA regardless of which agent executes the criteria.

Why should I use centralized JSON validation instead of inline parsing in each agent?

Centralized validation eliminates parsing inconsistencies and reduces injection vulnerability surface area. A single source of truth for schema enforcement, error handling, and secure messaging scales safely across multiple agents and prevents duplicate vulnerability logic.