code-organisation

Enforce TypeScript code organization with named exports and index.ts boundaries.

1|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/g-bastianelli/nuthouse --skill code-organisation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-organisation
Source: https://github.com/g-bastianelli/nuthouse/tree/main/subroutine/skills/code-organisation
Command: npx skills add https://github.com/g-bastianelli/nuthouse --skill code-organisation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces best practices in TypeScript code organization, ensuring clarity, reusability, and maintainability.

Core Features & Use Cases

  • Structured Exports: Ensures named exports and no default exports for better API design.
  • Index.ts Boundary: Defines index.ts as a boundary for re-exports and composition, not logic.
  • Single Responsibility Files: Enforces one-file-one-responsibility for better modularity.
  • Library Architecture: Encourages small, focused libraries with clear runtime/layer boundaries.
  • Reuse Before Writing: Promotes the use of existing shared libraries before writing new code.
  • Use Case: When you're creating or refactoring TypeScript files and want to adhere to best practices for clean and maintainable code.

Quick Start

Run the skill in a TypeScript file to apply code organisation principles automatically.

Frequently Asked Questions about code-organisation

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

FAQPage Schema
How do I organize TypeScript files for better modularity and maintainability?

To organize TypeScript files for better modularity, enforce single responsibility per file, use named exports, and treat index.ts files as boundaries for re-exports rather than logic. This ensures clarity and reusability.

What is the best way to structure a TypeScript library architecture?

The best way to structure a TypeScript library architecture is to build small, focused libraries with clear runtime and layer boundaries. Promote reusing existing shared libraries before writing new code to maintain separation of concerns.

Why should I use named exports instead of default exports in TypeScript?

You should use named exports instead of default exports in TypeScript to improve API design and code maintainability. Named exports enforce explicit structuring, making imports clearer and preventing naming collisions across modules.

Can I use code organization best practices for TypeScript refactoring without external dependencies?

Yes, you can apply TypeScript code organization best practices during refactoring without external dependencies. This approach requires no external libraries, relying solely on structural rules like single responsibility per file and index.ts boundaries.

When should I restrict logic in TypeScript index.ts files?

You should restrict logic in TypeScript index.ts files when defining module boundaries for composition. Treat index.ts strictly as a boundary for re-exports, preventing implementation logic from blurring your library architecture and API surface.