no-barrel-index

Detect barrel-only index files and enforce explicit module imports in TypeScript projects.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/holblin/webapp-template --skill no-barrel-index
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: no-barrel-index
Source: https://github.com/holblin/webapp-template/tree/main/.agents/skills/no-barrel-index
Command: npx skills add https://github.com/holblin/webapp-template --skill no-barrel-index

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers adhere to best practices by preventing the use of barrel-only index.ts/index.tsx re-export files, reducing ambiguity in module imports.

Core Features & Use Cases

  • Rule Enforcement: Detects and prevents creation of barrel files that re-export modules, encouraging direct imports.
  • Migration Assistance: Guides developers to update import statements to specific file paths, improving code clarity.
  • Use Case: In a large codebase, transitioning from re-exports via barrel files to direct imports enhances modularity and ease of debugging.

Quick Start

Find all barrel files in your project and update import statements to use specific module paths for better clarity and maintainability.

Frequently Asked Questions about no-barrel-index

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

FAQPage Schema
How do I remove barrel index files in TypeScript to use explicit imports?

Removing barrel index files in TypeScript involves identifying index.ts or index.tsx re-export files and migrating import statements to direct module paths, which improves code clarity and maintainability.

What are barrel files and why should I avoid them in large codebases?

Barrel files are index.ts or index.tsx files that re-export modules, creating import ambiguity. Avoiding them in large codebases enhances modularity, reduces debugging complexity, and promotes direct module imports for better maintainability.

How do I refactor TypeScript imports from barrel re-exports to direct file paths?

Refactoring TypeScript imports from barrel re-exports to direct file paths requires finding all barrel files in your project and updating import statements to use specific module paths, ensuring rules compliance throughout the migration steps.

Can I use barrel file removal for large JavaScript repository maintenance?

Barrel file removal is suitable for maintenance and codebase refactoring tasks involving large JavaScript or TypeScript repositories, enforcing explicit module imports to improve code clarity and reduce ambiguity in large-scale projects.

When should I not use explicit imports instead of barrel files?

You should not use explicit imports instead of barrel files when the refactoring cost outweighs maintainability benefits, such as in small projects where re-export ambiguity is minimal and barrel files effectively simplify public API surface management.