ref-integrity-scan

ref-integrity-scan is a skill for Claude Code, Codex from s977043/PlanGate. It costs 160 tokens per session (2,084 once invoked), scanned A, original, MIT.

A repository scan that finds references to files or folders before they are deleted, moved, or renamed. A repository is the project’s stored source files and related documents.

In plain words
What is it for?
Use it to check incoming references before path changes and produce candidates for updates; it checks repository references, not external website links or code imports.
Why use it?
It helps prevent links, scripts, or configuration from still pointing to an old path after a change.

Skill for Claude CodeCodex

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/s977043/plangate/ref-integrity-scan
Any agent
npx skills add s977043/PlanGate --skill ref-integrity-scan
Clone the repo
git clone --depth 1 https://github.com/s977043/PlanGate

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 ref-integrity-scan

README.md
[![agentmods](https://agentmods.dev/badge/skills/s977043/plangate/ref-integrity-scan.svg)](https://agentmods.dev/skills/s977043/plangate/ref-integrity-scan)
Your own site
<a href="https://agentmods.dev/skills/s977043/plangate/ref-integrity-scan"><img src="https://agentmods.dev/badge/skills/s977043/plangate/ref-integrity-scan.svg" alt="Measured on agentmods" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,084 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 $0.00160 $0.02084
Opus 5 $0.00080 $0.01042
Sonnet 5 $0.00032 $0.00417
Haiku 4.5 $0.00016 $0.00208

Measured 4d ago against content hash bf7cf0f389b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ref-integrity-scan 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 4d 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/ref-integrity-scan/SKILL.md · 111 lines

How it starts

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

Ref Integrity Scan

Provenance(出典・vendoring 規約): growth-core deletion-reference-scan (upstream: Growth-Teams-Agent@5219642 / 2026-07-03 時点)を PlanGate 向けに 汎用化して取り込み(#798)。上流への自動追従はしない — 上流更新の反映は 意図的に diff をレビューして行う(provenance 追跡 + 意図的更新の vendoring 標準)。

ファイル・ディレクトリを削除・移動・改名する前後に、リポジトリ全体を対象に被参照(そのパスを指している箇所)を洗い出し、ダングリング参照を防ぐための手順スキル。

#691(check-stale-skill-refs.py)との相補関係

スキル/スクリプト 走査方向 検出対象
scripts/check-stale-skill-refs.py(#691) outbound(発信) スキル/コマンド/エージェントが参照しているが実在しない(stale)
本スキル(ref-integrity-scan) inbound(被参照) 削除・移動・改名する対象への参照が他のどこかに残っている

#691 は「自分が指している先が消えていないか」、本スキルは「自分を消したときに誰かが迷子にならないか」を確認する。両方向を揃えることで参照整合を守る。

実害事例(動機)

2026-07-10、self-review スキルを diff-audit へ改名した際(#796)、削除・改名前の被参照スキャンを行わなかったため、以下が事後検出になった:

  • acceptance-review からのリンク切れ(RiverReview レビューで major 指摘として検出)
  • .cursor 配下の壊れた symlink(旧パス self-review を指したまま。Codex 側レビューで検出)

いずれも事前に inbound スキャンを行っていれば着手前に判明していた。本スキルはこの再発防止策として新設する。

When NOT to use

  • コード内の import / require 参照の整合性チェック → 型チェッカー / linter を使う
  • 外部サイトへのリンク切れ(http/https URL)のチェック → 対象外(本スキルはリポジトリ内参照のみ)

手順

Step 1: 対象パスの確認

削除・移動・改名する対象パスを列挙する(複数可)。例:

対象: .claude/skills/self-review/  (旧名)
対象: .claude/skills/self-review/SKILL.md

移動・改名の場合は「旧パス」と「新パス」の両方を把握しておく(新パスは対象外、旧パスのみスキャン対象)。

Step 2: スキャン実行

フルパスファイル名のみの 2 パターンで grep する。参照形式が ./ 省略・相対パス表記・単純なファイル名参照など様々なため、片方だけでは取りこぼす。

対象ディレクトリ・ファイル: docs/ .claude/ .agents/ .codex/ .cursor/ plugin/ bin/ scripts/ CLAUDE.md AGENTS.md README*.md 対象拡張子: *.md *.json *.sh *.yaml *.yml

TARGET_FULL="path/to/target"          # フルパス(削除・移動対象)
TARGET_NAME="$(basename "$TARGET_FULL")"  # ファイル名のみ

# プレースホルダのまま実行すると全行マッチで大量出力になるためガードする
if [ -z "$TARGET_FULL" ] || [ "$TARGET_FULL" = "path/to/target" ]; then
  echo "Error: TARGET_FULL を実際の対象パスに設定してください" >&2
else
  # git grep は .gitignore を尊重し高速。--untracked で未コミットの新規ファイルも対象に含める
  # パターン1: フルパスでの参照
  git grep -n -F --untracked -- "$TARGET_FULL" -- '*.md' '*.json' '*.sh' '*.yaml' '*.yml'

  # パターン2: ファイル名のみでの参照(誤検出が出やすいので手動で絞り込む)
  git grep -n -F --untracked -- "$TARGET_NAME" -- '*.md' '*.json' '*.sh' '*.yaml' '*.yml'
fi

Read the full file on GitHub · 111 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. 4d ago First seen · 111 lines · 160 tokens per session scan A bf7cf0f389b6

Subscribe to this mod's changes

ref-integrity-scan is a skill published in the GitHub repository s977043/PlanGate (2 stars, last pushed 4d ago), licensed MIT. It adds 160 tokens to every session and 2,084 once invoked, about $0.0008 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

skill-maintenance

Automated skill maintenance tool (v6 — Unified Registry + Snapshots). Full scan: [Orphan] migrate misplaced skills from category dirs OR standalone skills/&lt;name&gt;/ to auto-generated/, [Sync] auto-generated/ vs registry lifecycle diff (new/deleted/revived + description auto-sync via lifecycle field), [Reg]…

jiangyuxue666/hermes-soul-governance · 123 tokens

watch

File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through /do. Use for automatic reactions to file changes; do NOT use for…

SethGammon/Citadel · 70 tokens

review

5-pass structured code review — correctness, security, performance, readability, consistency.

SethGammon/Citadel · 17 tokens

live-preview

Mid-build visual verification loop. Takes screenshots of components during construction, not just after. Catches visual regressions and invisible features before they compound. Requires Playwright or similar screenshot tool.

SethGammon/Citadel · 40 tokens

marshal

Meta-orchestrator that takes any direction — broad, specific, or vague — and autonomously chains skills and context into actionable work. Gathers context from codebase, docs, and memory. Only asks the user when it genuinely cannot proceed. Single-session orchestrator.

SethGammon/Citadel · 56 tokens

wiki

Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to 400K words.

SethGammon/Citadel · 56 tokens