Activated when creating or modifying files. Enforces global kebab-case naming and file structure conventions.
To maintain consistency across the project's file system, all file names and directory names must strictly follow the kebab-case naming convention.
All file and directory names must convert camelCase or PascalCase from code into kebab-case.
| Code Name | File Name |
|---|---|
useWindowSize | use-window-size.ts |
AuthService | auth-service.ts |
dateFormat | date-format.ts |
UserProfileCard | user-profile-card.tsx |
/hooks)Hook files must retain the use- prefix in lowercase.
hooks/use-auth-listener.tshooks/useAuthListener.ts/utils or /lib)Utility files use kebab-case directly. If organized into subdirectories, those directories must also be kebab-case.
utils/string-helper.tsutils/api-formatters/date-parser.ts/services)API service layer files should describe the service's functionality.
services/user-api.tsservices/payment-gateway.ts/types)Type definition files should be named after the primary type they define.
types/user-profile.tstypes/api-response.tstypes/UserProfile.ts/constants)Constant files are named by their topic.
constants/api-endpoints.tsconstants/error-messages.tsWhen generating files of the types above, perform these checks:
-).kebab-case, exported variables and functions inside the file still follow standard JS/TS conventions (camelCase or PascalCase).| Type | Code Export Name | File Path |
|---|---|---|
| Hook | export const useScrollPosition = ... | hooks/use-scroll-position.ts |
| Service | export const OrderService = ... | services/order-service.ts |
| Util | export const formatCurrency = ... | utils/format-currency.ts |
| Type | export interface UserProfile ... | types/user-profile.ts |
| Const | export const API_ENDPOINTS = ... | constants/api-endpoints.ts |