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.
npx skills add EthanYoQ/Skill-hub --skill citation-anchor-resolvergit clone --depth 1 https://github.com/EthanYoQ/Skill-hubWrote 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.
[](https://agentmods.dev/skills/ethanyoq/skill-hub/citation-anchor-resolver)<a href="https://agentmods.dev/skills/ethanyoq/skill-hub/citation-anchor-resolver"><img src="https://agentmods.dev/badge/skills/ethanyoq/skill-hub/citation-anchor-resolver/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ethanyoq/skill-hub/citation-anchor-resolver"><img src="https://agentmods.dev/badge/skills/ethanyoq/skill-hub/citation-anchor-resolver.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00307 | $0.02383 |
| Opus 5.5 | $0.00123 | $0.00953 |
| Sonnet 5.5 | $0.00061 | $0.00477 |
| Haiku 4.5 | $0.00031 | $0.00238 |
Grade A, and why
citation-anchor-resolver 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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.
citation-anchor-resolver
TL;DR
输入:报告文本 + 一个 citation 锚点字符串 + sources_dir 目录 输出:锚点对应的源原文片段、或事实声明的关键词核对结果(verified True/False)
3 个公开函数:
parse_citations_in_text(text)— 扫描文本提取所有锚点 + 上下文resolve_citation(anchor, sources_dir)— 锚点 → 源文本片段verify_claim_against_source(claim_text, citation, sources_dir)— 核对 claim 关键词
Iron Law(P0 守护,绝对不可违反)
本 skill 是 Cite-or-Block 架构的基石。永远不做以下事:
- ❌ 维护"已知 PMID 列表 / 已知指南列表 / 已知药品列表"等任何字典
- ❌ 在 resolve 失败时 fallback 到"内置答案"
- ❌ 用 LLM 生成关键词的"语义匹配",必须用严格 substring(可加规范化)
- ❌ 任何形如
_known_xxx_fallback.py/KNOWN_XX_LIST = [...]的代码
唯一允许的姿势:
- ✅ 打开
sources_dir内的源文件(JSON/HTML/PDF/text) - ✅ 用字符串
in操作核对关键词 - ✅ 源里没有 → 返回
verified=False - ✅ 锚点解析不出文件 → 返回
None
源里没有 = verified=False,无例外。
Citation 锚点 schema
格式:[<source_type>:<source_id>:<locator>]
| source_type | source_id 形如 | 文件路径(相对 sources_dir) | locator 例 |
|---|---|---|---|
guideline |
CSCO-2024-NSCLC |
guidelines/CSCO-2024-NSCLC.{txt,md,html,pdf} + .toc.json |
§5.5.2 |
pmid |
12345678 |
pubmed/12345678.json |
abstract / title |
nct |
NCT01828099 |
trials/NCT01828099.json |
results / eligibility |
aact |
NCT01828099 |
aact/NCT01828099.json |
results |
europepmc |
PMC1234567 |
europepmc/PMC1234567.json |
abstract |
bioc |
PMC1234567 |
bioc/PMC1234567.json |
intro / methods / results |
evidence |
01_lit.md |
<sources_dir>/../evidence/01_lit.md |
line:42 / line:42-58 |
nmpa-page |
H20180123 |
nmpa/H20180123.{html,json} |
(可空) |
详见 references/anchor-schema.md 和 references/source-types.md。
公开 API
from resolver import (
parse_citations_in_text,
resolve_citation,
verify_claim_against_source,
)
# 1. 扫文本拿锚点
cites = parse_citations_in_text(report_html)
# [{"anchor": Citation(...), "anchor_str": "[pmid:12345678:abstract]",
# "claim_sentence": "...", "position": 42}, ...]
# 2. 锚点 → 源原文
src = resolve_citation("[guideline:CSCO-2024-NSCLC:§5.5.2]", sources_dir)
# str(源章节内容)or None
# 3. 核对关键词
res = verify_claim_against_source(
claim_text="洛拉替尼商品名博瑞纳",
citation="[guideline:CSCO-2024-NSCLC:§5.5.2]",
sources_dir=sources_dir,
)
# {"verified": True, "matched_keywords": [...], "missing_keywords": [],
# "source_excerpt": "...", "reason": "all keywords matched"}
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/anchor-schema.md 3.1 KB
- references/failure-modes.md 3.7 KB
- references/source-types.md 3.1 KB
- scripts/__init__.py 1.0 KB runs code
- scripts/_anchor_schema.py 3.2 KB runs code
- scripts/_keyword_match.py 7.6 KB runs code
- scripts/_source_loader.py 14 KB runs code
- scripts/resolver.py 7.4 KB runs code
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.
- 2mo ago First seen · 196 lines · 307 tokens per session scan A 732bbfb7527a
citation-anchor-resolver is a skill published in the GitHub repository EthanYoQ/Skill-hub (12 stars, last pushed 2d ago), licensed MIT. It adds 307 tokens to every session and 2,383 once invoked, about $0.0012 per session on Opus 5.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-09-13.
citation-anchor-resolver compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| citation-anchor-resolverEthanYoQ/Skill-hub | Skill | 12 | 2d ago | MIT | A | 307 | Claude Code, Codex |
| wikiSethGammon/Citadel | Skill | 943 | 3d ago | MIT | A | 56 | Claude Code |
| debriefspacedock-dev/spacedock | Skill | 87 | 3d ago | Apache-2.0 | A | 59 | Claude Code |
| document-processorvignesh2027/Claude-Agentic-Skills2.0-version | Skill | 4 | 3mo ago | MIT | A | 65 | Claude Code, Codex |
| create-proposalHarmeet10000/skills | Skill | 8 | 6mo ago | MIT | A | 8 | Claude Code, Codex |
| contract-generatorinbharatai/claude-skills | Skill | 44 | 8mo ago | MIT | A | 25 | Claude Code, Codex |
| docxinbharatai/claude-skills | Skill | 44 | 8mo ago | MIT | A | 35 | Claude Code, Codex |