agentleFS
joelbarmettlerUZHjoelbarmettlerUZH/ultrainit.sh/.claude/skills/fixture-sync/SKILL.md

fixture-sync

Skill8 starsChanged 7 months agoApache-2.0View on GitHub

Five of eight current fixtures violate their schemas. These are documented and intentional — no runtime schema validation exists in agent.sh. Proceed only if you are intentionally fixing drift: For fields with enum constraints (particularly patterns.json type and structure-scout.json role): When fixing, use real values — never hand-craft values. Capture from real claude output if possible: Fixing a schema violation can break existing tests if a test was asserting on the (incorrect) current value. Update the assertion alongside the fixture.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When fixing, use real values — never hand-craft values.

    line 79

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “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

Before You Start

  • tests/fixtures/findings/ — 8 fixture files, one per Phase 1 agent
  • schemas/ — 14 JSON schema files; the 8 relevant ones match by base name
  • tests/fixtures/CLAUDE.md — documents the 5 known schema violations in current fixtures

Known Violations

Five of eight current fixtures violate their schemas. These are documented and intentional — no runtime schema validation exists in agent.sh. Proceed only if you are intentionally fixing drift:

FixtureKnown Violation
patterns.jsontype: 'design' is not in the schema's enum
tooling.jsonMissing required purpose field
git-forensics.jsonUses path where schema expects file; missing commit_patterns.example_messages
structure-scout.jsonInvalid role strings; extra total_files/total_directories fields

Steps

1. Check which fixtures have required-field violations

for agent in identity commands git-forensics patterns tooling docs-scanner security-scan structure-scout; do
    fixture="tests/fixtures/findings/${agent}.json"
    schema="schemas/${agent}.json"
    if [[ ! -f "$fixture" || ! -f "$schema" ]]; then
        echo "MISSING: $agent"
        continue
    fi
    # Check required fields
    required=$(jq -r '.required[]?' "$schema" 2>/dev/null)
    for field in $required; do
        present=$(jq -e ".${field}" "$fixture" 2>/dev/null && echo yes || echo no)
        if [[ "$present" == "no" ]]; then
            echo "MISSING REQUIRED: $agent.$field"
        fi
    done
done

2. Check for additionalProperties violations

for agent in identity commands git-forensics patterns tooling docs-scanner security-scan structure-scout; do
    fixture="tests/fixtures/findings/${agent}.json"
    schema="schemas/${agent}.json"
    fixture_keys=$(jq -r 'keys[]' "$fixture" 2>/dev/null | sort)
    schema_keys=$(jq -r '.properties | keys[]' "$schema" 2>/dev/null | sort)
    extra=$(comm -23 <(echo "$fixture_keys") <(echo "$schema_keys"))
    if [[ -n "$extra" ]]; then
        echo "EXTRA FIELDS in $agent: $extra"
    fi
done

3. Check enum values

For fields with enum constraints (particularly patterns.json type and structure-scout.json role):

# Check patterns.json type values
jq -r '.patterns[].type' tests/fixtures/findings/patterns.json | sort -u
# Compare against schema enum:
jq -r '.properties.patterns.items.properties.type.enum[]' schemas/patterns.json | sort

4. Fix a fixture

When fixing, use real values — never hand-craft values. Capture from real claude output if possible:

# Option A: Minimal fix — add missing required field
jq '.findings[0] += {"purpose": "example purpose"}' \
    tests/fixtures/findings/tooling.json > /tmp/fixed.json
mv /tmp/fixed.json tests/fixtures/findings/tooling.json

# Option B: Replace invalid enum value
jq '.patterns[].type |= if . == "design" then "architecture" else . end' \
    tests/fixtures/findings/patterns.json > /tmp/fixed.json
mv /tmp/fixed.json tests/fixtures/findings/patterns.json

5. Verify tests still pass after fixing

make test-unit
make test-integration

Fixing a schema violation can break existing tests if a test was asserting on the (incorrect) current value. Update the assertion alongside the fixture.

Verify

# All fixtures are valid JSON
for f in tests/fixtures/findings/*.json; do jq empty "$f" && echo "OK: $f"; done

# Run tests
make test-unit

Common Mistakes

  1. Hand-crafting fixture values — the tests/fixtures/CLAUDE.md rule says to capture real claude -p --output-format json output. Hand-crafted fixtures can make tests pass against data that real Claude would never produce.
  2. Fixing a fixture without updating dependent tests — some unit tests assert on specific fixture field values. If you fix patterns.json's type enum, find any test that asserts type: 'design' and update it too.

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.