fix-knip-unused-exports

fix-knip-unused-exports is a skill for Codex from zacharygcook/agent-skills. It costs 59 tokens per session (435 once invoked), scanned A, original, MIT.

A skill for investigating and fixing Knip reports about exports that are not used. Knip is a code-analysis tool that finds apparently unused files, exports, and dependencies.

In plain words
What is it for?
Use it to search for consumers, inspect package entry points and export maps, remove dead exports or code, and verify the result with analysis, type checks, linting, and tests.
Why use it?
It helps distinguish genuinely dead code from public package interfaces, generated imports, dynamic users, and test-only code before anything is removed.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to search for consumers, inspect package entry points and export maps, remove dead exports or code, and verify the result with analysis, type checks, linting, and tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zacharygcook/agent-skills/fix-knip-unused-exports
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 zacharygcook/agent-skills --skill fix-knip-unused-exports
Clone the repo
git clone --depth 1 https://github.com/zacharygcook/agent-skills

Made for: 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 fix-knip-unused-exports

README.md
[![agentmods](https://agentmods.dev/badge/skills/zacharygcook/agent-skills/fix-knip-unused-exports/github.svg)](https://agentmods.dev/skills/zacharygcook/agent-skills/fix-knip-unused-exports)
Your own site
<a href="https://agentmods.dev/skills/zacharygcook/agent-skills/fix-knip-unused-exports"><img src="https://agentmods.dev/badge/skills/zacharygcook/agent-skills/fix-knip-unused-exports/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 fix-knip-unused-exports

Your own site · 80×15
<a href="https://agentmods.dev/skills/zacharygcook/agent-skills/fix-knip-unused-exports"><img src="https://agentmods.dev/badge/skills/zacharygcook/agent-skills/fix-knip-unused-exports.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 435 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.00059 $0.00435
Opus 5 $0.00030 $0.00217
Sonnet 5 $0.00012 $0.00087
Haiku 4.5 $0.00006 $0.00044

Measured 12d ago against content hash 763c59ac5852, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

fix-knip-unused-exports 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 12d 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/fix-knip-unused-exports/SKILL.md · 46 lines

What it actually says

Fix Knip Unused Exports

Unused-export reports are small but easy to “fix” incorrectly. Search the whole repository, classify the contract, then make the smallest truthful change.

Workflow

  1. Run the repository's Knip command from its expected root.
  2. Search each symbol globally and separately outside tests.
  3. Inspect package entry points, export maps, generated imports, and dynamic consumers.
  4. Classify the finding.
  5. Apply the preferred fix.
  6. Rerun Knip plus focused typecheck, lint, and tests.

Classification

Category Evidence Preferred fix
Internally used Referenced only in its defining module Remove export
Dead code No real caller Delete it and newly orphaned helpers
Dead barrel entry Re-exported but not consumed Remove the re-export
Test-only seam Export exists only for tests Test public behavior or extract a genuinely shared helper
Real consumer Production/generated/dynamic consumer exists Correct Knip entry/config/export metadata

Do not add broad ignores, dummy imports, speculative barrel exports, or @public comments solely to silence the tool.

Contract Checks

Before removing a package export, inspect:

  • package.json exports and types;
  • workspace consumers and build scripts;
  • framework conventions for discovered files;
  • code generation and dynamic import strings;
  • documentation examples that form a supported API.

When deleting a value, remove stale tests, imports, docs, and adjacent helpers only after confirming they have no independent use. Preserve intentional public APIs even when the current monorepo has no internal consumer; document that decision in Knip configuration narrowly.

Handoff

Report each classification, the change made, any intentional suppression, and validation results.

Files

What ships with it

1 file 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. 12d ago First seen · 46 lines · 59 tokens per session scan A 763c59ac5852

Subscribe to this mod's changes

fix-knip-unused-exports is a skill published in the GitHub repository zacharygcook/agent-skills (2 stars, last pushed 1mo ago), licensed MIT. It adds 59 tokens to every session and 435 once invoked, about $0.0003 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.