Agent skill

verify-output

Pattern for verifying your output matches required schema before completing. Use before writing final output to ensure validity.

Stars 232
Forks 15

Install this agent skill to your Project

npx add-skill https://github.com/aiskillstore/marketplace/tree/main/skills/clouder0/verify-output

SKILL.md

Verify Output Skill

Pattern for ensuring outputs match required schemas using automated validation.

When to Use

  • Before writing final output file
  • After completing a task
  • When producing structured JSON output

Quick Reference

Validate before writing:

bash
./scripts/validate.sh <schema_name> <file_path>

Available Schemas

Schema Used By Output Path
demand PM memory/reports/demand.json
design Architect memory/reports/designs/*.json
task-output Implementer memory/tasks/*/output.json
verification Verifier memory/tasks/*/verification.json
reflection Reflector memory/reflections/*.json
evolution-proposal Evolver memory/evolution/*.json
contract Executor memory/contracts/*.json

Validation Process

Step 1: Determine Your Schema

Based on your agent role:

PM agent          → demand.schema.json
Architect agent   → design.schema.json
Implementer agent → task-output.schema.json
Verifier agent    → verification.schema.json
Reflector agent   → reflection.schema.json
Evolver agent     → evolution-proposal.schema.json

Step 2: Write Output to Temp Location

bash
Write(memory/tasks/{id}/output.json.tmp, content)

Step 3: Validate

bash
./scripts/validate.sh task-output memory/tasks/{id}/output.json.tmp

Step 4: If Valid, Move to Final Location

bash
mv memory/tasks/{id}/output.json.tmp memory/tasks/{id}/output.json

Step 5: If Invalid, Fix and Retry

Common validation errors and fixes:

Error Fix
'X' is a required property Add the missing field
'Y' is not one of ['a', 'b'] Use valid enum value
'Z' is not of type 'array' Wrap value in array: [value]
Additional properties not allowed Remove extra fields

Output Format: Compact JSON

All agent outputs MUST be compact JSON (single line, no extra whitespace):

json
{"task_id":"001","status":"pre_complete","knowledge_updates":[],"reflection":{"what_worked":[],"what_failed":[],"patterns_noticed":[]}}

Mandatory Fields (All Agents)

Every output MUST include:

json
{"knowledge_updates":[{"category":"codebase","content":"string","confidence":"certain"}],"reflection":{"what_worked":["string"],"what_failed":["string"],"patterns_noticed":["string"]}}

Or empty arrays if no updates:

json
{"knowledge_updates":[],"reflection":{"what_worked":[],"what_failed":[],"patterns_noticed":[]}}

Valid values:

  • category: "codebase" | "convention" | "decision" | "gotcha"
  • confidence: "certain" | "likely" | "uncertain"

Pre-Write Validation Pattern

Recommended pattern for agents:

1. Construct output object in memory
2. Write to {output_path}.tmp
3. Run: ./scripts/validate.sh {schema} {output_path}.tmp
4. IF validation passes:
     → mv {output_path}.tmp {output_path}
     → Log: "Output validated and written"
5. ELSE:
     → Read validation errors
     → Fix output object
     → Retry from step 2
     → Max 3 retries, then report validation failure

Common Mistakes

  • Forgetting knowledge_updates (even if empty array)
  • Forgetting reflection fields
  • Using invalid enum values (check schema for allowed values)
  • Missing required nested fields
  • Wrong type (string instead of array, etc.)
  • Using YAML instead of JSON
  • Pretty-printing JSON (use compact format)

Principles

  1. Validate before write - Never output invalid data
  2. Schema is law - Missing fields = rejection by executor
  3. Empty is valid - "knowledge_updates":[] is okay
  4. Fail fast - Catch errors before they propagate
  5. Compact JSON - Single line, no formatting

Expand your agent's capabilities with these related and highly-rated skills.

aiskillstore/marketplace

perigon-backend

Perigon ASP.NET Core + EF Core + Aspire conventions

232 15
Explore
aiskillstore/marketplace

perigon-agent

Pointers for Copilot/agents to apply Perigon conventions

232 15
Explore
aiskillstore/marketplace

perigon-angular

Angular 21+ standalone/Material/signal conventions for Perigon WebApp

232 15
Explore
aiskillstore/marketplace

fastapi-mastery

Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation, Pydantic models, or FastAPI-specific features.

232 15
Explore
aiskillstore/marketplace

context7-efficient

Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.

232 15
Explore
aiskillstore/marketplace

browser-use

Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction.

232 15
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results