writing-typescript

Organize TypeScript code by feature ownership and split React components by responsibility.

1|Updated Apr 25, 2025
One-click install
npx skills add https://github.com/Gabr1elaugus700/WorkaPool --skill writing-typescript-gabr1elaugus700
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-typescript
Source: https://github.com/Gabr1elaugus700/WorkaPool/tree/main/.agents/skills/writing-typescript
Command: npx skills add https://github.com/Gabr1elaugus700/WorkaPool --skill writing-typescript-gabr1elaugus700

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It prevents TypeScript codebases from degrading into disorganized files with mixed responsibilities, barrel re-exports, and monolithic React components by enforcing single-responsibility file organization and feature-based folder structure. ## Core Features & Use Cases - Feature-based file placement: Maps every new source file to the correct frontend or backend folder (views, components, hooks, use-cases, repositories) based on behavior ownership. - React componentization rules: Enforces view/page orchestration versus presentational component splits, narrow props, and role-based naming for UI files. - Quality gate references: Provides dedicated guidance for performance-sensitive code and security-sensitive code (auth, input validation, secrets handling). - Use Case: When adding a new order-tracking screen, use this Skill to place the view under features/<feature>/views/, extract UI regions into sibling component files, colocate owned types, and wire direct imports without creating barrel files. ## Quick Start Ask the AI to create or refactor a TypeScript component, hook, or backend use-case following the writing-typescript skill's SRP and feature-folder rules.

Frequently Asked Questions about writing-typescript

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

FAQPage Schema
How do I organize TypeScript files by feature in a React project?

Place route-level screens in features/<feature>/views/ or pages/, UI pieces in features/<feature>/components/, and hooks, services, and types in matching feature subfolders. Keep one public value export per file and import directly from owning source files instead of barrels.

How to split large React components into smaller files?

Identify distinct responsibilities such as layout shell, list row, dialog body, or filter bar, and extract each into its own file under the feature's components folder. The parent view keeps routing, data fetching, and phase switching while children receive narrow props.

Should I use index.ts barrel files for exports in TypeScript?

No, this approach prohibits creating new index.ts barrels or multi-value re-export files. Import directly from the owning source file, and do not expand existing legacy barrels when adding new files.

Where should backend use-cases live in a feature-based Node.js API?

New domain actions go in backend/src/features/<domain>/useCases/ with one class per file, alongside controllers, routes, schemas, and repositories in the same feature folder. Do not add new domains to legacy root controllers or services folders.

When should I not apply SRP refactoring to existing code?

Do not mass-refactor unrelated legacy code without an explicit request, and leave generated components/ui primitives as-is. Keep source moves behavior-preserving and only restructure the code you are already touching.