agentleFS
ethosagentethosagent/ethos/.agents/skills/schema-validator/SKILL.md

schema-validator

Skill22 starsChanged 9 days agoMITView on GitHub

Validate changes against frozen contracts in packages/types/ (PersonalityConfig, AgentEvent, ContextEngine, Storage, plugin contract). Use when touching packages/types/, adding a field to a frozen schema, or changing a contract interface. Read-only.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If both come back clean, the change does not violate schema-freeze.

    line 14
  2. Distinctive:

    No arguments — runs against the current working tree (uncommitted + staged).

    line 22
  3. Very specific:

    When failed > 0, details lists the failing gate test names and their assertion messages.

    line 41
  4. Very specific:

    Before invoking /openai-reviewer if the diff includes schema changes — keeps review focused on architecture rather than mechanical schema …

    line 47

“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

Schema Validator

Tight focused check on the frozen-schema discipline declared in ARCHITECTURE.md §VII. Two things happen:

  1. Detect which schemas you touched by diffing packages/types/src/*.ts against HEAD.
  2. Run the schema-gate tests under packages/types/src/__tests__/ — these are the mechanical CI guards (e.g. personality-field-count.test.ts).

If both come back clean, the change does not violate schema-freeze. If gate tests fail, the schema drifted without a counter bump and the change is unmergeable.

Usage

.agents/skills/schema-validator/scripts/schema-validate

No arguments — runs against the current working tree (uncommitted + staged).

Output shape

{
  "touched_schemas": [
    "packages/types/src/personality.ts",
    "packages/types/src/agent-event.ts"
  ],
  "gate_tests": {
    "passed": 4,
    "failed": 0,
    "details": []
  },
  "verdict": "ok"
}

When failed > 0, details lists the failing gate test names and their assertion messages. verdict is "ok", "gate_failed", or "unchanged" (no schema files touched).

When to use

  • Touching any file under packages/types/.
  • Adding, removing, or renaming a field on PersonalityConfig, AgentEvent, Tool, ContextEngine, Storage, plugin contract, or any other frozen interface.
  • Before invoking /openai-reviewer if the diff includes schema changes — keeps review focused on architecture rather than mechanical schema drift.

When NOT to use

  • For changes that don't touch packages/types/ — verdict will be "unchanged" and the call is wasted.
  • As a substitute for pnpm check — this is one slice of the full gate, not a replacement.

Acting on failures

A failing gate test is a hard signal: you added/removed a schema field without bumping the counter file (e.g. .personality-field-count). The fix is one of:

  1. You meant to change the schema → bump the counter file in the same commit and add a CHANGELOG entry per ARCHITECTURE.md §VI.
  2. You didn't mean to → revert the schema-touching change.

Per CLAUDE.md: schema changes require the personality-schema-change label and two-maintainer approval. This skill flags drift; it does not authorize it.

Read-only

Runs gate tests and reads git diff. Does not modify the codebase or counter files.

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.