knip

Detect unused files, dependencies, and exports in JavaScript/TypeScript projects.

Updated Feb 2, 2026
One-click install
npx skills add https://github.com/artivilla/agents-config --skill knip-artivilla
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: knip
Source: https://github.com/artivilla/agents-config/tree/main/skills/knip
Command: npx skills add https://github.com/artivilla/agents-config --skill knip-artivilla

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Run knip to find and remove unused files, dependencies, and exports. Use for cleaning up dead code and unused dependencies.

Core Features & Use Cases

  • Detects unused files, dependencies, and exports
  • Provides safe removal recommendations with optional auto-fix
  • Integrates with common project workflows and configuration files

Quick Start

Run npx knip to scan your project for unused files, dependencies, and exports and apply the cleanup recommendations.

Frequently Asked Questions about knip

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find and remove unused dependencies in a JavaScript or TypeScript project?

To remove unused dependencies in JavaScript or TypeScript, you can run a static analysis scan to detect orphaned exports and uninstalled packages. This Skill automates that detection and provides safe removal recommendations for your codebase.

What is the best way to clean up dead code during a large refactoring campaign?

Dead code cleanup during refactoring is best handled by static analysis tools that identify unused files and exports. This Skill scans your project configuration to safely recommend removal steps without breaking existing workflows.

Can I automatically fix and remove unused files without breaking my project configuration?

Yes, you can automatically remove unused files while respecting project configuration. This Skill provides optional auto-fix recommendations that safeguard your existing rules and workflows during the cleanup process.

How does static analysis detect orphaned exports in a codebase?

Static analysis detects orphaned exports by scanning the codebase to trace module imports and usage. This Skill identifies exported variables or files that are never imported elsewhere, marking them as dead code for safe removal.

Does this dead code cleanup tool work with existing project workflows and configuration files?

Yes, this dead code cleanup tool integrates with common project workflows. It reads your existing configuration files to ensure that the detection of unused dependencies and files respects your specific project setup.