Repository navigation
feat(server): serve the skill references as MCP best-practices resources - #995
Conversation
…kill The binary now carries `skills/omnigraph` byte for byte. `omnigraph skill export <dir> [--force] [--json]` writes it where an agent loads skills, and `omnigraph skill show [<path>]` prints one file, so a consumer gets the skill written for the CLI it runs. A new `omnigraph-skill` crate has its package root at `skills/`, keeping the skill tree its one copy while still packaging; its build script embeds every file. An export records each written file's digest in `.omnigraph-skill.json`, so a later `--force` export removes only unchanged files the skill no longer has and never touches anything else. In-source tests hold the skill's command index and condensed reference to the clap tree; integration tests check byte identity and the `--force` rules; check-docs.py now also holds the skill's declared HTTP contract to the CLI's.
…5ff0 # Conflicts: # crates/omnigraph-cli/src/planes.rs # docs/user/cli/reference.md
…e command index
…5ff0 # Conflicts: # crates/omnigraph-cli/src/cli.rs # crates/omnigraph-cli/src/main.rs # crates/omnigraph-cli/src/planes.rs # docs/user/cli/reference.md
…s and opt-in writes
Review: Serve skill references as MCP best-practices resourcesWhat this PR does. This is the last piece of RFC 0003 R8: the Architecture. The Invariant compliance. This change is additive and does not touch the graph-write path, manifest publication, snapshot coherence, or recovery. The MCP write tools follow the existing handlers and policy actions. Test coverage. All tests pass at the exact head commit.
The Tradeoffs. Embedding the skill text into the server binary increases binary size by the sum of the five reference files (about 54 KiB). This is negligible. The alternative, reading files at runtime, would add I/O and a filesystem dependency that the server otherwise does not need for these static resources. Embedding is the right choice. Recommendation: approve once the one blocking finding below is resolved. Blocking
Optional / Nits
Validated at commit |
…aph into mcp-best-practices
…ing reference instead of panicking
…claude/cool-newton-c25ff0 # Conflicts: # Cargo.lock # crates/omnigraph-cli/src/main.rs
…claude/cool-newton-c25ff0 # Conflicts: # crates/omnigraph-cli/Cargo.toml
|
Review at 0f2f39e, addressed at 542c8fd:
The branch now also has
I'll merge #986's branch again when it pushes its review fixes. |
The exported skill now states the storage formats this binary reports, and an in-source test holds that line to the value `omnigraph version` prints, through one shared formatter. Elsewhere the skill refers to that line instead of repeating the numbers. A `--force` export no longer removes a recorded file that differs from a current file only in ASCII case, which on a case-insensitive file system is the file it just wrote. Skill paths and record paths must be ASCII. The skill crate's package includes exactly what its build embeds. The command index lists `cluster list` and `cluster pull`.
…aph into mcp-best-practices # Conflicts: # crates/omnigraph-server/Cargo.toml
|
Merged #986's head Checks with
|
|
#986's review fixes are pushed:
|
…c/omnigraph into mcp-best-practices
|
Merged #986's head Checks with
|
The last part of R8 in the RFC 0003 amendment (#992, issue #991): the npm package's
omnigraph://best-practices/*resources, now served by the server itself.Stacked on #994 (which is stacked on #993) and on #986, whose
omnigraph-skillcrate embedsskills/omnigraphbyte for byte. Only the last commit is new. I'll mergemainin as those land.What changes
omnigraph-serverdepends onomnigraph-skill(path + version, as the CLI does).resources/listaddsomnigraph://best-practices/indexandomnigraph://best-practices/{queries,data,schema,search,changes}. The bodies areskills/omnigraph/references/<topic>.mdfrom the embedded skill, so the server always ships the references written beside its source; the npm package fetched them from this repository at build time instead. The curated descriptions move here from the package'scookbook-descriptions.json, rewritten for the server's tool names. The package's excluded references (CLI, cluster, policy, migrations, blobs, stored queries, remote ops) stay excluded for the same reasons./mcp's middleware.Tests
cargo test -p omnigraph-server --locked: lib 202 passed (2 ignored),integration262 passed,boot_settings39,multi_graph8.mcp_resources_read_graphs_schema_and_branches_under_policynow asserts the full resource list and that each topic's text equals the skill file byte for byte; the unit testevery_best_practice_resource_is_an_embedded_skill_referencefails the build if a listed topic leaves the skill.cargo fmt --all --check, clippy onomnigraph-serverwith-D warnings,check-docs.py,check-dependency-sources.py,typos: clean.resources/listreturns the seven URIs andomnigraph://best-practices/queriesreads back# Query Authoring & Linting.