core/internal/
├── domain/ # Entidades puras (0 deps)
│ ├── project.go # Project, Environment, CLIProfile, ScriptHook
│ ├── skill.go # Skill, SkillResult, SkillCategory
│ └── audit.go # AuditEntry
│
├── port/ # Interfaces (contratos)
│ └── ports.go # CLIProfiler, ConfigReader, AuditLogger, ScriptGenerator
│
├── service/ # Lógica de negocio
│ └── orchestrator.go # Orchestrator: skills + CLI profiles (paralelo) + hooks
│
└── adapter/ # Implementaciones
├── cli/ # Comandos Cobra
│ ├── root.go # Root command + banner
│ ├── init.go # Interactive project init
│ ├── switch.go # Context switch (cache-first, parallel)
│ ├── sync.go # Cache sync command
│ ├── cloud.go # Login, status, logout, pull
│ ├── list.go # List projects from YAML
│ ├── current.go # Show active context
│ └── setup_shell.go # Shell integration
├── config/
│ └── yaml_reader.go # Lee nexus.yaml (flat structure)
├── executor/ # Skills + CLI Profilers
│ ├── cli_profilers.go # Todos los profilers (git, gh, aws, supabase, vercel, expo, etc.)
│ ├── parallel_executor.go # Ejecución concurrente de skills
│ ├── env_injector.go # Variables de entorno
│ ├── doc_generator.go # NEXUS_CONTEXT.md
│ └── sandbox.go # Ephemeral sandbox
├── repository/
│ ├── api_client.go # HTTP client para el backend
│ └── project_cache.go # Cache local de proyectos (~/.nexus/cache/)
├── audit/
│ ├── file_logger.go # Append-only JSONL local
│ └── multi_logger.go # Local (sync) + Remote (async)
└── state/
└── state_manager.go # Contexto activo global