← ClaudeAtlas

barrel-export-managerlisted

This skill should be used when the user asks to "create barrel exports", "add index.ts", "organize exports", "create entity", "add DTO", "create service", or when adding files to NestJS module directories. Auto-maintains barrel exports.
smicolon/ai-kit · ★ 3 · AI & Automation · score 64
Install: claude install-skill smicolon/ai-kit
# Barrel Export Manager Auto-creates and maintains `index.ts` barrel export files in NestJS modules for clean, maintainable imports. ## Activation Triggers This skill activates when: - Creating new entity, DTO, service, controller, guard, decorator - Adding files to module directories - Organizing NestJS module structure - Mentioning "NestJS", "module", "create" - Importing from module directories ## Required Pattern (MANDATORY) Every NestJS module folder MUST have `index.ts` barrel exports: ``` users/ ├── entities/ │ ├── user.entity.ts │ ├── profile.entity.ts │ └── index.ts # ✅ Barrel export ├── dto/ │ ├── create-user.dto.ts │ ├── update-user.dto.ts │ └── index.ts # ✅ Barrel export ├── services/ │ ├── users.service.ts │ └── index.ts # ✅ Barrel export └── controllers/ ├── users.controller.ts └── index.ts # ✅ Barrel export ``` ## Auto-Management Process ### Step 1: Detect New File When user creates: ```typescript // users/entities/user.entity.ts @Entity('users') export class User { @PrimaryGeneratedColumn('uuid') id: string // ... } ``` ### Step 2: Auto-Create/Update index.ts Automatically create or update `users/entities/index.ts`: ```typescript // users/entities/index.ts export * from './user.entity' export * from './profile.entity' ``` ### Step 3: Verify Imports Use Barrel Ensure other files import from barrel: ```typescript // ✅ CORRECT - Import from barrel import { User, Profile } from 'src/u