wiki-bot: Skill for Claude Code

.agents/skills/template-usage-audit/SKILL.md

template-usage-audit is a skill for Claude Code, Codex from re0wiki/wiki-bot. It costs 38 tokens per session (2,128 once invoked), scanned A, original, MIT.

A checking workflow for finding whether Fandom wiki templates are really used before deleting them. It combines site-wide source searches with Fandom's page- parsing data to separate real template calls from lookalike syntax.

In plain words
What is it for?
It helps audit candidate templates, check redirects and documentation examples, inspect hidden include-only dependencies, and record delete-or-keep decisions.
Why use it?
Fandom's embedded-in report and simple text searches can miss uses or count examples and built-in syntax as uses. This reduces the risk of deleting a template that pages still need, or keeping one that is unused.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is re0wiki/wiki-bot's own configuration. It tells Claude Code and Codex how to work on wiki-bot itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything wiki-bot configures →

Reuse

Borrowing it

Nothing to install: this file belongs to re0wiki/wiki-bot. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/re0wiki/wiki-bot/main/.agents/skills/template-usage-audit/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/re0wiki/wiki-bot

Made for: Claude Code, Codex.

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 template-usage-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/re0wiki/wiki-bot/template-usage-audit/github.svg)](https://agentmods.dev/skills/re0wiki/wiki-bot/template-usage-audit)
Your own site
<a href="https://agentmods.dev/skills/re0wiki/wiki-bot/template-usage-audit"><img src="https://agentmods.dev/badge/skills/re0wiki/wiki-bot/template-usage-audit/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.

agentmods 80×15 button for template-usage-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/re0wiki/wiki-bot/template-usage-audit"><img src="https://agentmods.dev/badge/skills/re0wiki/wiki-bot/template-usage-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,128 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00038 $0.02128
Opus 5.5 $0.00015 $0.00851
Sonnet 5.5 $0.00008 $0.00426
Haiku 4.5 $0.00004 $0.00213

Measured 9d ago against content hash 38a6304891e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

template-usage-audit 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 9d 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.

.agents/skills/template-usage-audit/SKILL.md · 105 lines

How it starts

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

零引用模板审计(Fandom 模板删除前检查)

背景:审查 embeddedin() 报告零引用的模板,决定删除还是保留。 2026-07 模板清理实测:32 个候选,全站 11,207 页扫描。 每次盘点的数据与逐模板结论记录在 docs/templates.md,本文是可复用的工作流。

为什么 embeddedin 单独不可信

Fandom 的 templatelinks 曾被认为是「会漏真实使用」,2026-07-28 更正:当时唯一的证据 ({{!}} 在 143 个图库页的 #tag:tabber 参数里、embeddedin=0)真实原因是 {{!}} 自 MW 1.24 起是内置 magic word,根本不产生 transclusion——embeddedin=0 是对的, grep 命中的也只是语法不是调用。同理 {{=}}(1.39 起)。判「语法出现是否真是模板调用」 的最可靠手段是 action=parse&prop=templates:magic word 处理的不会出现在列表里。 (同名模板存在时 magic word 优先,模板是死代码。)

仍真实的 embeddedin 局限:

  1. 未使用模板里的 <includeonly> 调用:死模板体内 <includeonly>{{SomeOther}}</includeonly> 在自身页面上永不解析,SomeOther 显示 0 引用,但源码里依赖存在。

结论:对每个候选名跑全站 wikitext dump + 正则 grep (\{\{\s*(?:subst\s*:\s*)?Name\s*[|}],首字母不区分大小写)。 注意 grep 命中 ⊇ 真实调用:magic word({{!}}、{{=}} 等)与 includeonly 死代码 都只是语法出现——拿不准时用 action=parse&prop=templates 判定。

grep 的三个坑(2026-07-28 复核实测,曾造成漏判/误判)

  1. 必须排除模板自身与自身 /doc:模板文档里的示例调用({{StructuredQuote|...}} 之类) 会被 grep 算作「使用」——2026-07-26 首轮复核因此把 StructuredQuote、未用 Infobox 系、 Tocright 误判为 used 而漏删,2026-07-28 排除自身后才暴露。
  2. 重定向别名的用量记在目标上:页面写 {{R}} 时按本名 grep Auto ruby 是 0, 但 embeddedin(Auto ruby)=151——templatelinks 会把经重定向的引用归到目标页。 判「零」要 embeddedin 交叉验证(或 grep 时把所有重定向别名并进模式); 反过来,embeddedin 有的盲区(上节)靠 grep 补。两法都零才算零。
  3. 别漏命名空间:授权模板(Fairuse/PD 等)只用在 File 页(ns 6), 维护模板可能在 User/Project 页——dump 范围要含 0/2/4/6/8/10/14/828 (本节的旧配方排除 ns 6/7,只适用于当时已知名单,不复用)。

复核脚本:src/tools/recheck_template_usage.py(全命名空间批量 dump + 逐模板 grep, 排除自身/自身子页,输出零引用清单与重定向标注)。

全站 dump 配方(全命名空间,默认限速下 ~11k 页 ~3 分钟)

from pywikibot.data.api import QueryGenerator
for nsid in (0, 2, 4, 6, 8, 10, 14, 828):
    for pg in QueryGenerator(site=site, generator="allpages",
                             gapnamespace=str(nsid), gaplimit="50",
                             prop="revisions", rvprop="content", rvslots="main"):
        text = pg["revisions"][0].get("slots", {}).get("main", {}).get("*", "")
  • QueryGenerator 配 generator 直接产出页面 dict——不要再解 result["query"]["pages"] (那样静默拿不到东西)。
  • gapnamespace="*" 会被拒(badvalue)——显式迭代命名空间 id。
  • 多页 generator 查询禁止 rvlimit/rvdir=newer(invalidparammix)——省略即可, prop=revisions 本来就只返回每页最新版本。(单页查首版本另发 simple_request 带 rvdir=newer, rvlimit=1。)

Read the full file on GitHub · 105 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. 9d ago Changed · +1 lines 38a6304891e1
  2. 1mo ago First seen · 104 lines · 38 tokens per session scan A d09747164902

Subscribe to this mod's changes

template-usage-audit is a skill published in the GitHub repository re0wiki/wiki-bot (5 stars, last pushed 3d ago), licensed MIT. It adds 38 tokens to every session and 2,128 once invoked, about $0.0002 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-22.

Related

template-usage-audit compared with skills from other repositories

template-usage-audit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
template-usage-auditre0wiki/wiki-botSkill53d agoMITA38Claude Code, Codex
schema-explorationlangchain-ai/deepagentsSkill31kyesterdayMITA57Claude Code, Codex
matlabK-Dense-AI/scientific-agent-skillsSkill56k4d agoMITA44Claude Code
mem0-oss-to-platformmem0ai/mem0Skill68k2d agoApache-2.0A217Claude Code, Codex
mempalace-recallMemPalace/mempalaceSkill60kyesterdayMITA94Claude Code
analyze-marketlangchain-ai/deepagentsSkill31kyesterdayMITA34Claude Code, Codex
haikuagno-agi/agnoSkill43kyesterdayApache-2.0A0Claude Code, Codex