Skip to main content

structuring-project-layout

Specifies folder structure, module boundaries, barrels, and path aliases for a Node.js TypeScript project. Use when starting a new repo, adding a new feature module, or refactoring tangled imports.

소스 정보

저장소
j4flmao/agent_skills_nodejs_nestjs
최근 소스 활동
2026년 5월 3일 03:46
감지된 SKILL.md 언어
영어
스타
1
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
3 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
structuring-project-layout
description
Specifies folder structure, module boundaries, barrels, and path aliases for a Node.js TypeScript project. Use when starting a new repo, adding a new feature module, or refactoring tangled imports.
license
MIT
# Structuring Project Layout ## When to use - Starting a new Node.js TypeScript repo - Adding a new feature module - Refactoring tangled imports and unclear boundaries ## Core rules 1. Three-layer layout: `src/domain/`, `src/application/`, `src/infrastructure/` 2. Feature modules inside `src/features/<feature-name>/` with own layers 3. Shared kernel in `src/shared/` (types, errors, contracts, constants) 4. Barrel files (`index.ts`) in every folder for clean imports 5. Path aliases: `@domain/*`, `@application/*`, `@infrastructure/*`, `@shared/*` 6. No cross-feature imports; use `@shared/contracts` ## Reference shape (TypeScript) ``` src/ ├── domain/ # Pure business rules, no framework │ ├── entities/ │ ├── value-objects/ │ ├── services/ │ └── index.ts ├── application/ # Use-cases, ports, orchestration │ ├── use-cases/ │ ├── ports/ │ └── index.ts ├── infrastructure/ # Adapters: HTTP, DB, 3rd-party │ ├── repositories/ │ ├── http/ │ └── index.ts ├── shared/ # Kernel: types, errors, contracts │ ├── types/ │ ├── errors/ │ ├── contracts/ │ └── index.ts ├── features/ # Feature modules (each with own layers) │ └── user/ │ ├── domain/ │ ├── application/ │ ├── infrastructure/ │ └── index.ts └── main.ts # Entry point ``` ## Examples — Do ```typescript // Barrel re-exports // src/domain/entities/index.ts export { User } from './user.entity'; export { Order } from './order.entity'; // Clean import with path alias import { User } from '@domain/entities'; import { UserRepository } from '@application/ports'; ``` ## Examples — Don't ```typescript // ❌ Deep relative imports import { User } from '../../../../domain/entities/user.entity'; // ❌ Cross-feature import import { OtherFeatureService } from '../other-feature/application/service'; ``` ## Checklist - [ ] Three-layer structure created - [ ] `shared/` kernel with types, errors, contracts - [ ] Barrel files in all folders - [ ] Path aliases configured in `tsconfig.json` - [ ] No deep relative imports See [reference/layout-patterns.md](./reference/layout-patterns.md) for full patterns.
GitHub에서 보기