semantic-drift-scan-protocol

Detects semantic drift between wiki pages and PATTERN.md sections using embedding cosine similarity.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/soli92/soli-projects --skill semantic-drift-scan-protocol-soli92
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: semantic-drift-scan-protocol
Source: https://github.com/soli92/soli-projects/tree/main/.cursor/skills/semantic-drift-scan-protocol
Command: npx skills add https://github.com/soli92/soli-projects --skill semantic-drift-scan-protocol-soli92

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Wiki pages can silently drift away from the pattern sections they are supposed to document, and manual review does not scale. This Skill measures that drift quantitatively by comparing embedding vectors of each wiki page against its referenced PATTERN.md section. ## Core Features & Use Cases - Embedding-based drift detection: Computes cosine similarity between each candidate wiki page body and its declared pattern_section in PATTERN.md, using a configurable embedding model (default voyage-3). - Cost and safety gates: Estimates API cost before running, requires explicit user confirmation above a configurable USD threshold, and degrades gracefully when the embedding API is unreachable. - Structured reporting: Writes a dated markdown report (wiki-lint-semantic-YYYY-MM-DD.md) with pages below/above threshold, error entries, score statistics, and a log entry in wiki/log.md. - Use Case: Run the scan after a large wiki refactor to find the top 5 pages whose content no longer matches their pattern section, then prioritize them for rewriting. ## Quick Start Run the semantic drift scan on the wiki and show me the pages most at risk of drifting from PATTERN.md.

Frequently Asked Questions about semantic-drift-scan-protocol

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect semantic drift in a markdown wiki?▼

Compute embeddings for each wiki page body and for the PATTERN.md section it references via its pattern_section frontmatter field, then compare them with cosine similarity. Pages scoring below the configured threshold (default 0.75) are flagged as drifted.

How to measure similarity between a wiki page and a reference document?▼

Embed both texts with the same model (default voyage-3) and compute cosine similarity as dot(A, B) divided by the product of their norms. The scan produces one score per page plus min, max, and mean statistics in the report.

Which embedding models does the semantic drift scan support?▼

The model is read from wiki_lint.semantic_check.embedding_model in factory.config.yaml, defaulting to voyage-3. The documentation also references text-embedding-3-small pricing as an alternative option.

What happens if the embedding API is unreachable during the scan?▼

The scan emits a warning in chat and stops cleanly without failing, since it is an experimental opt-in check. Per-page transient API errors are recorded as null scores and the scan continues with remaining pages.

Does the semantic drift scan block the wiki lint pipeline?▼

No. It is a research-grade check that emits only INFO log entries, never WARNING or ERROR lint results. It runs exclusively via manual trigger and is not a pipeline gate.

How is the cost of an embedding-based wiki scan controlled?▼

Before any API call, the scan estimates cost from the candidate page count and model pricing. If the estimate exceeds the cost_warn_usd threshold (default $1.00), it asks for explicit confirmation and aborts cleanly if declined.