Help us improve
Share bugs, ideas, or general feedback.
Generate barrel index.ts files for TypeScript projects. Use when user mentions: (1) barrel files, (2) index.ts exports, (3) re-export files, (4) simplify import paths, (5) create index files for directory, or (6) generate export aggregators.
npx claudepluginhub haibaraaiaptx/frontend-openapi-skills --plugin frontend-openapi-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/frontend-openapi-skills:generate-barrelsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate barrel index.ts files for TypeScript directories to simplify imports.
Organizes TypeScript code with ES modules, barrel exports, path aliases, and declaration files. Helps structure import/export architecture and avoid circular dependencies.
Generates new files that match existing codebase conventions for naming, structure, imports, exports, and test patterns. Wires generated files into project registration points.
Guides TypeScript library authoring: project setup, dual CJS/ESM package exports, tsdown/unbuild config, type-safe API design, advanced type patterns, vitest testing, and npm release workflows.
Share bugs, ideas, or general feedback.
Generate barrel index.ts files for TypeScript directories to simplify imports.
Note: Generation commands (
model gen,aptx functions,react-query,vue-query) automatically update barrel files after generation. Use this command only for manual fixes or special cases.
| Scenario | Action |
|---|---|
| Normal generation | Barrel files are auto-updated - no action needed |
| Fixing corrupted barrel files | Use this command |
| Processing non-standard directory structures | Use this command |
| One-time batch updates across multiple directories | Use this command |
pnpm add -D @aptx/frontend-tk-cli
pnpm exec aptx-ft barrel gen -i <input-dir>
Alternative (without pnpm):
npx aptx-ft barrel gen -i ./src/functions
| Directory | Purpose |
|---|---|
./src/functions | Function modules |
./src/api | API modules |
./src | Entire source directory |
# Generate for functions directory
pnpm exec aptx-ft barrel gen -i ./src/functions
# Generate for entire src directory
pnpm exec aptx-ft barrel gen -i ./src
# Generate for specific module
pnpm exec aptx-ft barrel gen -i ./src/api
Recursively scans directory and generates barrel files at all levels:
src/
├── index.ts # Exports functions, react-query, spec
├── functions/
│ ├── index.ts # Exports application, assignment, ...
│ └── application/
│ └── index.ts # Exports getXXX, setXXX, ...
├── react-query/
│ ├── index.ts # Exports application, assignment, ...
│ └── application/
│ └── index.ts # Exports *.query.ts, *.mutation.ts
└── spec/
└── ...
node_modules and hidden directories (starting with .).ts files, not .tsx, .js, etc.