Skip to content

Acted before loading

An agent touches a file or takes an action without the prerequisite context — a skill, a doc, a checklist — actually being loaded first. The action proceeds as if the step happened, and afterward there’s no way to tell that it didn’t: “available” reads the same as “loaded” once the work is done. The record that was supposed to shape the action never entered the run, and nothing marks its absence.

Watch it happen — then get refused

The action is blocked until the required context is actually present in the run. The requirement is answered against what really happened — was this skill loaded this session — not against a claim that it was.

  1. Writing under a governed path fires a gate in the pre-phase, before the write lands.

  2. The gate’s require names the skill that must have loaded first. If it hasn’t, the write is denied until the prerequisite is met.

This is a precondition: a gate whose require is the whole rule — no check script, because the requirement itself is the refusal.

This is the real example shipped at examples/required-context-precondition/. One nature — two gates, each a gate.yaml under .sloprail/, one per governed path:

  • Directory.sloprail/
    • Directorygate/
      • Directoryrequire-skill-decisions/
        • gate.yaml
      • Directoryrequire-skill-topics/
        • gate.yaml

Each gate binds a governed path to the skill it demands. A separate gate per path, because require binds to the whole gate — which prefix demands which skill is the structure itself. No checks: the require is the entire rule.

.sloprail/gate/require-skill-decisions/gate.yaml
# Writing under memories/decisions/ is blocked until document-strategy was
# loaded. A separate gate rather than a second entry in the topics one, because
# `require` binds to the whole gate — which prefix demands which skill is the
# structure, not a lookup a single gate's checks would carry. `PreFileWrite`
# expands to create + update.
on:
- event: PreFileWrite
match: event.path startsWith "memories/decisions/"
require:
- skill: document-strategy
.sloprail/gate/require-skill-topics/gate.yaml
# Writing under memories/topics/ is blocked until document-topic was loaded
# this session. No checks: `require` is the whole rule. `PreFileWrite` is the
# alias the engine expands to PreFileCreate + PreFileUpdate — so the same match
# is written once, not duplicated across two triggers.
on:
- event: PreFileWrite
match: event.path startsWith "memories/topics/"
require:
- skill: document-topic