/semantic-okf:build-semantic-okffrom semantic-okf
Builds and maintains a Semantic OKF source definition and its generated knowledge folder with deterministic Python adapters for Markdown, CSV, JSON or JSONL, and RDF. Use when Codex needs to create or change a manifest, source topology, mapping, ontology, validation rule, generated snapshot, refresh, promotion, rollback, or recovery. This skill owns construction and maintenance only; it does not answer questions from the generated knowledge.
Ships in semantic-okf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Create and maintain one deterministic, validated knowledge folder from reviewed local sources. Keep the complete construction contract inside this skill.
SKILL.md, references/, scripts/, and declared Python requirements.Do not infer classes, relations, rules, identity matches, or source precedence from field names alone. Ask for review when the mapping would change domain meaning.
Run commands from the directory containing this SKILL.md, or prefix paths with the skill root.
python -m venv .venv
source .venv/bin/activate
On Windows PowerShell, activate the same environment with:
.\./.venv/Scripts/Activate.ps1
Then install and verify with the activated interpreter:
python -m pip install -r scripts/requirements.txt
python scripts/runtime_smoke.py
Keep the environment activated for every command below. CPython 3.12 is the compatibility baseline used to compile the lock; a newer CPython is supported only when runtime_smoke.py passes with the exact locked dependencies. No external data-processing engine is required.
python scripts/build_semantic_okf.py manifest.json semantic-okf-output \
--concept-layout source-packed-v1
python scripts/validate_okf_bundle.py semantic-okf-output
python scripts/validate_semantic_okf.py semantic-okf-output --output-format json
For repeated builds, keep the discardable parser cache outside both raw input and generated output:
python scripts/build_semantic_okf.py manifest.json semantic-okf-output \
--cache-dir .semantic-okf-cache --concept-layout source-packed-v1
Reuse requires the same logical path, raw SHA-256, adapter configuration, and processor digest. File modification times and date-based folders are not freshness authorities.
The output directory must not already exist. A successful build contains:
semantic-okf-output/
index.md
concepts/
semantic/
ontology.ttl
data.ttl
shapes.ttl
provenance.ttl
records.jsonl
semantic-plan.json
source-manifest.json
validation-report.ttl
build-report.json
These artifacts are one release unit. The builder keeps asserted data, ontology, provenance, constraints, and validation results in separate files and validates their cross-layer coherence before publication.
Preview a complete reprocessing pass:
python scripts/refresh_semantic_okf.py update manifest.json semantic-okf-output --check --output-format json
Use the same external cache on preview and promotion to parse only changed physical inputs:
python scripts/refresh_semantic_okf.py update manifest.json semantic-okf-output \
--cache-dir .semantic-okf-cache --check --output-format json
Promote an approved candidate:
python scripts/refresh_semantic_okf.py update manifest.json semantic-okf-output \
--expected-current-tree-sha256 <current-tree-sha256> \
--expected-candidate-tree-sha256 <candidate-tree-sha256> \
--allow-plan-change \
--allow-record-removals
Omit an approval flag when that change class is not intended. Refresh never merges generated trees in place. If promotion is interrupted, run:
python scripts/refresh_semantic_okf.py recover semantic-okf-output
markdown: one concept per file; mapped YAML values must be scalars; the body is preserved for reading.source-packed-v1 keeps Markdown one-file-per-record and combines repeated CSV, JSON, or RDF records into one validated collection document per source. Logical concept_id, concept_path, record body, hashes, RDF, provenance, and ledger order do not change.semantic/records.jsonl and the semantic graphs.csv: exact, case-sensitive headers; header order is irrelevant; duplicate, missing, and extra columns fail; scalar conversion is strict.json: one object per line unless multiLine=true; missing declared fields become null; unknown fields are ignored; malformed or non-object records fail.rdf: one concept per absolute URI subject; blank nodes must be skolemized; repeated mapped predicate values remain repeated values.(source_id, record_id). RDF subjects are global and must not collide.Before delivery, confirm all of the following:
agents/openai.yaml (opens in a new tab)references/coherence-contract.md (opens in a new tab)references/manifest.md (opens in a new tab)references/python-runtime.md (opens in a new tab)references/refreshing.md (opens in a new tab)references/source-combination.md (opens in a new tab)scripts/_semantic_okf.py (opens in a new tab)scripts/build_semantic_okf.py (opens in a new tab)scripts/refresh_semantic_okf.py (opens in a new tab)scripts/requirements.in (opens in a new tab)scripts/requirements.txt (opens in a new tab)scripts/runtime_smoke.py (opens in a new tab)scripts/validate_okf_bundle.py (opens in a new tab)scripts/validate_semantic_okf.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gvillarroel/plugins --plugin semantic-okf16 skills in this plugin
/build-semantic-okf-adaptiveBuilds and independently validates an atomic Semantic OKF/RDF snapshot plus a deterministic adaptive retrieval projection for arbitrary declared sources. Use when Codex needs a standalone offline builder that combines Bag of Words, BM25, topic communities, a PPMI term graph, query-aspect routing, diversified reranking, and exact evidence bindings without changing authoritative records or requiring embeddings. This skill owns construction only and never answers from a published snapshot./build-semantic-okf-classicalBuilds and independently validates an atomic Semantic OKF/RDF snapshot plus a deterministic, non-authoritative classical text-retrieval projection. Use when Codex needs Bag of Words, Okapi BM25, corpus lexical statistics, co-occurrence topic communities, PPMI query expansion, or diversity-aware retrieval without embeddings or model downloads. This standalone skill owns construction only and never answers from a published snapshot./build-semantic-okf-embeddingsBuilds and independently validates an atomic Semantic OKF/RDF v1 snapshot plus a hash-bound, non-authoritative retrieval projection with record or semantic chunks and local embeddings. Use when Codex needs to materialize Markdown, CSV, JSON/JSONL, or RDF sources for semantic discovery, compare native and LlamaIndex splitting, use deterministic hashing or a pinned offline SentenceTransformers model, or reproduce an embedding-enabled corpus build. This skill owns construction only and does not answer questions from the snapshot./build-semantic-okf-ensembleBuilds and independently validates a new Semantic OKF bundle with one authoritative Markdown/RDF/SHACL core plus deterministic adaptive lexical, source-generic entity-section graph, embedding, exact identity-crosswalk, and quality-gated ensemble projections. Use when Codex must publish a standalone, reproducible multi-signal knowledge snapshot from a closed local manifest and plan without modifying an existing bundle or treating retrieval artifacts as authoritative./consult-semantic-okfProvides an agent with the general read-only context and local tools needed to navigate and consult an existing Semantic OKF knowledge folder efficiently. Use when Codex needs to discover records, read concepts, choose an authoritative semantic layer, run safe local SELECT or ASK queries, trace provenance, compare sources, or return grounded evidence. This skill never creates, repairs, refreshes, or modifies knowledge./consult-semantic-okf-adaptiveConsults an existing adaptive Semantic OKF snapshot read-only through BM25, topic, PPMI term-graph, fusion, query-aspect retrieval, or facet-separated claim coverage and finalize contract-ready evidence from authoritative bindings. Use when Codex must discover diverse evidence across arbitrary declared sources, answer multi-source questions, preserve exact IDs and locators, or inspect retrieval integrity without building, repairing, or modifying knowledge.