Structure: - control-plane/: Registries, SIMCO directives, CI/CD templates - projects/: Gamilit, ERP-Suite, Trading-Platform, Betting-Analytics - shared/: Libs catalog, knowledge-base Key features: - Centralized port, domain, database, and service registries - 23 SIMCO directives + 6 fundamental principles - NEXUS agent profiles with delegation rules - Validation scripts for workspace integrity - Dockerfiles for all services - Path aliases for quick reference 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
512 lines
17 KiB
Markdown
512 lines
17 KiB
Markdown
# PLAN MAESTRO DE MIGRACION - WORKSPACE V1
|
|
|
|
**Fecha:** 2025-12-18
|
|
**Version:** 1.0.0
|
|
**Estado:** Planificacion
|
|
**Ubicacion Destino:** `/home/adrian/Documentos/workspace-v1`
|
|
|
|
---
|
|
|
|
## TABLA DE CONTENIDOS
|
|
|
|
1. [Vision General de la Migracion](#1-vision-general)
|
|
2. [Arquitectura Objetivo](#2-arquitectura-objetivo)
|
|
3. [Estructura de Fases](#3-estructura-de-fases)
|
|
4. [Metodologia por Fase](#4-metodologia-por-fase)
|
|
5. [Mapa de Dependencias](#5-mapa-de-dependencias)
|
|
6. [Cronograma de Ejecucion](#6-cronograma)
|
|
7. [Roles de Agentes](#7-roles-de-agentes)
|
|
|
|
---
|
|
|
|
## 1. VISION GENERAL
|
|
|
|
### 1.1 Objetivo de la Migracion
|
|
|
|
Transformar el workspace actual de una estructura "monolitica" a una arquitectura de **3 capas de repositorios**:
|
|
|
|
```
|
|
ESTADO ACTUAL ESTADO OBJETIVO
|
|
================ ================
|
|
|
|
workspace/ workspace-control-plane/
|
|
+-- core/ +-- control-plane/
|
|
+-- projects/ +-- registries/
|
|
+-- gamilit/ +-- manifests/
|
|
+-- erp-suite/ +-- ci/
|
|
+-- trading/ +-- devtools/
|
|
+-- knowledge-base/
|
|
+-- devtools/ repos-productos/ (separados)
|
|
+-- gamilit-platform/
|
|
+-- erp-suite/
|
|
+-- trading-platform/
|
|
|
|
repos-shared/
|
|
+-- shared-libs/
|
|
+-- shared-infra/
|
|
+-- knowledge-base/
|
|
```
|
|
|
|
### 1.2 Beneficios Esperados
|
|
|
|
| Problema Actual | Solucion | Beneficio |
|
|
|-----------------|----------|-----------|
|
|
| Colision de puertos | Registry + Enforcement | Cero conflictos por diseno |
|
|
| Acoplamiento de despliegue | Repos separados | Deploy independiente por producto |
|
|
| Duplicacion de codigo | shared-libs versionado | Reutilizacion real |
|
|
| Agentes sin contratos | service.descriptor.yml | Menos errores, mas velocidad |
|
|
| Dev/Prod mezclados | Redes + dominios separados | Aislamiento garantizado |
|
|
|
|
### 1.3 Principios de Migracion
|
|
|
|
1. **Incremental:** No romper lo que funciona
|
|
2. **Reversible:** Poder volver atras en cada fase
|
|
3. **Validado:** Cada fase termina con validacion completa
|
|
4. **Documentado:** Trazabilidad de cada cambio
|
|
|
|
---
|
|
|
|
## 2. ARQUITECTURA OBJETIVO
|
|
|
|
### 2.1 Diagrama de Arquitectura de Repos
|
|
|
|
```
|
|
+===========================================================================+
|
|
| ARQUITECTURA DE 3 CAPAS DE REPOS |
|
|
+===========================================================================+
|
|
| |
|
|
| CAPA A: CONTROL PLANE (workspace-control-plane) |
|
|
| ================================================ |
|
|
| +-- control-plane/ |
|
|
| | +-- orchestration/ # SIMCO, CAPVED, Agentes |
|
|
| | +-- registries/ # Puertos, Dominios, BDs |
|
|
| | +-- manifests/ # repos.manifest, environments |
|
|
| | +-- ci/ # Jenkins templates, shared-library |
|
|
| | +-- devtools/ # Scripts, Docker configs |
|
|
| +-- docs/ # Governance, Onboarding |
|
|
| |
|
|
| CAPA B: REPOS POR PRODUCTO |
|
|
| ========================== |
|
|
| gamilit-platform/ |
|
|
| +-- apps/ |
|
|
| | +-- backend/ |
|
|
| | +-- frontend/ |
|
|
| | +-- database/ |
|
|
| +-- docker/ |
|
|
| +-- orchestration/ # Inventarios locales |
|
|
| +-- service.descriptor.yml # CONTRATO del servicio |
|
|
| |
|
|
| erp-suite/ |
|
|
| +-- apps/ |
|
|
| | +-- erp-core/ |
|
|
| | +-- verticales/ |
|
|
| +-- docker/ |
|
|
| +-- orchestration/ |
|
|
| +-- service.descriptor.yml |
|
|
| |
|
|
| CAPA C: REPOS COMPARTIDOS |
|
|
| ========================= |
|
|
| shared-libs/ |
|
|
| +-- packages/ |
|
|
| | +-- utils/ |
|
|
| | +-- auth/ |
|
|
| | +-- ui-components/ |
|
|
| +-- package.json # npm workspaces |
|
|
| |
|
|
| shared-infra/ |
|
|
| +-- reverse-proxy/ # Traefik config |
|
|
| +-- observability/ # Prometheus, Grafana |
|
|
| +-- docker/ |
|
|
| |
|
|
| knowledge-base/ |
|
|
| +-- sources/ # Markdown, ADRs, specs |
|
|
| +-- indexes/ # Embeddings, metadatos RAG |
|
|
| |
|
|
+===========================================================================+
|
|
```
|
|
|
|
### 2.2 Modelo de Red y Puertos
|
|
|
|
```
|
|
+===========================================================================+
|
|
| MODELO DE RED OBJETIVO |
|
|
+===========================================================================+
|
|
| |
|
|
| INTERNET |
|
|
| | |
|
|
| v |
|
|
| +-------------------+ |
|
|
| | TRAEFIK (80/443) | <-- UNICO PUNTO DE ENTRADA PUBLICO |
|
|
| +--------+----------+ |
|
|
| | |
|
|
| +-----+-----+-----+-----+ |
|
|
| | | | | | |
|
|
| v v v v v |
|
|
| +-----+ +-----+ +-----+ +-----+ |
|
|
| | net | | net | | net | | net | |
|
|
| | dev | |prod | | dev | |prod | |
|
|
| |gami | |gami | | erp | | erp | |
|
|
| +--+--+ +--+--+ +--+--+ +--+--+ |
|
|
| | | | | |
|
|
| v v v v |
|
|
| [api:3000] [api:3000] [api:3100] [api:3100] |
|
|
| [web:3001] [web:3001] [web:3101] [web:3101] |
|
|
| |
|
|
| Dominios: |
|
|
| DEV: *.dev.tu-dominio.com |
|
|
| PROD: *.tu-dominio.com |
|
|
| |
|
|
+===========================================================================+
|
|
```
|
|
|
|
### 2.3 Modelo de Base de Datos
|
|
|
|
```
|
|
PostgreSQL Instance (compartida)
|
|
|
|
|
+-- gamilit_db
|
|
| +-- owner: app_gamilit_owner
|
|
| +-- runtime: app_gamilit_runtime
|
|
| +-- migrator: app_gamilit_migrator
|
|
|
|
|
+-- erp_suite_db
|
|
| +-- owner: app_erp_owner
|
|
| +-- runtime: app_erp_runtime
|
|
| +-- migrator: app_erp_migrator
|
|
|
|
|
+-- trading_db
|
|
+-- owner: app_trading_owner
|
|
+-- runtime: app_trading_runtime
|
|
+-- migrator: app_trading_migrator
|
|
```
|
|
|
|
---
|
|
|
|
## 3. ESTRUCTURA DE FASES
|
|
|
|
### 3.1 Mapa de Fases
|
|
|
|
```
|
|
FASE 0: PLAN MAESTRO (Este documento)
|
|
|
|
|
v
|
|
FASE 1: CONTROL PLANE
|
|
+-- 1.1 Estructura base
|
|
+-- 1.2 Registries
|
|
+-- 1.3 Manifests
|
|
+-- 1.4 CI/CD Templates
|
|
|
|
|
v
|
|
FASE 2: CORE ORCHESTRATION
|
|
+-- 2.1 Migracion SIMCO
|
|
+-- 2.2 Perfiles de Agentes (actualizados)
|
|
+-- 2.3 Templates y Checklists
|
|
+-- 2.4 Service Descriptor Standard
|
|
|
|
|
v
|
|
FASE 3: REGISTRIES Y ENFORCEMENT
|
|
+-- 3.1 ports.registry.yml
|
|
+-- 3.2 domains.registry.yml
|
|
+-- 3.3 databases.registry.yml
|
|
+-- 3.4 Scripts de validacion
|
|
|
|
|
v
|
|
FASE 4: PROYECTOS (por cada uno)
|
|
+-- 4.1 Gamilit
|
|
+-- 4.2 ERP Suite
|
|
+-- 4.3 Trading Platform
|
|
+-- 4.4 Betting Analytics
|
|
|
|
|
v
|
|
FASE 5: SHARED LIBS
|
|
+-- 5.1 Estructura de packages
|
|
+-- 5.2 Extraccion de codigo comun
|
|
+-- 5.3 Publicacion npm local
|
|
|
|
|
v
|
|
FASE 6: KNOWLEDGE BASE
|
|
+-- 6.1 Reorganizacion sources/indexes
|
|
+-- 6.2 Pipelines de indexado
|
|
|
|
|
v
|
|
FASE 7: VALIDACION FINAL
|
|
+-- 7.1 Tests de integracion
|
|
+-- 7.2 Validacion de registries
|
|
+-- 7.3 Documentacion final
|
|
```
|
|
|
|
### 3.2 Metodologia CAPVED por Fase
|
|
|
|
Cada fase sigue el ciclo CAPVED adaptado:
|
|
|
|
```
|
|
SUBFASE A: PLANEACION DEL ANALISIS
|
|
- Definir alcance del analisis
|
|
- Identificar archivos/componentes a revisar
|
|
- Asignar agente responsable
|
|
|
|
SUBFASE B: EJECUCION DEL ANALISIS
|
|
- Ejecutar analisis segun plan
|
|
- Documentar hallazgos
|
|
- Identificar dependencias
|
|
|
|
SUBFASE C: PLANEACION DE IMPLEMENTACION
|
|
- Definir tareas especificas
|
|
- Crear prompts para agentes
|
|
- Establecer orden de ejecucion
|
|
|
|
SUBFASE D: VALIDACION DE PLANEACION
|
|
- Verificar completitud vs analisis
|
|
- Validar dependencias
|
|
- Confirmar que no faltan objetos
|
|
|
|
SUBFASE E: EJECUCION DE IMPLEMENTACION
|
|
- Ejecutar tareas segun plan
|
|
- Documentar cambios
|
|
- Actualizar inventarios
|
|
```
|
|
|
|
---
|
|
|
|
## 4. METODOLOGIA POR FASE
|
|
|
|
### 4.1 Template de Documentacion por Fase
|
|
|
|
Cada carpeta de fase contendra:
|
|
|
|
```
|
|
XX-fase-nombre/
|
|
|
|
|
+-- README.md # Descripcion de la fase
|
|
+-- ANALISIS/
|
|
| +-- 00-PLAN-ANALISIS.md # Subfase A
|
|
| +-- 01-EJECUCION-ANALISIS.md # Subfase B
|
|
| +-- 02-HALLAZGOS.md # Resultados
|
|
|
|
|
+-- PLANEACION/
|
|
| +-- 00-TAREAS.md # Subfase C
|
|
| +-- 01-VALIDACION.md # Subfase D
|
|
| +-- 02-DEPENDENCIAS.md # Mapa de dependencias
|
|
|
|
|
+-- IMPLEMENTACION/
|
|
| +-- 00-EJECUCION.md # Subfase E
|
|
| +-- 01-CAMBIOS.md # Log de cambios
|
|
| +-- 02-ROLLBACK.md # Plan de rollback
|
|
|
|
|
+-- PROMPTS/
|
|
| +-- PROMPT-AGENTE-X.md # Prompt para cada agente
|
|
| +-- PROMPT-AGENTE-Y.md
|
|
|
|
|
+-- VALIDACION/
|
|
+-- CHECKLIST.md # Checklist de validacion
|
|
+-- REPORTE.md # Reporte final de fase
|
|
```
|
|
|
|
### 4.2 Criterios de Completitud por Fase
|
|
|
|
Una fase se considera COMPLETA cuando:
|
|
|
|
```markdown
|
|
[ ] Analisis documentado completamente
|
|
[ ] Todas las tareas ejecutadas
|
|
[ ] Inventarios actualizados
|
|
[ ] Dependencias validadas
|
|
[ ] Tests pasan (si aplica)
|
|
[ ] Documentacion actualizada
|
|
[ ] Reporte de fase generado
|
|
[ ] Aprobacion para siguiente fase
|
|
```
|
|
|
|
---
|
|
|
|
## 5. MAPA DE DEPENDENCIAS
|
|
|
|
### 5.1 Dependencias entre Fases
|
|
|
|
```
|
|
FASE 1 (Control Plane)
|
|
|
|
|
+---> FASE 2 (Core Orchestration) [requiere estructura base]
|
|
|
|
|
+---> FASE 3 (Registries) [requiere estructura + SIMCO actualizado]
|
|
|
|
|
+---> FASE 4 (Proyectos) [requiere registries]
|
|
| |
|
|
| +---> FASE 5 (Shared Libs) [requiere proyectos separados]
|
|
|
|
|
+---> FASE 6 (Knowledge Base) [puede paralelo con 4-5]
|
|
|
|
|
+---> FASE 7 (Validacion) [requiere todo]
|
|
```
|
|
|
|
### 5.2 Dependencias Internas por Fase
|
|
|
|
#### Fase 1: Control Plane
|
|
```
|
|
1.1 Estructura --> 1.2 Registries --> 1.3 Manifests --> 1.4 CI
|
|
```
|
|
|
|
#### Fase 2: Core Orchestration
|
|
```
|
|
2.1 SIMCO --> 2.2 Perfiles --> 2.3 Templates --> 2.4 Service Descriptor
|
|
```
|
|
|
|
#### Fase 3: Registries
|
|
```
|
|
3.1 Ports --> 3.2 Domains --> 3.3 Databases --> 3.4 Scripts
|
|
(pueden ser paralelas 3.1-3.3, scripts al final)
|
|
```
|
|
|
|
#### Fase 4: Proyectos
|
|
```
|
|
4.1 Gamilit (prioritario, mas avanzado)
|
|
|
|
|
+---> 4.2 ERP Suite (segundo, mas complejo)
|
|
|
|
|
+---> 4.3 Trading (tercero)
|
|
|
|
|
+---> 4.4 Betting (ultimo, menos avanzado)
|
|
```
|
|
|
|
---
|
|
|
|
## 6. CRONOGRAMA
|
|
|
|
### 6.1 Estimacion por Fase
|
|
|
|
| Fase | Duracion Estimada | Dependencias |
|
|
|------|-------------------|--------------|
|
|
| 0 - Plan Maestro | 1 dia | Ninguna |
|
|
| 1 - Control Plane | 2-3 dias | Fase 0 |
|
|
| 2 - Core Orchestration | 3-5 dias | Fase 1 |
|
|
| 3 - Registries | 2-3 dias | Fase 2 |
|
|
| 4 - Proyectos | 5-10 dias | Fase 3 |
|
|
| 5 - Shared Libs | 3-5 dias | Fase 4 |
|
|
| 6 - Knowledge Base | 2-3 dias | Fase 3 |
|
|
| 7 - Validacion | 2-3 dias | Todo |
|
|
| **TOTAL** | **20-32 dias** | - |
|
|
|
|
### 6.2 Puntos de Control
|
|
|
|
| Checkpoint | Criterio de Exito |
|
|
|------------|-------------------|
|
|
| CP1 (Post Fase 1) | Control plane estructura lista |
|
|
| CP2 (Post Fase 2) | SIMCO v2 operativo |
|
|
| CP3 (Post Fase 3) | Registries con enforcement |
|
|
| CP4 (Post Fase 4) | Proyectos separados y funcionando |
|
|
| CP5 (Post Fase 5) | Shared libs publicadas |
|
|
| CP6 (Post Fase 7) | Migracion completa y validada |
|
|
|
|
---
|
|
|
|
## 7. ROLES DE AGENTES
|
|
|
|
### 7.1 Agentes por Fase
|
|
|
|
| Fase | Agente Principal | Agentes Soporte |
|
|
|------|------------------|-----------------|
|
|
| 0 | Tech-Leader | Requirements-Analyst |
|
|
| 1 | Architecture-Analyst | DevOps-Agent |
|
|
| 2 | Tech-Leader | Documentation-Validator |
|
|
| 3 | DevOps-Agent | Backend-Agent |
|
|
| 4.x | Backend-Agent, Frontend-Agent, Database-Agent | Tech-Leader |
|
|
| 5 | Backend-Agent | Architecture-Analyst |
|
|
| 6 | Knowledge-Agent | Tech-Leader |
|
|
| 7 | QA-Agent | Todos |
|
|
|
|
### 7.2 Responsabilidades por Agente
|
|
|
|
```yaml
|
|
Tech-Leader:
|
|
- Coordinacion general
|
|
- Validacion de completitud
|
|
- Toma de decisiones arquitectonicas
|
|
- Aprobacion de fases
|
|
|
|
Architecture-Analyst:
|
|
- Diseno de estructura de repos
|
|
- Definicion de contratos
|
|
- ADRs
|
|
- Validacion de patrones
|
|
|
|
DevOps-Agent:
|
|
- Configuracion de CI/CD
|
|
- Scripts de validacion
|
|
- Docker/Compose configs
|
|
- Reverse proxy
|
|
|
|
Backend-Agent:
|
|
- Migracion de codigo backend
|
|
- Service descriptors
|
|
- APIs y servicios
|
|
|
|
Frontend-Agent:
|
|
- Migracion de codigo frontend
|
|
- Componentes compartidos
|
|
|
|
Database-Agent:
|
|
- Roles y permisos de BD
|
|
- Migraciones
|
|
- Seeds
|
|
|
|
Documentation-Validator:
|
|
- Validacion de docs
|
|
- Actualizacion de inventarios
|
|
|
|
Knowledge-Agent:
|
|
- Reorganizacion de knowledge base
|
|
- Pipelines de indexado
|
|
|
|
QA-Agent:
|
|
- Tests de integracion
|
|
- Validacion final
|
|
- Reporte de calidad
|
|
```
|
|
|
|
---
|
|
|
|
## 8. ARCHIVOS DE REFERENCIA
|
|
|
|
### 8.1 Del Workspace Actual a Preservar
|
|
|
|
```
|
|
core/orchestration/directivas/simco/ -> Migrar y actualizar
|
|
core/orchestration/agents/perfiles/ -> Migrar y actualizar
|
|
core/catalog/ -> Migrar a shared-libs
|
|
projects/gamilit/ -> Separar a repo propio
|
|
projects/erp-suite/ -> Separar a repo propio
|
|
knowledge-base/ -> Migrar a repo shared
|
|
```
|
|
|
|
### 8.2 Archivos Nuevos a Crear
|
|
|
|
```
|
|
control-plane/registries/ports.registry.yml
|
|
control-plane/registries/domains.registry.yml
|
|
control-plane/registries/databases.registry.yml
|
|
control-plane/registries/services.registry.yml
|
|
control-plane/manifests/repos.manifest.yml
|
|
control-plane/manifests/environments.manifest.yml
|
|
devtools/scripts/validate-ports.sh
|
|
devtools/scripts/validate-domains.sh
|
|
devtools/scripts/validate-databases.sh
|
|
{proyecto}/service.descriptor.yml (por cada servicio)
|
|
```
|
|
|
|
---
|
|
|
|
## 9. SIGUIENTE PASO
|
|
|
|
Proceder a **Fase 1: Control Plane** con:
|
|
|
|
1. Leer `01-fase-control-plane/README.md`
|
|
2. Ejecutar subfases A-E
|
|
3. Generar reporte de fase
|
|
4. Obtener aprobacion para Fase 2
|
|
|
|
---
|
|
|
|
**Documento generado por:** Tech-Leader Agent
|
|
**Fecha:** 2025-12-18
|
|
**Version:** 1.0.0
|