## Phase 2: Nx Workspace Initialization ✅

### 2.1 Nx Setup

- [x] **2.1.1** Install nx, @nx/js, @nx/node, @nx/react, @nx/vite as
      devDependencies
- [x] **2.1.2** Create nx.json configuration at oshun root
- [x] **2.1.3** Configure Nx Cloud (optional but recommended for caching)
- [x] **2.1.4** Set up nx.json with default task runner options
- [x] **2.1.5** Configure parallel execution limits based on CI runners
- [x] **2.1.6** Set up affected commands configuration

### 2.2 Directory Structure

- [x] **2.2.1** Create apps/ directory at oshun root
- [x] **2.2.2** Create libs/ directory at oshun root
- [x] **2.2.3** Create tools/ directory at oshun root
- [x] **2.2.4** Create apps/lilith/ subdirectory for lilith apps
- [x] **2.2.5** Create apps/yemaya/ subdirectory for yemaya apps
- [x] **2.2.6** Create apps/isis/ subdirectory for isis apps
- [x] **2.2.7** Create apps/sophia/ subdirectory for sophia apps
- [x] **2.2.8** Create apps/hathor/ subdirectory for hathor apps
- [x] **2.2.9** Create apps/bellona/ subdirectory for bellona apps
- [x] **2.2.10** Create libs/shared/ subdirectory for shared foundation
- [x] **2.2.11** Create libs/contracts/ subdirectory for cross-domain contracts
- [x] **2.2.12** Create libs/isis/ subdirectory for isis libraries
- [x] **2.2.13** Create libs/sophia/ subdirectory for sophia libraries
- [x] **2.2.14** Create libs/hathor/ subdirectory for hathor libraries
- [x] **2.2.15** Create libs/bellona/ subdirectory for bellona libraries
- [x] **2.2.16** Create libs/lilith/ subdirectory for lilith-specific libraries
- [x] **2.2.17** Create libs/yemaya/ subdirectory for yemaya-specific libraries

### 2.3 Nx Tags Configuration

- [x] **2.3.1** Define scope tags in nx.json: scope:lilith, scope:yemaya,
      scope:isis, scope:sophia, scope:hathor, scope:bellona, scope:shared
- [x] **2.3.2** Define type tags: type:app, type:lib, type:e2e
- [x] **2.3.3** Define layer tags: layer:ui, layer:domain, layer:data,
      layer:infra, layer:contracts
- [x] **2.3.4** Create .eslintrc.json at root with @nx/enforce-module-boundaries
      rule
- [x] **2.3.5** Configure depConstraints for scope boundaries:
  - [x] scope:lilith cannot depend on scope:yemaya (and vice versa)
  - [x] scope:isis cannot depend on scope:lilith or scope:yemaya
  - [x] scope:sophia cannot depend on scope:lilith or scope:yemaya
  - [x] scope:hathor can depend on scope:sophia
  - [x] layer:ui can depend on layer:domain, layer:contracts, layer:infra
  - [x] layer:domain cannot depend on layer:ui

### 2.4 Shared TypeScript Configuration

- [x] **2.4.1** Create tsconfig.base.json at oshun root
- [x] **2.4.2** Configure path aliases for all scopes (@oshun/_, @lilith/_,
      @yemaya/\*, etc.)
- [x] **2.4.3** Set strict mode, ES2022 target, NodeNext module resolution
- [x] **2.4.4** Create tsconfig.lib.json for library projects
- [x] **2.4.5** Create tsconfig.app.json for application projects
- [x] **2.4.6** Create tsconfig.spec.json for test configurations
- [x] **2.4.7** Migrate lilith/tsconfig.json settings to base config
- [x] **2.4.8** Migrate yemaya configs/typescript/\* settings to base config
- [x] **2.4.9** Remove redundant tsconfig files from yemaya/configs/

### 2.5 Shared Linting Configuration

- [x] **2.5.1** Create root .eslintrc.json with base rules
- [x] **2.5.2** Migrate lilith/.eslintrc.json rules
- [x] **2.5.3** Migrate yemaya/configs/eslint rules
- [x] **2.5.4** Create .prettierrc at root
- [x] **2.5.5** Migrate prettier configs from both projects
- [x] **2.5.6** Remove lilith/packages/eslint-config
- [x] **2.5.7** Remove lilith/packages/prettier-config
- [x] **2.5.8** Remove yemaya/configs/eslint
- [x] **2.5.9** Remove yemaya/configs/prettier
- [x] **2.5.10** Create lint-staged configuration at root

---

