Codex

prose-validate

Validate an OpenProse program file against Prose contract grammar without executing it — checks frontmatter, contract structure, service references, and strategy syntax

104 stars

Best use case

prose-validate is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

It is a strong fit for teams already working in Codex.

Validate an OpenProse program file against Prose contract grammar without executing it — checks frontmatter, contract structure, service references, and strategy syntax

Teams using prose-validate should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/prose-validate/SKILL.md --create-dirs "https://raw.githubusercontent.com/jmagly/aiwg/main/.agents/skills/prose-validate/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/prose-validate/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How prose-validate Compares

Feature / Agentprose-validateStandard Approach
Platform SupportCodexLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Validate an OpenProse program file against Prose contract grammar without executing it — checks frontmatter, contract structure, service references, and strategy syntax

Which AI agents support this skill?

This skill is designed for Codex.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Prose Validate Skill

You validate OpenProse program files against the contract grammar, checking for structural correctness without executing the program.

## Triggers

- "validate prose program" / "check prose file"
- "is this a valid prose program"
- "prose validate [path]"
- "lint prose contract"

## Input

A path to a `.md` file to validate, or a directory containing a multi-service program.

## Behavior

### Step 0: Detect OpenProse Installation

Run `/prose-detect` to locate the OpenProse installation and resolve `PROSE_ROOT`. The contract grammar spec at `$PROSE_ROOT/prose.md` is used as the validation reference. If not found, stop and report:

```
OpenProse not found. Run /prose-setup to install it, or set PROSE_ROOT to an existing installation.
```

### Validation Checks

Run all checks and report results as pass/fail with details:

#### 1. Frontmatter Validation

- [ ] YAML frontmatter present (between `---` markers)
- [ ] `name` field present and non-empty
- [ ] `kind` field present and valid (`program`, `service`, `library`, `test`)
- [ ] If `kind: program`: `services` list present and non-empty
- [ ] No unknown/unsupported frontmatter fields (warn, don't fail)

#### 2. Contract Validation

- [ ] `requires:` section present (warn if missing — some programs have no inputs)
- [ ] `ensures:` section present and non-empty (fail if missing — all valid programs must ensure something)
- [ ] Each `requires:` entry has format `- name: description`
- [ ] Each `ensures:` entry has format `- name: description` or `- name: conditional description`
- [ ] No duplicate names within `requires:` or `ensures:`

#### 3. Strategy Validation

- [ ] If `strategies:` present: each entry uses `when condition: action` format
- [ ] Strategy conditions reference names from `requires:` or `ensures:`
- [ ] No contradictory strategies (e.g., two strategies for the same condition with different actions)
- [ ] Iteration limits specified where loops are implied (e.g., "max N iterations")

#### 4. Error and Invariant Validation

- [ ] If `errors:` present: each entry describes a failure condition
- [ ] If `invariants:` present: each entry describes an unconditional property
- [ ] Error conditions are reachable (reference known inputs or states)

#### 5. Service Reference Validation (Multi-Service Programs)

- [ ] Each service listed in `services:` has a corresponding `.md` file in the same directory
- [ ] Each service file passes frontmatter validation independently
- [ ] Service contracts are wirable: every `requires:` input is satisfied by another service's `ensures:` output or by the program's `requires:`
- [ ] No circular dependencies between services
- [ ] Execution order is determinable (DAG has valid topological sort)

### Output Format

```markdown
## Prose Validation Report

**File**: {path}
**Program**: {name}
**Kind**: {kind}

### Results

| Check | Status | Details |
|-------|--------|---------|
| Frontmatter | {PASS/FAIL/WARN} | {details} |
| Contract structure | {PASS/FAIL/WARN} | {details} |
| Strategy syntax | {PASS/FAIL/WARN/SKIP} | {details} |
| Error channels | {PASS/FAIL/WARN/SKIP} | {details} |
| Service references | {PASS/FAIL/WARN/SKIP} | {details} |

### Issues Found
{numbered list of specific issues, or "No issues found"}

### Overall: {VALID / INVALID / VALID WITH WARNINGS}
```

## Edge Cases

- **Directory input**: If given a directory, look for `index.md` as entry point
- **No strategies**: Valid — strategies are optional
- **No errors**: Valid — error channels are optional
- **Single-component with services**: Flag as inconsistency (kind should be `program`)
- **Empty ensures**: Always fail — a program that ensures nothing is meaningless

## Model

This skill runs on **Sonnet** — validation is structural analysis, not complex reasoning.

## References

- @$AIWG_ROOT/agentic/code/addons/prose-integration/README.md — prose-integration addon overview
- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/research-before-decision.md — Run prose-detect before validating; read grammar spec from PROSE_ROOT
- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/vague-discretion.md — Concrete pass/fail/warn criteria for each validation check
- @$AIWG_ROOT/docs/cli-reference.md — CLI reference for AIWG addon integration commands

Related Skills

validate-metadata

104
from jmagly/aiwg

Validate AIWG extension definitions against the metadata schema and report errors with field names, line numbers, and remediation hints

Codex

validate-component

104
from jmagly/aiwg

Validate a single AIWG component (skill, agent, or command) for completeness and correctness

Codex

validate-addon

104
from jmagly/aiwg

Validate an entire AIWG addon package for completeness and release readiness

Codex

soul-validate

104
from jmagly/aiwg

Validate a SOUL.md file against community best practices and quality criteria

Codex

setup-validate

104
from jmagly/aiwg

Validate a `setup.aiwg.io/v1` SetupManifest file against the schema and run cons

Codex

reproducibility-validate

104
from jmagly/aiwg

Run a workflow multiple times and compare outputs to produce a similarity score and pass/fail verdict

Codex

provenance-validate

104
from jmagly/aiwg

Validate provenance records and chains for completeness and consistency

Codex

prose-setup

104
from jmagly/aiwg

Clone or update the OpenProse repository to ensure AIWG prose tools hook into the latest version of the specification and examples

Codex

prose-run

104
from jmagly/aiwg

Execute an OpenProse program within the current AIWG session, following the two-phase model (Forme wiring + Prose VM execution)

Codex

prose-reader

104
from jmagly/aiwg

Read and parse an OpenProse program file, extracting its contract (requires, ensures, strategies, errors, invariants) and services into a structured representation

Codex

prose-install

104
from jmagly/aiwg

Install OpenProse for AIWG use when no existing installation is found. Tries npx skills add first, falls back to git clone, then saves the resolved path to .aiwg/config.json.

Codex

prose-detect

104
from jmagly/aiwg

Locate an existing OpenProse installation using a prioritized signal chain — env var, AIWG config, AIWG-local install, project plugin manifest, user home directory, or global CLI. Returns the resolved PROSE_ROOT path. Does not install OpenProse; triggers prose-setup if no installation is found.

Codex