auditing-helper-reuse

auditing-helper-reuse is a skill for Claude Code from apple/coreai-models. It costs 110 tokens per session (1,449 once invoked), scanned A, original, BSD-3-Clause.

A review procedure for large model-export code changes that checks whether new code duplicates helpers already in the project. It compares exported graphs, weights, and outputs to ensure reuse does not change them.

In plain words
What is it for?
Use it before finalising a large pull request that adds model layers, encoders, exporters, attention code, masks, loaders, or related helpers.
Why use it?
It helps avoid unnecessary duplicate implementations while treating any change in model output or lowering as a real model change.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin.

Part of the coreai-skills plugin — 4 skills shipped together

Good fit Use it before finalising a large pull request that adds model layers, encoders, exporters, attention code, masks, loaders, or related helpers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/apple/coreai-models/auditing-helper-reuse
About the project

Core AI Models is a toolkit for exporting AI models, creating model components in Python, and running exported models in macOS and iOS apps through Swift utilities. It is for developers building on-device AI applications with Core AI. Its catalogue skills and plugin help coding agents work with the model export and runtime tooling.

apple/coreai-models · 2,402 stars · on GitHub

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.

Any agent
npx skills add apple/coreai-models --skill auditing-helper-reuse
Clone the repo
git clone --depth 1 https://github.com/apple/coreai-models

Made for: Claude Code.

Or install coreai-skills, the plugin that ships this one along with the rest of its 4 skills.

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 auditing-helper-reuse

README.md
[![agentmods](https://agentmods.dev/badge/skills/apple/coreai-models/auditing-helper-reuse/github.svg)](https://agentmods.dev/skills/apple/coreai-models/auditing-helper-reuse)
Your own site
<a href="https://agentmods.dev/skills/apple/coreai-models/auditing-helper-reuse"><img src="https://agentmods.dev/badge/skills/apple/coreai-models/auditing-helper-reuse/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 auditing-helper-reuse

Your own site · 80×15
<a href="https://agentmods.dev/skills/apple/coreai-models/auditing-helper-reuse"><img src="https://agentmods.dev/badge/skills/apple/coreai-models/auditing-helper-reuse.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,449 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.00110 $0.01449
Opus 5.5 $0.00044 $0.00580
Sonnet 5.5 $0.00022 $0.00290
Haiku 4.5 $0.00011 $0.00145

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

Security

Grade A, and why

auditing-helper-reuse 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 16d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/graph_identity.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/skills/auditing-helper-reuse/SKILL.md · 90 lines

How it starts

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

Auditing helper reuse before a model-export PR

Overview

Replace re-implemented helpers with existing ones only when the replacement is an identity transform: exported graphs, weights and outputs stay exactly the same.

A reuse that changes numbers or lowering is a model change, not a cleanup, however small the tolerance. That includes deleting a branch the target model never takes.

scripts/graph_identity.py compare is the arbiter: reading code finds candidates, compare decides. Count added non-test source toward the 500 lines.

Preconditions and invariant

  • Before: the new code has tests, and every one that can run here passes. Failures elsewhere are acceptable only if they fail the same way on the base branch in the same environment; otherwise stop and fix them. A tier that cannot run (missing package, no network) is recorded as not run: it does not block the audit, but the PR stays in draft until it has run.
  • Invariant: every test has the same outcome as in the baseline, and compare reports 0 differences.

The baseline is the unedited PR head in a detached worktree; snapshot its python/src and run its tests there. Run the suite one test file per process (a Core AI runtime crash kills a whole run). Rerun a differing test on its own, three times, in both trees: flaky in both is the same outcome, flaky in one is a difference.

Process

  1. Snapshot the baseline first. Write a spec (see the script's docstring) that builds every new module from tiny seeded configs. Give every branch an edit touches its own case: a GQA config even if the real model has as many KV heads as query heads, and both values of a module flag, set in the module that reads it after the change. Cover a caller that only builds from real weights with its smallest submodule that uses the helper. Put config-dependent facts in extras(): CLI --help, written metadata (no timestamps), errors from construction-time guards, and mlir_hash of converted programs. Then:
    • control: snapshot again; compare must report 0 (the spec is deterministic);
    • negative control: in a scratch copy, flip one constant in each area you plan to edit; compare must report differences for each, or the spec is blind there and must be fixed.
  2. Inventory every helper family, starting from references/helper-map.md (check it against the tree; it goes stale). The biggest wins are often whole blocks copied from a peer model, export boilerplate and private imports, not the RoPE math.
  3. Check each candidate by reading both implementations: layout, dtype, eps, constants, op order. A helper that fits only some call sites is still a reuse at those sites. Passing your config to a shared class is fine if the class reads only fields it already has.
  4. Apply only identities. Reject near-misses, anything that needs the shared helper or your config changed to fit, and anything compare cannot cover. Write each rejection down with its reason; it answers "why not reuse X?". A reviewer's swap request goes through the same check and the Boundaries; if compare differs, reply with the first difference it reports.
  5. Prove it: compare exits 0 against the baseline; the suite matches the baseline (reused test helpers keep the same test count); the new code's optional tiers run via the uv run --with ... overlay their docstrings name, or are listed as not run in the PR's Tests section; ruff check and ruff format --check pass. Have an independent reviewer try to refute each applied reuse; they also catch what compare cannot see, such as a new import pulling in a heavy package.
  6. Commit. Fold each reuse into the commit that introduced the copy (fixup! <subject>, then GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash <base>). A promotion goes first: commit the move and the switch of callers already in the base on top of <base>, then git rebase --onto <that commit> <base> <pr-branch>; the new code's switch is one more fixup. Confirm git diff <tested-sha> is empty and every commit imports on its own. Rewriting history needs a force-push, so do it only on your own branch before reviews start; after that, add the reuses as new commits on top, promotion first.

Read the full file on GitHub · 90 lines

Files

What ships with it

3 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.

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. 16d ago First seen · 90 lines · 110 tokens per session scan A 4506a9a3da60

Subscribe to this mod's changes

auditing-helper-reuse is a skill published in the GitHub repository apple/coreai-models (2,402 stars, last pushed today), licensed BSD-3-Clause. It adds 110 tokens to every session and 1,449 once invoked, about $0.0004 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-11-17.

Related

auditing-helper-reuse compared with skills from other repositories

auditing-helper-reuse next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
auditing-helper-reuseapple/coreai-modelsSkill2.4ktodayBSD-3-ClauseA110Claude Code
autoreviewopenclaw/clawhubSkill9.6ktodayMITA17Claude Code, Codex
omh-code-reviewrlaope/oh-my-hermesSkill6.3ktodayMITA18Claude Code
agent-teams-simplify-and-hardenLeoYeAI/openclaw-master-skillsSkill2.2k11d agoMITA115Claude Code, Codex
asplos-writing-stylebrycewang-stanford/Awesome-Journal-SkillsSkill1.5kyesterdayMITA65Claude Code
revdiff-planumputun/revdiffSkill976yesterdayMITA84Claude Code
re0-mergeLilMGenius/paperthinSkill1.5ktodayMITA51Claude Code, Codex