barrel-surface-curation

Validate TypeScript barrel file structures to enforce public API boundaries.

1|Updated Jul 7, 2022
One-click install
npx skills add https://github.com/chiubaka/circleci-orb --skill barrel-surface-curation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: barrel-surface-curation
Source: https://github.com/chiubaka/circleci-orb/tree/main/org/agents/skills/barrel-surface-curation
Command: npx skills add https://github.com/chiubaka/circleci-orb --skill barrel-surface-curation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill ensures index.ts barrels are clear public API boundaries, enhancing code organization and reducing accidental re-exports.

Core Features & Use Cases

  • Barrel Management: Organizes exports into specific boundaries for packages, features, layers, and adapter categories.
  • API Stability: Promotes small, stable, and meaningful API surfaces.
  • Use Case: When adding a new export to any index.ts, creating a new feature boundary, or resolving boundary leaks, this skill helps maintain clean code structure.

Quick Start

Run the barrel-surface-curation skill after adding a new export to your index.ts to enforce API boundaries.

Frequently Asked Questions about barrel-surface-curation

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

FAQPage Schema
How do I prevent accidental re-exports in TypeScript barrel files?

Preventing accidental re-exports in TypeScript barrel files requires validating index.ts structures to enforce clear public API boundaries. This process organizes exports into specific boundaries for packages and features, reducing accidental boundary leaks and maintaining a small, stable API surface.

What is the best way to manage public API boundaries in a TypeScript project?

Managing public API boundaries in a TypeScript project involves enforcing specific rules for internal helper exclusion and barrel placement. This ensures index.ts files act as clear public API boundaries, promoting code organization and API stability across packages, features, and layers.

How do I exclude internal helpers from TypeScript index.ts exports?

Excluding internal helpers from TypeScript index.ts exports is handled by enforcing strict barrel file rules that define clear public API boundaries. This validation process prevents internal modules from leaking into the public API surface, ensuring only intentional exports are exposed.

When do I need to validate my TypeScript barrel file structure?

You need to validate your TypeScript barrel file structure after adding a new export to any index.ts, creating a new feature boundary, or resolving boundary leaks. This manual execution ensures your code organization maintains intentional and stable public API boundaries.

Can I organize TypeScript barrel exports into specific package and feature boundaries?

Yes, you can organize TypeScript barrel exports into specific boundaries for packages, features, layers, and adapter categories. This boundary management enforces clear public API surfaces and reduces accidental re-exports within your TypeScript project structure.

Why does my TypeScript barrel file keep leaking internal modules?

TypeScript barrel files leak internal modules when index.ts structures lack enforced rules for internal helper exclusion and specific barrel placement. Validating barrel file structures resolves these boundary leaks by defining clear public API boundaries and reducing accidental re-exports.