Compare commits

..

No commits in common. "cb4c0681d3989e28edf7f8d97d526fd013ac7b98" and "d332c805098b193f4e9ff209445b858697d6704b" have entirely different histories.

309 changed files with 14235 additions and 40129 deletions

28
.gitignore vendored
View File

@ -181,22 +181,6 @@ backups/
# Backup de gamilit (submodule migration) # Backup de gamilit (submodule migration)
projects/gamilit.bak.*/ projects/gamilit.bak.*/
# -----------------------------------------------------------------------------
# MCP SERVERS - Repositorios independientes
# -----------------------------------------------------------------------------
# Los MCP servers internos son repositorios independientes que se clonan
# manualmente despues de clonar workspace-v1.
# Ver core/mcp-servers/_registry.yml para lista completa e instrucciones.
# -----------------------------------------------------------------------------
core/mcp-servers/internal/rag-knowledge/
core/mcp-servers/internal/scrum-taiga/
# Mantener estructura base (README, registry, templates)
!core/mcp-servers/README.md
!core/mcp-servers/_registry.yml
!core/mcp-servers/internal/.gitkeep
!core/mcp-servers/external/
!core/mcp-servers/templates/
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# SUBREPOSITORIOS - Proyectos con repositorios independientes en Gitea # SUBREPOSITORIOS - Proyectos con repositorios independientes en Gitea
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -205,7 +189,6 @@ core/mcp-servers/internal/scrum-taiga/
# #
# NOTA: gamilit NO se ignora porque es un submodulo Git (ver .gitmodules) # NOTA: gamilit NO se ignora porque es un submodulo Git (ver .gitmodules)
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# ERP Family
projects/erp-suite/ projects/erp-suite/
projects/erp-core/ projects/erp-core/
projects/erp-construccion/ projects/erp-construccion/
@ -213,18 +196,7 @@ projects/erp-clinicas/
projects/erp-retail/ projects/erp-retail/
projects/erp-mecanicas-diesel/ projects/erp-mecanicas-diesel/
projects/erp-vidrio-templado/ projects/erp-vidrio-templado/
# Trading & Analytics
projects/trading-platform/ projects/trading-platform/
projects/betting-analytics/ projects/betting-analytics/
projects/inmobiliaria-analytics/ projects/inmobiliaria-analytics/
projects/platform_marketing_content/ projects/platform_marketing_content/
# Nuevos proyectos (2026-01-07)
projects/michangarrito/
projects/template-saas/
projects/clinica-dental/
projects/clinica-veterinaria/
# Gitea token (no commitear)
.gitea-token

View File

@ -1,7 +1,7 @@
# Subrepositorios del Workspace # Subrepositorios del Workspace
**Fecha:** 2026-01-07 **Fecha:** 2025-01-04
**Version:** 1.3 **Version:** 1.1
--- ---
@ -97,15 +97,6 @@ Estos proyectos SI pueden tener subrepositorios para sus apps (backend, frontend
| **inmobiliaria-analytics** | `projects/inmobiliaria-analytics` | `http://72.60.226.4:3000/rckrdmrd/inmobiliaria-analytics.git` | | **inmobiliaria-analytics** | `projects/inmobiliaria-analytics` | `http://72.60.226.4:3000/rckrdmrd/inmobiliaria-analytics.git` |
| **platform_marketing_content** | `projects/platform_marketing_content` | `http://72.60.226.4:3000/rckrdmrd/platform_marketing_content.git` | | **platform_marketing_content** | `projects/platform_marketing_content` | `http://72.60.226.4:3000/rckrdmrd/platform_marketing_content.git` |
### Proyectos Nuevos (2026-01-07)
| Proyecto | Path Local | Repositorio | Subrepositorios |
|----------|------------|-------------|-----------------|
| **michangarrito** | `projects/michangarrito` | `http://72.60.226.4:3000/rckrdmrd/michangarrito.git` | backend, frontend, mobile, database, mcp-server, whatsapp |
| **template-saas** | `projects/template-saas` | `http://72.60.226.4:3000/rckrdmrd/template-saas.git` | backend, frontend, database |
| **clinica-dental** | `projects/clinica-dental` | `http://72.60.226.4:3000/rckrdmrd/clinica-dental.git` | database |
| **clinica-veterinaria** | `projects/clinica-veterinaria` | `http://72.60.226.4:3000/rckrdmrd/clinica-veterinaria.git` | database |
### Estructura con Subrepositorios (para proyectos Gitea) ### Estructura con Subrepositorios (para proyectos Gitea)
Los proyectos en Gitea pueden usar esta estructura de subrepositorios: Los proyectos en Gitea pueden usar esta estructura de subrepositorios:
@ -216,93 +207,4 @@ git -C /home/isem/workspace-v1/projects/gamilit status
--- ---
## Estado Actual de Repositorios en Gitea
### Repositorios Existentes (2026-01-04)
| Repositorio | Tipo | Estado |
|-------------|------|--------|
| workspace | Principal | Activo |
| workspace-v1 | Principal | Activo |
| erp-construccion-backend | Subrepositorio | Activo |
| erp-construccion-frontend-web | Subrepositorio | Activo |
| erp-construccion-frontend-mobile | Subrepositorio | Activo |
| erp-construccion-database | Subrepositorio | Activo |
| erp-mecanicas-diesel-backend | Subrepositorio | Activo |
| erp-mecanicas-diesel-frontend-web | Subrepositorio | Activo |
| erp-mecanicas-diesel-database | Subrepositorio | Activo |
| erp-core-backend | Subrepositorio | Activo |
| erp-core-frontend-web | Subrepositorio | Activo |
| erp-core-database | Subrepositorio | Activo |
### Repositorios Creados (2026-01-07)
Los siguientes repositorios fueron creados via API:
| Repositorio | Tipo | Estado |
|-------------|------|--------|
| michangarrito | Principal | ✅ Creado |
| michangarrito-backend | Subrepositorio | ✅ Creado |
| michangarrito-frontend | Subrepositorio | ✅ Creado |
| michangarrito-mobile | Subrepositorio | ✅ Creado |
| michangarrito-database | Subrepositorio | ✅ Creado |
| michangarrito-mcp-server | Subrepositorio | ✅ Creado |
| michangarrito-whatsapp | Subrepositorio | ✅ Creado |
| template-saas | Principal | ✅ Creado |
| template-saas-backend | Subrepositorio | ✅ Creado |
| template-saas-frontend | Subrepositorio | ✅ Creado |
| template-saas-database | Subrepositorio | ✅ Creado |
| clinica-dental | Principal | ✅ Creado |
| clinica-dental-database | Subrepositorio | ✅ Creado |
| clinica-veterinaria | Principal | ✅ Creado |
| clinica-veterinaria-database | Subrepositorio | ✅ Creado |
### Repositorios Pendientes de Crear
Los siguientes repositorios principales necesitan crearse via API o web de Gitea:
- erp-suite (principal)
- erp-core (principal)
- erp-construccion (principal)
- erp-clinicas (principal)
- erp-retail (principal)
- erp-mecanicas-diesel (principal)
- erp-vidrio-templado (principal)
- trading-platform (principal)
- betting-analytics (principal)
- inmobiliaria-analytics (principal)
- platform-marketing-content (principal)
---
## Scripts de Gestion
### Crear repositorios en Gitea
```bash
# Requiere token de API de Gitea
./scripts/create-gitea-repos-api.sh <GITEA_TOKEN>
# Para obtener el token:
# 1. Ir a http://72.60.226.4:3000/rckrdmrd
# 2. Settings -> Applications -> Generate New Token
# 3. Dar permisos de 'repo' y 'write:repository'
```
### Push de todos los proyectos
```bash
# Despues de crear los repositorios
./scripts/push-all-projects.sh
```
### Configurar repositorios locales
```bash
# Configura remotes en cada proyecto
./scripts/create-gitea-repos.sh
```
---
*Generado por NEXUS v3.4 - Sistema de Orquestacion* *Generado por NEXUS v3.4 - Sistema de Orquestacion*

View File

@ -155,7 +155,7 @@ repositories:
shared-libs: shared-libs:
type: "shared" type: "shared"
description: "Librerias compartidas" description: "Librerias compartidas"
path: "shared/catalog/" path: "shared/libs/"
status: "planned" status: "planned"
packages: packages:
- "@workspace/auth" - "@workspace/auth"

View File

@ -1,127 +1,119 @@
# Core - Arquitectura del Workspace # Core - Núcleo de la Fábrica de Software
**Version:** 2.0.0 ## Descripción
**Actualizado:** 2026-01-04
## Descripcion El directorio `core/` contiene todo lo que se comparte a nivel de **fábrica**, no de proyecto individual:
El directorio `core/` contiene la **arquitectura central del workspace**: sistema de orquestacion, MCP servers, y herramientas de ambiente. NO contiene codigo de aplicacion ni recursos compartidos (esos estan en `shared/`). - Sistema de orquestación de agentes
- Módulos de código reutilizables
- Estándares técnicos y de negocio
- Directivas globales para agentes/subagentes
- Constantes y tipos universales
## Estructura ## Estructura
``` ```
core/ core/
├── README.md # Este archivo ├── modules/ # Código compartido ejecutable
│ ├── utils/ # Utilidades universales ✅
│ │ ├── date.util.ts # Manipulación de fechas
│ │ ├── string.util.ts # Manipulación de strings
│ │ ├── validation.util.ts # Validaciones
│ │ └── index.ts
│ ├── auth/ # Autenticación (por implementar)
│ ├── billing/ # Facturación
│ ├── notifications/ # Notificaciones
│ ├── payments/ # Pagos
│ └── multitenant/ # Multi-tenancy
├── mcp-servers/ # MCP Servers para el workspace ├── constants/ # Constantes globales ✅
│ ├── internal/ # Servidores MCP internos │ ├── enums.constants.ts # Enums universales
│ ├── external/ # Referencias a servidores externos │ ├── regex.constants.ts # Patrones regex
│ ├── templates/ # Templates para crear nuevos MCP servers │ └── index.ts
│ └── _registry.yml # Registro de servidores disponibles
├── orchestration/ # Sistema NEXUS/SIMCO de orquestacion ├── types/ # Tipos TypeScript compartidos ✅
│ ├── agents/ # Perfiles de agentes │ ├── api.types.ts # Tipos de API
│ │ ├── perfiles/ # Perfiles ligeros SIMCO │ ├── common.types.ts # Tipos comunes
│ │ └── legacy/ # Prompts legacy (referencia) │ └── index.ts
│ ├── directivas/ # Directivas por operacion
│ │ ├── simco/ # Sistema SIMCO
│ │ ├── legacy/ # Directivas legacy
│ │ └── _MAP.md
│ ├── referencias/ # ALIASES.yml y referencias
│ ├── templates/ # Templates de documentacion
│ ├── auditorias/ # Auditorias arquitectonicas
│ ├── impactos/ # Matrices de impacto
│ ├── inventarios/ # Inventarios de deployment
│ ├── procesos/ # Guias de procesos
│ ├── deployment/ # Arquitectura de deployment
│ ├── claude/ # Configuraciones Claude
│ └── _historico/ # Documentos archivados
└── devtools/ # Herramientas de ambiente ├── catalog/ # Documentación de funcionalidades
└── environment/ # Configuracion de ambientes │ ├── auth/
├── scripts/ # Scripts de setup │ ├── notifications/
├── templates/ # Templates .env │ └── ...
└── DEV-ENVIRONMENT-REGISTRY.yml
├── orchestration/ # Sistema de agentes NEXUS
│ ├── agents/
│ ├── directivas/
│ ├── templates/
│ └── referencias/
└── standards/ # Estándares técnicos globales
├── CODING-STANDARDS.md
├── TESTING-STANDARDS.md
└── ...
``` ```
## Que NO esta en core/
Los siguientes elementos fueron movidos a `shared/`:
| Elemento | Nueva ubicacion |
|----------|-----------------|
| catalog/ | `shared/catalog/` |
| modules/ | `shared/modules/` |
| constants/ | `shared/constants/` |
| types/ | `shared/types/` |
| standards/ | `shared/knowledge-base/standards/` |
## Uso ## Uso
### MCP Servers ### Importar Utilidades
```bash ```typescript
# Ver servidores disponibles // En cualquier proyecto del workspace
cat core/mcp-servers/_registry.yml import { formatDate, slugify, isEmail } from '@core/modules/utils';
# Crear nuevo servidor MCP interno // O importar específico
cp -r core/mcp-servers/templates/TEMPLATE-MCP-INTERNO core/mcp-servers/internal/mi-servidor import { formatToISO, addDays } from '@core/modules/utils/date.util';
``` ```
### Sistema de Orquestacion ### Importar Constantes
Los agentes cargan automaticamente las directivas de `core/orchestration/directivas/` al inicializar. ```typescript
import { UserStatus, PaymentStatus } from '@core/constants';
```markdown import { EMAIL_REGEX, UUID_REGEX } from '@core/constants/regex.constants';
# Inicializacion de agente
1. Leer core/orchestration/directivas/simco/_INDEX.md
2. Leer core/orchestration/directivas/principios/*.md
3. Cargar perfil desde core/orchestration/agents/perfiles/
4. Leer ALIASES.yml para navegacion
``` ```
### Herramientas de Ambiente ### Importar Tipos
```bash ```typescript
# Validar ambiente de un proyecto import { ApiResponse, PaginatedResponse } from '@core/types';
./core/devtools/environment/scripts/validate-environment.sh /path/to/project import { BaseEntity, Address } from '@core/types/common.types';
# Setup de ambiente
./core/devtools/environment/scripts/setup-project-env.sh /path/to/project
``` ```
## Relacion con otras carpetas ## Módulos Disponibles
``` ### Utils (`@core/modules/utils`)
workspace-v1/
├── core/ # ARQUITECTURA (este directorio)
│ └── orchestration/ # Sistema SIMCO/NEXUS
├── shared/ # RECURSOS COMPARTIDOS
│ ├── catalog/ # Funcionalidades reutilizables
│ ├── modules/ # Codigo ejecutable
│ ├── constants/ # Constantes globales
│ ├── types/ # Tipos TypeScript
│ └── knowledge-base/ # Documentacion
├── control-plane/ # GOVERNANCE
│ ├── registries/ # Puertos, dominios, BDs
│ ├── manifests/ # Configuraciones de repos
│ └── devtools/ # CI/CD, Docker
├── orchestration/ # DIRECTIVAS A NIVEL WORKSPACE (hereda de core/)
└── projects/ # PROYECTOS DE PRODUCTO
```
## Ver Tambien | Archivo | Funciones | Descripción |
|---------|-----------|-------------|
| `date.util.ts` | formatDate, addDays, diffInDays, etc. | Manipulación de fechas |
| `string.util.ts` | slugify, capitalize, truncate, etc. | Manipulación de strings |
| `validation.util.ts` | isEmail, isUUID, isStrongPassword, etc. | Validaciones |
- [Sistema de Orquestacion](orchestration/README.md) ### Constants (`@core/constants`)
- [MCP Servers](mcp-servers/README.md)
- [Recursos Compartidos](../shared/README.md)
- [Catalogo de Funcionalidades](../shared/catalog/README.md)
--- | Archivo | Contenido |
|---------|-----------|
| `enums.constants.ts` | UserStatus, PaymentStatus, NotificationType, etc. |
| `regex.constants.ts` | EMAIL_REGEX, UUID_REGEX, PHONE_REGEX, etc. |
**Mantenido por:** Tech-Leader ### Types (`@core/types`)
**Ultima actualizacion:** 2026-01-04
| Archivo | Tipos |
|---------|-------|
| `api.types.ts` | ApiResponse, PaginatedResponse, ErrorCodes |
| `common.types.ts` | BaseEntity, Address, Money, Result |
## Proyectos que Usan Core
- **Gamilit** - Plataforma educativa de gamificación
- **Trading Platform** - OrbiQuant IA trading
- **ERP Suite** - Sistema ERP multi-vertical
## Sistema de Orquestación
Los agentes cargan automáticamente las directivas de `core/orchestration/directivas/` al inicializar.
## Ver También
- [Sistema de Orquestación](orchestration/README.md)
- [Catálogo de Funcionalidades](catalog/README.md)
- [Plan de Organización](../PLAN-ORGANIZACION-WORKSPACE.md)

View File

@ -28,7 +28,7 @@ funcionalidades:
auth: auth:
nombre: "Autenticación y Autorización" nombre: "Autenticación y Autorización"
path: "shared/catalog/auth/" path: "core/catalog/auth/"
alias: "@CATALOG_AUTH" alias: "@CATALOG_AUTH"
estado: "production-ready" # production-ready | documentando | pendiente estado: "production-ready" # production-ready | documentando | pendiente
origen: "projects/gamilit" origen: "projects/gamilit"
@ -68,7 +68,7 @@ funcionalidades:
session-management: session-management:
nombre: "Gestión de Sesiones" nombre: "Gestión de Sesiones"
path: "shared/catalog/session-management/" path: "core/catalog/session-management/"
alias: "@CATALOG_SESSION" alias: "@CATALOG_SESSION"
estado: "production-ready" estado: "production-ready"
origen: "projects/gamilit" origen: "projects/gamilit"
@ -98,7 +98,7 @@ funcionalidades:
rate-limiting: rate-limiting:
nombre: "Limitación de Tasa (Rate Limiting)" nombre: "Limitación de Tasa (Rate Limiting)"
path: "shared/catalog/rate-limiting/" path: "core/catalog/rate-limiting/"
alias: "@CATALOG_RATELIMIT" alias: "@CATALOG_RATELIMIT"
estado: "production-ready" estado: "production-ready"
origen: "projects/gamilit" origen: "projects/gamilit"
@ -129,7 +129,7 @@ funcionalidades:
notifications: notifications:
nombre: "Sistema de Notificaciones" nombre: "Sistema de Notificaciones"
path: "shared/catalog/notifications/" path: "core/catalog/notifications/"
alias: "@CATALOG_NOTIFY" alias: "@CATALOG_NOTIFY"
estado: "production-ready" estado: "production-ready"
origen: "projects/gamilit" origen: "projects/gamilit"
@ -165,7 +165,7 @@ funcionalidades:
websocket: websocket:
nombre: "Comunicación WebSocket" nombre: "Comunicación WebSocket"
path: "shared/catalog/websocket/" path: "core/catalog/websocket/"
alias: "@CATALOG_WS" alias: "@CATALOG_WS"
estado: "production-ready" estado: "production-ready"
origen: "projects/trading-platform" origen: "projects/trading-platform"
@ -199,7 +199,7 @@ funcionalidades:
multi-tenancy: multi-tenancy:
nombre: "Soporte Multi-Tenant" nombre: "Soporte Multi-Tenant"
path: "shared/catalog/multi-tenancy/" path: "core/catalog/multi-tenancy/"
alias: "@CATALOG_TENANT" alias: "@CATALOG_TENANT"
estado: "production-ready" estado: "production-ready"
origen: "projects/gamilit" origen: "projects/gamilit"
@ -233,7 +233,7 @@ funcionalidades:
feature-flags: feature-flags:
nombre: "Feature Flags Dinámicos" nombre: "Feature Flags Dinámicos"
path: "shared/catalog/feature-flags/" path: "core/catalog/feature-flags/"
alias: "@CATALOG_FLAGS" alias: "@CATALOG_FLAGS"
estado: "production-ready" estado: "production-ready"
origen: "projects/gamilit" origen: "projects/gamilit"
@ -268,7 +268,7 @@ funcionalidades:
payments: payments:
nombre: "Integración de Pagos" nombre: "Integración de Pagos"
path: "shared/catalog/payments/" path: "core/catalog/payments/"
alias: "@CATALOG_PAYMENTS" alias: "@CATALOG_PAYMENTS"
estado: "production-ready" estado: "production-ready"
origen: "projects/trading-platform" origen: "projects/trading-platform"
@ -304,7 +304,7 @@ funcionalidades:
template-saas: template-saas:
nombre: "Template SaaS Multi-tenant" nombre: "Template SaaS Multi-tenant"
path: "shared/catalog/template-saas/" path: "core/catalog/template-saas/"
alias: "@CATALOG_SAAS" alias: "@CATALOG_SAAS"
estado: "production-ready" estado: "production-ready"
origen: "projects/erp-core, projects/gamilit" origen: "projects/erp-core, projects/gamilit"
@ -342,7 +342,7 @@ funcionalidades:
portales: portales:
nombre: "Portales y Dashboards" nombre: "Portales y Dashboards"
path: "shared/catalog/portales/" path: "core/catalog/portales/"
alias: "@CATALOG_PORTALES" alias: "@CATALOG_PORTALES"
estado: "production-ready" estado: "production-ready"
origen: "projects/gamilit, projects/trading-platform" origen: "projects/gamilit, projects/trading-platform"
@ -379,7 +379,7 @@ funcionalidades:
audit-logs: audit-logs:
nombre: "Sistema de Auditoria" nombre: "Sistema de Auditoria"
path: "shared/catalog/audit-logs/" path: "core/catalog/audit-logs/"
alias: "@CATALOG_AUDIT" alias: "@CATALOG_AUDIT"
estado: "production-ready" estado: "production-ready"
origen: "projects/gamilit, projects/erp-core" origen: "projects/gamilit, projects/erp-core"
@ -419,7 +419,7 @@ funcionalidades:
# ───────────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────────
# #
# Para buscar funcionalidad por keyword: # Para buscar funcionalidad por keyword:
# grep -i "{keyword}" shared/catalog/CATALOG-INDEX.yml # grep -i "{keyword}" core/catalog/CATALOG-INDEX.yml
# #
# Ejemplos: # Ejemplos:
# grep -i "login" → auth # grep -i "login" → auth
@ -469,7 +469,7 @@ instrucciones:
- Considerar agregar al catálogo después - Considerar agregar al catálogo después
que_hacer_si_encuentra: | que_hacer_si_encuentra: |
1. Ir a: shared/catalog/{funcionalidad}/ 1. Ir a: core/catalog/{funcionalidad}/
2. Leer: README.md (descripción y trade-offs) 2. Leer: README.md (descripción y trade-offs)
3. Seguir: IMPLEMENTATION.md (pasos) 3. Seguir: IMPLEMENTATION.md (pasos)
4. Copiar: _reference/ (código base) 4. Copiar: _reference/ (código base)

View File

@ -30,7 +30,7 @@ Este catálogo centraliza **código funcional probado y documentado** que puede
## ESTRUCTURA DEL CATÁLOGO ## ESTRUCTURA DEL CATÁLOGO
``` ```
shared/catalog/ core/catalog/
├── README.md ← ESTÁS AQUÍ ├── README.md ← ESTÁS AQUÍ
├── CATALOG-INDEX.yml # Índice máquina-readable ├── CATALOG-INDEX.yml # Índice máquina-readable
@ -103,16 +103,16 @@ shared/catalog/
### Alias Disponibles ### Alias Disponibles
```yaml ```yaml
@CATALOG: shared/catalog/ @CATALOG: core/catalog/
@CATALOG_INDEX: shared/catalog/CATALOG-INDEX.yml @CATALOG_INDEX: core/catalog/CATALOG-INDEX.yml
@CATALOG_AUTH: shared/catalog/auth/ @CATALOG_AUTH: core/catalog/auth/
@CATALOG_SESSION: shared/catalog/session-management/ @CATALOG_SESSION: core/catalog/session-management/
@CATALOG_RATELIMIT: shared/catalog/rate-limiting/ @CATALOG_RATELIMIT: core/catalog/rate-limiting/
@CATALOG_NOTIFY: shared/catalog/notifications/ @CATALOG_NOTIFY: core/catalog/notifications/
@CATALOG_TENANT: shared/catalog/multi-tenancy/ @CATALOG_TENANT: core/catalog/multi-tenancy/
@CATALOG_FLAGS: shared/catalog/feature-flags/ @CATALOG_FLAGS: core/catalog/feature-flags/
@CATALOG_WS: shared/catalog/websocket/ @CATALOG_WS: core/catalog/websocket/
@CATALOG_PAYMENTS: shared/catalog/payments/ @CATALOG_PAYMENTS: core/catalog/payments/
``` ```
--- ---
@ -251,7 +251,7 @@ Una funcionalidad DEBE agregarse al catálogo si cumple **TODOS** estos criterio
```markdown ```markdown
PASO 1: PREPARAR ESTRUCTURA PASO 1: PREPARAR ESTRUCTURA
[ ] Crear directorio: shared/catalog/{nombre-en-kebab-case}/ [ ] Crear directorio: core/catalog/{nombre-en-kebab-case}/
[ ] Crear README.md vacío [ ] Crear README.md vacío
[ ] Crear IMPLEMENTATION.md vacío [ ] Crear IMPLEMENTATION.md vacío
@ -286,7 +286,7 @@ PASO 4: ACTUALIZAR ÍNDICES (OBLIGATORIO)
PASO 5: ACTUALIZAR ALIASES (OBLIGATORIO) PASO 5: ACTUALIZAR ALIASES (OBLIGATORIO)
[ ] Editar core/orchestration/referencias/ALIASES.yml: [ ] Editar core/orchestration/referencias/ALIASES.yml:
- Agregar alias @CATALOG_{NOMBRE} - Agregar alias @CATALOG_{NOMBRE}
- Ejemplo: @CATALOG_AUDIT: "shared/catalog/audit-logs/" - Ejemplo: @CATALOG_AUDIT: "core/catalog/audit-logs/"
PASO 6: VALIDAR PASO 6: VALIDAR
[ ] Verificar que grep encuentra la funcionalidad en CATALOG-INDEX.yml [ ] Verificar que grep encuentra la funcionalidad en CATALOG-INDEX.yml

View File

@ -5,7 +5,7 @@
* Estos son los enums "universales" que aplican a múltiples proyectos. * Estos son los enums "universales" que aplican a múltiples proyectos.
* Los enums específicos de cada proyecto deben estar en su propio repositorio. * Los enums específicos de cada proyecto deben estar en su propio repositorio.
* *
* @module @shared/constants/enums * @module @core/constants/enums
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -3,7 +3,7 @@
* *
* Universal constants shared across all projects in the workspace. * Universal constants shared across all projects in the workspace.
* *
* @module @shared/constants * @module @core/constants
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -3,7 +3,7 @@
* *
* Regex patterns compartidos entre todos los proyectos del workspace. * Regex patterns compartidos entre todos los proyectos del workspace.
* *
* @module @shared/constants/regex * @module @core/constants/regex
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -1,228 +0,0 @@
# MCP Servers
**Version:** 1.0.0
**Fecha:** 2026-01-04
**Sistema:** NEXUS v3.4 + SIMCO
---
## Proposito
Esta carpeta contiene la infraestructura para MCP (Model Context Protocol) servers del workspace. Los MCP servers proporcionan herramientas especializadas para agentes de IA.
---
## Estructura
```
mcp-servers/
├── README.md # Este archivo
├── _registry.yml # Registro central de MCP servers
├── internal/ # MCP servers desarrollados internamente
│ ├── .gitkeep
│ ├── rag-knowledge/ # [REPO INDEPENDIENTE] Sistema RAG
│ └── scrum-taiga/ # [REPO INDEPENDIENTE] Integracion Taiga
├── external/ # MCP servers de terceros
│ ├── .gitkeep
│ └── _sources.yml # Fuentes confiables
└── templates/ # Templates para nuevos MCP
└── TEMPLATE-MCP-INTERNO/
```
---
## Arquitectura: Repositorios Independientes
Los MCP servers internos son **repositorios independientes** (NO submodules):
| Caracteristica | Valor |
|----------------|-------|
| Versionado | Independiente del workspace |
| Dependencias | Propias (node_modules excluidos) |
| Desarrollo | Ciclo de vida propio |
| Clonacion | Manual despues de workspace |
### Por que NO son submodules?
1. **Flexibilidad:** Pueden actualizarse sin afectar workspace
2. **Desarrollo independiente:** Equipos pueden trabajar en paralelo
3. **Reutilizacion:** Pueden usarse en otros contextos
4. **Simplicidad:** Sin complejidad de submodules anidados
---
## MCP Servers Disponibles
### Internos (Desarrollo Propio)
| MCP Server | Descripcion | Prioridad | Estado |
|------------|-------------|-----------|--------|
| **rag-knowledge** | Sistema RAG como fuente de verdad | MAXIMA | Planificado |
| **scrum-taiga** | Integracion con Taiga SCRUM | ALTA | Planificado |
### Externos (Terceros)
Ver `external/_sources.yml` para fuentes confiables de MCP servers externos.
---
## Instalacion
### 1. Requisitos Previos
- workspace-v1 clonado
- SSH configurado para Gitea (ver `orchestration/referencias/REPOSITORY-STRUCTURE.md`)
- Node.js >= 18
### 2. Clonar MCP Servers
```bash
# Navegar a carpeta de MCP internos
cd /home/isem/workspace-v1/core/mcp-servers/internal
# Clonar RAG Knowledge Base (recomendado para desarrollo)
git clone git@gitea-server:rckrdmrd/mcp-rag-knowledge.git rag-knowledge
# Clonar SCRUM Taiga (opcional)
git clone git@gitea-server:rckrdmrd/mcp-scrum-taiga.git scrum-taiga
```
### 3. Instalar Dependencias
```bash
# RAG Knowledge
cd rag-knowledge
npm install
cp .env.example .env
# Configurar .env con credenciales
# SCRUM Taiga
cd ../scrum-taiga
npm install
cp .env.example .env
# Configurar .env con credenciales Taiga
```
### 4. Verificar Instalacion
```bash
# Desde workspace-v1
cd /home/isem/workspace-v1
# Verificar estructura
ls -la core/mcp-servers/internal/
# Verificar que MCP servers responden
cd core/mcp-servers/internal/rag-knowledge
npm run health-check
```
---
## Desarrollo de Nuevos MCP
### Usar Template
```bash
# Copiar template
cp -r templates/TEMPLATE-MCP-INTERNO nuevo-mcp-server
# Personalizar
cd nuevo-mcp-server
# Editar package.json, README.md, etc.
```
### Directivas a Seguir
| Directiva | Proposito |
|-----------|-----------|
| @SIMCO_MCP | Desarrollo de MCP servers |
| @SIMCO_MCP_IMPORT | Importacion de MCP externos |
| @SIMCO_RAG | Interaccion con sistema RAG |
### Registrar en _registry.yml
Despues de crear un nuevo MCP server, agregarlo a `_registry.yml`:
```yaml
mcp_servers:
internal:
nuevo-mcp:
name: "Nombre del MCP"
description: "Descripcion"
status: "development"
repository:
url: "git@gitea-server:rckrdmrd/mcp-nuevo.git"
# ...
```
---
## Perfiles de Agentes Relacionados
| Perfil | Responsabilidad |
|--------|-----------------|
| @PERFIL_MCP_ARCHITECT | Diseno e integracion de MCP |
| @PERFIL_MCP_DEVELOPER | Desarrollo de MCP internos |
| @PERFIL_MCP_INTEGRATOR | Importacion de MCP externos |
| @PERFIL_RAG_ENGINEER | Mantenimiento del RAG |
---
## Aliases Utiles
```yaml
@MCP_SERVERS: "core/mcp-servers/"
@MCP_REGISTRY: "core/mcp-servers/_registry.yml"
@MCP_RAG: "core/mcp-servers/internal/rag-knowledge/"
@MCP_TAIGA: "core/mcp-servers/internal/scrum-taiga/"
```
---
## Troubleshooting
### MCP server no clonado
```bash
# Verificar SSH
ssh -T gitea-server
# Si falla, verificar ~/.ssh/config
cat ~/.ssh/config | grep gitea
```
### Dependencias faltantes
```bash
# Reinstalar
cd core/mcp-servers/internal/rag-knowledge
rm -rf node_modules
npm install
```
### Variables de entorno
```bash
# Verificar .env existe
ls -la .env
# Verificar variables requeridas
cat .env.example
```
---
## Referencias
- `_registry.yml` - Registro completo de MCP servers
- `orchestration/directivas/simco/SIMCO-MCP.md` - Directiva de desarrollo
- `orchestration/referencias/REPOSITORY-STRUCTURE.md` - Estructura de repos
---
**Mantenido por:** @PERFIL_MCP_ARCHITECT
**Sistema:** NEXUS v3.4 + SIMCO

View File

@ -1,172 +0,0 @@
# MCP Servers Registry
# ====================
# Registro central de todos los MCP servers del workspace
#
# Version: 1.0.0
# Fecha: 2026-01-04
# Sistema: NEXUS v3.4 + SIMCO
version: "1.0.0"
last_updated: "2026-01-04"
maintainer: "@PERFIL_MCP_ARCHITECT"
# ============================================================================
# MCP SERVERS INTERNOS
# ============================================================================
# Desarrollados internamente para necesidades especificas del workspace
# Cada uno es un repositorio independiente que se clona manualmente
mcp_servers:
internal:
# -------------------------------------------------------------------------
# RAG Knowledge Base - PRIORIDAD MAXIMA
# -------------------------------------------------------------------------
rag-knowledge:
name: "RAG Knowledge Base"
description: |
Sistema RAG (Retrieval-Augmented Generation) como fuente de verdad
del workspace. Proporciona busqueda semantica sobre documentacion,
directivas, perfiles y codigo.
status: "planned"
priority: "maxima"
repository:
type: "gitea"
url: "git@gitea-server:rckrdmrd/mcp-rag-knowledge.git"
https: "http://72.60.226.4:3000/rckrdmrd/mcp-rag-knowledge"
clone_path: "core/mcp-servers/internal/rag-knowledge"
dependencies:
runtime:
- "Node.js >= 18"
- "TypeScript >= 5.0"
database:
- "PostgreSQL >= 15"
- "pgvector extension"
external_apis:
- "OpenAI API (embeddings)"
tools_provided:
- rag_query_context
- rag_get_directive
- rag_get_agent_profile
- rag_trace_reference
- rag_get_relations
- rag_find_code
- rag_explain_impact
- rag_index_document
- rag_sync_category
- rag_get_sync_status
- rag_validate_coverage
- rag_report_feedback
documentation:
architecture: "docs/ARCHITECTURE.md"
deployment: "docs/DEPLOYMENT.md"
usage: "docs/USAGE.md"
tools_spec: "docs/MCP-TOOLS-SPEC.md"
# -------------------------------------------------------------------------
# SCRUM Taiga Integration - PRIORIDAD ALTA
# -------------------------------------------------------------------------
scrum-taiga:
name: "SCRUM Taiga Integration"
description: |
Integracion con Taiga para gestion de proyectos SCRUM.
Permite sincronizar EPICs, User Stories y Tasks entre
el workspace y Taiga.
status: "planned"
priority: "alta"
repository:
type: "gitea"
url: "git@gitea-server:rckrdmrd/mcp-scrum-taiga.git"
https: "http://72.60.226.4:3000/rckrdmrd/mcp-scrum-taiga"
clone_path: "core/mcp-servers/internal/scrum-taiga"
dependencies:
runtime:
- "Node.js >= 18"
- "TypeScript >= 5.0"
external_apis:
- "Taiga API"
tools_provided:
- taiga_get_project
- taiga_list_epics
- taiga_create_epic
- taiga_list_user_stories
- taiga_create_user_story
- taiga_list_tasks
- taiga_create_task
- taiga_update_status
- taiga_sync_sprint
documentation:
architecture: "docs/ARCHITECTURE.md"
deployment: "docs/DEPLOYMENT.md"
usage: "docs/USAGE.md"
# ============================================================================
# MCP SERVERS EXTERNOS
# ============================================================================
# MCP servers de terceros evaluados y aprobados para uso
external:
# Lista de MCP servers externos pendientes de evaluacion
pending_evaluation: []
# MCP servers externos aprobados
approved: []
# Fuentes confiables para buscar MCP servers
trusted_sources:
- name: "Anthropic Official"
url: "https://github.com/anthropics"
priority: 1
- name: "MCP Community"
url: "https://github.com/modelcontextprotocol"
priority: 2
# ============================================================================
# INSTRUCCIONES DE CLONACION
# ============================================================================
clone_instructions: |
# Despues de clonar workspace-v1, clonar los MCP servers necesarios:
# 1. Navegar a la carpeta de MCP internos
cd /home/isem/workspace-v1/core/mcp-servers/internal
# 2. Clonar RAG Knowledge Base (recomendado)
git clone git@gitea-server:rckrdmrd/mcp-rag-knowledge.git rag-knowledge
cd rag-knowledge && npm install && cd ..
# 3. Clonar SCRUM Taiga (opcional)
git clone git@gitea-server:rckrdmrd/mcp-scrum-taiga.git scrum-taiga
cd scrum-taiga && npm install && cd ..
# 4. Verificar instalacion
ls -la
# ============================================================================
# VALIDACION
# ============================================================================
validation:
required_for_development:
- rag-knowledge
optional:
- scrum-taiga
check_command: |
# Verificar que MCP servers estan clonados
for mcp in rag-knowledge scrum-taiga; do
if [ -d "core/mcp-servers/internal/$mcp" ]; then
echo "OK: $mcp"
else
echo "MISSING: $mcp (clone con: git clone git@gitea-server:rckrdmrd/mcp-$mcp.git)"
fi
done

View File

@ -1,2 +0,0 @@
# Esta carpeta contiene MCP servers externos evaluados e instalados
# Ver _sources.yml para fuentes confiables

View File

@ -1,125 +0,0 @@
# MCP External Sources
# ====================
# Fuentes confiables para MCP servers externos
#
# Version: 1.0.0
# Fecha: 2026-01-04
version: "1.0.0"
last_updated: "2026-01-04"
# ============================================================================
# FUENTES CONFIABLES
# ============================================================================
# Lista de repositorios/organizaciones confiables para MCP servers
trusted_sources:
# Nivel 1: Oficial (maxima confianza)
official:
- name: "Anthropic Official"
url: "https://github.com/anthropics"
description: "MCP servers oficiales de Anthropic"
trust_level: "official"
auto_approve: true
- name: "Model Context Protocol"
url: "https://github.com/modelcontextprotocol"
description: "Repositorio oficial del protocolo MCP"
trust_level: "official"
auto_approve: true
# Nivel 2: Comunidad Verificada (alta confianza)
community_verified:
- name: "MCP Community Servers"
url: "https://github.com/mcp-community"
description: "Servidores MCP de la comunidad verificados"
trust_level: "verified"
auto_approve: false
requires_review: true
# Nivel 3: Terceros (requiere evaluacion completa)
third_party: []
# ============================================================================
# PROCESO DE EVALUACION
# ============================================================================
evaluation_process:
steps:
1_identify:
description: "Identificar MCP server de interes"
actions:
- Verificar fuente en trusted_sources
- Revisar repositorio y documentacion
- Verificar actividad y mantenimiento
2_security_review:
description: "Revision de seguridad"
actions:
- Revisar dependencias (npm audit)
- Buscar vulnerabilidades conocidas
- Verificar permisos requeridos
- Revisar codigo fuente si es necesario
3_functionality_test:
description: "Prueba de funcionalidad"
actions:
- Instalar en ambiente de prueba
- Ejecutar tests incluidos
- Verificar herramientas funcionan
- Documentar comportamiento
4_approval:
description: "Aprobacion final"
actions:
- Documentar en _registry.yml
- Agregar a external/installed/
- Actualizar documentacion
criteria:
mandatory:
- "Codigo fuente disponible"
- "Sin vulnerabilidades criticas"
- "Documentacion adecuada"
- "Tests incluidos"
recommended:
- "Mantenimiento activo (< 6 meses)"
- "Mas de 10 estrellas en GitHub"
- "Issues respondidos"
# ============================================================================
# MCP SERVERS EXTERNOS INSTALADOS
# ============================================================================
installed: []
# Formato cuando se instale uno:
# - name: "nombre-del-mcp"
# source: "url del repo"
# version: "1.0.0"
# installed_date: "2026-01-04"
# installed_by: "@PERFIL_MCP_INTEGRATOR"
# location: "external/installed/nombre-del-mcp"
# review_notes: "Notas de la evaluacion"
# ============================================================================
# MCP SERVERS PENDIENTES DE EVALUACION
# ============================================================================
pending_evaluation: []
# Formato:
# - name: "nombre"
# source: "url"
# requested_by: "quien lo solicito"
# requested_date: "fecha"
# reason: "por que se necesita"
# ============================================================================
# MCP SERVERS RECHAZADOS
# ============================================================================
rejected: []
# Formato:
# - name: "nombre"
# source: "url"
# rejected_date: "fecha"
# reason: "razon del rechazo"

View File

@ -1,3 +0,0 @@
# Esta carpeta contiene MCP servers internos como repositorios independientes
# Cada MCP server se clona manualmente despues de clonar workspace-v1
# Ver _registry.yml para lista de MCP servers disponibles

View File

@ -1 +0,0 @@
# Esta carpeta contiene templates para crear nuevos MCP servers

View File

@ -1,16 +0,0 @@
# ============================================================================
# MCP Server Configuration
# ============================================================================
# Server
PORT=3100
NODE_ENV=development
# Database (PostgreSQL with pgvector)
DATABASE_URL=postgresql://user:password@localhost:5432/mcp_db
# OpenAI (for embeddings)
OPENAI_API_KEY=sk-your-api-key-here
# Logging
LOG_LEVEL=info

View File

@ -1,35 +0,0 @@
# Dependencies
node_modules/
# Build
dist/
*.tsbuildinfo
# Environment
.env
.env.local
.env.*.local
# Logs
logs/
*.log
npm-debug.log*
# Testing
coverage/
.nyc_output/
# IDE
.idea/
.vscode/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
# Temp
tmp/
temp/
.cache/

View File

@ -1,121 +0,0 @@
# {NOMBRE_MCP}
**Version:** 0.1.0
**Fecha:** {FECHA}
**Sistema:** NEXUS v3.4 + SIMCO
---
## Descripcion
{DESCRIPCION_DEL_MCP}
---
## Instalacion
```bash
# Clonar (desde workspace-v1/core/mcp-servers/internal/)
git clone git@gitea-server:rckrdmrd/mcp-{nombre}.git {nombre}
cd {nombre}
# Instalar dependencias
npm install
# Configurar
cp .env.example .env
# Editar .env con credenciales
```
---
## Configuracion
### Variables de Entorno
| Variable | Descripcion | Requerido |
|----------|-------------|-----------|
| `DATABASE_URL` | URL de PostgreSQL | Si |
| `OPENAI_API_KEY` | API key de OpenAI | Si |
### Archivo .env.example
```env
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/db
# OpenAI (para embeddings)
OPENAI_API_KEY=sk-...
# Server
PORT=3100
```
---
## Uso
### Iniciar Servidor
```bash
npm run start
```
### Desarrollo
```bash
npm run dev
```
### Tests
```bash
npm run test
```
---
## Herramientas MCP Disponibles
| Herramienta | Descripcion |
|-------------|-------------|
| `{tool_1}` | {descripcion} |
| `{tool_2}` | {descripcion} |
---
## Estructura
```
{nombre}/
├── README.md
├── package.json
├── tsconfig.json
├── .env.example
├── .gitignore
├── docs/
│ ├── ARCHITECTURE.md
│ ├── DEPLOYMENT.md
│ └── USAGE.md
├── orchestration/
│ └── 00-guidelines/
│ └── CONTEXTO-PROYECTO.md
├── src/
│ ├── index.ts
│ ├── tools/
│ └── services/
├── config/
└── tests/
```
---
## Referencias
- Directiva: @SIMCO_MCP
- Perfil: @PERFIL_MCP_DEVELOPER
- Registry: core/mcp-servers/_registry.yml
---
**Mantenido por:** @PERFIL_MCP_DEVELOPER

View File

@ -1 +0,0 @@
# Configuration files directory

View File

@ -1,318 +0,0 @@
# ============================================================================
# CHUNKING-STRATEGIES.yml
# Estrategias de Chunking para Sistema RAG
# ============================================================================
# Version: 1.0.0
# Fecha: 2026-01-04
# EPIC: EPIC-013
# ============================================================================
# ----------------------------------------------------------------------------
# CONFIGURACION GLOBAL
# ----------------------------------------------------------------------------
global:
# Modelo de embeddings a usar
embedding_model: "text-embedding-ada-002"
embedding_dimensions: 1536
# Limites generales
max_chunk_size: 1500 # Caracteres maximos por chunk
min_chunk_size: 100 # Caracteres minimos (evitar chunks muy pequeños)
chunk_overlap: 200 # Overlap entre chunks consecutivos
# Separadores de chunk (en orden de prioridad)
separators:
- "\n## " # Heading nivel 2
- "\n### " # Heading nivel 3
- "\n#### " # Heading nivel 4
- "\n\n" # Parrafo
- "\n" # Linea
- ". " # Oracion
- " " # Palabra (ultimo recurso)
# ----------------------------------------------------------------------------
# ESTRATEGIAS POR TIPO DE DOCUMENTO
# ----------------------------------------------------------------------------
strategies:
# --------------------------------------------------------------------------
# DIRECTIVAS SIMCO
# --------------------------------------------------------------------------
directiva:
description: "Documentos de directivas del sistema SIMCO"
file_patterns:
- "orchestration/directivas/**/*.md"
- "**/SIMCO-*.md"
chunking:
method: "semantic" # semantic | fixed | paragraph
preserve_headings: true # Mantener jerarquia de headings en cada chunk
max_chunk_size: 1200 # Directivas son densos, chunks mas pequenos
include_frontmatter: true # Incluir frontmatter en primer chunk
metadata_extraction:
- field: "version"
pattern: "Version:\\s*([\\d.]+)"
- field: "priority"
pattern: "Prioridad:\\s*(\\w+)"
- field: "applies_to"
pattern: "Aplica a:\\s*(.+)"
heading_weights:
"RESUMEN EJECUTIVO": 1.5 # Boost para secciones importantes
"PRINCIPIO FUNDAMENTAL": 1.5
"CHECKLIST": 1.3
# --------------------------------------------------------------------------
# PERFILES DE AGENTES
# --------------------------------------------------------------------------
perfil:
description: "Perfiles de agentes del sistema NEXUS"
file_patterns:
- "orchestration/perfiles/**/*.md"
- "**/PERFIL-*.md"
chunking:
method: "semantic"
preserve_headings: true
max_chunk_size: 1000 # Perfiles necesitan precision alta
include_frontmatter: true
metadata_extraction:
- field: "agent_id"
pattern: "@(PERFIL_[A-Z_]+)"
- field: "system"
pattern: "Sistema:\\s*(\\w+)"
- field: "context_level"
pattern: "Contexto:\\s*(\\w+)"
special_sections:
- name: "DIRECTIVAS APLICABLES"
extract_as: "applicable_directives"
is_list: true
- name: "HERRAMIENTAS MCP"
extract_as: "mcp_tools"
is_list: true
# --------------------------------------------------------------------------
# TEMPLATES
# --------------------------------------------------------------------------
template:
description: "Templates y plantillas del workspace"
file_patterns:
- "**/templates/**/*"
- "**/TEMPLATE-*.md"
chunking:
method: "fixed" # Templates se dividen por tamano fijo
preserve_code_blocks: true # No cortar bloques de codigo
max_chunk_size: 2000 # Templates pueden ser mas largos
metadata_extraction:
- field: "template_type"
pattern: "Tipo:\\s*(\\w+)"
- field: "usage"
pattern: "Uso:\\s*(.+)"
special_handling:
- pattern: "```"
action: "preserve_block" # Mantener bloques de codigo intactos
# --------------------------------------------------------------------------
# CODIGO FUENTE
# --------------------------------------------------------------------------
code:
description: "Archivos de codigo fuente"
file_patterns:
- "**/*.ts"
- "**/*.tsx"
- "**/*.js"
- "**/*.jsx"
- "**/*.sql"
- "**/*.py"
chunking:
method: "ast" # Usar Abstract Syntax Tree
preserve_functions: true # No cortar funciones a la mitad
include_context: true # Incluir imports y contexto
max_chunk_size: 2500 # Codigo puede necesitar mas contexto
metadata_extraction:
- field: "language"
from: "file_extension"
- field: "exports"
pattern: "export\\s+(function|class|const|type)\\s+(\\w+)"
- field: "imports"
pattern: "import\\s+.*from\\s+['\"](.+)['\"]"
special_sections:
- type: "function"
extract_signature: true
extract_jsdoc: true
- type: "class"
extract_signature: true
include_methods: true
# --------------------------------------------------------------------------
# ESPECIFICACIONES
# --------------------------------------------------------------------------
spec:
description: "Documentos de especificacion tecnica"
file_patterns:
- "**/specs/**/*.md"
- "**/SPEC-*.md"
- "**/DDL-*.sql"
chunking:
method: "semantic"
preserve_headings: true
preserve_code_blocks: true
max_chunk_size: 1800
metadata_extraction:
- field: "spec_type"
pattern: "Tipo:\\s*(\\w+)"
- field: "version"
pattern: "Version:\\s*([\\d.]+)"
special_handling:
- pattern: "CREATE TABLE"
action: "preserve_statement"
- pattern: "CREATE FUNCTION"
action: "preserve_statement"
# --------------------------------------------------------------------------
# GUIAS Y DOCUMENTACION
# --------------------------------------------------------------------------
guide:
description: "Guias de uso y documentacion general"
file_patterns:
- "**/docs/**/*.md"
- "**/README.md"
- "**/USAGE.md"
- "**/GUIDE-*.md"
chunking:
method: "paragraph" # Por parrafos naturales
preserve_headings: true
preserve_code_blocks: true
max_chunk_size: 1500
metadata_extraction:
- field: "doc_type"
from: "filename"
- field: "project"
from: "path_segment"
segment_index: 1
# --------------------------------------------------------------------------
# EPICS Y TAREAS
# --------------------------------------------------------------------------
epic:
description: "Documentos de EPICs y planificacion"
file_patterns:
- "**/EPIC-*.md"
- "**/epics/**/*.md"
chunking:
method: "semantic"
preserve_headings: true
max_chunk_size: 1200
metadata_extraction:
- field: "epic_id"
pattern: "EPIC-(\\d+)"
- field: "status"
pattern: "Estado:\\s*(\\w+)"
- field: "priority"
pattern: "Prioridad:\\s*(\\w+)"
special_sections:
- name: "TAREAS"
extract_as: "tasks"
is_list: true
- name: "DEPENDENCIAS"
extract_as: "dependencies"
is_list: true
# --------------------------------------------------------------------------
# TRAZAS DE SESION
# --------------------------------------------------------------------------
traza:
description: "Trazas de sesiones de agentes"
file_patterns:
- "**/trazas/TRAZA-*.md"
chunking:
method: "fixed"
max_chunk_size: 2000 # Trazas son largas
preserve_code_blocks: true
metadata_extraction:
- field: "session_id"
pattern: "TRAZA-(\\d+)"
- field: "agent"
pattern: "Agente:\\s*@(\\w+)"
- field: "date"
pattern: "Fecha:\\s*([\\d-]+)"
indexing:
priority: "low" # Trazas tienen menor prioridad
retention_days: 90 # Mantener por 90 dias
# ----------------------------------------------------------------------------
# PROCESAMIENTO ESPECIAL
# ----------------------------------------------------------------------------
preprocessing:
# Limpiar antes de chunking
cleanup:
- remove_html_comments: true
- normalize_whitespace: true
- convert_tabs_to_spaces: true
# Frontmatter YAML
frontmatter:
extract: true
include_in_first_chunk: true
fields_to_index:
- "title"
- "version"
- "applicable_agents"
- "priority"
postprocessing:
# Agregar contexto a cada chunk
add_context:
- document_title: true
- heading_path: true
- document_category: true
# Validacion
validation:
- min_length: 50
- max_length: 3000
- require_content: true
# ----------------------------------------------------------------------------
# CONFIGURACION DE EMBEDDINGS
# ----------------------------------------------------------------------------
embeddings:
# Proveedor
provider: "openai"
model: "text-embedding-ada-002"
dimensions: 1536
# Batching
batch_size: 100
max_retries: 3
retry_delay_ms: 1000
# Cache
cache:
enabled: true
ttl_hours: 168 # 7 dias
storage: "postgres"
# ----------------------------------------------------------------------------
# FIN DE CONFIGURACION
# ----------------------------------------------------------------------------

View File

@ -1,359 +0,0 @@
# ============================================================================
# PATH-MAPPINGS.yml
# Mapeo de Rutas del Workspace a Categorias RAG
# ============================================================================
# Version: 1.0.0
# Fecha: 2026-01-04
# EPIC: EPIC-013
# ============================================================================
# ----------------------------------------------------------------------------
# CONFIGURACION BASE
# ----------------------------------------------------------------------------
base:
workspace_root: "/home/isem/workspace-v1"
# Categorias principales del sistema RAG
categories:
- orchestration # Sistema de orquestacion (directivas, perfiles, trazas)
- core # Componentes core (MCP servers, utilidades)
- knowledge-base # Base de conocimiento (documentacion, snippets)
- projects # Proyectos activos (gamilit, erp-core, etc)
# ----------------------------------------------------------------------------
# MAPEOS DE RUTAS
# ----------------------------------------------------------------------------
mappings:
# ==========================================================================
# ORCHESTRATION - Sistema de Orquestacion
# ==========================================================================
orchestration:
base_path: "orchestration/"
description: "Sistema NEXUS de orquestacion de agentes"
priority: "maxima"
subcategories:
# Directivas SIMCO
directivas:
paths:
- "orchestration/directivas/**/*.md"
document_type: "directiva"
applicable_agents: ["*"]
index_priority: 1
# Perfiles de agentes
perfiles:
paths:
- "orchestration/perfiles/**/*.md"
document_type: "perfil"
applicable_agents: ["*"]
index_priority: 1
# Templates de orquestacion
templates:
paths:
- "orchestration/templates/**/*"
document_type: "template"
applicable_agents: ["PERFIL_ARCHITECT", "PERFIL_DEVELOPER"]
index_priority: 2
# Trazas de sesiones
trazas:
paths:
- "orchestration/trazas/**/*.md"
document_type: "traza"
applicable_agents: ["PERFIL_ANALYST"]
index_priority: 3
retention_days: 90
# Referencias
referencias:
paths:
- "orchestration/referencias/**/*.md"
document_type: "reference"
applicable_agents: ["*"]
index_priority: 2
# EPICs
epics:
paths:
- "orchestration/epics/**/*.md"
document_type: "epic"
applicable_agents: ["PERFIL_SCRUM_MANAGER", "PERFIL_ARCHITECT"]
index_priority: 2
# ==========================================================================
# CORE - Componentes Core del Workspace
# ==========================================================================
core:
base_path: "core/"
description: "Componentes core compartidos"
priority: "alta"
subcategories:
# MCP Servers
mcp-servers:
paths:
- "core/mcp-servers/**/*.md"
- "core/mcp-servers/**/*.yml"
- "core/mcp-servers/**/*.yaml"
- "core/mcp-servers/templates/**/*"
document_type: "spec"
applicable_agents: ["PERFIL_MCP_ARCHITECT", "PERFIL_MCP_DEVELOPER"]
index_priority: 1
exclude:
- "core/mcp-servers/internal/*/node_modules/**"
- "core/mcp-servers/internal/*/.git/**"
- "core/mcp-servers/external/installed/**"
# Utilidades compartidas
utils:
paths:
- "core/utils/**/*"
document_type: "code"
applicable_agents: ["PERFIL_DEVELOPER"]
index_priority: 2
# Scripts
scripts:
paths:
- "core/scripts/**/*"
document_type: "code"
applicable_agents: ["PERFIL_DEVOPS"]
index_priority: 3
# ==========================================================================
# KNOWLEDGE-BASE - Base de Conocimiento
# ==========================================================================
knowledge-base:
base_path: "knowledge-base/"
description: "Documentacion y recursos de referencia"
priority: "alta"
subcategories:
# Documentacion tecnica
technical:
paths:
- "knowledge-base/technical/**/*.md"
document_type: "guide"
applicable_agents: ["*"]
index_priority: 2
# Snippets de codigo
snippets:
paths:
- "knowledge-base/snippets/**/*"
document_type: "code"
applicable_agents: ["PERFIL_DEVELOPER"]
index_priority: 2
# Mejores practicas
best-practices:
paths:
- "knowledge-base/best-practices/**/*.md"
document_type: "guide"
applicable_agents: ["*"]
index_priority: 2
# Patrones de diseno
patterns:
paths:
- "knowledge-base/patterns/**/*.md"
document_type: "guide"
applicable_agents: ["PERFIL_ARCHITECT", "PERFIL_DEVELOPER"]
index_priority: 2
# ==========================================================================
# PROJECTS - Proyectos Activos
# ==========================================================================
projects:
base_path: "projects/"
description: "Proyectos en desarrollo activo"
priority: "alta"
# Proyectos especificos
project_mappings:
# Gamilit - Sistema educativo
gamilit:
paths:
- "projects/gamilit/orchestration/**/*.md"
- "projects/gamilit/docs/**/*.md"
- "projects/gamilit/apps/*/README.md"
document_type: "spec"
project: "gamilit"
applicable_agents:
- "PERFIL_ARCHITECT"
- "PERFIL_BACKEND_DEVELOPER"
- "PERFIL_FRONTEND_DEVELOPER"
index_priority: 1
exclude:
- "projects/gamilit/**/node_modules/**"
- "projects/gamilit/**/dist/**"
- "projects/gamilit/**/.git/**"
# ERP Core - Sistema ERP
erp-core:
paths:
- "projects/erp-core/orchestration/**/*.md"
- "projects/erp-core/docs/**/*.md"
document_type: "spec"
project: "erp-core"
applicable_agents:
- "PERFIL_ARCHITECT"
- "PERFIL_DEVELOPER"
index_priority: 2
# Template de proyecto (para nuevos proyectos)
_template:
paths:
- "projects/*/orchestration/**/*.md"
- "projects/*/docs/**/*.md"
document_type: "spec"
index_priority: 3
# ----------------------------------------------------------------------------
# EXCLUSIONES GLOBALES
# ----------------------------------------------------------------------------
global_exclusions:
# Carpetas de dependencias
- "**/node_modules/**"
- "**/.npm/**"
- "**/vendor/**"
# Carpetas de build
- "**/dist/**"
- "**/build/**"
- "**/.next/**"
- "**/coverage/**"
# Control de versiones
- "**/.git/**"
- "**/.svn/**"
# Cache y temporales
- "**/.cache/**"
- "**/tmp/**"
- "**/.tmp/**"
- "**/temp/**"
# Logs
- "**/logs/**"
- "**/*.log"
# IDE y editores
- "**/.idea/**"
- "**/.vscode/**"
- "**/*.swp"
- "**/*.swo"
# Archivos binarios
- "**/*.png"
- "**/*.jpg"
- "**/*.jpeg"
- "**/*.gif"
- "**/*.ico"
- "**/*.pdf"
- "**/*.zip"
- "**/*.tar.gz"
# ----------------------------------------------------------------------------
# REGLAS DE DETECCION DE TIPO
# ----------------------------------------------------------------------------
type_detection:
# Por nombre de archivo
by_filename:
- pattern: "SIMCO-*.md"
type: "directiva"
- pattern: "PERFIL-*.md"
type: "perfil"
- pattern: "TEMPLATE-*.md"
type: "template"
- pattern: "EPIC-*.md"
type: "epic"
- pattern: "TRAZA-*.md"
type: "traza"
- pattern: "DDL-*.sql"
type: "spec"
- pattern: "README.md"
type: "guide"
- pattern: "*.test.ts"
type: "test"
# Por extension
by_extension:
- extension: ".md"
default_type: "guide"
- extension: ".ts"
type: "code"
- extension: ".tsx"
type: "code"
- extension: ".sql"
type: "spec"
- extension: ".yml"
type: "config"
- extension: ".yaml"
type: "config"
# ----------------------------------------------------------------------------
# RELACIONES AUTOMATICAS
# ----------------------------------------------------------------------------
auto_relations:
# Detectar referencias entre documentos
reference_patterns:
- pattern: "@(SIMCO[/_][A-Z-]+)"
relation_type: "references"
target_category: "orchestration"
- pattern: "@(PERFIL_[A-Z_]+)"
relation_type: "references"
target_category: "orchestration"
- pattern: "EPIC-(\\d+)"
relation_type: "references"
target_category: "orchestration"
- pattern: "MEJ-(\\d+)-(\\d+)"
relation_type: "implements"
target_category: "orchestration"
# Detectar imports en codigo
code_imports:
- pattern: "from ['\"](.+)['\"]"
relation_type: "imports"
resolve_path: true
# ----------------------------------------------------------------------------
# SINCRONIZACION
# ----------------------------------------------------------------------------
sync:
# Frecuencia de sincronizacion por categoria
schedules:
orchestration:
frequency: "realtime" # Sincronizar inmediatamente al cambiar
core:
frequency: "hourly" # Cada hora
knowledge-base:
frequency: "daily" # Diariamente
projects:
frequency: "on_demand" # Solo cuando se solicite
# Hooks de sincronizacion
hooks:
pre_sync:
- validate_frontmatter: true
- check_file_size: true
- max_file_size_mb: 5
post_sync:
- update_relations: true
- validate_coverage: true
- notify_if_errors: true
# ----------------------------------------------------------------------------
# FIN DE CONFIGURACION
# ----------------------------------------------------------------------------

View File

@ -1,103 +0,0 @@
# Arquitectura: MCP {NOMBRE}
**Version:** 0.1.0
**Fecha:** {FECHA}
---
## 1. Vision General
```
┌─────────────────────────────────────────────────────────┐
│ Claude / Agente │
└───────────────────────────┬─────────────────────────────┘
│ MCP Protocol
v
┌─────────────────────────────────────────────────────────┐
│ MCP Server {NOMBRE} │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Tools │ │ Services │ │ Config │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└───────────────────────────┬─────────────────────────────┘
v
┌─────────────────────────────────────────────────────────┐
│ PostgreSQL + pgvector │
└─────────────────────────────────────────────────────────┘
```
---
## 2. Componentes
### 2.1 Tools Layer
Herramientas expuestas via MCP Protocol:
| Tool | Descripcion |
|------|-------------|
| `{tool_1}` | {desc} |
| `{tool_2}` | {desc} |
### 2.2 Services Layer
Logica de negocio:
| Service | Responsabilidad |
|---------|-----------------|
| `{Service1}` | {resp} |
| `{Service2}` | {resp} |
### 2.3 Data Layer
Acceso a datos:
- PostgreSQL para almacenamiento persistente
- pgvector para busqueda semantica
---
## 3. Flujo de Datos
```
Request (Tool Call)
v
Validate Input
v
Service Logic
v
Database Query
v
Format Response
v
Response (Tool Result)
```
---
## 4. Tecnologias
| Componente | Tecnologia |
|------------|------------|
| Runtime | Node.js 18+ |
| Lenguaje | TypeScript 5+ |
| Database | PostgreSQL 15+ |
| Vector Search | pgvector |
| HTTP | Express |
---
## 5. Seguridad
- Variables sensibles en .env (no versionado)
- Validacion de entrada en cada tool
- Conexion a DB via SSL en produccion
---
**Documento generado:** {FECHA}

View File

@ -1,432 +0,0 @@
-- ============================================================================
-- DDL-RAG-SCHEMA.sql
-- Schema de Base de Datos para Sistema RAG
-- ============================================================================
-- Version: 1.0.0
-- Fecha: 2026-01-04
-- Database: PostgreSQL 15+ con extension pgvector
-- EPIC: EPIC-013
-- ============================================================================
-- ============================================================================
-- EXTENSIONES REQUERIDAS
-- ============================================================================
CREATE EXTENSION IF NOT EXISTS vector; -- Para embeddings y busqueda semantica
CREATE EXTENSION IF NOT EXISTS pg_trgm; -- Para busqueda fuzzy de texto
-- ============================================================================
-- TABLA: documents
-- ============================================================================
-- Almacena documentos indexados del workspace
CREATE TABLE IF NOT EXISTS documents (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
-- Identificacion
path TEXT NOT NULL UNIQUE, -- Ruta relativa al workspace
title TEXT NOT NULL, -- Titulo del documento
-- Clasificacion
category TEXT NOT NULL, -- orchestration, core, knowledge-base, projects
subcategory TEXT, -- directivas, perfiles, templates, etc.
document_type TEXT NOT NULL, -- directiva, perfil, template, spec, code, guide
project TEXT, -- Proyecto especifico (gamilit, erp-core, etc.)
-- Contenido
content TEXT NOT NULL, -- Contenido completo del documento
content_hash TEXT NOT NULL, -- Hash para detectar cambios
-- Metadata
applicable_agents TEXT[] DEFAULT '{}', -- Agentes que deben conocer este doc
metadata JSONB DEFAULT '{}', -- Metadata adicional flexible
frontmatter JSONB, -- Frontmatter parseado (si existe)
-- Timestamps
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW(),
-- Soft delete
is_deleted BOOLEAN DEFAULT FALSE,
deleted_at TIMESTAMPTZ
);
-- Indices para documents
CREATE INDEX idx_documents_path ON documents(path);
CREATE INDEX idx_documents_category ON documents(category);
CREATE INDEX idx_documents_type ON documents(document_type);
CREATE INDEX idx_documents_project ON documents(project);
CREATE INDEX idx_documents_agents ON documents USING GIN(applicable_agents);
CREATE INDEX idx_documents_deleted ON documents(is_deleted) WHERE is_deleted = FALSE;
-- ============================================================================
-- TABLA: document_chunks
-- ============================================================================
-- Chunks de documentos con embeddings para busqueda semantica
CREATE TABLE IF NOT EXISTS document_chunks (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
document_id UUID REFERENCES documents(id) ON DELETE CASCADE,
-- Posicion
chunk_index INTEGER NOT NULL, -- Orden del chunk en el documento
-- Contenido
content TEXT NOT NULL, -- Contenido del chunk
heading_path TEXT[] DEFAULT '{}', -- Jerarquia de headings (## Seccion > ### Subseccion)
-- Ubicacion en archivo original
line_start INTEGER, -- Linea de inicio
line_end INTEGER, -- Linea de fin
-- Embedding
embedding vector(1536), -- Vector de embedding (OpenAI ada-002)
-- Timestamps
created_at TIMESTAMPTZ DEFAULT NOW(),
-- Constraint de unicidad
UNIQUE(document_id, chunk_index)
);
-- Indice IVFFlat para busqueda por similitud coseno
-- lists = 100 es un buen balance para ~10k-100k chunks
CREATE INDEX idx_chunks_embedding ON document_chunks
USING ivfflat (embedding vector_cosine_ops)
WITH (lists = 100);
CREATE INDEX idx_chunks_document ON document_chunks(document_id);
CREATE INDEX idx_chunks_heading ON document_chunks USING GIN(heading_path);
-- ============================================================================
-- TABLA: document_relations
-- ============================================================================
-- Relaciones entre documentos (grafo de dependencias)
CREATE TABLE IF NOT EXISTS document_relations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
-- Documentos relacionados
source_document_id UUID REFERENCES documents(id) ON DELETE CASCADE,
target_document_id UUID REFERENCES documents(id) ON DELETE CASCADE,
-- Tipo de relacion
relation_type TEXT NOT NULL, -- references, extends, implements, uses, etc.
context TEXT, -- Contexto adicional de la relacion
-- Metadata
auto_detected BOOLEAN DEFAULT FALSE, -- True si fue detectado automaticamente
-- Timestamps
created_at TIMESTAMPTZ DEFAULT NOW(),
-- Constraint para evitar duplicados
UNIQUE(source_document_id, target_document_id, relation_type)
);
-- Indices para relaciones
CREATE INDEX idx_relations_source ON document_relations(source_document_id);
CREATE INDEX idx_relations_target ON document_relations(target_document_id);
CREATE INDEX idx_relations_type ON document_relations(relation_type);
-- ============================================================================
-- TABLA: code_references
-- ============================================================================
-- Referencias a codigo encontradas en documentos
CREATE TABLE IF NOT EXISTS code_references (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
document_id UUID REFERENCES documents(id) ON DELETE CASCADE,
-- Identificacion del codigo
code_path TEXT NOT NULL, -- Ruta al archivo de codigo
code_name TEXT NOT NULL, -- Nombre (funcion, clase, etc.)
code_type TEXT NOT NULL, -- function, class, interface, const, type
-- Metadata
language TEXT, -- typescript, javascript, sql, etc.
line_start INTEGER, -- Linea de inicio en codigo
line_end INTEGER, -- Linea de fin
context TEXT, -- Contexto de la referencia
-- Timestamps
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Indices para referencias de codigo
CREATE INDEX idx_code_refs_document ON code_references(document_id);
CREATE INDEX idx_code_refs_path ON code_references(code_path);
CREATE INDEX idx_code_refs_name ON code_references(code_name);
CREATE INDEX idx_code_refs_type ON code_references(code_type);
-- ============================================================================
-- TABLA: sync_log
-- ============================================================================
-- Log de sincronizacion para tracking
CREATE TABLE IF NOT EXISTS sync_log (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
-- Operacion
operation TEXT NOT NULL, -- index, update, delete, sync_category
document_path TEXT, -- Ruta del documento (si aplica)
category TEXT, -- Categoria (si aplica)
-- Resultado
status TEXT NOT NULL, -- success, error, skipped
message TEXT, -- Mensaje de resultado
chunks_processed INTEGER DEFAULT 0, -- Chunks procesados
duration_ms INTEGER, -- Duracion en milisegundos
-- Timestamps
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX idx_sync_log_created ON sync_log(created_at DESC);
CREATE INDEX idx_sync_log_status ON sync_log(status);
-- ============================================================================
-- FUNCIONES DE BUSQUEDA
-- ============================================================================
-- Busqueda semantica principal
CREATE OR REPLACE FUNCTION search_knowledge(
query_embedding vector(1536),
p_category TEXT DEFAULT NULL,
p_document_type TEXT DEFAULT NULL,
p_project TEXT DEFAULT NULL,
p_agent TEXT DEFAULT NULL,
p_threshold FLOAT DEFAULT 0.7,
p_limit INTEGER DEFAULT 10
)
RETURNS TABLE (
document_id UUID,
chunk_id UUID,
path TEXT,
title TEXT,
category TEXT,
document_type TEXT,
chunk_content TEXT,
heading_path TEXT[],
line_start INTEGER,
line_end INTEGER,
similarity FLOAT,
applicable_agents TEXT[]
)
LANGUAGE plpgsql
AS $$
BEGIN
RETURN QUERY
SELECT
d.id as document_id,
c.id as chunk_id,
d.path,
d.title,
d.category,
d.document_type,
c.content as chunk_content,
c.heading_path,
c.line_start,
c.line_end,
1 - (c.embedding <=> query_embedding) as similarity,
d.applicable_agents
FROM document_chunks c
JOIN documents d ON d.id = c.document_id
WHERE
d.is_deleted = FALSE
AND (p_category IS NULL OR d.category = p_category)
AND (p_document_type IS NULL OR d.document_type = p_document_type)
AND (p_project IS NULL OR d.project = p_project)
AND (p_agent IS NULL OR p_agent = ANY(d.applicable_agents))
AND 1 - (c.embedding <=> query_embedding) > p_threshold
ORDER BY c.embedding <=> query_embedding
LIMIT p_limit;
END;
$$;
-- Obtener documentos relacionados (recursivo)
CREATE OR REPLACE FUNCTION get_related_documents(
p_document_id UUID,
p_relation_types TEXT[] DEFAULT NULL,
p_depth INTEGER DEFAULT 1
)
RETURNS TABLE (
document_id UUID,
path TEXT,
title TEXT,
relation_type TEXT,
relation_depth INTEGER,
relation_context TEXT
)
LANGUAGE plpgsql
AS $$
BEGIN
RETURN QUERY
WITH RECURSIVE related AS (
-- Nivel 0: documento inicial
SELECT
d.id,
d.path,
d.title,
NULL::TEXT as rel_type,
0 as depth,
NULL::TEXT as context
FROM documents d
WHERE d.id = p_document_id
UNION ALL
-- Niveles siguientes
SELECT
d.id,
d.path,
d.title,
r.relation_type,
related.depth + 1,
r.context
FROM related
JOIN document_relations r ON r.source_document_id = related.id
JOIN documents d ON d.id = r.target_document_id
WHERE
related.depth < p_depth
AND d.is_deleted = FALSE
AND (p_relation_types IS NULL OR r.relation_type = ANY(p_relation_types))
)
SELECT
related.id as document_id,
related.path,
related.title,
related.rel_type as relation_type,
related.depth as relation_depth,
related.context as relation_context
FROM related
WHERE related.depth > 0
ORDER BY related.depth, related.title;
END;
$$;
-- Trazar referencia (para evitar alucinaciones)
CREATE OR REPLACE FUNCTION trace_reference(
p_query TEXT,
p_embedding vector(1536)
)
RETURNS TABLE (
source_type TEXT,
source_path TEXT,
source_title TEXT,
line_reference TEXT,
content_snippet TEXT,
confidence FLOAT,
related_documents JSONB
)
LANGUAGE plpgsql
AS $$
BEGIN
RETURN QUERY
WITH best_matches AS (
SELECT
d.id,
d.path,
d.title,
d.category as src_type,
c.line_start,
c.line_end,
c.content,
1 - (c.embedding <=> p_embedding) as sim
FROM document_chunks c
JOIN documents d ON d.id = c.document_id
WHERE
d.is_deleted = FALSE
AND 1 - (c.embedding <=> p_embedding) > 0.75
ORDER BY c.embedding <=> p_embedding
LIMIT 5
)
SELECT
bm.src_type as source_type,
bm.path as source_path,
bm.title as source_title,
bm.path || ':' || bm.line_start || '-' || bm.line_end as line_reference,
LEFT(bm.content, 500) as content_snippet,
bm.sim as confidence,
(
SELECT jsonb_agg(jsonb_build_object(
'path', d.path,
'title', d.title,
'relation', r.relation_type
))
FROM document_relations r
JOIN documents d ON d.id = r.target_document_id
WHERE r.source_document_id = bm.id
LIMIT 5
) as related_documents
FROM best_matches bm;
END;
$$;
-- ============================================================================
-- TRIGGERS
-- ============================================================================
-- Actualizar updated_at automaticamente
CREATE OR REPLACE FUNCTION update_updated_at()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER trigger_documents_updated_at
BEFORE UPDATE ON documents
FOR EACH ROW
EXECUTE FUNCTION update_updated_at();
-- ============================================================================
-- VISTAS UTILES
-- ============================================================================
-- Vista de documentos con estadisticas
CREATE OR REPLACE VIEW v_document_stats AS
SELECT
d.id,
d.path,
d.title,
d.category,
d.document_type,
d.project,
COUNT(c.id) as chunk_count,
d.created_at,
d.updated_at
FROM documents d
LEFT JOIN document_chunks c ON c.document_id = d.id
WHERE d.is_deleted = FALSE
GROUP BY d.id;
-- Vista de estado de sincronizacion por categoria
CREATE OR REPLACE VIEW v_sync_status AS
SELECT
category,
COUNT(*) as total_documents,
MAX(updated_at) as last_updated,
COUNT(CASE WHEN updated_at < NOW() - INTERVAL '1 hour' THEN 1 END) as stale_count
FROM documents
WHERE is_deleted = FALSE
GROUP BY category;
-- ============================================================================
-- COMENTARIOS
-- ============================================================================
COMMENT ON TABLE documents IS 'Documentos indexados del workspace para busqueda RAG';
COMMENT ON TABLE document_chunks IS 'Chunks de documentos con embeddings para busqueda semantica';
COMMENT ON TABLE document_relations IS 'Grafo de relaciones entre documentos';
COMMENT ON TABLE code_references IS 'Referencias a codigo encontradas en documentos';
COMMENT ON TABLE sync_log IS 'Log de operaciones de sincronizacion';
COMMENT ON FUNCTION search_knowledge IS 'Busqueda semantica principal con filtros';
COMMENT ON FUNCTION get_related_documents IS 'Obtiene grafo de documentos relacionados recursivamente';
COMMENT ON FUNCTION trace_reference IS 'Verifica origen de informacion para evitar alucinaciones';
-- ============================================================================
-- FIN DEL SCHEMA
-- ============================================================================

View File

@ -1,687 +0,0 @@
# MCP-TOOLS-SPEC: Especificación de Herramientas RAG
**Version:** 1.0.0
**Fecha:** 2026-01-04
**MCP Server:** mcp-rag-knowledge
**EPIC:** EPIC-013
---
## RESUMEN
Este documento especifica las 12 herramientas MCP del sistema RAG para consulta y gestión del conocimiento del workspace.
---
## HERRAMIENTAS DE CONSULTA SEMÁNTICA
### 1. rag_query_context
**Descripción:** Busqueda semántica principal sobre el conocimiento del workspace.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| query | string | Sí | Pregunta o consulta en lenguaje natural |
| category | string | No | Filtrar por categoría (orchestration, core, knowledge-base, projects) |
| document_type | string | No | Filtrar por tipo (directiva, perfil, template, code, spec, guide) |
| project | string | No | Filtrar por proyecto específico |
| agent | string | No | Filtrar documentos aplicables a un agente específico |
| threshold | float | No | Umbral mínimo de similitud (default: 0.7) |
| limit | integer | No | Máximo de resultados (default: 10) |
**Retorno:**
```typescript
interface QueryResult {
results: Array<{
document_id: string;
chunk_id: string;
path: string;
title: string;
category: string;
document_type: string;
content: string;
heading_path: string[];
line_start: number;
line_end: number;
similarity: number;
applicable_agents: string[];
}>;
query_time_ms: number;
total_matches: number;
}
```
**Ejemplo:**
```typescript
const result = await rag_query_context({
query: "¿Cómo se debe documentar un cambio según SIMCO?",
category: "orchestration",
threshold: 0.75,
limit: 5
});
// Resultado esperado:
// {
// results: [{
// path: "orchestration/directivas/simco/SIMCO-DOCUMENTAR.md",
// title: "SIMCO-DOCUMENTAR",
// similarity: 0.89,
// content: "## Proceso de Documentación...",
// line_start: 45,
// line_end: 78
// }],
// query_time_ms: 120,
// total_matches: 3
// }
```
**Errores Comunes:**
| Código | Mensaje | Solución |
|--------|---------|----------|
| 400 | "Query too short" | Proporcionar query de al menos 3 palabras |
| 404 | "No results found" | Reducir threshold o generalizar query |
| 503 | "Embedding service unavailable" | Reintentar después de unos segundos |
---
### 2. rag_get_directive
**Descripción:** Obtiene una directiva SIMCO específica por su identificador.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| directive_id | string | Sí | Identificador de la directiva (ej: "SIMCO-TAREA") |
| include_relations | boolean | No | Incluir documentos relacionados (default: false) |
**Retorno:**
```typescript
interface DirectiveResult {
found: boolean;
directive: {
id: string;
path: string;
title: string;
version: string;
priority: string;
applies_to: string;
content: string;
sections: Array<{
heading: string;
content: string;
line_start: number;
line_end: number;
}>;
checklist: string[];
};
relations?: Array<{
path: string;
title: string;
relation_type: string;
}>;
}
```
**Ejemplo:**
```typescript
const directive = await rag_get_directive({
directive_id: "SIMCO-RAG",
include_relations: true
});
```
---
### 3. rag_get_agent_profile
**Descripción:** Carga el perfil completo de un agente para inicialización.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| agent_id | string | Sí | Identificador del agente (ej: "PERFIL_BACKEND_DEVELOPER") |
| include_directives | boolean | No | Incluir directivas aplicables (default: true) |
| include_tools | boolean | No | Incluir herramientas MCP disponibles (default: true) |
**Retorno:**
```typescript
interface AgentProfileResult {
found: boolean;
profile: {
id: string;
name: string;
system: string;
context_level: string;
responsibilities: string[];
applicable_directives: string[];
mcp_tools: string[];
constraints: string[];
full_content: string;
};
directives?: DirectiveResult[];
tools?: ToolSpec[];
}
```
**Ejemplo:**
```typescript
const profile = await rag_get_agent_profile({
agent_id: "PERFIL_MCP_DEVELOPER",
include_directives: true,
include_tools: true
});
```
---
## HERRAMIENTAS DE TRAZABILIDAD
### 4. rag_trace_reference
**Descripción:** Verifica el origen de una afirmación para prevenir alucinaciones.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| claim | string | Sí | Afirmación a verificar |
| context | string | No | Contexto adicional para la búsqueda |
| min_confidence | float | No | Confianza mínima requerida (default: 0.75) |
**Retorno:**
```typescript
interface TraceResult {
verified: boolean;
sources: Array<{
source_type: string;
source_path: string;
source_title: string;
line_reference: string; // formato: "path:line_start-line_end"
content_snippet: string;
confidence: number;
related_documents: Array<{
path: string;
title: string;
relation: string;
}>;
}>;
recommendation: "cite" | "verify" | "cannot_confirm";
}
```
**Ejemplo:**
```typescript
const trace = await rag_trace_reference({
claim: "Las directivas SIMCO son obligatorias para todos los agentes",
min_confidence: 0.8
});
// Si verified = true, usar las fuentes para citar
// Si verified = false, indicar que no se puede confirmar
```
---
### 5. rag_get_relations
**Descripción:** Obtiene el grafo de relaciones de un documento.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| document_path | string | Sí | Ruta del documento |
| relation_types | string[] | No | Filtrar por tipos de relación |
| depth | integer | No | Profundidad de recursión (default: 1, max: 3) |
| direction | string | No | "outgoing" \| "incoming" \| "both" (default: "both") |
**Retorno:**
```typescript
interface RelationsResult {
document: {
id: string;
path: string;
title: string;
};
relations: Array<{
document_id: string;
path: string;
title: string;
relation_type: string;
relation_depth: number;
direction: "outgoing" | "incoming";
context: string;
}>;
graph_summary: {
total_relations: number;
by_type: Record<string, number>;
max_depth_reached: number;
};
}
```
**Tipos de Relación:**
| Tipo | Descripción |
|------|-------------|
| references | Documento A menciona/cita a documento B |
| extends | Documento A extiende/amplía documento B |
| implements | Documento A implementa especificación B |
| uses | Documento A usa/depende de documento B |
| supersedes | Documento A reemplaza documento B |
---
### 6. rag_find_code
**Descripción:** Busca referencias de código en el workspace.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| name | string | No | Nombre de función/clase/tipo a buscar |
| code_type | string | No | Tipo: function, class, interface, const, type |
| language | string | No | Lenguaje: typescript, javascript, sql, python |
| path_pattern | string | No | Patrón glob para filtrar rutas |
| include_context | boolean | No | Incluir código circundante (default: true) |
**Retorno:**
```typescript
interface CodeSearchResult {
matches: Array<{
path: string;
name: string;
code_type: string;
language: string;
line_start: number;
line_end: number;
signature: string;
documentation: string;
code_snippet: string;
related_documents: string[]; // Documentos que referencian este código
}>;
total_matches: number;
}
```
**Ejemplo:**
```typescript
const code = await rag_find_code({
name: "validateParams",
code_type: "function",
language: "typescript"
});
```
---
### 7. rag_explain_impact
**Descripción:** Analiza el impacto de modificar un documento.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| document_path | string | Sí | Ruta del documento a analizar |
| change_type | string | Sí | "create" \| "modify" \| "delete" |
| affected_sections | string[] | No | Secciones específicas afectadas |
**Retorno:**
```typescript
interface ImpactAnalysis {
document: {
path: string;
title: string;
category: string;
document_type: string;
};
impact: {
direct_dependents: Array<{
path: string;
title: string;
relation_type: string;
impact_level: "high" | "medium" | "low";
}>;
indirect_dependents: Array<{
path: string;
title: string;
distance: number;
impact_level: "high" | "medium" | "low";
}>;
agents_affected: string[];
risk_level: "critical" | "high" | "medium" | "low";
propagation_order: string[]; // Orden sugerido para actualizar
};
recommendations: string[];
}
```
**Ejemplo:**
```typescript
const impact = await rag_explain_impact({
document_path: "orchestration/directivas/simco/SIMCO-TAREA.md",
change_type: "modify",
affected_sections: ["PRINCIPIO FUNDAMENTAL"]
});
// Antes de hacer cambios significativos, revisar:
// - impact.risk_level
// - impact.agents_affected
// - impact.propagation_order
```
---
## HERRAMIENTAS DE INDEXACIÓN
### 8. rag_index_document
**Descripción:** Indexa o re-indexa un documento en el sistema RAG.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| path | string | Sí | Ruta del documento a indexar |
| force | boolean | No | Forzar re-indexación aunque no haya cambios (default: false) |
| extract_relations | boolean | No | Detectar y crear relaciones automáticamente (default: true) |
**Retorno:**
```typescript
interface IndexResult {
success: boolean;
document: {
id: string;
path: string;
title: string;
category: string;
document_type: string;
};
indexing: {
chunks_created: number;
relations_detected: number;
code_references_found: number;
processing_time_ms: number;
};
status: "created" | "updated" | "unchanged" | "error";
error?: string;
}
```
**Ejemplo:**
```typescript
// Después de crear o modificar un documento
const result = await rag_index_document({
path: "orchestration/directivas/simco/SIMCO-NUEVA.md",
extract_relations: true
});
if (result.success) {
console.log(`Indexado: ${result.indexing.chunks_created} chunks`);
} else {
console.error(`Error: ${result.error}`);
}
```
---
### 9. rag_sync_category
**Descripción:** Sincroniza todos los documentos de una categoría.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| category | string | Sí | Categoría a sincronizar |
| subcategory | string | No | Subcategoría específica |
| force | boolean | No | Forzar re-indexación completa (default: false) |
| dry_run | boolean | No | Solo simular, no hacer cambios (default: false) |
**Retorno:**
```typescript
interface SyncResult {
category: string;
subcategory?: string;
summary: {
total_files: number;
indexed: number;
updated: number;
unchanged: number;
deleted: number;
errors: number;
};
details: Array<{
path: string;
status: "indexed" | "updated" | "unchanged" | "deleted" | "error";
chunks: number;
error?: string;
}>;
duration_ms: number;
}
```
**Ejemplo:**
```typescript
// Sincronizar todas las directivas
const sync = await rag_sync_category({
category: "orchestration",
subcategory: "directivas",
dry_run: false
});
console.log(`Sincronizado: ${sync.summary.indexed} nuevos, ${sync.summary.updated} actualizados`);
```
---
### 10. rag_get_sync_status
**Descripción:** Obtiene el estado de sincronización del sistema.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| category | string | No | Filtrar por categoría |
| include_stale | boolean | No | Incluir documentos desactualizados (default: true) |
**Retorno:**
```typescript
interface SyncStatus {
overall: {
total_documents: number;
total_chunks: number;
last_sync: string; // ISO timestamp
health: "healthy" | "degraded" | "unhealthy";
};
by_category: Array<{
category: string;
total_documents: number;
last_updated: string;
stale_count: number;
stale_documents?: string[];
}>;
pending_sync: Array<{
path: string;
reason: "new" | "modified" | "deleted";
detected_at: string;
}>;
}
```
---
## HERRAMIENTAS DE VALIDACIÓN
### 11. rag_validate_coverage
**Descripción:** Verifica la cobertura de indexación del workspace.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| category | string | No | Categoría a validar (todas si no se especifica) |
| report_missing | boolean | No | Incluir lista de archivos no indexados (default: true) |
**Retorno:**
```typescript
interface CoverageReport {
summary: {
total_files_expected: number;
total_files_indexed: number;
coverage_percentage: number;
health: "complete" | "partial" | "incomplete";
};
by_category: Array<{
category: string;
expected: number;
indexed: number;
coverage: number;
}>;
missing: Array<{
path: string;
category: string;
reason: "not_indexed" | "outdated" | "excluded";
}>;
recommendations: string[];
}
```
**Ejemplo:**
```typescript
const coverage = await rag_validate_coverage({
category: "orchestration",
report_missing: true
});
if (coverage.summary.coverage_percentage < 100) {
console.log("Documentos faltantes:", coverage.missing);
}
```
---
### 12. rag_report_feedback
**Descripción:** Reporta problemas de calidad en el sistema RAG.
**Parámetros:**
| Nombre | Tipo | Requerido | Descripción |
|--------|------|-----------|-------------|
| feedback_type | string | Sí | "missing_info" \| "incorrect_info" \| "outdated" \| "low_relevance" |
| query | string | Sí | Query que generó el problema |
| context | string | No | Contexto adicional del problema |
| document_path | string | No | Documento específico afectado |
| expected_result | string | No | Qué se esperaba encontrar |
**Retorno:**
```typescript
interface FeedbackResult {
feedback_id: string;
received: boolean;
suggested_actions: Array<{
action: string;
priority: "high" | "medium" | "low";
automated: boolean;
}>;
}
```
**Ejemplo:**
```typescript
// Cuando una búsqueda no encuentra lo esperado
const feedback = await rag_report_feedback({
feedback_type: "missing_info",
query: "¿Cómo configurar hooks en NEXUS?",
expected_result: "Debería encontrar SIMCO-HOOKS pero no está indexado",
document_path: "orchestration/directivas/simco/SIMCO-HOOKS.md"
});
```
---
## SCHEMAS JSON PARA REGISTRO MCP
```typescript
// schemas/tools.ts
export const toolSchemas = {
rag_query_context: {
name: "rag_query_context",
description: "Búsqueda semántica en el conocimiento del workspace",
parameters: {
type: "object",
properties: {
query: { type: "string", description: "Consulta en lenguaje natural" },
category: { type: "string", enum: ["orchestration", "core", "knowledge-base", "projects"] },
document_type: { type: "string", enum: ["directiva", "perfil", "template", "code", "spec", "guide"] },
project: { type: "string" },
agent: { type: "string" },
threshold: { type: "number", default: 0.7 },
limit: { type: "integer", default: 10 }
},
required: ["query"]
}
},
// ... resto de schemas
};
```
---
## NOTAS DE IMPLEMENTACIÓN
### Manejo de Errores
Todas las herramientas deben manejar:
1. **Errores de conexión:** Reintentar con backoff exponencial
2. **Errores de embedding:** Cachear embeddings para evitar recálculos
3. **Documentos no encontrados:** Retornar resultado vacío, no error
### Rate Limiting
- Embeddings: Máximo 100 requests/minuto a OpenAI
- Queries: Sin límite interno (depende de PostgreSQL)
- Sync: Máximo 1 sync completo por minuto
### Caché
- Embeddings: Cache de 7 días en PostgreSQL
- Queries: Cache de 5 minutos para queries idénticos
- Perfiles: Cache en memoria durante sesión
---
**Version:** 1.0.0 | **EPIC:** EPIC-013 | **Sistema:** SIMCO

View File

@ -1,83 +0,0 @@
# CONTEXTO-PROYECTO: MCP {NOMBRE}
**Version:** 0.1.0
**Fecha:** {FECHA}
**Sistema:** NEXUS v3.4 + SIMCO
---
## IDENTIFICACION
```yaml
proyecto: "mcp-{nombre}"
tipo: "mcp-server-interno"
estado: "development"
prioridad: "{alta|maxima}"
ubicacion:
workspace: "/home/isem/workspace-v1"
proyecto: "core/mcp-servers/internal/{nombre}"
repositorio: "git@gitea-server:rckrdmrd/mcp-{nombre}.git"
stack:
runtime: "Node.js >= 18"
lenguaje: "TypeScript"
database: "PostgreSQL + pgvector"
```
---
## PROPOSITO
{DESCRIPCION_DETALLADA_DEL_PROPOSITO}
---
## HERRAMIENTAS MCP
| Herramienta | Descripcion | Estado |
|-------------|-------------|--------|
| `{tool_1}` | {descripcion} | planned |
| `{tool_2}` | {descripcion} | planned |
---
## DEPENDENCIAS
### Externas
- PostgreSQL >= 15 con extension pgvector
- OpenAI API (para embeddings)
### Del Workspace
- Acceso a documentacion en orchestration/
- Acceso a knowledge-base/
---
## DIRECTIVAS APLICABLES
```yaml
siempre:
- @SIMCO_MCP
- @PRINCIPIO_CAPVED
- @PRINCIPIO_DOC_PRIMERO
operaciones:
crear_herramienta: [@SIMCO_CREAR]
modificar: [@SIMCO_MODIFICAR]
validar: [@SIMCO_VALIDAR]
```
---
## PERFILES RELACIONADOS
| Perfil | Responsabilidad |
|--------|-----------------|
| @PERFIL_MCP_DEVELOPER | Desarrollo de este MCP |
| @PERFIL_RAG_ENGINEER | Integracion con RAG |
| @PERFIL_MCP_ARCHITECT | Diseno y arquitectura |
---
**Contexto generado:** {FECHA}

View File

@ -1,50 +0,0 @@
{
"name": "mcp-{nombre}",
"version": "0.1.0",
"description": "{DESCRIPCION}",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "ts-node-dev --respawn src/index.ts",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"lint": "eslint src/**/*.ts",
"lint:fix": "eslint src/**/*.ts --fix",
"typecheck": "tsc --noEmit",
"health-check": "curl -s http://localhost:${PORT:-3100}/health || echo 'Server not running'"
},
"keywords": [
"mcp",
"model-context-protocol",
"anthropic",
"claude"
],
"author": "workspace-v1",
"license": "MIT",
"dependencies": {
"@anthropic-ai/sdk": "^0.25.0",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"pg": "^8.11.3",
"pgvector": "^0.1.8"
},
"devDependencies": {
"@types/express": "^4.17.21",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.0",
"@types/pg": "^8.10.9",
"@typescript-eslint/eslint-plugin": "^6.13.0",
"@typescript-eslint/parser": "^6.13.0",
"eslint": "^8.54.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"ts-node-dev": "^2.0.0",
"typescript": "^5.3.0"
},
"engines": {
"node": ">=18.0.0"
}
}

View File

@ -1,61 +0,0 @@
/**
* MCP Server: {NOMBRE}
*
* {DESCRIPCION}
*
* @version 0.1.0
*/
import express from 'express';
import dotenv from 'dotenv';
// Load environment variables
dotenv.config();
const app = express();
const PORT = process.env.PORT || 3100;
// Middleware
app.use(express.json());
// Health check endpoint
app.get('/health', (req, res) => {
res.json({
status: 'ok',
service: 'mcp-{nombre}',
version: '0.1.0',
timestamp: new Date().toISOString(),
});
});
// MCP Tools endpoint
app.post('/tools/:toolName', async (req, res) => {
const { toolName } = req.params;
const { parameters } = req.body;
try {
// TODO: Implement tool routing
const result = await handleTool(toolName, parameters);
res.json({ success: true, result });
} catch (error) {
res.status(500).json({
success: false,
error: error instanceof Error ? error.message : 'Unknown error',
});
}
});
// Tool handler
async function handleTool(toolName: string, parameters: unknown): Promise<unknown> {
switch (toolName) {
// TODO: Add tool cases
default:
throw new Error(`Unknown tool: ${toolName}`);
}
}
// Start server
app.listen(PORT, () => {
console.log(`MCP Server {nombre} running on port ${PORT}`);
console.log(`Health check: http://localhost:${PORT}/health`);
});

View File

@ -1 +0,0 @@
# Tests directory

View File

@ -1,6 +1,6 @@
# Auth - Core Module # Auth - Core Module
**Modulo:** shared/modules/auth/ **Modulo:** core/modules/auth/
**Version:** 0.1.0 **Version:** 0.1.0
**Fecha:** 2026-01-03 **Fecha:** 2026-01-03
**Owner:** Backend-Agent **Owner:** Backend-Agent
@ -10,7 +10,7 @@
## Descripcion ## Descripcion
Modulo de autenticacion compartido que provee guards, decorators y utilidades JWT para proyectos NestJS. Complementa el catalogo `shared/catalog/auth/` con codigo listo para importar. Modulo de autenticacion compartido que provee guards, decorators y utilidades JWT para proyectos NestJS. Complementa el catalogo `core/catalog/auth/` con codigo listo para importar.
--- ---
@ -29,7 +29,7 @@ npm install -D @types/passport-jwt @types/bcrypt
{ {
"compilerOptions": { "compilerOptions": {
"paths": { "paths": {
"@shared/modules/*": ["../../shared/modules/*"] "@core/modules/*": ["../../core/modules/*"]
} }
} }
} }
@ -70,7 +70,7 @@ npm install -D @types/passport-jwt @types/bcrypt
### Ejemplo 1: Proteger Controller ### Ejemplo 1: Proteger Controller
```typescript ```typescript
import { JwtAuthGuard, CurrentUser, Roles } from '@shared/modules/auth'; import { JwtAuthGuard, CurrentUser, Roles } from '@core/modules/auth';
@Controller('users') @Controller('users')
@UseGuards(JwtAuthGuard) @UseGuards(JwtAuthGuard)
@ -92,7 +92,7 @@ export class UsersController {
### Ejemplo 2: Hash de Password ### Ejemplo 2: Hash de Password
```typescript ```typescript
import { PasswordService } from '@shared/modules/auth'; import { PasswordService } from '@core/modules/auth';
const passwordService = new PasswordService(); const passwordService = new PasswordService();
@ -111,7 +111,7 @@ const isValid = await passwordService.verify('myPassword123', hash);
| Modulo | Uso | | Modulo | Uso |
|--------|-----| |--------|-----|
| `@shared/modules/utils` | Validaciones | | `@core/modules/utils` | Validaciones |
### Externas (npm) ### Externas (npm)
@ -126,9 +126,9 @@ const isValid = await passwordService.verify('myPassword123', hash);
## Relacion con Catalogo ## Relacion con Catalogo
Este modulo (`shared/modules/auth/`) provee **codigo importable**. Este modulo (`core/modules/auth/`) provee **codigo importable**.
El catalogo (`shared/catalog/auth/`) provee **documentacion y referencia** para implementaciones completas. El catalogo (`core/catalog/auth/`) provee **documentacion y referencia** para implementaciones completas.
```yaml ```yaml
Usar modules/auth cuando: Usar modules/auth cuando:
@ -168,4 +168,4 @@ Usar catalog/auth cuando:
--- ---
**Modulo:** shared/modules/auth/ | **Owner:** Backend-Agent | **Estado:** desarrollo **Modulo:** core/modules/auth/ | **Owner:** Backend-Agent | **Estado:** desarrollo

View File

@ -1,6 +1,6 @@
# Billing - Core Module # Billing - Core Module
**Modulo:** shared/modules/billing/ **Modulo:** core/modules/billing/
**Version:** 0.1.0 **Version:** 0.1.0
**Fecha:** 2026-01-03 **Fecha:** 2026-01-03
**Owner:** Backend-Agent **Owner:** Backend-Agent
@ -29,7 +29,7 @@ npm install stripe
{ {
"compilerOptions": { "compilerOptions": {
"paths": { "paths": {
"@shared/modules/*": ["../../shared/modules/*"] "@core/modules/*": ["../../core/modules/*"]
} }
} }
} }
@ -97,7 +97,7 @@ interface UsageRecord {
### Ejemplo 1: Verificar Cuota ### Ejemplo 1: Verificar Cuota
```typescript ```typescript
import { QuotaService } from '@shared/modules/billing'; import { QuotaService } from '@core/modules/billing';
@Injectable() @Injectable()
export class ProjectService { export class ProjectService {
@ -125,7 +125,7 @@ export class ProjectService {
### Ejemplo 2: Obtener Plan Actual ### Ejemplo 2: Obtener Plan Actual
```typescript ```typescript
import { PlanService, UsageService } from '@shared/modules/billing'; import { PlanService, UsageService } from '@core/modules/billing';
@Controller('billing') @Controller('billing')
export class BillingController { export class BillingController {
@ -158,8 +158,8 @@ export class BillingController {
| Modulo | Uso | | Modulo | Uso |
|--------|-----| |--------|-----|
| `@shared/modules/payments` | Transacciones | | `@core/modules/payments` | Transacciones |
| `@shared/modules/utils` | Formateo | | `@core/modules/utils` | Formateo |
### Externas (npm) ### Externas (npm)
@ -191,4 +191,4 @@ export class BillingController {
--- ---
**Modulo:** shared/modules/billing/ | **Owner:** Backend-Agent **Modulo:** core/modules/billing/ | **Owner:** Backend-Agent

View File

@ -1,6 +1,6 @@
# Multitenant - Core Module # Multitenant - Core Module
**Modulo:** shared/modules/multitenant/ **Modulo:** core/modules/multitenant/
**Version:** 0.1.0 **Version:** 0.1.0
**Fecha:** 2026-01-03 **Fecha:** 2026-01-03
**Owner:** Backend-Agent **Owner:** Backend-Agent
@ -29,7 +29,7 @@ npm install typeorm pg
{ {
"compilerOptions": { "compilerOptions": {
"paths": { "paths": {
"@shared/modules/*": ["../../shared/modules/*"] "@core/modules/*": ["../../core/modules/*"]
} }
} }
} }
@ -99,7 +99,7 @@ interface TenantContext {
### Ejemplo 1: Entity con RLS ### Ejemplo 1: Entity con RLS
```typescript ```typescript
import { TenantAware } from '@shared/modules/multitenant'; import { TenantAware } from '@core/modules/multitenant';
@Entity('projects') @Entity('projects')
@TenantAware() @TenantAware()
@ -118,7 +118,7 @@ export class Project {
### Ejemplo 2: Acceder al Tenant Actual ### Ejemplo 2: Acceder al Tenant Actual
```typescript ```typescript
import { CurrentTenant, TenantGuard } from '@shared/modules/multitenant'; import { CurrentTenant, TenantGuard } from '@core/modules/multitenant';
@Controller('projects') @Controller('projects')
@UseGuards(TenantGuard) @UseGuards(TenantGuard)
@ -155,7 +155,7 @@ SET app.current_tenant_id = 'uuid-del-tenant';
| Modulo | Uso | | Modulo | Uso |
|--------|-----| |--------|-----|
| `@shared/modules/auth` | JWT, user context | | `@core/modules/auth` | JWT, user context |
### Externas (npm) ### Externas (npm)
@ -213,4 +213,4 @@ CREATE POLICY tenant_isolation ON {schema}.{table}
--- ---
**Modulo:** shared/modules/multitenant/ | **Owner:** Backend-Agent **Modulo:** core/modules/multitenant/ | **Owner:** Backend-Agent

View File

@ -1,6 +1,6 @@
# Notifications - Core Module # Notifications - Core Module
**Modulo:** shared/modules/notifications/ **Modulo:** core/modules/notifications/
**Version:** 0.1.0 **Version:** 0.1.0
**Fecha:** 2026-01-03 **Fecha:** 2026-01-03
**Owner:** Backend-Agent **Owner:** Backend-Agent
@ -31,7 +31,7 @@ npm install firebase-admin
{ {
"compilerOptions": { "compilerOptions": {
"paths": { "paths": {
"@shared/modules/*": ["../../shared/modules/*"] "@core/modules/*": ["../../core/modules/*"]
} }
} }
} }
@ -82,7 +82,7 @@ interface NotificationPreferences {
### Ejemplo 1: Enviar Notificacion ### Ejemplo 1: Enviar Notificacion
```typescript ```typescript
import { NotificationService } from '@shared/modules/notifications'; import { NotificationService } from '@core/modules/notifications';
@Injectable() @Injectable()
export class OrderService { export class OrderService {
@ -123,7 +123,7 @@ await this.notifications.sendMulti({
| Modulo | Uso | | Modulo | Uso |
|--------|-----| |--------|-----|
| `@shared/modules/utils` | Formateo, validaciones | | `@core/modules/utils` | Formateo, validaciones |
### Externas (npm) ### Externas (npm)
@ -168,4 +168,4 @@ await this.notifications.sendMulti({
--- ---
**Modulo:** shared/modules/notifications/ | **Owner:** Backend-Agent **Modulo:** core/modules/notifications/ | **Owner:** Backend-Agent

View File

@ -1,5 +1,5 @@
{ {
"name": "@shared/modules", "name": "@core/modules",
"version": "1.0.0", "version": "1.0.0",
"description": "Core modules compartidos para todos los proyectos del workspace", "description": "Core modules compartidos para todos los proyectos del workspace",
"main": "index.ts", "main": "index.ts",

View File

@ -1,6 +1,6 @@
# Payments - Core Module # Payments - Core Module
**Modulo:** shared/modules/payments/ **Modulo:** core/modules/payments/
**Version:** 0.1.0 **Version:** 0.1.0
**Fecha:** 2026-01-03 **Fecha:** 2026-01-03
**Owner:** Backend-Agent **Owner:** Backend-Agent
@ -31,7 +31,7 @@ npm install mercadopago
{ {
"compilerOptions": { "compilerOptions": {
"paths": { "paths": {
"@shared/modules/*": ["../../shared/modules/*"] "@core/modules/*": ["../../core/modules/*"]
} }
} }
} }
@ -90,7 +90,7 @@ interface CheckoutSession {
### Ejemplo 1: Crear Checkout Session ### Ejemplo 1: Crear Checkout Session
```typescript ```typescript
import { PaymentService } from '@shared/modules/payments'; import { PaymentService } from '@core/modules/payments';
@Injectable() @Injectable()
export class CheckoutService { export class CheckoutService {
@ -116,7 +116,7 @@ export class CheckoutService {
### Ejemplo 2: Procesar Webhook ### Ejemplo 2: Procesar Webhook
```typescript ```typescript
import { WebhookService } from '@shared/modules/payments'; import { WebhookService } from '@core/modules/payments';
@Controller('webhooks') @Controller('webhooks')
export class WebhookController { export class WebhookController {
@ -151,7 +151,7 @@ export class WebhookController {
| Modulo | Uso | | Modulo | Uso |
|--------|-----| |--------|-----|
| `@shared/modules/utils` | Formateo moneda | | `@core/modules/utils` | Formateo moneda |
### Externas (npm) ### Externas (npm)
@ -195,4 +195,4 @@ export class WebhookController {
--- ---
**Modulo:** shared/modules/payments/ | **Owner:** Backend-Agent **Modulo:** core/modules/payments/ | **Owner:** Backend-Agent

View File

@ -1,6 +1,6 @@
# Utils - Core Module # Utils - Core Module
**Modulo:** shared/modules/utils/ **Modulo:** core/modules/utils/
**Version:** 1.0.0 **Version:** 1.0.0
**Fecha:** 2026-01-03 **Fecha:** 2026-01-03
**Owner:** Tech-Leader **Owner:** Tech-Leader
@ -28,7 +28,7 @@ Agregar en `tsconfig.json` del proyecto consumidor:
{ {
"compilerOptions": { "compilerOptions": {
"paths": { "paths": {
"@shared/modules/*": ["../../shared/modules/*"] "@core/modules/*": ["../../core/modules/*"]
} }
} }
} }
@ -141,7 +141,7 @@ Agregar en `tsconfig.json` del proyecto consumidor:
### Ejemplo 1: Formateo de Fechas ### Ejemplo 1: Formateo de Fechas
```typescript ```typescript
import { formatDate, addDays, isPast, getRelativeTime } from '@shared/modules/utils'; import { formatDate, addDays, isPast, getRelativeTime } from '@core/modules/utils';
// Formatear fecha // Formatear fecha
const fecha = new Date(); const fecha = new Date();
@ -160,7 +160,7 @@ console.log(getRelativeTime(ayer)); // "1 day ago"
### Ejemplo 2: Manipulacion de Strings ### Ejemplo 2: Manipulacion de Strings
```typescript ```typescript
import { slugify, capitalize, maskEmail, formatCurrency } from '@shared/modules/utils'; import { slugify, capitalize, maskEmail, formatCurrency } from '@core/modules/utils';
// Generar slug // Generar slug
const slug = slugify('Hello World 2026!'); // "hello-world-2026" const slug = slugify('Hello World 2026!'); // "hello-world-2026"
@ -179,7 +179,7 @@ const precioMXN = formatCurrency(1234.50, 'MXN', 'es-MX'); // "$1,234.50"
### Ejemplo 3: Validaciones ### Ejemplo 3: Validaciones
```typescript ```typescript
import { isEmail, isStrongPassword, hasRequiredFields, createValidator } from '@shared/modules/utils'; import { isEmail, isStrongPassword, hasRequiredFields, createValidator } from '@core/modules/utils';
// Validaciones simples // Validaciones simples
console.log(isEmail('test@example.com')); // true console.log(isEmail('test@example.com')); // true
@ -225,7 +225,7 @@ Ninguna. Solo usa APIs nativas de JavaScript.
## Estructura de Archivos ## Estructura de Archivos
``` ```
shared/modules/utils/ core/modules/utils/
+-- index.ts # Punto de entrada, re-exporta todo +-- index.ts # Punto de entrada, re-exporta todo
+-- date.util.ts # 25 funciones de fecha +-- date.util.ts # 25 funciones de fecha
+-- string.util.ts # 30 funciones de string +-- string.util.ts # 30 funciones de string
@ -282,4 +282,4 @@ shared/modules/utils/
--- ---
**Modulo:** shared/modules/utils/ | **Owner:** Tech-Leader | **90 funciones** **Modulo:** core/modules/utils/ | **Owner:** Tech-Leader | **90 funciones**

View File

@ -4,7 +4,7 @@
* Framework-agnostic date manipulation and formatting functions. * Framework-agnostic date manipulation and formatting functions.
* Can be used in any project (NestJS, Express, Frontend, etc.) * Can be used in any project (NestJS, Express, Frontend, etc.)
* *
* @module @shared/utils/date * @module @core/utils/date
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -4,12 +4,12 @@
* Framework-agnostic utility functions that can be used across * Framework-agnostic utility functions that can be used across
* all projects in the workspace (Gamilit, Trading Platform, ERP Suite, etc.) * all projects in the workspace (Gamilit, Trading Platform, ERP Suite, etc.)
* *
* @module @shared/utils * @module @core/utils
* @version 1.0.0 * @version 1.0.0
* *
* @example * @example
* ```typescript * ```typescript
* import { formatDate, slugify, isEmail } from '@shared/utils'; * import { formatDate, slugify, isEmail } from '@core/utils';
* *
* const date = formatDate(new Date(), 'YYYY-MM-DD'); * const date = formatDate(new Date(), 'YYYY-MM-DD');
* const slug = slugify('Hello World'); * const slug = slugify('Hello World');

View File

@ -4,7 +4,7 @@
* Framework-agnostic string manipulation and formatting functions. * Framework-agnostic string manipulation and formatting functions.
* Can be used in any project (NestJS, Express, Frontend, etc.) * Can be used in any project (NestJS, Express, Frontend, etc.)
* *
* @module @shared/utils/string * @module @core/utils/string
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -4,7 +4,7 @@
* Framework-agnostic validation helper functions. * Framework-agnostic validation helper functions.
* Can be used in any project (NestJS, Express, Frontend, etc.) * Can be used in any project (NestJS, Express, Frontend, etc.)
* *
* @module @shared/utils/validation * @module @core/utils/validation
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -27,7 +27,7 @@ Este directorio contiene el **Sistema NEXUS** de orquestación de agentes IA par
### Acceso Rápido ### Acceso Rápido
``` ```
shared/catalog/ # 🆕 CATÁLOGO DE FUNCIONALIDADES (CONSULTAR PRIMERO) core/catalog/ # 🆕 CATÁLOGO DE FUNCIONALIDADES (CONSULTAR PRIMERO)
├── CATALOG-INDEX.yml # Índice máquina-readable ├── CATALOG-INDEX.yml # Índice máquina-readable
├── auth/ # Autenticación y autorización ├── auth/ # Autenticación y autorización
├── session-management/ # Gestión de sesiones ├── session-management/ # Gestión de sesiones
@ -102,8 +102,8 @@ referencias/
@TPL_CAPVED: templates/TEMPLATE-TAREA-CAPVED.md @TPL_CAPVED: templates/TEMPLATE-TAREA-CAPVED.md
# CATÁLOGO DE FUNCIONALIDADES (CONSULTAR PRIMERO) # CATÁLOGO DE FUNCIONALIDADES (CONSULTAR PRIMERO)
@CATALOG: shared/catalog/ @CATALOG: core/catalog/
@CATALOG_INDEX: shared/catalog/CATALOG-INDEX.yml @CATALOG_INDEX: core/catalog/CATALOG-INDEX.yml
# Operaciones # Operaciones
@REUTILIZAR: directivas/simco/SIMCO-REUTILIZAR.md @REUTILIZAR: directivas/simco/SIMCO-REUTILIZAR.md

View File

@ -46,7 +46,7 @@ core/orchestration/
│ ├── SIMCO-BACKEND.md │ ├── SIMCO-BACKEND.md
│ └── ... │ └── ...
└── shared/catalog/ # 🆕 CATÁLOGO DE FUNCIONALIDADES └── core/catalog/ # 🆕 CATÁLOGO DE FUNCIONALIDADES
├── CATALOG-INDEX.yml # Índice para búsqueda ├── CATALOG-INDEX.yml # Índice para búsqueda
├── auth/ ├── auth/
├── session-management/ ├── session-management/
@ -138,7 +138,7 @@ Los archivos `INIT-NEXUS-*.md` siguen siendo útiles como:
- **Índice SIMCO:** core/orchestration/directivas/simco/_INDEX.md - **Índice SIMCO:** core/orchestration/directivas/simco/_INDEX.md
- **Perfiles de Agentes:** core/orchestration/agents/perfiles/ - **Perfiles de Agentes:** core/orchestration/agents/perfiles/
- **Catálogo:** shared/catalog/ - **Catálogo:** core/catalog/
- **Aliases:** core/orchestration/referencias/ALIASES.yml - **Aliases:** core/orchestration/referencias/ALIASES.yml
--- ---

View File

@ -33,7 +33,7 @@ core/orchestration/
│ ├── SIMCO-MODIFICAR.md │ ├── SIMCO-MODIFICAR.md
│ └── SIMCO-{DOMINIO}.md │ └── SIMCO-{DOMINIO}.md
└── shared/catalog/ # Funcionalidades reutilizables └── core/catalog/ # Funcionalidades reutilizables
├── auth/ ├── auth/
├── notifications/ ├── notifications/
└── ... └── ...

View File

@ -2,10 +2,9 @@
**ID:** @PERFIL_KB_MANAGER **ID:** @PERFIL_KB_MANAGER
**Nombre:** Knowledge-Base Manager **Nombre:** Knowledge-Base Manager
**Version:** 1.1.0 **Version:** 1.0.0
**Sistema:** NEXUS v3.4 + SIMCO + CAPVED **Sistema:** NEXUS v3.4 + SIMCO + CAPVED
**Creado:** 2026-01-04 **Creado:** 2026-01-04
**Actualizado:** 2026-01-04
**EPIC:** EPIC-012 **EPIC:** EPIC-012
--- ---
@ -13,7 +12,7 @@
## ROL ## ROL
Gestor de la base de conocimiento compartida del workspace, responsable de: Gestor de la base de conocimiento compartida del workspace, responsable de:
- Coordinar mejoras en `shared/catalog/` y `shared/knowledge-base/` - Coordinar mejoras en `core/catalog/` y `shared/knowledge-base/`
- Analizar mejoras propagables siguiendo proceso CAPVED - Analizar mejoras propagables siguiendo proceso CAPVED
- Detectar dependencias internas entre modulos - Detectar dependencias internas entre modulos
- Generar tareas SCRUM formales para propagacion - Generar tareas SCRUM formales para propagacion
@ -31,7 +30,7 @@ Gestor de la base de conocimiento compartida del workspace, responsable de:
- C: Contexto del modulo afectado - C: Contexto del modulo afectado
- A: Analisis de impacto en KB y proyectos consumidores - A: Analisis de impacto en KB y proyectos consumidores
- P: Plan de propagacion por niveles - P: Plan de propagacion por niveles
3. **Actualizar shared/catalog** si la mejora aplica a modulos base 3. **Actualizar core/catalog** si la mejora aplica a modulos base
4. **Actualizar shared/knowledge-base** con cambios sincronizados 4. **Actualizar shared/knowledge-base** con cambios sincronizados
5. **Generar tareas SCRUM** para proyectos afectados usando `generate-scrum-tasks.sh` 5. **Generar tareas SCRUM** para proyectos afectados usando `generate-scrum-tasks.sh`
6. **Coordinar con @PERFIL_PROJECT_AGENT** para ejecucion en proyectos 6. **Coordinar con @PERFIL_PROJECT_AGENT** para ejecucion en proyectos
@ -102,7 +101,7 @@ Scripts disponibles en `devtools/scripts/propagation/`:
| |
v v
4. ACTUALIZAR NIVEL 0 (si aplica) 4. ACTUALIZAR NIVEL 0 (si aplica)
Actualizar modulo en shared/catalog/ Actualizar modulo en core/catalog/
Validar: Documentacion actualizada Validar: Documentacion actualizada
| |
v v
@ -170,9 +169,6 @@ Scripts disponibles en `devtools/scripts/propagation/`:
| @PERFIL_DOCUMENTATION | Colabora en documentacion de cambios | Seccion en TASK | | @PERFIL_DOCUMENTATION | Colabora en documentacion de cambios | Seccion en TASK |
| @PERFIL_INTEGRATION_VALIDATOR | Valida integracion final | Checklist de validacion | | @PERFIL_INTEGRATION_VALIDATOR | Valida integracion final | Checklist de validacion |
| @PERFIL_TECH_LEADER | Escala decisiones arquitecturales | Issue/Reunion | | @PERFIL_TECH_LEADER | Escala decisiones arquitecturales | Issue/Reunion |
| @PERFIL_PROPAGATION_TRACKER | Tracking de estado de propagaciones | TRAZABILIDAD-PROPAGACION.yml |
| @PERFIL_PRODUCTION_MANAGER | Sincroniza cambios con produccion | Registro/Alerta |
| @PERFIL_SECRETS_MANAGER | Coordina cambios de secretos | Protocolo seguro |
--- ---
@ -237,13 +233,6 @@ formato: "Comentario en tarea o seccion EJECUCION"
- USAGE.md: `shared/knowledge-base/propagacion/USAGE.md` - USAGE.md: `shared/knowledge-base/propagacion/USAGE.md`
- USAGE-ORQUESTACION.md: `shared/knowledge-base/propagacion/USAGE-ORQUESTACION.md` - USAGE-ORQUESTACION.md: `shared/knowledge-base/propagacion/USAGE-ORQUESTACION.md`
### Perfiles Relacionados
- @PERFIL_PROPAGATION_TRACKER: `orchestration/agents/perfiles/PERFIL-PROPAGATION-TRACKER.md`
- @PERFIL_PRODUCTION_MANAGER: `orchestration/agents/perfiles/PERFIL-PRODUCTION-MANAGER.md`
- @PERFIL_SECRETS_MANAGER: `orchestration/agents/perfiles/PERFIL-SECRETS-MANAGER.md`
- @PERFIL_MONITORING_AGENT: `orchestration/agents/perfiles/PERFIL-MONITORING-AGENT.md`
--- ---
**Perfil creado por:** EPIC-012 **Perfil creado por:** EPIC-012

View File

@ -45,7 +45,7 @@ grep "Versión:" /home/isem/workspace/core/orchestration/README.md | head -1
**Cambios realizados:** **Cambios realizados:**
- 131 archivos en `core/orchestration/` corregidos - 131 archivos en `core/orchestration/` corregidos
- 11 archivos en `shared/catalog/_reference/` corregidos - 11 archivos en `core/catalog/_reference/` corregidos
- Archivos de catalog raíz (*.yml, *.md) corregidos - Archivos de catalog raíz (*.yml, *.md) corregidos
**Verificación:** **Verificación:**
@ -162,7 +162,7 @@ grep -n "Versión:" ~/workspace/core/orchestration/README.md | head -1
find ~/workspace/core/orchestration -perm 600 -type f | wc -l # Debe ser 0 find ~/workspace/core/orchestration -perm 600 -type f | wc -l # Debe ser 0
# Verificar _reference/ poblados # Verificar _reference/ poblados
find ~/workspace/shared/catalog -name "*.reference.ts" | wc -l # Debe ser 11 find ~/workspace/core/catalog -name "*.reference.ts" | wc -l # Debe ser 11
# Verificar UserIdConversionService exportado # Verificar UserIdConversionService exportado
grep "UserIdConversionService" ~/workspace/projects/gamilit/apps/backend/src/shared/services/index.ts grep "UserIdConversionService" ~/workspace/projects/gamilit/apps/backend/src/shared/services/index.ts

View File

@ -236,7 +236,7 @@ Sprint 0 P0 - Completado
# ERP-Suite shared-libs # ERP-Suite shared-libs
ls -la ~/workspace/projects/erp-suite/apps/shared-libs/core/entities/ ls -la ~/workspace/projects/erp-suite/apps/shared-libs/core/entities/
ls -la ~/workspace/projects/erp-suite/apps/shared-libs/core/middleware/ ls -la ~/workspace/projects/erp-suite/apps/shared-libs/core/middleware/
ls -la ~/workspace/projects/erp-suite/apps/shared-libs/shared/constants/ ls -la ~/workspace/projects/erp-suite/apps/shared-libs/core/constants/
# Betting Analytics # Betting Analytics
ls -la ~/workspace/projects/betting-analytics/apps/backend/src/ ls -la ~/workspace/projects/betting-analytics/apps/backend/src/

View File

@ -78,7 +78,7 @@ core:
contenido: Directivas, principios, agentes, templates contenido: Directivas, principios, agentes, templates
prioridad: P0 prioridad: P0
- nombre: shared/catalog - nombre: core/catalog
nivel: 0 (Global) nivel: 0 (Global)
contenido: Funcionalidades reutilizables contenido: Funcionalidades reutilizables
prioridad: P0 prioridad: P0
@ -334,7 +334,7 @@ herramientas:
secuencia: secuencia:
1_core: 1_core:
- core/orchestration/directivas/ (principios base) - core/orchestration/directivas/ (principios base)
- shared/catalog/ (funcionalidades compartidas) - core/catalog/ (funcionalidades compartidas)
prioridad: PRIMERO (establecer baseline) prioridad: PRIMERO (establecer baseline)
2_proyectos_maduros: 2_proyectos_maduros:
@ -698,7 +698,7 @@ protocolo:
orden_ejecucion: orden_ejecucion:
fase_6a_core: fase_6a_core:
- Correcciones en core/orchestration - Correcciones en core/orchestration
- Correcciones en shared/catalog - Correcciones en core/catalog
razon: Base para proyectos razon: Base para proyectos
fase_6b_proyectos_referencia: fase_6b_proyectos_referencia:

View File

@ -849,7 +849,7 @@ P0 Completado
[ ] core/orchestration versión unificada 3.3 [ ] core/orchestration versión unificada 3.3
[ ] core/orchestration permisos 644 [ ] core/orchestration permisos 644
[ ] core/orchestration 6 principios documentados [ ] core/orchestration 6 principios documentados
[ ] shared/catalog _reference/ poblados (8 funcionalidades) [ ] core/catalog _reference/ poblados (8 funcionalidades)
[ ] gamilit UserIdConversionService creado [ ] gamilit UserIdConversionService creado
[ ] gamilit Repository Factory implementado [ ] gamilit Repository Factory implementado
[ ] gamilit God classes divididas (al menos 2) [ ] gamilit God classes divididas (al menos 2)

View File

@ -13,7 +13,7 @@ Se completó el análisis exhaustivo de **6 áreas** del workspace:
| Área | Estado | Score | Hallazgos P0 | P1 | P2 | | Área | Estado | Score | Hallazgos P0 | P1 | P2 |
|------|--------|-------|--------------|----|----| |------|--------|-------|--------------|----|----|
| **core/orchestration** | 🟡 Necesita mejoras | 7/10 | 3 | 5 | 3 | | **core/orchestration** | 🟡 Necesita mejoras | 7/10 | 3 | 5 | 3 |
| **shared/catalog** | 🟡 Necesita mejoras | 8/10 | 1 | 4 | 6 | | **core/catalog** | 🟡 Necesita mejoras | 8/10 | 1 | 4 | 6 |
| **gamilit** | 🟡 Deuda técnica | 6.5/10 | 4 | 6 | 10 | | **gamilit** | 🟡 Deuda técnica | 6.5/10 | 4 | 6 | 10 |
| **trading-platform** | 🟡 MVP en progreso | 6/10 | 5 | 5 | 4 | | **trading-platform** | 🟡 MVP en progreso | 6/10 | 5 | 5 | 4 |
| **erp-suite** | 🟡 Duplicación crítica | 5/10 | 3 | 4 | 3 | | **erp-suite** | 🟡 Duplicación crítica | 5/10 | 3 | 4 | 3 |
@ -123,7 +123,7 @@ Se completó el análisis exhaustivo de **6 áreas** del workspace:
| Proyecto | Docs | ADRs | Inventarios | Propagación | | Proyecto | Docs | ADRs | Inventarios | Propagación |
|----------|------|------|-------------|-------------| |----------|------|------|-------------|-------------|
| core/orchestration | ✅ 177 MD | ✅ Sistema | ✅ YAML | 🟡 Parcial | | core/orchestration | ✅ 177 MD | ✅ Sistema | ✅ YAML | 🟡 Parcial |
| shared/catalog | ✅ 8 funciones | N/A | ✅ Tracking | ✅ OK | | core/catalog | ✅ 8 funciones | N/A | ✅ Tracking | ✅ OK |
| gamilit | ✅ 17 carpetas | ✅ 20 ADRs | ✅ Completos | ✅ OK | | gamilit | ✅ 17 carpetas | ✅ 20 ADRs | ✅ Completos | ✅ OK |
| trading-platform | ✅ 264 docs | ✅ 14 ADRs | ✅ Completos | ✅ OK | | trading-platform | ✅ 264 docs | ✅ 14 ADRs | ✅ Completos | ✅ OK |
| erp-suite | ✅ 449+ docs | ⚠️ Parcial | 🟡 Parcial | 🟡 Parcial | | erp-suite | ✅ 449+ docs | ⚠️ Parcial | 🟡 Parcial | 🟡 Parcial |
@ -134,7 +134,7 @@ Se completó el análisis exhaustivo de **6 áreas** del workspace:
## CÓDIGO DUPLICADO ENTRE PROYECTOS ## CÓDIGO DUPLICADO ENTRE PROYECTOS
### Candidatos para shared/catalog ### Candidatos para core/catalog
| Funcionalidad | Proyectos | Estado | Acción | | Funcionalidad | Proyectos | Estado | Acción |
|---------------|-----------|--------|--------| |---------------|-----------|--------|--------|
@ -183,7 +183,7 @@ Se completó el análisis exhaustivo de **6 áreas** del workspace:
| # | Acción | Proyectos | Esfuerzo | | # | Acción | Proyectos | Esfuerzo |
|---|--------|-----------|----------| |---|--------|-----------|----------|
| 1 | Poblar `_reference/` en shared/catalog | catalog | 8h | | 1 | Poblar `_reference/` en core/catalog | catalog | 8h |
| 2 | Sincronizar versionado orchestration a 3.3 | core | 2h | | 2 | Sincronizar versionado orchestration a 3.3 | core | 2h |
| 3 | Cambiar permisos 600→644 en orchestration | core | 1h | | 3 | Cambiar permisos 600→644 en orchestration | core | 1h |
| 4 | Crear UserIdConversionService en gamilit | gamilit | 4h | | 4 | Crear UserIdConversionService en gamilit | gamilit | 4h |

View File

@ -34,7 +34,7 @@
┌─────────────────────────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────────────────────────┐
│ │ │ │
│ NUNCA referenciar un proyecto desde otro proyecto. │ │ NUNCA referenciar un proyecto desde otro proyecto. │
│ SIEMPRE usar shared/catalog/ o core/orchestration/ como fuente. │ │ SIEMPRE usar core/catalog/ o core/orchestration/ como fuente. │
│ │ │ │
└─────────────────────────────────────────────────────────────────────┘ └─────────────────────────────────────────────────────────────────────┘
``` ```
@ -47,7 +47,7 @@
| Tipo | Ejemplo | Uso Correcto | | Tipo | Ejemplo | Uso Correcto |
|------|---------|--------------| |------|---------|--------------|
| **Core Catalog** | `shared/catalog/auth/` | Componentes reutilizables | | **Core Catalog** | `core/catalog/auth/` | Componentes reutilizables |
| **Core Orchestration** | `core/orchestration/directivas/` | Directivas y templates | | **Core Orchestration** | `core/orchestration/directivas/` | Directivas y templates |
| **Subproyecto Interno** | `erp-suite/apps/erp-core/` | Solo desde la misma suite | | **Subproyecto Interno** | `erp-suite/apps/erp-core/` | Solo desde la misma suite |
| **Ejemplos Ilustrativos** | `ejemplos: "gamilit, trading"` | Solo como ilustración marcada | | **Ejemplos Ilustrativos** | `ejemplos: "gamilit, trading"` | Solo como ilustración marcada |
@ -70,7 +70,7 @@
JERARQUÍA_VÁLIDA: JERARQUÍA_VÁLIDA:
Nivel_0_Core: Nivel_0_Core:
- shared/catalog/ # Funcionalidades reutilizables - core/catalog/ # Funcionalidades reutilizables
- core/orchestration/ # Directivas y templates - core/orchestration/ # Directivas y templates
- core/devtools/ # Herramientas de desarrollo - core/devtools/ # Herramientas de desarrollo
@ -130,7 +130,7 @@ ANTES:
DESPUÉS: DESPUÉS:
# ELIMINAR la línea completamente # ELIMINAR la línea completamente
# O cambiar a: # O cambiar a:
| Catálogo global | `/home/isem/workspace/shared/catalog/` | | Catálogo global | `/home/isem/workspace/core/catalog/` |
``` ```
### Caso 2: Ruta a Otro Proyecto ### Caso 2: Ruta a Otro Proyecto
@ -140,7 +140,7 @@ ANTES:
- Patrones auth: `projects/gamilit/apps/backend/src/auth/` - Patrones auth: `projects/gamilit/apps/backend/src/auth/`
DESPUÉS: DESPUÉS:
- Patrones auth: `shared/catalog/auth/` - Patrones auth: `core/catalog/auth/`
``` ```
### Caso 3: Lista de Proyectos de Referencia ### Caso 3: Lista de Proyectos de Referencia
@ -153,11 +153,11 @@ ANTES:
DESPUÉS: DESPUÉS:
## Patrones de Referencia (desde Catálogo) ## Patrones de Referencia (desde Catálogo)
> **Nota:** Usar siempre shared/catalog/ para componentes reutilizables. > **Nota:** Usar siempre core/catalog/ para componentes reutilizables.
| Patrón | Catálogo | | Patrón | Catálogo |
| Auth | shared/catalog/auth/ | | Auth | core/catalog/auth/ |
| RLS | shared/catalog/multi-tenancy/ | | RLS | core/catalog/multi-tenancy/ |
``` ```
### Caso 4: Directiva con Header de Proyecto ### Caso 4: Directiva con Header de Proyecto
@ -247,7 +247,7 @@ VALIDACIÓN_ADICIONAL:
```yaml ```yaml
CONTEXTO_A_PASAR: CONTEXTO_A_PASAR:
referencias_permitidas: referencias_permitidas:
- shared/catalog/ - core/catalog/
- core/orchestration/ - core/orchestration/
- {proyecto_actual}/ # Solo interno - {proyecto_actual}/ # Solo interno
referencias_prohibidas: referencias_prohibidas:
@ -295,7 +295,7 @@ echo "=== Fin de Auditoría ==="
## REFERENCIAS ## REFERENCIAS
- **Principio relacionado:** `PRINCIPIO-ANTI-DUPLICACION.md` - **Principio relacionado:** `PRINCIPIO-ANTI-DUPLICACION.md`
- **Catálogo global:** `shared/catalog/` - **Catálogo global:** `core/catalog/`
- **Templates:** `core/orchestration/templates/` - **Templates:** `core/orchestration/templates/`
- **Índice SIMCO:** `core/orchestration/directivas/simco/_INDEX.md` - **Índice SIMCO:** `core/orchestration/directivas/simco/_INDEX.md`

View File

@ -12,7 +12,7 @@
**ANTES de implementar funcionalidades comunes**, verificar si existe código probado: **ANTES de implementar funcionalidades comunes**, verificar si existe código probado:
``` ```
shared/catalog/ # FUNCIONALIDADES REUTILIZABLES core/catalog/ # FUNCIONALIDADES REUTILIZABLES
├── CATALOG-INDEX.yml # Índice para búsqueda rápida ├── CATALOG-INDEX.yml # Índice para búsqueda rápida
├── auth/ # Autenticación y autorización ├── auth/ # Autenticación y autorización
├── session-management/ # Gestión de sesiones ├── session-management/ # Gestión de sesiones

View File

@ -361,7 +361,7 @@ Ver: @NIVELES_PROP (`shared/knowledge-base/propagacion/NIVELES-PROPAGACION.yml`)
| Nivel | Nombre | Contenido | | Nivel | Nombre | Contenido |
|-------|--------|-----------| |-------|--------|-----------|
| 0 | Core Catalog | shared/catalog/ | | 0 | Core Catalog | core/catalog/ |
| 1 | Knowledge-Base | shared/knowledge-base/ | | 1 | Knowledge-Base | shared/knowledge-base/ |
| 2 | Proyectos Base | erp-core, gamilit, trading-platform | | 2 | Proyectos Base | erp-core, gamilit, trading-platform |
| 3 | Proyectos Hoja | Verticales ERP, otros | | 3 | Proyectos Hoja | Verticales ERP, otros |

View File

@ -28,16 +28,16 @@ global:
# ═══════════════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════════════
# CATÁLOGO DE FUNCIONALIDADES REUTILIZABLES (CONSULTAR PRIMERO) # CATÁLOGO DE FUNCIONALIDADES REUTILIZABLES (CONSULTAR PRIMERO)
# ═══════════════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════════════
"@CATALOG": "shared/catalog/" "@CATALOG": "core/catalog/"
"@CATALOG_INDEX": "shared/catalog/CATALOG-INDEX.yml" "@CATALOG_INDEX": "core/catalog/CATALOG-INDEX.yml"
"@CATALOG_AUTH": "shared/catalog/auth/" "@CATALOG_AUTH": "core/catalog/auth/"
"@CATALOG_SESSION": "shared/catalog/session-management/" "@CATALOG_SESSION": "core/catalog/session-management/"
"@CATALOG_RATELIMIT": "shared/catalog/rate-limiting/" "@CATALOG_RATELIMIT": "core/catalog/rate-limiting/"
"@CATALOG_NOTIFY": "shared/catalog/notifications/" "@CATALOG_NOTIFY": "core/catalog/notifications/"
"@CATALOG_TENANT": "shared/catalog/multi-tenancy/" "@CATALOG_TENANT": "core/catalog/multi-tenancy/"
"@CATALOG_FLAGS": "shared/catalog/feature-flags/" "@CATALOG_FLAGS": "core/catalog/feature-flags/"
"@CATALOG_WS": "shared/catalog/websocket/" "@CATALOG_WS": "core/catalog/websocket/"
"@CATALOG_PAYMENTS": "shared/catalog/payments/" "@CATALOG_PAYMENTS": "core/catalog/payments/"
# ═══════════════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════════════
# CAPVED - CICLO DE VIDA DE TAREAS (🆕 v2.0) # CAPVED - CICLO DE VIDA DE TAREAS (🆕 v2.0)
@ -222,8 +222,8 @@ niveles:
# ═══════════════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════════════
"@CORE": "core/" "@CORE": "core/"
"@CORE_ORCH": "core/orchestration/" "@CORE_ORCH": "core/orchestration/"
"@CORE_CATALOG": "shared/catalog/" "@CORE_CATALOG": "core/catalog/"
"@CORE_MODULES": "shared/modules/" "@CORE_MODULES": "core/modules/"
# ═══════════════════════════════════════════════════════════════════ # ═══════════════════════════════════════════════════════════════════
# NIVEL 2: PROYECTOS (alias dinámicos) # NIVEL 2: PROYECTOS (alias dinámicos)

View File

@ -3,7 +3,7 @@
* *
* Tipos compartidos para APIs REST en todos los proyectos. * Tipos compartidos para APIs REST en todos los proyectos.
* *
* @module @shared/types/api * @module @core/types/api
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -3,7 +3,7 @@
* *
* Tipos comunes compartidos entre todos los proyectos. * Tipos comunes compartidos entre todos los proyectos.
* *
* @module @shared/types/common * @module @core/types/common
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -3,7 +3,7 @@
* *
* Type definitions shared across all projects in the workspace. * Type definitions shared across all projects in the workspace.
* *
* @module @shared/types * @module @core/types
* @version 1.0.0 * @version 1.0.0
*/ */

View File

@ -163,7 +163,7 @@ niveles:
- archivo: "directivas/simco/SIMCO-MODULOS-COMPARTIDOS.md" - archivo: "directivas/simco/SIMCO-MODULOS-COMPARTIDOS.md"
alias: "@MODULOS" alias: "@MODULOS"
obligatoria: false obligatoria: false
descripcion: "Uso de modulos en shared/modules/" descripcion: "Uso de modulos en core/modules/"
version: "1.0.0" version: "1.0.0"
fecha: "2026-01-03" fecha: "2026-01-03"
@ -254,7 +254,7 @@ niveles:
templates_nuevos: templates_nuevos:
- archivo: "templates/TEMPLATE-MODULO-COMPARTIDO.md" - archivo: "templates/TEMPLATE-MODULO-COMPARTIDO.md"
alias: "@TPL_MODULO" alias: "@TPL_MODULO"
descripcion: "Template para documentar modulos en shared/modules/" descripcion: "Template para documentar modulos en core/modules/"
version: "1.0.0" version: "1.0.0"
fecha: "2026-01-03" fecha: "2026-01-03"
@ -457,9 +457,9 @@ aliases:
"@OP_ARQUITECTURA": "orchestration/directivas/simco/SIMCO-ARQUITECTURA.md" "@OP_ARQUITECTURA": "orchestration/directivas/simco/SIMCO-ARQUITECTURA.md"
# Catalogo y Modulos # Catalogo y Modulos
"@CATALOG": "shared/catalog/CATALOG-INDEX.yml" "@CATALOG": "core/catalog/CATALOG-INDEX.yml"
"@REUTILIZAR": "orchestration/directivas/simco/SIMCO-REUTILIZAR.md" "@REUTILIZAR": "orchestration/directivas/simco/SIMCO-REUTILIZAR.md"
"@MODULES": "shared/modules/" "@MODULES": "core/modules/"
# Templates (NUEVOS) # Templates (NUEVOS)
"@TPL_MODULO": "orchestration/templates/TEMPLATE-MODULO-COMPARTIDO.md" "@TPL_MODULO": "orchestration/templates/TEMPLATE-MODULO-COMPARTIDO.md"
@ -505,12 +505,12 @@ changelog:
epic: "EPIC-003" epic: "EPIC-003"
cambios: cambios:
- "Agregado SIMCO-ESTRUCTURA-REPOS.md (arquitectura 4 niveles)" - "Agregado SIMCO-ESTRUCTURA-REPOS.md (arquitectura 4 niveles)"
- "Agregado SIMCO-MODULOS-COMPARTIDOS.md (uso de shared/modules)" - "Agregado SIMCO-MODULOS-COMPARTIDOS.md (uso de core/modules)"
- "Agregado TEMPLATE-MODULO-COMPARTIDO.md" - "Agregado TEMPLATE-MODULO-COMPARTIDO.md"
- "Agregado TEMPLATE-ESTRUCTURA-VERTICAL.md" - "Agregado TEMPLATE-ESTRUCTURA-VERTICAL.md"
- "Agregado CHECKLIST-NUEVO-PROYECTO.md" - "Agregado CHECKLIST-NUEVO-PROYECTO.md"
- "Agregado validate-repo-structure.sh" - "Agregado validate-repo-structure.sh"
- "Documentados 6 modulos en shared/modules/" - "Documentados 6 modulos en core/modules/"
- "Actualizado _INDEX.md a v2.4.0" - "Actualizado _INDEX.md a v2.4.0"
- "Actualizado ALIASES.yml a v2.4.0" - "Actualizado ALIASES.yml a v2.4.0"
- "30+ aliases nuevos" - "30+ aliases nuevos"

View File

@ -40,7 +40,7 @@ projects/{proyecto}/orchestration/ ← Extensiones por Proyecto
### Acceso Rápido (Rutas Relativas a Este Directorio) ### Acceso Rápido (Rutas Relativas a Este Directorio)
``` ```
../shared/catalog/ # CATÁLOGO DE FUNCIONALIDADES (en core/) ../core/catalog/ # CATÁLOGO DE FUNCIONALIDADES (en core/)
├── CATALOG-INDEX.yml # Índice máquina-readable ├── CATALOG-INDEX.yml # Índice máquina-readable
├── auth/ # Autenticación y autorización ├── auth/ # Autenticación y autorización
├── session-management/ # Gestión de sesiones ├── session-management/ # Gestión de sesiones
@ -115,8 +115,8 @@ referencias/
@TPL_CAPVED: templates/TEMPLATE-TAREA-CAPVED.md @TPL_CAPVED: templates/TEMPLATE-TAREA-CAPVED.md
# CATÁLOGO DE FUNCIONALIDADES (CONSULTAR PRIMERO) # CATÁLOGO DE FUNCIONALIDADES (CONSULTAR PRIMERO)
@CATALOG: shared/catalog/ @CATALOG: core/catalog/
@CATALOG_INDEX: shared/catalog/CATALOG-INDEX.yml @CATALOG_INDEX: core/catalog/CATALOG-INDEX.yml
# Operaciones # Operaciones
@REUTILIZAR: directivas/simco/SIMCO-REUTILIZAR.md @REUTILIZAR: directivas/simco/SIMCO-REUTILIZAR.md

View File

@ -1,318 +0,0 @@
# MAPA DE ORQUESTACION: WORKSPACE-V1
**Sistema:** NEXUS v4.0 + SIMCO
**Propósito:** Orquestación central para todos los proyectos del workspace
**Última actualización:** 2026-01-04
---
## Estructura de Orquestación
```
orchestration/
├── agents/ # Perfiles de agentes
│ └── perfiles/ # Definiciones de roles
├── analisis/ # Análisis transversales
├── checklists/ # Checklists de validación
├── directivas/ # Directivas SIMCO y principios
│ ├── principios/ # 6 principios fundamentales
│ └── simco/ # 45 directivas SIMCO
├── errores/ # Registro global de errores
├── inventarios/ # Inventarios de workspace
├── patrones/ # Patrones arquitectónicos
├── procesos/ # Definiciones de procesos
├── referencias/ # Referencias y matrices
├── scrum/ # Templates Scrum
├── templates/ # Templates globales
│ ├── capved/ # Templates CAPVED++
│ ├── scrum/ # Templates Scrum
│ └── service-descriptor/ # Descriptores de servicio
└── tracking/ # Tracking de sesiones
```
---
## Archivos Principales
| Archivo | Propósito |
|---------|-----------|
| `README.md` | Descripción del sistema NEXUS v4.0 |
| `INDICE-DIRECTIVAS-WORKSPACE.yml` | Índice maestro de directivas |
| `_MAP.md` | Este archivo - mapa de navegación |
---
## Sistema NEXUS v4.0
### Niveles de Contexto
| Nivel | Tokens | Contenido | Obligatorio |
|-------|--------|-----------|-------------|
| L0 Sistema | ~4500 | Principios, perfil agente | Sí |
| L1 Proyecto | ~3000 | CONTEXTO-PROYECTO, PROXIMA-ACCION | Sí |
| L2 Operación | ~2500 | SIMCO por operación/dominio | Según tarea |
| L3 Tarea | max 8000 | docs/, código, histórico | Dinámico |
### Límites de Tokens
```yaml
limite_absoluto: 25000
limite_seguro: 18000
limite_alerta: 20000
```
---
## Principios Fundamentales (6)
| Principio | Archivo | Propósito |
|-----------|---------|-----------|
| CAPVED++ | `PRINCIPIO-CAPVED.md` | Ciclo de vida de tareas con gates |
| Doc-Primero | `PRINCIPIO-DOC-PRIMERO.md` | Documentación antes de código |
| Anti-Duplicación | `PRINCIPIO-ANTI-DUPLICACION.md` | Verificar catálogo antes de crear |
| Validación | `PRINCIPIO-VALIDACION-OBLIGATORIA.md` | Build/lint deben pasar |
| Economía Tokens | `PRINCIPIO-ECONOMIA-TOKENS.md` | Límites de contexto |
| No Asumir | `PRINCIPIO-NO-ASUMIR.md` | Preguntar si falta información |
**Path:** `directivas/principios/`
---
## Directivas SIMCO (45)
### Por Operación
| Directiva | Cuándo Usar |
|-----------|-------------|
| `SIMCO-CREAR.md` | Crear nuevos artefactos |
| `SIMCO-MODIFICAR.md` | Modificar artefactos existentes |
| `SIMCO-VALIDAR.md` | Validar coherencia/calidad |
| `SIMCO-BUSCAR.md` | Buscar información en codebase |
| `SIMCO-DOCUMENTAR.md` | Crear/actualizar documentación |
| `SIMCO-DELEGACION.md` | Delegar a subagentes |
| `SIMCO-PROPAGACION.md` | Propagar mejoras entre proyectos |
| `SIMCO-REUTILIZAR.md` | Reutilizar código existente |
| `SIMCO-CONTRIBUIR-CATALOGO.md` | Contribuir al catálogo compartido |
### Por Dominio
| Directiva | Dominio |
|-----------|---------|
| `SIMCO-DDL.md` | Base de datos PostgreSQL |
| `SIMCO-BACKEND.md` | Backend (NestJS, Express) |
| `SIMCO-FRONTEND.md` | Frontend (React, Vue) |
| `SIMCO-MOBILE.md` | Aplicaciones móviles |
| `SIMCO-DEVOPS.md` | DevOps y CI/CD |
| `SIMCO-ML.md` | Machine Learning |
| `SIMCO-ARQUITECTURA.md` | Decisiones arquitectónicas |
| `SIMCO-GIT.md` | Control de versiones |
### NEXUS v4.0 (Nuevas)
| Directiva | Propósito |
|-----------|-----------|
| `SIMCO-CAPVED-PLUS.md` | Ciclo extendido con gates |
| `SIMCO-CONTEXT-RESOLUTION.md` | Resolución automática de contexto |
| `SIMCO-CONTROL-TOKENS.md` | Gestión de límites de tokens |
| `SIMCO-DELEGACION-PARALELA.md` | Orquestación de subagentes |
| `SIMCO-ERROR-RECURRENTE.md` | Manejo de errores repetidos |
| `SIMCO-SCRUM-INTEGRATION.md` | Integración Scrum |
### Referencia
| Directiva | Propósito |
|-----------|-----------|
| `SIMCO-QUICK-REFERENCE.md` | Referencia rápida |
| `SIMCO-DECISION-MATRIZ.md` | Matriz de decisión |
| `SIMCO-NIVELES.md` | Tipos de proyectos |
| `SIMCO-ESTRUCTURA-REPOS.md` | Estructura de repositorios |
| `_INDEX.md` | Índice de directivas SIMCO |
**Path:** `directivas/simco/`
---
## Templates
### CAPVED++ (7)
| Template | Fase |
|----------|------|
| `TEMPLATE-FASE-C-OUTPUT.yml` | Contexto |
| `TEMPLATE-FASE-A-OUTPUT.yml` | Análisis |
| `TEMPLATE-FASE-P-OUTPUT.yml` | Planeación |
| `TEMPLATE-FASE-V-OUTPUT.yml` | Validación |
| `TEMPLATE-FASE-E-OUTPUT.yml` | Ejecución |
| `TEMPLATE-FASE-D-OUTPUT.yml` | Documentación |
| `TEMPLATE-POST-VALIDACION.yml` | Post-ejecución |
**Path:** `templates/capved/`
### Scrum (2)
| Template | Propósito |
|----------|-----------|
| `TEMPLATE-SPRINT-BACKLOG.yml` | Backlog de sprint |
| `TEMPLATE-RETROSPECTIVA.yml` | Retrospectiva |
**Path:** `templates/scrum/`
### Otros
| Template | Propósito |
|----------|-----------|
| `TEMPLATE-CONTEXT-MAP.yml` | Mapa de contexto por proyecto |
| `SESSION-TRACKING-TEMPLATE.yml` | Tracking de sesiones |
| `SERVICE-DESCRIPTOR-TEMPLATE.yml` | Descriptor de servicios |
**Path:** `templates/`
---
## Referencias
| Archivo | Propósito |
|---------|-----------|
| `ALIASES.yml` | Resolución de @ALIAS |
| `REPOSITORY-STRUCTURE.md` | Estructura de repositorios |
| `PROPAGATION-CRITERIA-MATRIX.yml` | Criterios de propagación |
**Path:** `referencias/`
---
## Registro de Errores
| Archivo | Propósito |
|---------|-----------|
| `REGISTRO-ERRORES.yml` | Historial global de errores |
**Path:** `errores/`
Estructura de error:
```yaml
errores:
- id: ERR-XXXX
descripcion: "..."
ocurrencias: 3
causa_raiz: "..."
solucion_definitiva: "..."
prevencion: "..."
```
---
## Perfiles de Agentes
| Perfil | Especialización |
|--------|-----------------|
| `PERFIL-AGENTE-BASE.md` | Base común |
| `PERFIL-DATABASE-DEVELOPER.md` | PostgreSQL, DDL |
| `PERFIL-BACKEND-DEVELOPER.md` | NestJS, Express |
| `PERFIL-FRONTEND-DEVELOPER.md` | React, Vue |
| `PERFIL-ARCHITECTURE-ANALYST.md` | Análisis arquitectónico |
| `PERFIL-MCP-ARCHITECT.md` | MCP Servers |
| `PERFIL-MCP-DEVELOPER.md` | Desarrollo MCP |
| `PERFIL-RAG-ENGINEER.md` | RAG Systems |
**Path:** `agents/perfiles/`
---
## Proyectos del Workspace
### Standalone
| Proyecto | CONTEXT-MAP |
|----------|-------------|
| gamilit | `projects/gamilit/orchestration/CONTEXT-MAP.yml` |
| trading-platform | `projects/trading-platform/orchestration/CONTEXT-MAP.yml` |
| betting-analytics | `projects/betting-analytics/orchestration/CONTEXT-MAP.yml` |
| inmobiliaria-analytics | `projects/inmobiliaria-analytics/orchestration/CONTEXT-MAP.yml` |
| platform_marketing_content | `projects/platform_marketing_content/orchestration/CONTEXT-MAP.yml` |
### Suite ERP
| Proyecto | Nivel | CONTEXT-MAP |
|----------|-------|-------------|
| erp-suite | SUITE | `projects/erp-suite/orchestration/CONTEXT-MAP.yml` |
| erp-core | CORE | `projects/erp-core/orchestration/CONTEXT-MAP.yml` |
| erp-clinicas | VERTICAL | `projects/erp-clinicas/orchestration/CONTEXT-MAP.yml` |
| erp-construccion | VERTICAL | `projects/erp-construccion/orchestration/CONTEXT-MAP.yml` |
| erp-mecanicas-diesel | VERTICAL | `projects/erp-mecanicas-diesel/orchestration/CONTEXT-MAP.yml` |
| erp-retail | VERTICAL | `projects/erp-retail/orchestration/CONTEXT-MAP.yml` |
| erp-vidrio-templado | VERTICAL | `projects/erp-vidrio-templado/orchestration/CONTEXT-MAP.yml` |
---
## Ciclo CAPVED++
```
┌─────────────────────────────────────────────────────────────────┐
│ FASE 0: Resolución Automática de Contexto │
│ └─ CONTEXT-MAP.yml → Cargar archivos por nivel/tarea │
├─────────────────────────────────────────────────────────────────┤
│ FASE C: Contexto (~5 min) │
│ └─ Gate: HU vinculada, tipo clasificado, catálogo verificado │
├─────────────────────────────────────────────────────────────────┤
│ FASE A: Análisis (~15 min) │
│ └─ Gate: Objetos mapeados, dependencias, riesgos │
├─────────────────────────────────────────────────────────────────┤
│ FASE P: Planeación (~10 min) │
│ └─ Gate: Subtareas definidas, agentes asignados │
├─────────────────────────────────────────────────────────────────┤
│ FASE V: Validación (~5 min) - NO DELEGAR │
│ └─ Gate: Cobertura A→P 100%, dependencias resueltas │
├─────────────────────────────────────────────────────────────────┤
│ FASE E: Ejecución (variable) │
│ └─ Gate por subtarea: build pasa, lint pasa │
├─────────────────────────────────────────────────────────────────┤
│ FASE D: Documentación (~10 min) │
│ └─ Gate: Inventarios, trazas, propagación │
├─────────────────────────────────────────────────────────────────┤
│ POST: Validación Post-Ejecución │
│ └─ Comparar plan vs real, verificar consistencia │
└─────────────────────────────────────────────────────────────────┘
```
---
## Uso Rápido
### Iniciar Tarea en Proyecto
```bash
# 1. Leer CONTEXT-MAP del proyecto
cat projects/{proyecto}/orchestration/CONTEXT-MAP.yml
# 2. Verificar errores previos
cat orchestration/errores/REGISTRO-ERRORES.yml
cat projects/{proyecto}/orchestration/errores/REGISTRO-ERRORES.yml
# 3. Seguir SIMCO correspondiente
cat orchestration/directivas/simco/SIMCO-{operacion}.md
cat orchestration/directivas/simco/SIMCO-{dominio}.md
```
### Delegar a Subagente
```bash
# 1. Usar SIMCO-DELEGACION-PARALELA.md
# 2. Crear SESSION-TRACKING
# 3. Heredar CONTEXT-MAP resuelto
```
---
## Recursos Compartidos
| Recurso | Path |
|---------|------|
| Knowledge Base | `shared/knowledge-base/` |
| Catálogo | `shared/catalog/` |
| Scripts | `scripts/` |
---
**Actualizado:** 2026-01-04
**Sistema:** NEXUS v4.0 + SIMCO

View File

@ -274,16 +274,16 @@ paths:
"@PERFILES": "control-plane/orchestration/agents/perfiles/" "@PERFILES": "control-plane/orchestration/agents/perfiles/"
# Catalogo de funcionalidades # Catalogo de funcionalidades
"@CATALOG": "shared/catalog/" "@CATALOG": "shared/libs/"
"@CATALOG_INDEX": "shared/catalog/README.md" "@CATALOG_INDEX": "shared/libs/README.md"
"@CATALOG_AUTH": "shared/catalog/auth/" "@CATALOG_AUTH": "shared/libs/auth/"
"@CATALOG_SESSION": "shared/catalog/session-management/" "@CATALOG_SESSION": "shared/libs/session-management/"
"@CATALOG_RATELIMIT": "shared/catalog/rate-limiting/" "@CATALOG_RATELIMIT": "shared/libs/rate-limiting/"
"@CATALOG_NOTIFY": "shared/catalog/notifications/" "@CATALOG_NOTIFY": "shared/libs/notifications/"
"@CATALOG_TENANT": "shared/catalog/multi-tenancy/" "@CATALOG_TENANT": "shared/libs/multi-tenancy/"
"@CATALOG_FLAGS": "shared/catalog/feature-flags/" "@CATALOG_FLAGS": "shared/libs/feature-flags/"
"@CATALOG_WS": "shared/catalog/websocket/" "@CATALOG_WS": "shared/libs/websocket/"
"@CATALOG_PAYMENTS": "shared/catalog/payments/" "@CATALOG_PAYMENTS": "shared/libs/payments/"
# Knowledge Base # Knowledge Base
"@KNOWLEDGE": "shared/knowledge-base/" "@KNOWLEDGE": "shared/knowledge-base/"

View File

@ -34,7 +34,7 @@ PASO_1_IDENTIFICAR:
PASO_2_CARGAR_CORE: PASO_2_CARGAR_CORE:
leer_obligatorio: leer_obligatorio:
- shared/catalog/CATALOG-INDEX.yml - core/catalog/CATALOG-INDEX.yml
- core/orchestration/directivas/principios/PRINCIPIO-CAPVED.md - core/orchestration/directivas/principios/PRINCIPIO-CAPVED.md
- core/orchestration/directivas/principios/PRINCIPIO-DOC-PRIMERO.md - core/orchestration/directivas/principios/PRINCIPIO-DOC-PRIMERO.md
- core/orchestration/directivas/principios/PRINCIPIO-ANTI-DUPLICACION.md - core/orchestration/directivas/principios/PRINCIPIO-ANTI-DUPLICACION.md

View File

@ -35,7 +35,7 @@ PASO_1_IDENTIFICAR:
PASO_2_CARGAR_CORE: PASO_2_CARGAR_CORE:
leer_obligatorio: leer_obligatorio:
- shared/catalog/CATALOG-INDEX.yml # PRIMERO: Funcionalidades reutilizables - core/catalog/CATALOG-INDEX.yml # PRIMERO: Funcionalidades reutilizables
- core/orchestration/directivas/principios/PRINCIPIO-CAPVED.md - core/orchestration/directivas/principios/PRINCIPIO-CAPVED.md
- core/orchestration/directivas/principios/PRINCIPIO-DOC-PRIMERO.md - core/orchestration/directivas/principios/PRINCIPIO-DOC-PRIMERO.md
- core/orchestration/directivas/principios/PRINCIPIO-ANTI-DUPLICACION.md - core/orchestration/directivas/principios/PRINCIPIO-ANTI-DUPLICACION.md

View File

@ -35,7 +35,7 @@ PASO_1_IDENTIFICAR:
PASO_2_CARGAR_CORE: PASO_2_CARGAR_CORE:
leer_obligatorio: leer_obligatorio:
- shared/catalog/CATALOG-INDEX.yml # PRIMERO: Funcionalidades reutilizables - core/catalog/CATALOG-INDEX.yml # PRIMERO: Funcionalidades reutilizables
- core/orchestration/directivas/principios/PRINCIPIO-CAPVED.md # Ciclo de vida - core/orchestration/directivas/principios/PRINCIPIO-CAPVED.md # Ciclo de vida
- core/orchestration/directivas/principios/PRINCIPIO-DOC-PRIMERO.md - core/orchestration/directivas/principios/PRINCIPIO-DOC-PRIMERO.md
- core/orchestration/directivas/principios/PRINCIPIO-ANTI-DUPLICACION.md - core/orchestration/directivas/principios/PRINCIPIO-ANTI-DUPLICACION.md

Some files were not shown because too many files have changed in this diff Show More