coherence-check

coherence-check is a skill for Claude Code, Codex from lukasrepublic/agentic-foundry. It costs 113 tokens per session (1,940 once invoked), scanned A, original, MIT.

A read-only checker that examines links and citations in selected project Markdown folders and reports whether they resolve correctly.

In plain words
What is it for?
Use it to audit citations in documentation, specifications, and Foundry files and receive deterministic JSON findings. It is advisory, not a merge blocker.
Why use it?
It catches broken references and distinguishes them from valid references that point outside the checked folders.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the foundry plugin — 81 skills, 8 agents, 8 hooks, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lukasrepublic/agentic-foundry/coherence-check
Any agent
npx skills add lukasrepublic/agentic-foundry --skill coherence-check
Clone the repo
git clone --depth 1 https://github.com/lukasrepublic/agentic-foundry

Made for: Claude Code, Codex.

Or install foundry, the plugin that ships this one along with the rest of its 81 skills, 8 agents, 8 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for coherence-check

README.md
[![agentmods](https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/coherence-check.svg)](https://agentmods.dev/skills/lukasrepublic/agentic-foundry/coherence-check)
Your own site
<a href="https://agentmods.dev/skills/lukasrepublic/agentic-foundry/coherence-check"><img src="https://agentmods.dev/badge/skills/lukasrepublic/agentic-foundry/coherence-check.svg" alt="Measured on agentmods" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,940 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00113 $0.01940
Opus 5 $0.00056 $0.00970
Sonnet 5 $0.00023 $0.00388
Haiku 4.5 $0.00011 $0.00194

Measured 5d ago against content hash 4e4ae22110f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

coherence-check scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/coherence-check/SKILL.md · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/foundry:coherence-check

An operator/agent ADVISORY sweep that walks the direct-edit WORKSPACE corpus (docs/, foundry/, specs/ markdown) and reports citation coherence. It builds the citation graph fresh in-memory on every run — it does NOT read the committed .foundry/graph.json (no cache trust, no is_stale branch, single fresh-walk provenance shape).

python3 "${CLAUDE_PLUGIN_ROOT}/scripts/foundry-coherence-check.py"
# override the scope (repeatable); default is the canonical docs/ foundry/ specs/:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/foundry-coherence-check.py" --scope specs --scope docs

Output (deterministic JSON, single document on stdout)

{
  "provenance": {"source": "fresh-walk", "scope": ["docs","foundry","specs"],
                 "corpus_root": "/abs/root", "node_count": 42},
  "findings":     [ {"src","target","resolved","reason"} ],   // broken; reason ∈ {malformed, target_missing}
  "out_of_scope": [ {"src","target","resolved"} ],            // resolve to a real .md outside scope — NOT broken
  "counts":       {"broken": N, "out_of_scope": M}
}

findings are sorted by (reason, src, target); out_of_scope by (src, target). On an operational failure provenance.source == "error" and an error key carries the cause.

Tri-state, fail-CLOSED exit (LOAD-BEARING)

  • 0 — ran, zero broken citations.
  • 1 — ran, ≥1 broken citation. This is ADVISORY only.
  • 2operational failure: build_graph raised, the resolved corpus root is missing, OR the corpus walked to zero nodes. An empty / mis-resolved corpus is a HARD error, never a vacuous clean 0 — that is what makes the sweep fail-closed.

The 1 vs 2 split is load-bearing. Downstream wiring MUST NOT promote exit 1 into a blocking gate over the workspace corpus. 1 says "broken citations exist, an operator should look" — it is not a merge veto. 2 is the only fail-closed operational stop, and it exists so a mis-resolved/empty corpus can never masquerade as clean.

Read the full file on GitHub · 123 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 123 lines · 113 tokens per session scan A 4e4ae22110f8

Subscribe to this mod's changes

coherence-check is a skill published in the GitHub repository lukasrepublic/agentic-foundry (1 stars, last pushed today), licensed MIT. It adds 113 tokens to every session and 1,940 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

foundry-hosted-agent-validation

Step-by-step process for validating a Python Foundry hosted agent sample (under python/samples/04-hosting/foundry-hosted-agents/) end to end — running it locally (native runtime and azd ai agent run) and after deploying it to an Azure AI Foundry project with azd. Use this when asked to validate a hosted agent sample.

microsoft/agent-framework · 82 tokens

skill-doc-delivery

Convert markdown to DOCX, PPTX, XLSX, PDF office documents — use when you need exportable deliverables.

nyldn/claude-octopus · 29 tokens

add-pdf-report

Internal implementation skill invoked by /add-native for app-generated PDF report workflows using expo-print and, when present, expo-sharing.

microsoft/power-platform-skills · 30 tokens

add-pdf-viewer

Internal implementation skill invoked by /add-native for native PDF control workflows. Handles HTTPS and file URI PDF viewing with @microsoft/power-apps-native-pdf-viewer 0.2.9+.

microsoft/power-platform-skills · 47 tokens

paper-figures

Extract figures from downloaded papers and include them in survey/review reports. Use when the report covers other groups' work and benefits from their architecture diagrams, experimental plots, or system schematics. Your brain prompt supplies the absolute path to the extract-figures script as {{EXTRACTFIGURES}} — use…

Muuuun/luxas · 79 tokens

moai-docs-generation

Documentation generation patterns for technical specs, API docs, user guides, and knowledge bases using real tools like Sphinx, MkDocs, TypeDoc, and Nextra. Use when creating docs from code, building doc sites, or automating documentation workflows.

modu-ai/moai-adk · 56 tokens