validate_prompt.py (internal script)

Convert natural language requirements into structured Claude prompts with XML tags.

Updated Nov 8, 2025
One-click install
npx skills add https://github.com/wade56754/AI_ad_spend02 --skill validate-prompt-py-internal-script
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: validate_prompt.py (internal script)
Source: https://github.com/wade56754/AI_ad_spend02/tree/main/.claude/skills/prompt-optimizer/scripts/validate_prompt.py
Command: npx skills add https://github.com/wade56754/AI_ad_spend02 --skill validate-prompt-py-internal-script

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires re, typing, and includes scripts (resource) components.

What problem does it solve?

This script validates the structural integrity of prompts, including XML tag closure, code blocks, and required sections.

Core Features & Use Cases

  • XML/Code validation: Ensures prompts have proper tag closure and block formatting.
  • Section checks: Validates presence of goal, output_format, and constraints.

Quick Start

Run the script with a prompt file path to receive a validation report.

Frequently Asked Questions about validate_prompt.py (internal script)

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

FAQPage Schema
How do I validate prompt structure and XML tags in my Claude prompts?

Prompt validation checks structural integrity by verifying XML tag closure, required sections like <role>, <goal>, <input>, <output_format>, <constraints>, <error_handling>, and <examples>, and proper code block formatting. Run the script with your prompt file path to receive a validation report identifying missing tags or malformed blocks.

What XML tags and sections are required in a valid Claude prompt?

Valid Claude prompts must include mandatory XML tags: <role>, <goal>, <input>, <output_format>, <constraints>, <error_handling>, and <examples>. The validation process ensures all tags are properly closed and present, along with other required sections like explicit forward instructions and prefill support.

Can I validate code blocks and XML formatting without manual inspection?

Yes, automated validation checks code block formatting and XML tag closure to catch structural errors. The script identifies unclosed tags, malformed blocks, and missing required sections, eliminating manual inspection and catching formatting issues before prompt deployment.

What happens if my prompt is missing required sections or has broken XML tags?

The validation report flags missing mandatory sections and XML formatting errors, showing exactly which tags are unclosed or absent. This prevents downstream failures when the prompt reaches Claude and ensures your prompt meets all functional and structural requirements.

How do I convert natural language requirements into a validated Claude prompt?

The validation script applies quality rules across intent parsing, signature construction, prompt generation, and evaluation to convert requirements into structured Claude prompts. It validates XML structure, required tags, code blocks, and multi-dimensional quality rules to produce production-ready prompts.