agentleFS
epamepam/ai-dial-core/.claude/skills/validate-config-on-every-write/SKILL.md

validate-config-on-every-write

Skill663 starsChanged 23 days agoApache-2.0View on GitHub

Make a rule that the config rebuild enforces on an entity also run before the blob is written, on PUT, /v1/admin/validate and /v1/admin/apply. Use when adding a validation to ConfigPostProcessor or auditing an entity type whose rule runs only at reload.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 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.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Put the invariants in one validate<Entity>Invariants(entity, ..., warnings) and call it from the rebuild too, so the gate cannot drift (see …

    line 23
  2. Very specific:

    Call it before the write on every path.

    line 25
  3. Very specific:

    Add the requirement to openspec/specs/config-store/spec.md and any operator docs.

    line 36
  4. Distinctive:

    Do not change the rebuild's behaviour.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Validate on every write path

Arguments: $ARGUMENTS — optionally the entity type (e.g. route, translator) and the rule to enforce (e.g. BEARER upstream needs a key). With none, audit every entity type for rules that run only at reload.

Rule: whatever the rebuild (ConfigPostProcessor) rejects, a write must reject first.

Why: a rule checked only at reload lets a write store a blob the next rebuild rejects. The caller gets a 500 (apply says APPLIED), the blob stays, and under onInvalidEntity: abort the pod will not start. Seen with model invariants (#2001) and route BEARER upstream without a key (#2225).

Steps

  1. Find the entity's rebuild rules (processSemantic, validateSingle<Entity>). A rule that reads only the entity is an invariant: hard at every gate. A rule that reads another entity (interceptor names) follows softValidation.
  2. Put the invariants in one validate<Entity>Invariants(entity, ..., warnings) and call it from the rebuild too, so the gate cannot drift (see validateModelInvariants, validateRouteInvariants).
  3. Call it before the write on every path. An empty -> { } arm or a missing instanceof branch is the gap.

    PathPlaceFailure
    PUTConfigResourceController.handlePut, after the secret merge, before putResource422 via rejectWithValidationWarnings
    validateConfigValidationService.validateOnlyFAILED
    applyConfigApplyService, before the blob writeFAILED

    Applications and toolsets: hook in ApplicationService / ToolSetService.

  4. Tests in the existing API classes: PUT gives 422, GET gives 404, a retry with If-None-Match: * gives 200 (nothing was written); an update omitting a secret passes; validate and apply with precheck: false give FAILED.
  5. Add the requirement to openspec/specs/config-store/spec.md and any operator docs.

Traps

  • PUT checks the merged entity; apply checks the manifest as sent.
  • The gate has no entity name yet; keep message prefixes null-safe.
  • Do not change the rebuild's behaviour.

Present the plan and wait for approval before editing code; use the OpenSpec flow.

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.