Imported from charlierix/CyberpunkMods (
!okf/agent for most builds/.agent/skills/create-maintain/validate/SKILL.md). Install upstream withnpx skills add charlierix/CyberpunkMods --skill validate. Copyright stays with the author.
OKF Validate — Conformance Checker
This sub-skill of okf-create-maintain validates that an OKF bundle meets the three hard conformance rules from §9 of the spec. Read the parent skill for context and the spec for normative rules.
Run the checker
Run the deterministic conformance checker against the target bundle. Default to
the project's .okf/ directory when no path is given.
python3 "$(dirname "$0")/scripts/okf_validate.py" <bundle-dir> [--strict] [--json]
If pyyaml is missing:
python3 -m pip install --quiet pyyaml && python3 scripts/okf_validate.py <bundle-dir>
What the checker validates
Hard errors (bundle is non-conformant)
| Code | Rule |
|---|---|
| E1 | File has no parseable YAML frontmatter block (§9.1) |
| E2 | Frontmatter is missing or has an empty type field (§9.2) |
Soft warnings (non-blocking)
| Code | Rule |
|---|---|
| W1 | Recommended field title, description, tags, or timestamp is absent (§4.1) |
| W2 | Cross-link target not found in bundle (§5.3 — tolerated by spec) |
| W3 | index.md has frontmatter when it should not (§6), or root index has unexpected keys |
| W4 | log.md has frontmatter (§7) or date heading is not ISO 8601 YYYY-MM-DD |
Reserved file checks (§9.3)
| File | Check |
|---|---|
index.md |
No frontmatter, except bundle-root may carry only okf_version (§11) |
log.md |
No frontmatter; date headings in ISO 8601 YYYY-MM-DD format |
Interpret results
- ERROR → a hard §9 conformance failure. Fix every one before declaring done.
- warn → soft guidance. Never blocks; fix when cheap. Broken links in particular are explicitly tolerated by the spec (§5.3).
Exit code is non-zero if any error is present (or any warning, when --strict).
Add --json for machine-readable output (useful in CI).
Consumers MUST NOT reject a bundle for
- Missing optional frontmatter fields
- Unknown
typevalues - Unknown additional frontmatter keys
- Broken cross-links
- Missing
index.mdfiles
This permissive consumption model is intentional: OKF is meant to remain useful as bundles grow, get refactored, and are partially generated by agents.