Skip to content
Back to skills

Spgr Validate Artifact

ASecurity

Validate an artifact against its registered JSON Schema and report a structured pass or fail with itemized issues. Use before consuming an artifact received from another agent, and inline before any artifact write completes, to confirm required fields, types, schema version, and confidence signals.

  • 2 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 11, 2026
ai-agentspythongoexpress

Works with

  • cli

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add z4gunn/springer --skill spgr-validate-artifact --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Spgr Validate Artifact?

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

Security grade badge for Spgr Validate Artifact
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/z4gunn-spgr-validate-artifact/badge)](https://www.skillsdirectory.com/skills/z4gunn-spgr-validate-artifact)

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: spgr-validate-artifact
description: Validate an artifact against its registered JSON Schema and report a structured pass or fail with itemized issues. Use before consuming an artifact received from another agent, and inline before any artifact write completes, to confirm required fields, types, schema version, and confidence signals.
---

# validate-artifact

## Purpose

Hold the line on the typed-artifact contract. A receiving agent validates before acting so it never builds on a malformed or version-mismatched input, and `spgr-write-artifact` validates inline so no invalid artifact is ever written. Schema and field validation is deterministic and runs through the shared validator. Semantic consistency checks that need judgment run separately. The schema pass is deterministic and needs no model at all: a dispatcher runs `schemas/validate.py` directly and opens this skill only to interpret a failure, and even then it runs correctly on the smallest model tier.

## Inputs

| Field | Description |
|-------|-------------|
| `artifact_path` | Path to the artifact JSON to validate |
| `artifact_type` | Optional override. Defaults to the artifact's own `artifact_type` |
| `schema_version` | Optional override. Defaults to the artifact's own `schema_version` |
| `validation_mode` | `schema` (default) or `schema+semantic` to add consistency checks |

## Outputs

| Artifact | Description |
|----------|-------------|
| `validation_result` | Object: `is_valid`, `artifact_id`, `artifact_type`, `schema_version_match`, `validation_mode`, `error_count`, `warning_count`, `issues`, `validated_at` |

## Procedure

1. Run the deterministic validator: `python3 schemas/validate.py <artifact_path>`. It loads the schema for `artifact_type` plus `schema_version` from the registry, resolves the shared envelope, and reports every schema issue with its field path. A zero exit means schema-valid.
2. Map each reported issue to one of the issue types: `missing_required_field`, `wrong_type`, `schema_version_mismatch`, `missing_confidence_signal`, `internal_contradiction`, `out_of_range_value`, `invalid_reference`.
3. When `validation_mode` is `schema+semantic`, add the per-type consistency checks that schema alone cannot express. Examples: PRD success metrics reference goal dimensions defined earlier in the same artifact, architecture component dependencies are acyclic, a test plan references only story IDs that exist in the backlog.
4. Return the structured `validation_result`. Set `is_valid` false if any error-severity issue exists. Warnings do not fail validation.

## Notes

- The schema registry and validator live at `schemas/` (see [schemas/validate.py](../../../schemas/validate.py)). Do not restate field lists here. The registry is the single source of truth for required fields and types.
- Validation has two modes. When a content schema is registered for the artifact type, the validator applies it (mode `content`). When no content schema exists yet, the validator falls back to validating the shared envelope header only (mode `envelope-only`), so the header, confidence map, decision log, and version are still checked while content is treated as opaque until a schema is added. Report the mode so the caller knows whether content was checked.
- Validation never edits the artifact. It reports. The caller decides whether to fix, re-version, or escalate.

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.