omnigraph-best-practices
Installation
SKILL.md
Operating Omnigraph Locally
This skill captures the operational rules for working with a locally deployed Omnigraph (RustFS-backed or remote S3). Follow them when authoring schema, writing queries, loading data, evolving schema, or automating graph operations.
The Seven Rules
- Lint before commit —
omnigraph query lint --schema schema.pg --query queries/foo.gqvalidates both sides against each other. No running repo required. - Plan before apply — never run
schema applywithout a successfulschema planfirst. Apply is destructive; plan is free. - Branches are for data; apply is for schema — review data ingests on a feature branch then merge. Schema changes go straight to
main. - Pick the right write command —
changefor edits (typechecked, parameterized),load --mode mergefor bulk upsert on local repos,ingestfor remote,load --mode overwriteonly for clean slates. - Parameterize everything — never string-interpolate values into
.gqbodies or--params. Declare$var: Typeand pass via--params. - Expose agent operations as aliases — not raw CLI invocations. Aliases decouple the operation name from the query implementation.
- Verify after every remote write — compare
commit list --branch mainhead before and after. The CLI's exit code is not authoritative on remote graphs; proxies can drop the response while the write commits server-side. Seereferences/remote-ops.mdfor the verification ritual and how to recover from 504s.
Local Setup
Bootstrap a local RustFS + Omnigraph in one command
Requires Docker. RustFS runs in a container — install Docker and verify before running the bootstrap:
Related skills