agentleFS
Abenor-LabsAbenor-Labs/Open-MHS/.claude/skills/schema-validator/SKILL.md

schema-validator

Skill2 starsChanged 2 months agoApache-2.0View on GitHub

Use when validating, authoring, or debugging an Open-MHS Capability Tag (.mhs / .ohs / .json) against schema/capability_schema.json. Triggers on "validate this capability tag", "is my .mhs file valid", "check device manifest", "why is my hardware rejected by the registry", or any task that creates or edits a device descriptor.

  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. murphytrueman/design-system-ops★ 197same name
    2. ethosagent/ethos★ 22same name
    3. nek1987/auto-agent-harness★ 4same name
    4. nexscope-ai/ecommerce-seo-geo-skills★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository3 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the schema file is missing, stop and say so.

    line 36
  2. Very specific:

    Never relax schema/capability_schema.json to accommodate one device.

    line 86

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Open-MHS Capability Tag Validator

Validate a hardware Capability Tag against the official Open-MHS JSON Schema and report actionable, line-anchored errors.

When to use

  • A new driver author wrote a .mhs / .ohs file and needs it checked before registration.
  • The Discovery Layer rejected a device and the reason is unclear.
  • You are about to edit schema/capability_schema.json and must re-validate all fixtures.
  • CI needs a deterministic pass/fail gate over examples/**/*.mhs.

Prerequisites

pip install jsonschema

The canonical schema lives at schema/capability_schema.json. Never validate against a copy — always resolve the repo-root path so drift is impossible.

Workflow

1. Locate the artifacts

ls schema/capability_schema.json
find . -name '*.mhs' -o -name '*.ohs' | grep -v node_modules

If the schema file is missing, stop and say so. Do not invent a schema.

2. Run structural validation

python -m tools.validate_tag <path-to-tag>          # preferred, if tools/ exists

Fallback one-liner when no CLI is present:

python - <<'PY'
import json, sys
from jsonschema import Draft202012Validator
schema = json.load(open("schema/capability_schema.json"))
doc = json.load(open(sys.argv[1] if len(sys.argv) > 1 else "device.mhs"))
errs = sorted(Draft202012Validator(schema).iter_errors(doc), key=lambda e: e.path)
for e in errs:
    print(f"{'/'.join(map(str, e.absolute_path)) or '<root>'}: {e.message}")
print("VALID" if not errs else f"INVALID ({len(errs)} error(s))")
PY

3. Run the semantic checks the schema cannot express

JSON Schema catches shape. It does not catch physics. Always additionally verify:

CheckRule
Safety coverageEvery entry inactuators[] has a matching safety_limits[] entry keyed by the same id. An unbounded actuator is a hard failure, not a warning.
Limit sanitymin < max for every limit. default (if present) falls inside [min, max].
Unit agreementTheunit on an actuator matches the unit on its safety limit. deg vs rad mismatches are the classic field failure.
ID uniquenessid is unique across the union of sensors[] and actuators[], not just within each array. read("x") and write("x") must never be ambiguous.
Sensor immutabilityNoid appears in both sensors[] and actuators[] unless the actuator declares a paired feedback_sensor.
Rate limitsAny actuator withmax_rate also declares unit and a time base.

4. Report

Emit one line per problem, most severe first:

<file>:<json-pointer>: <ERROR|WARN>: <what is wrong>. <how to fix>.

Close with a single verdict line: VALID or INVALID (n errors, m warnings).

Rules

  • Never auto-fix a safety limit. Widening a bound to make validation pass can move real hardware into a destructive range. Report it and let a human decide.
  • Never relax schema/capability_schema.json to accommodate one device. If a legitimate device cannot be expressed, that is a schema RFC, not a local edit.
  • Unknown top-level keys are errors, not warnings — additionalProperties: false is deliberate so typos like actuatorz cannot silently disable safety enforcement.
  • Validate the file as written on disk. Do not normalize, reformat, or reorder first.

Red flags

ThoughtReality
"The limits are obviously wrong, I'll fix them"You do not know the hardware. Report only.
"Just add the field to the schema"Schema changes need an RFC + all fixtures re-validated.
"It parsed as JSON, so it's fine"Parsing is not validation. Run the validator.
"One missing safety limit is a warning"It is an ERROR. Unbounded write = unbounded hardware.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.