agentsclimarketplace

Fix knip unused exports

Skill zacharygcook/agent-skills/skills/fix-knip-unused-exports

A curated collection of practical, evidence-backed skills for coding agents.

Install
npx -y skills add zacharygcook/agent-skills --skill fix-knip-unused-exports

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 26 days oldThe repository was created 26 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Resolve Knip unused-export findings by classifying each symbol before editing and preferring dead-code deletion, local visibility, or deliberate package contracts over suppression. Use for unused exports, exported types, barrel re-exports, test-only exports, and apparent false positives.

SKILL.md

2.1 KB, as published. Nobody here has run it

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

CategoryEvidencePreferred fix
Internally usedReferenced only in its defining moduleRemove export
Dead codeNo real callerDelete it and newly orphaned helpers
Dead barrel entryRe-exported but not consumedRemove the re-export
Test-only seamExport exists only for testsTest public behavior or extract a genuinely shared helper
Real consumerProduction/generated/dynamic consumer existsCorrect 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.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.