# ontomcp-driver

Adopt this skill: https://proskills.md/skills/other/mareasw-ontoskills-site-public-agent-skills-ontomcp-driver

Page: https://proskills.md/skills/other/mareasw-ontoskills-site-public-agent-skills-ontomcp-driver
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: site/public/agent-skills/ontomcp-driver/SKILL.md
size: 1363
sha: 02751af15eb884b50610d61dea2be2f526fc0ef1
upstream: https://github.com/mareasw/ontoskills/blob/main/site/public/agent-skills/ontomcp-driver/SKILL.md

```text
---
name: ontomcp-driver
description: Use OntoSkills MCP tools to discover and apply structured skill knowledge.
---

## Tools

- **prefetch_knowledge** — One call: search + fetch context + compact. **Use this first.**
- **search** — Find skills by keyword, alias, or structured filters.
- **get_skill_context** — Full skill context with knowledge nodes (procedures, constraints, anti-patterns).
- **evaluate_execution_plan** — Validate a multi-skill plan against state chains.
- **query_epistemic_rules** — Cross-skill knowledge rules filtered by kind/severity.

Responses are compact by default. Use `format: "raw"` for full JSON.

## Workflow

1. Call `prefetch_knowledge` with a query describing the task goal.
2. Read the returned knowledge nodes — they contain procedures, constraints, and anti-patterns.
3. For multi-skill plans: call `evaluate_execution_plan` to validate state chains.
4. Write code following the knowledge nodes.

## Critical rules

- **Always prefetch first** — don't guess skill names.
- **CRITICAL/HIGH severity nodes are hard constraints** — never skip them.
- **Check requiresState** — skills fail without their preconditions.

## State semantics

Skills form a state machine: `requiresState` (preconditions) / `yieldsState` (outcomes).
Skill A's yieldsState must match Skill B's requiresState for valid chaining.
```

## File: README.md
upstream: https://github.com/mareasw/ontoskills/blob/main/README.md

````text
<p align="center">
  <img src="assets/ontoskills-banner.png" alt="OntoSkills: Neuro-Symbolic Skill Compiler" width="100%">
</p>

<h1 align="center">
  <a href="https://ontoskills.sh" style="text-decoration: none; color: inherit; display: flex; align-items: center; justify-content: center; gap: 10px;">
    <img src="assets/ontoskills-logo.png" alt="OntoSkills Logo Inline" height="40px" style="display: block;">
    <span>OntoSkills</span>
  </a>
</h1>

<p align="center">
  <b>🇬🇧 English</b> • <a href="README_zh.md">🇨🇳 中文</a>
</p>

<p align="center">
  <strong>The <span style="color:#e91e63">deterministic</span> enterprise AI agent platform.</strong>
</p>

<p align="center">
  Neuro-symbolic architecture for the Agentic Web — <span style="color:#00bf63;font-weight:bold">OntoCore</span> • <span style="color:#2196F3;font-weight:bold">OntoMCP</span> • <span style="color:#9333EA;font-weight:bold">OntoStore</span>
</p>

<p align="center">
  <a href="https://ontoskills.sh/docs/overview/">Overview</a> •
  <a href="https://ontoskills.sh/docs/getting-started/">Getting Started</a> •
  <a href="https://ontoskills.sh/docs/roadmap/">Roadmap</a> •
  <a href="PHILOSOPHY.md">Philosophy</a>
</p>

<p align="center">
  <img src="https://img.shields.io/badge/python-3.10%2B-blue?style=for-the-badge&logo=python" alt="Python 3.10+">
  <img src="https://img.shields.io/badge/node.js-18%2B-green?style=for-the-badge&logo=node.js" alt="Node.js 18+">
  <img src="https://img.shields.io/badge/OWL%202-RDF%2FTurtle-green?style=for-the-badge&logo=w3c" alt="OWL 2 RDF/Turtle">
  <img src="https://img.shields.io/badge/SHACL-Validation-purple?style=for-the-badge&logo=graphql" alt="SHACL Validation">
  <a href="#license">
    <img src="https://img.shields.io/badge/license-MIT-orange?style=for-the-badge" alt="MIT License">
  </a>
</p>

---

## What is OntoSkills?

OntoSkills transforms natural language skill definitions into **validated OWL 2 ontologies** — queryable knowledge graphs that enable deterministic reasoning for AI agents.

**The problem:** LLMs read skills probabilistically. Same query, different results. Long skill files burn tokens and confuse smaller models.

**The solution:** Compile skills to ontologies. Query with SPARQL. Get exact answers, every time.

```mermaid
flowchart LR
    CORE["OntoCore<br/>━━━━━━━━━━<br/>SKILL.md → .ttl<br/>LLM + SHACL"] -->|"compiles"| CENTER["OntoSkills<br/>━━━━━━━━━━<br/>OWL 2 Ontologies<br/>.ttl artifacts"]
    CENTER -->|"loads"| MCP["OntoMCP<br/>━━━━━━━━━━<br/>Rust SPARQL<br/>in-memory graph"]
    MCP <-->|"queries"| AGENT["AI Agent<br/>━━━━━━━━━━<br/>Deterministic<br/>reasoning"]

    style CORE fill:#e91e63,stroke:#2a2a3e,color:#f0f0f5
    style CENTER fill:#abf9cc,stroke:#2a2a3e,color:#0d0d14
    style MCP fill:#92eff4,stroke:#2a2a3e,color:#0d0d14
    style AGENT fill:#6dc9ee,stroke:#2a2a3e,color:#0d0d14
```

---

## Why OntoSkills?

| Problem | Solution |
|---------|----------|
| LLMs interpret text differently each time | SPARQL returns exact answers |
| 50+ skill files = context overflow | Query only what's needed |
| No verifiable structure for relationships | OWL 2 formal semantics |
| Small models can't read complex skills | Democratized intelligence via graph queries |

**For 100 skills:** ~500KB text scan → ~1KB query

[→ Read the full philosophy](PHILOSOPHY.md)

---

## Quick Start

```bash
# Install the MCP runtime and bootstrap your client
npx ontoskills install mcp --claude

# Or install the Python compiler separately
pip install ontocore
ontocore compile
```

[→ Full installation guide](https://ontoskills.sh/docs/getting-started/)

---

## Components

| Component | Language | Description |
|-----------|----------|-------------|
| **OntoCore** | Python | Neuro-symbolic compiler: SKILL.md → OWL 2 ontology |
| **OntoMCP** | Rust | MCP server with sub-ms SPARQL queries |
| **OntoStore** | GitHub | Versioned skill registry |
| **CLI** | Node.js | One-command installer (`npx ontoskills`) |

---

## Document knowledge base

OntoCore also compiles a **folder of documents** into a knowledge base, not just
skills. Every statement is an atomic claim with a verbatim quote and a locator
(document, page, section, URL), and answers are deterministic — no model is
called at query time.

```bash
cd examples/demo-corpus && ./fetch.sh     # 14 public documents, hashes checked

ontocore ingest . -o kb --estimate        # cost estimate, no API calls
ontocore ingest . -o kb --resume          # compile (paid, one model per chunk)
ontocore ingest . -o kb --resume --semantic  # + local vectors, still no network
ontocore ask "How quickly must a personal-data breach be notified?" --kb kb
ontocore view --kb kb --questions-file questions.txt
```

- the compiler never writes a quote: the model returns span ids, the quote and
  locator are copied from the segmented text; a list item also carries the span
  that opens its list as `context` evidence, so an item with no subject of its
  own is still readable;
- a **deterministic verifier** (verbatim, locator, page, section, numbers) gates
  every claim and ships `weak` / `no` verdicts visibly instead of hiding them;
  `ask` answers only claims it passed, `view` shows every claim with its badge;
- a number that names where a rule lives (`Clause 8.2`, `Directive (EU)
  2019/790`) is a note, not a failure; a quantity that no quote carries is
  refused when the claim is built and recorded in `rejected.jsonl`;
- `ask` ranks with BM25 and groups by document, so a cross-document question
  shows which document says what; when the KB carries `vectors.jsonl` it fuses
  BM25 with a local MiniLM ranking (reciprocal rank fusion), offline and with no
  paid call, and falls back to BM25 alone if the optional runtime is absent;
- when two documents give the same topic different numbers, the answer reports
  a **tension** with both citations rather than picking a winner;
- output: `claims.jsonl`, `graph.ttl`, `evidence.csv`, `text/`, and a
  self-contained read-only `view.html` with copy-citation.

Measured on that corpus with `deepseek-v4.1-flash`, one full run: **5,680 claims**
from 14 documents and 556 pages, **99.8% `ok`** at the verifier (10 `weak`, 0
`no`), **$1.27**; all three demo questions cite claims from at least two
documents, one of them with a cross-document tension. Retrieval is measured, not
assumed: against a 20-question gold set declared before the first run, BM25 hits
13/20 and the hybrid 16/20 — both **miss the pre-registered gate** (18/20 and
0.60 recall), and `RESULTS.md` reports the numbers with the diagnosis. The
`weak` breakdown and both measurements are in `benchmark/docbench/RESULTS.md`.

See `docs/phase2-plan.md` for the pipeline and `examples/demo-corpus/` for the
corpus manifest, licences and sources. Measured extraction results are in
`benchmark/docbench/RESULTS.md`.

---

## Documentation

- **[Overview](https://ontoskills.sh/docs/overview/)** — What is OntoSkills and why it matters
- **[Getting Started](https://ontoskills.sh/docs/getting-started/)** — Installation and first steps
- **[Architecture](https://ontoskills.sh/docs/architecture/)** — How the system works
- **[Knowledge Extraction](https://ontoskills.sh/docs/knowledge-extraction/)** — Extracting value from skills
- **[OntoStore](https://ontoskills.sh/ontostore/)** — Browse and install skills
- **[Roadmap](https://ontoskills.sh/docs/roadmap/)** — Development phases

---

## <a id="license"></a>License

MIT License — see [LICENSE](LICENSE) for details.

*© 2026 [MareaSW](https://ontoskills.sh)*
````
