Write Gate
PLUGINDeterministic pre-write content gate for Ulpi.
by 2vic1 · v1.0.0
What it does
Deterministic pre-write content gate for Ulpi. A pre_tool_call hook parses the exact bytes about to be written as JSON, TOML or Python (stdlib parsers), rejects NUL bytes, oversized content and user-declared regex contracts, and short-circuits invalid writes with a precise line/column error returned to the model as a tool-call error, so the agent fixes the content in the same tool-calling loop instead of leaving a broken file behind.
Also adds a write_gate_check preflight tool, a /writegate slash command and Settings -> Plugins config. Patch/replacement fragments are never parsed as whole documents: NUL, size and regex contracts still run on the fragment, and the reconstructed post-edit file is parsed when it can be rebuilt.
Disclosure — no network calls, no shell commands, no subprocesses, no background processes, no credentials, no telemetry; reads the in-memory arguments of the tool call it gates, one optional user-specified JSON rules file named in the rules_file setting, and (for fragment edits only) the size-capped target file named in that same tool call, read-only; persists three integer counters in profile-scoped plugin state; never auto-approves or bypasses Ulpi's approval gate; fails open on any internal error.
Tools it adds
The tools an agent gets once this plugin is installed.
- write_gate_check
Review notes
What an owner reads and accepts before the install is approved.
- Ulpi has not reviewed this version: it is listed in the public plugin catalog, and the install still fetches it at its pinned commit, checks its shape and scans it before you approve