generate-barrels
Skill1 starsChanged 47 days agoMITView on GitHub
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.
- Installs packages
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adapt-materal-enumsSkill
- download-openapiSkill
- generate-artifactsSkill
- generate-modelsSkill
- generate-pythonSkill
- write-pluginSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
Ask user for target directory path
- Very specific: line 87
Only generates index.ts barrel files, no other code
- Very specific: line 91
Only processes .ts files, not .tsx, .js, etc.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Generate Barrel Files
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.
When to Use This Command
| 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 |
Prerequisites
pnpm add -D @aptx-js/frontend-tk-cliUsage
pnpm exec aptx-ft barrel gen -i <input-dir>Alternative (without pnpm):
npx aptx-ft barrel gen -i ./src/functionsWorkflow
- Ask user for target directory path
- Show complete command and confirm with user
- Execute and report results
Common Directories
| Directory | Purpose |
./src/functions | Function modules |
./src/api | API modules |
./src | Entire source directory |
Examples
# 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/apiOutput
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/
└── ...Boundaries
- Only generates index.ts barrel files, no other code
- Subdirectory index.ts files are overwritten
- Root index.ts is NOT overwritten if it exists with different content (protects manual entry files)
- Automatically skips
node_modulesand hidden directories (starting with.) - Only processes
.tsfiles, not.tsx,.js, etc.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

