[MIINVENTARIO] feat: Add SaaS documentation structure from template-saas
Some checks failed
Build / Build Backend (push) Has been cancelled
Build / Build Mobile (TypeScript Check) (push) Has been cancelled
Lint / Lint Backend (push) Has been cancelled
Lint / Lint Mobile (push) Has been cancelled
Test / Backend E2E Tests (push) Has been cancelled
Test / Mobile Unit Tests (push) Has been cancelled
Build / Build Docker Image (push) Has been cancelled
Some checks failed
Build / Build Backend (push) Has been cancelled
Build / Build Mobile (TypeScript Check) (push) Has been cancelled
Lint / Lint Backend (push) Has been cancelled
Lint / Lint Mobile (push) Has been cancelled
Test / Backend E2E Tests (push) Has been cancelled
Test / Mobile Unit Tests (push) Has been cancelled
Build / Build Docker Image (push) Has been cancelled
- Add orchestration/directivas/ with proyecto-triggers - TRIGGER-COHERENCIA-CAPAS.md for DDL/Backend coherence - TRIGGER-INVENTARIOS.md for inventory synchronization - Add orchestration/agents/ with perfiles - PERFIL-DDL-AGENT.md - PERFIL-BACKEND-AGENT.md - PERFIL-MOBILE-AGENT.md (React Native/Expo specialized) - Add MAPA-DOCUMENTACION.yml as central reference Inheritance: INTEGRATES from template-saas Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
30a7a6becd
commit
7988c7f9f8
149
orchestration/MAPA-DOCUMENTACION.yml
Normal file
149
orchestration/MAPA-DOCUMENTACION.yml
Normal file
@ -0,0 +1,149 @@
|
||||
# ===============================================================================
|
||||
# MAPA DE DOCUMENTACION - MIINVENTARIO
|
||||
# ===============================================================================
|
||||
#
|
||||
# Proposito: Centro de referencias a toda la documentacion del proyecto
|
||||
# Alias: @MI_MAPA_DOC
|
||||
# Herencia: INTEGRATES de template-saas
|
||||
#
|
||||
# ===============================================================================
|
||||
|
||||
version: "1.0.0"
|
||||
created: "2026-01-16"
|
||||
updated: "2026-01-16"
|
||||
proyecto: "miinventario"
|
||||
tipo: "INTEGRATES"
|
||||
hereda_de: "template-saas"
|
||||
nivel: 1
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
# DOCUMENTACION DE USUARIO (docs/)
|
||||
# -------------------------------------------------------------------------------
|
||||
|
||||
docs:
|
||||
raiz:
|
||||
README.md:
|
||||
alias: "@MI_README"
|
||||
descripcion: "Punto de entrada del proyecto"
|
||||
|
||||
vision:
|
||||
ruta: "docs/00-vision-general/"
|
||||
archivos:
|
||||
- VISION-PROYECTO.md
|
||||
- ARQUITECTURA-TECNICA.md
|
||||
- REQUERIMIENTOS-FUNCIONALES.md
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
# DOCUMENTACION OPERACIONAL (orchestration/)
|
||||
# -------------------------------------------------------------------------------
|
||||
|
||||
orchestration:
|
||||
raiz:
|
||||
README.md:
|
||||
alias: "@MI_ORCH_README"
|
||||
PROJECT-STATUS.md:
|
||||
alias: "@MI_STATUS"
|
||||
descripcion: "Estado actual del proyecto"
|
||||
PROXIMA-ACCION.md:
|
||||
alias: "@MI_NEXT"
|
||||
descripcion: "Siguiente tarea a ejecutar"
|
||||
|
||||
trazabilidad:
|
||||
CONTEXT-MAP.yml:
|
||||
alias: "@MI_CONTEXT"
|
||||
descripcion: "Mapeo de contexto"
|
||||
TRACEABILITY.yml:
|
||||
alias: "@MI_TRACEABILITY"
|
||||
descripcion: "Trazabilidad del proyecto"
|
||||
DEPENDENCY-GRAPH.yml:
|
||||
alias: "@MI_DEP_GRAPH"
|
||||
descripcion: "Grafo de dependencias"
|
||||
_inheritance.yml:
|
||||
alias: "@MI_INHERITANCE"
|
||||
descripcion: "Herencia: INTEGRATES template-saas"
|
||||
|
||||
inventarios:
|
||||
ruta: "orchestration/inventarios/"
|
||||
alias: "@MI_INV"
|
||||
archivos:
|
||||
MASTER_INVENTORY.yml:
|
||||
alias: "@MI_INV_MASTER"
|
||||
DATABASE_INVENTORY.yml:
|
||||
alias: "@MI_INV_DB"
|
||||
BACKEND_INVENTORY.yml:
|
||||
alias: "@MI_INV_BE"
|
||||
MOBILE_INVENTORY.yml:
|
||||
alias: "@MI_INV_MOBILE"
|
||||
|
||||
directivas:
|
||||
ruta: "orchestration/directivas/"
|
||||
alias: "@MI_DIRECTIVAS"
|
||||
hereda_de: "@WS_DIRECTIVAS"
|
||||
archivos:
|
||||
- README.md
|
||||
- proyecto-triggers/TRIGGER-COHERENCIA-CAPAS.md
|
||||
- proyecto-triggers/TRIGGER-INVENTARIOS.md
|
||||
|
||||
agentes:
|
||||
ruta: "orchestration/agents/"
|
||||
alias: "@MI_AGENTS"
|
||||
archivos:
|
||||
perfiles:
|
||||
- PERFIL-DDL-AGENT.md
|
||||
- PERFIL-BACKEND-AGENT.md
|
||||
- PERFIL-MOBILE-AGENT.md
|
||||
trazas:
|
||||
- _INDEX.yml
|
||||
|
||||
trazas:
|
||||
ruta: "orchestration/trazas/"
|
||||
alias: "@MI_TRAZAS"
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
# REFERENCIAS AL WORKSPACE
|
||||
# -------------------------------------------------------------------------------
|
||||
|
||||
workspace_refs:
|
||||
archivo: "orchestration/_refs/WS-REFERENCES.yml"
|
||||
alias: "@MI_WS_REFS"
|
||||
contenido:
|
||||
- "@WS_DIRECTIVAS"
|
||||
- "@WS_PERFILES"
|
||||
- "@WS_TEMPLATES"
|
||||
- "@WS_DEFINITIONS"
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
# ESTADISTICAS
|
||||
# -------------------------------------------------------------------------------
|
||||
|
||||
estadisticas:
|
||||
docs:
|
||||
total_archivos: "~15"
|
||||
carpetas: 3
|
||||
orchestration:
|
||||
total_archivos: "~20"
|
||||
inventarios: 4
|
||||
trazas: 1
|
||||
total_aliases: 20
|
||||
cobertura_documentacion: "85%"
|
||||
ultima_auditoria: "2026-01-16"
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
# NAVEGACION RAPIDA POR ROL
|
||||
# -------------------------------------------------------------------------------
|
||||
|
||||
por_rol:
|
||||
desarrollador_backend:
|
||||
inicio: "@MI_INV_BE"
|
||||
api: "@MI_STATUS"
|
||||
|
||||
desarrollador_mobile:
|
||||
inicio: "@MI_INV_MOBILE"
|
||||
api: "@MI_STATUS"
|
||||
|
||||
dba:
|
||||
inicio: "@MI_INV_DB"
|
||||
|
||||
orquestador:
|
||||
inicio: "@MI_STATUS"
|
||||
siguiente: "@MI_NEXT"
|
||||
65
orchestration/agents/README.md
Normal file
65
orchestration/agents/README.md
Normal file
@ -0,0 +1,65 @@
|
||||
# Agentes de MiInventario
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Actualizado:** 2026-01-16
|
||||
|
||||
---
|
||||
|
||||
## Proposito
|
||||
|
||||
Este directorio contiene perfiles de agentes especializados para trabajar
|
||||
en el proyecto miinventario y trazas de sus actividades.
|
||||
|
||||
## Estructura
|
||||
|
||||
```
|
||||
agents/
|
||||
├── README.md <- Este archivo
|
||||
├── perfiles/ <- Perfiles de agentes especializados
|
||||
│ ├── PERFIL-DDL-AGENT.md
|
||||
│ ├── PERFIL-BACKEND-AGENT.md
|
||||
│ └── PERFIL-MOBILE-AGENT.md
|
||||
└── trazas/ <- Registro de actividad de agentes
|
||||
├── _INDEX.yml
|
||||
└── TRAZA-AGENTE-*.md
|
||||
```
|
||||
|
||||
## Perfiles Disponibles
|
||||
|
||||
| Perfil | Rol | Especialidad |
|
||||
|--------|-----|--------------|
|
||||
| DDL-AGENT | Database Developer | Schemas, tablas, multi-tenant |
|
||||
| BACKEND-AGENT | Backend Developer | NestJS, TypeORM, APIs, Bull queues |
|
||||
| MOBILE-AGENT | Mobile Developer | React Native, Expo, video capture |
|
||||
|
||||
## Herencia de Perfiles
|
||||
|
||||
Los agentes de miinventario heredan capacidades del workspace:
|
||||
|
||||
```
|
||||
Workspace Perfiles (39 disponibles)
|
||||
│
|
||||
├── PERFIL-ORQUESTADOR (coordinacion)
|
||||
├── PERFIL-TECH-LEADER (arquitectura)
|
||||
├── PERFIL-BACKEND-EXPRESS (implementacion)
|
||||
└── ... otros
|
||||
│
|
||||
└── MiInventario Perfiles (especializados)
|
||||
├── DDL-AGENT (DDL + video storage)
|
||||
├── BACKEND-AGENT (NestJS + AI)
|
||||
└── MOBILE-AGENT (Expo + camera)
|
||||
```
|
||||
|
||||
## Trazas
|
||||
|
||||
Las trazas registran:
|
||||
- Tareas ejecutadas por cada agente
|
||||
- Archivos creados/modificados
|
||||
- Commits asociados
|
||||
- Decisiones tomadas
|
||||
|
||||
## Referencias
|
||||
|
||||
- `@WS_PERFILES` - Perfiles del workspace
|
||||
- `@MI_AGENTS` - Este directorio
|
||||
- `@MI_TRAZAS` - Trazas de agentes
|
||||
124
orchestration/agents/perfiles/PERFIL-BACKEND-AGENT.md
Normal file
124
orchestration/agents/perfiles/PERFIL-BACKEND-AGENT.md
Normal file
@ -0,0 +1,124 @@
|
||||
# PERFIL: Backend Agent
|
||||
|
||||
**ID:** MI-BACKEND-AGENT
|
||||
**Version:** 1.0.0
|
||||
**Proyecto:** miinventario
|
||||
**Hereda de:** @WS_PERFIL_BACKEND_EXPRESS
|
||||
|
||||
---
|
||||
|
||||
## Identidad
|
||||
|
||||
**Rol:** Backend Developer especializado en NestJS para inventario AI
|
||||
**Alcance:** Modulos, services, controllers, entities, queues
|
||||
|
||||
## Responsabilidades
|
||||
|
||||
### Primarias
|
||||
- Implementar modulos NestJS
|
||||
- Crear entities TypeORM alineadas con DDL
|
||||
- Desarrollar services con logica de negocio
|
||||
- Integrar con servicios AI/ML
|
||||
- Configurar Bull queues para procesamiento asincrono
|
||||
- Escribir tests unitarios y E2E
|
||||
|
||||
### Secundarias
|
||||
- Coordinar con DDL-AGENT para coherencia
|
||||
- Mantener BACKEND_INVENTORY.yml actualizado
|
||||
- Documentar APIs
|
||||
|
||||
## Herramientas
|
||||
|
||||
### Estructura de Modulo
|
||||
```
|
||||
apps/backend/src/modules/{modulo}/
|
||||
├── index.ts
|
||||
├── {modulo}.module.ts
|
||||
├── {modulo}.controller.ts
|
||||
├── {modulo}.service.ts
|
||||
├── entities/
|
||||
│ └── {entity}.entity.ts
|
||||
├── dto/
|
||||
│ ├── create-{entity}.dto.ts
|
||||
│ └── update-{entity}.dto.ts
|
||||
├── processors/ # Bull job processors
|
||||
│ └── {job}.processor.ts
|
||||
└── __tests__/
|
||||
└── {modulo}.service.spec.ts
|
||||
```
|
||||
|
||||
### Patron Entity Multi-tenant
|
||||
```typescript
|
||||
@Entity({ schema: 'schema_name' })
|
||||
export class EntityName {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column('uuid')
|
||||
@Index()
|
||||
tenantId: string;
|
||||
|
||||
@ManyToOne(() => Tenant, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'tenant_id' })
|
||||
tenant: Tenant;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt: Date;
|
||||
|
||||
@UpdateDateColumn()
|
||||
updatedAt: Date;
|
||||
}
|
||||
```
|
||||
|
||||
### Ubicaciones
|
||||
- Modulos: `apps/backend/src/modules/`
|
||||
- Entities: `apps/backend/src/modules/{mod}/entities/`
|
||||
- Tests: `apps/backend/src/modules/{mod}/__tests__/`
|
||||
- Inventario: `orchestration/inventarios/BACKEND_INVENTORY.yml`
|
||||
|
||||
## Triggers Activos
|
||||
|
||||
- `@TRIGGER-MI-COHERENCIA` - Validar DDL existe
|
||||
- `@TRIGGER-MI-INVENTARIOS` - Actualizar inventario
|
||||
|
||||
## Validaciones Pre-Commit
|
||||
|
||||
```bash
|
||||
# Build
|
||||
cd apps/backend && npm run build
|
||||
|
||||
# Lint
|
||||
npm run lint
|
||||
|
||||
# Tests
|
||||
npm run test
|
||||
```
|
||||
|
||||
## Patrones Requeridos
|
||||
|
||||
1. **Multi-tenancy:** Inyectar `tenantId` en queries
|
||||
2. **Queues:** Usar Bull para procesamiento de video
|
||||
3. **DTOs:** Validar con class-validator
|
||||
4. **Storage:** Usar S3 compatible para videos
|
||||
5. **Swagger:** Documentar todos los endpoints
|
||||
|
||||
## Modulos Principales
|
||||
|
||||
| Modulo | Descripcion |
|
||||
|--------|-------------|
|
||||
| auth | Autenticacion JWT |
|
||||
| tenants | Multi-tenancy |
|
||||
| stores | Gestion de tiendas |
|
||||
| videos | Upload y procesamiento |
|
||||
| ai | Integracion con deteccion |
|
||||
| inventory | Resultados de conteo |
|
||||
| credits | Wallet y tokens |
|
||||
| payments | Stripe y agregadores |
|
||||
| referrals | Sistema multinivel |
|
||||
|
||||
## Referencias
|
||||
|
||||
- `@MI_DEF_ENTITIES` - ENTITIES-CATALOG.md
|
||||
- `@MI_DEF_SERVICES` - SERVICES-CATALOG.md
|
||||
- `@MI_INV_BE` - BACKEND_INVENTORY.yml
|
||||
- `@WS_PERFIL_BACKEND_EXPRESS` - Perfil padre
|
||||
88
orchestration/agents/perfiles/PERFIL-DDL-AGENT.md
Normal file
88
orchestration/agents/perfiles/PERFIL-DDL-AGENT.md
Normal file
@ -0,0 +1,88 @@
|
||||
# PERFIL: DDL Agent
|
||||
|
||||
**ID:** MI-DDL-AGENT
|
||||
**Version:** 1.0.0
|
||||
**Proyecto:** miinventario
|
||||
**Hereda de:** @WS_PERFIL_DATABASE_AUDITOR
|
||||
|
||||
---
|
||||
|
||||
## Identidad
|
||||
|
||||
**Rol:** Database Developer especializado en DDL para inventario AI
|
||||
**Alcance:** Schemas, tablas, migraciones, storage de video
|
||||
|
||||
## Responsabilidades
|
||||
|
||||
### Primarias
|
||||
- Disenar y crear schemas PostgreSQL
|
||||
- Implementar tablas con soporte multi-tenant
|
||||
- Disenar estructura para almacenar resultados de AI
|
||||
- Crear funciones y triggers
|
||||
- Mantener DATABASE_INVENTORY.yml actualizado
|
||||
|
||||
### Secundarias
|
||||
- Coordinar con BACKEND-AGENT para entities
|
||||
- Validar coherencia DDL <-> TypeORM
|
||||
- Documentar cambios en DATABASE-SCHEMA.md
|
||||
|
||||
## Herramientas
|
||||
|
||||
### DDL
|
||||
```sql
|
||||
-- Patron de tabla multi-tenant para inventario
|
||||
CREATE TABLE schema.tabla (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
tenant_id UUID NOT NULL REFERENCES tenants.tenants(id) ON DELETE CASCADE,
|
||||
-- columnas especificas inventario AI
|
||||
created_at TIMESTAMPTZ DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Indice para tenant
|
||||
CREATE INDEX idx_tabla_tenant ON schema.tabla(tenant_id);
|
||||
```
|
||||
|
||||
### Ubicaciones
|
||||
- DDL: `database/schemas/{schema}/tables/`
|
||||
- Seeds: `database/seeds/`
|
||||
- Inventario: `orchestration/inventarios/DATABASE_INVENTORY.yml`
|
||||
- Documentacion: `docs/_definitions/DATABASE-SCHEMA.md`
|
||||
|
||||
## Triggers Activos
|
||||
|
||||
- `@TRIGGER-MI-COHERENCIA` - Validar entity existe
|
||||
- `@TRIGGER-MI-INVENTARIOS` - Actualizar inventario
|
||||
|
||||
## Validaciones Pre-Commit
|
||||
|
||||
```bash
|
||||
# Validar sintaxis SQL
|
||||
npm run db:validate
|
||||
|
||||
# Ejecutar migraciones en dev
|
||||
npm run db:migrate
|
||||
```
|
||||
|
||||
## Patrones Requeridos
|
||||
|
||||
1. **Multi-tenancy:** TODAS las tablas de negocio tienen `tenant_id`
|
||||
2. **UUID Keys:** Usar UUID para PKs
|
||||
3. **Timestamps:** Incluir `created_at` y `updated_at`
|
||||
4. **Storage refs:** Referencias a S3 para videos/imagenes
|
||||
|
||||
## Modulos Principales
|
||||
|
||||
- Auth/Tenants
|
||||
- Stores (tiendas)
|
||||
- Videos (procesamiento)
|
||||
- Products (detectados)
|
||||
- Inventory (conteo)
|
||||
- Credits (wallet/tokens)
|
||||
- Referrals (multinivel)
|
||||
|
||||
## Referencias
|
||||
|
||||
- `@MI_DEF_DB` - DATABASE-SCHEMA.md
|
||||
- `@MI_INV_DB` - DATABASE_INVENTORY.yml
|
||||
- `@WS_PERFIL_DATABASE_AUDITOR` - Perfil padre
|
||||
118
orchestration/agents/perfiles/PERFIL-MOBILE-AGENT.md
Normal file
118
orchestration/agents/perfiles/PERFIL-MOBILE-AGENT.md
Normal file
@ -0,0 +1,118 @@
|
||||
# PERFIL: Mobile Agent
|
||||
|
||||
**ID:** MI-MOBILE-AGENT
|
||||
**Version:** 1.0.0
|
||||
**Proyecto:** miinventario
|
||||
**Hereda de:** @WS_PERFIL_FRONTEND
|
||||
|
||||
---
|
||||
|
||||
## Identidad
|
||||
|
||||
**Rol:** Mobile Developer especializado en React Native/Expo para inventario
|
||||
**Alcance:** Screens, components, navigation, camera, video
|
||||
|
||||
## Responsabilidades
|
||||
|
||||
### Primarias
|
||||
- Implementar screens en React Native
|
||||
- Integrar captura de video con Expo Camera
|
||||
- Subir videos a backend
|
||||
- Mostrar resultados de inventario
|
||||
- Gestionar creditos y pagos in-app
|
||||
|
||||
### Secundarias
|
||||
- Coordinar con BACKEND-AGENT para APIs
|
||||
- Mantener MOBILE_INVENTORY.yml actualizado
|
||||
- Optimizar para dispositivos de gama media/baja
|
||||
|
||||
## Herramientas
|
||||
|
||||
### Stack Tecnologico
|
||||
- **Framework:** React Native (Expo)
|
||||
- **Navigation:** React Navigation
|
||||
- **Data Fetching:** TanStack Query
|
||||
- **State:** Zustand
|
||||
- **Camera:** expo-camera
|
||||
- **Storage:** AsyncStorage / SecureStore
|
||||
|
||||
### Estructura de Screen
|
||||
```
|
||||
apps/mobile/src/screens/{feature}/
|
||||
├── index.tsx # Export principal
|
||||
├── {Feature}Screen.tsx # Componente de screen
|
||||
├── components/ # Componentes locales
|
||||
│ └── {Component}.tsx
|
||||
└── hooks/ # Hooks locales
|
||||
└── use{Feature}.ts
|
||||
```
|
||||
|
||||
### Patron de Hook Mobile
|
||||
```typescript
|
||||
export function useFeature() {
|
||||
const { tenantId } = useTenant();
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['feature', tenantId],
|
||||
queryFn: () => featureApi.getAll(tenantId),
|
||||
enabled: !!tenantId,
|
||||
staleTime: 5 * 60 * 1000, // Cache agresivo
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
### Ubicaciones
|
||||
- Screens: `apps/mobile/src/screens/`
|
||||
- Components: `apps/mobile/src/components/`
|
||||
- Hooks: `apps/mobile/src/hooks/`
|
||||
- Navigation: `apps/mobile/src/navigation/`
|
||||
- Inventario: `orchestration/inventarios/MOBILE_INVENTORY.yml`
|
||||
|
||||
## Triggers Activos
|
||||
|
||||
- `@TRIGGER-MI-INVENTARIOS` - Actualizar inventario
|
||||
|
||||
## Validaciones Pre-Commit
|
||||
|
||||
```bash
|
||||
# TypeCheck
|
||||
cd apps/mobile && npm run typecheck
|
||||
|
||||
# Lint
|
||||
npm run lint
|
||||
|
||||
# Tests
|
||||
npm run test
|
||||
```
|
||||
|
||||
## Patrones Requeridos
|
||||
|
||||
1. **Expo:** Usar Expo SDK donde sea posible
|
||||
2. **Offline-First:** Cache para uso sin internet
|
||||
3. **Video:** Grabar 30-60s, optimizar antes de subir
|
||||
4. **Feedback:** Mostrar progreso de procesamiento
|
||||
5. **Creditos:** Mostrar balance y consumo
|
||||
|
||||
## Screens Principales
|
||||
|
||||
| Screen | Descripcion |
|
||||
|--------|-------------|
|
||||
| HomeScreen | Dashboard principal |
|
||||
| CameraScreen | Captura de video |
|
||||
| InventoryScreen | Resultados de conteo |
|
||||
| HistoryScreen | Historial de inventarios |
|
||||
| CreditsScreen | Balance y recarga |
|
||||
| StoreScreen | Gestion de tienda |
|
||||
| ProfileScreen | Configuracion usuario |
|
||||
|
||||
## Features Nativas
|
||||
|
||||
- **Camera:** Grabar video de anaqueles
|
||||
- **Upload:** Subir video en background
|
||||
- **Notificaciones:** Avisar cuando inventario listo
|
||||
- **Galeria:** Seleccionar video existente
|
||||
|
||||
## Referencias
|
||||
|
||||
- `@MI_INV_MOBILE` - MOBILE_INVENTORY.yml
|
||||
- `@MI_QUICK_API` - QUICK-API.yml (endpoints disponibles)
|
||||
48
orchestration/agents/trazas/_INDEX.yml
Normal file
48
orchestration/agents/trazas/_INDEX.yml
Normal file
@ -0,0 +1,48 @@
|
||||
# ===============================================================================
|
||||
# INDICE DE TRAZAS DE AGENTES - MIINVENTARIO
|
||||
# ===============================================================================
|
||||
#
|
||||
# Proposito: Registro de actividad de agentes en el proyecto
|
||||
# Alias: @MI_TRAZAS_INDEX
|
||||
#
|
||||
# ===============================================================================
|
||||
|
||||
version: "1.0.0"
|
||||
created: "2026-01-16"
|
||||
updated: "2026-01-16"
|
||||
proyecto: "miinventario"
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
# AGENTES REGISTRADOS
|
||||
# -------------------------------------------------------------------------------
|
||||
|
||||
agentes:
|
||||
MI-DDL-AGENT:
|
||||
perfil: "orchestration/agents/perfiles/PERFIL-DDL-AGENT.md"
|
||||
trazas: []
|
||||
ultima_actividad: null
|
||||
|
||||
MI-BACKEND-AGENT:
|
||||
perfil: "orchestration/agents/perfiles/PERFIL-BACKEND-AGENT.md"
|
||||
trazas: []
|
||||
ultima_actividad: null
|
||||
|
||||
MI-MOBILE-AGENT:
|
||||
perfil: "orchestration/agents/perfiles/PERFIL-MOBILE-AGENT.md"
|
||||
trazas: []
|
||||
ultima_actividad: null
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
# ESTADISTICAS
|
||||
# -------------------------------------------------------------------------------
|
||||
|
||||
estadisticas:
|
||||
total_agentes: 3
|
||||
total_trazas: 0
|
||||
ultima_traza: null
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
# FORMATO DE TRAZA
|
||||
# -------------------------------------------------------------------------------
|
||||
# Las trazas se nombran: TRAZA-{AGENTE}-{YYYY-MM-DD}-{NNN}.md
|
||||
# Ejemplo: TRAZA-MI-BACKEND-AGENT-2026-01-16-001.md
|
||||
53
orchestration/directivas/README.md
Normal file
53
orchestration/directivas/README.md
Normal file
@ -0,0 +1,53 @@
|
||||
# Directivas de MiInventario
|
||||
|
||||
**Version:** 1.0.0
|
||||
**Actualizado:** 2026-01-16
|
||||
|
||||
---
|
||||
|
||||
## Proposito
|
||||
|
||||
Este directorio contiene directivas especificas del proyecto miinventario.
|
||||
Las directivas generales se heredan del workspace padre (`/orchestration/directivas/`).
|
||||
|
||||
## Estructura
|
||||
|
||||
```
|
||||
directivas/
|
||||
├── README.md <- Este archivo
|
||||
├── proyecto-triggers/ <- Triggers especificos del proyecto
|
||||
│ ├── TRIGGER-COHERENCIA-CAPAS.md
|
||||
│ └── TRIGGER-INVENTARIOS.md
|
||||
└── proyecto-modos/ <- Modos especificos (si aplica)
|
||||
└── README.md
|
||||
```
|
||||
|
||||
## Herencia
|
||||
|
||||
MiInventario hereda tipo INTEGRATES de template-saas:
|
||||
|
||||
| Categoria | Heredado de | Ruta |
|
||||
|-----------|-------------|------|
|
||||
| Principios | Workspace | `/orchestration/directivas/principios/` |
|
||||
| SIMCO | Workspace | `/orchestration/directivas/simco/` |
|
||||
| Triggers | Workspace | `/orchestration/directivas/triggers/` |
|
||||
| Modos | Workspace | `/orchestration/directivas/modos/` |
|
||||
|
||||
## Triggers Especificos
|
||||
|
||||
Los triggers en `proyecto-triggers/` son **adicionales** a los del workspace
|
||||
y aplican especificamente a miinventario.
|
||||
|
||||
### TRIGGER-COHERENCIA-CAPAS.md
|
||||
|
||||
Valida que cambios en DDL tengan entities correspondientes en backend.
|
||||
Adaptado para arquitectura con apps/backend y apps/mobile (React Native/Expo).
|
||||
|
||||
### TRIGGER-INVENTARIOS.md
|
||||
|
||||
Valida que los inventarios esten sincronizados con el codigo.
|
||||
|
||||
## Referencias
|
||||
|
||||
- `@WS_DIRECTIVAS` - Directivas del workspace
|
||||
- `@MI_DIRECTIVAS` - Este directorio
|
||||
@ -0,0 +1,108 @@
|
||||
# TRIGGER: Coherencia Entre Capas
|
||||
|
||||
**ID:** TRIGGER-MI-COHERENCIA
|
||||
**Version:** 1.0.0
|
||||
**Prioridad:** P1 (Bloqueante)
|
||||
**Activacion:** Automatica en cambios DDL/Backend
|
||||
**Hereda de:** template-saas (INTEGRATES)
|
||||
|
||||
---
|
||||
|
||||
## Proposito
|
||||
|
||||
Garantizar coherencia entre las capas DDL, Backend y Mobile del proyecto MiInventario.
|
||||
Cada tabla DDL debe tener su entity correspondiente en el backend.
|
||||
|
||||
## Contexto del Proyecto
|
||||
|
||||
MiInventario es un SaaS movil para inventario automatico por video con:
|
||||
- **Backend:** NestJS + TypeScript
|
||||
- **Mobile:** React Native (Expo)
|
||||
- **Database:** PostgreSQL + Redis
|
||||
- **AI:** Deteccion de productos por video
|
||||
|
||||
## Activacion
|
||||
|
||||
Este trigger se activa cuando:
|
||||
- Se crea/modifica archivo en `database/schemas/*/tables/*.sql`
|
||||
- Se crea/modifica archivo en `apps/backend/src/modules/*/entities/*.entity.ts`
|
||||
- Se ejecuta validacion manual con `@MI_VALIDATE_COHERENCIA`
|
||||
|
||||
## Validaciones
|
||||
|
||||
### 1. DDL -> Entity (Obligatorio)
|
||||
|
||||
```
|
||||
Para cada tabla en DDL:
|
||||
├── Verificar que existe entity correspondiente
|
||||
├── Verificar que columnas coincidan (nombre, tipo)
|
||||
├── Verificar que relaciones esten mapeadas
|
||||
└── Documentar excepciones justificadas
|
||||
```
|
||||
|
||||
**Excepciones Permitidas:**
|
||||
- Tablas M:N gestionadas por TypeORM (documentar en ENTITIES-CATALOG)
|
||||
- Tablas de auditoria automatica (documentar en DATABASE-SCHEMA)
|
||||
- Tablas de sistema/migracion
|
||||
- Tablas de ML/AI temporales
|
||||
|
||||
### 2. Entity -> Service (Recomendado)
|
||||
|
||||
```
|
||||
Para cada entity:
|
||||
├── Verificar que existe service que la usa
|
||||
└── Verificar que operaciones CRUD estan implementadas (si aplica)
|
||||
```
|
||||
|
||||
### 3. Service -> Controller (Si expone API)
|
||||
|
||||
```
|
||||
Para cada service expuesto:
|
||||
├── Verificar que existe controller
|
||||
├── Verificar que endpoints estan documentados
|
||||
└── Verificar que DTOs existen para request/response
|
||||
```
|
||||
|
||||
## Ubicaciones Especificas
|
||||
|
||||
| Capa | Ubicacion |
|
||||
|------|-----------|
|
||||
| DDL | `database/schemas/{schema}/tables/` |
|
||||
| Entities | `apps/backend/src/modules/{mod}/entities/` |
|
||||
| Services | `apps/backend/src/modules/{mod}/` |
|
||||
| Controllers | `apps/backend/src/modules/{mod}/` |
|
||||
|
||||
## Resultado de Validacion
|
||||
|
||||
### Exito
|
||||
```yaml
|
||||
status: "pass"
|
||||
ddl_tables: <total>
|
||||
entities: <total>
|
||||
coverage: 100%
|
||||
exceptions: 0
|
||||
```
|
||||
|
||||
### Fallo (Bloqueante)
|
||||
```yaml
|
||||
status: "fail"
|
||||
ddl_tables: <total+1>
|
||||
entities: <total>
|
||||
coverage: <porcentaje>
|
||||
missing:
|
||||
- tabla: "new_table"
|
||||
schema: "new_schema"
|
||||
accion_requerida: "Crear entity o documentar excepcion"
|
||||
```
|
||||
|
||||
## Acciones Correctivas
|
||||
|
||||
1. **Si falta entity:** Crear entity en `apps/backend/src/modules/{modulo}/entities/`
|
||||
2. **Si es excepcion:** Documentar en `docs/_definitions/ENTITIES-CATALOG.md`
|
||||
3. **Si es tabla temporal:** Agregar a lista de exclusiones
|
||||
|
||||
## Referencias
|
||||
|
||||
- `@MI_DEF_ENTITIES` - Catalogo de entities
|
||||
- `@MI_DEF_DB` - Schema de base de datos
|
||||
- `@MI_INV_BE` - Inventario backend
|
||||
@ -0,0 +1,124 @@
|
||||
# TRIGGER: Inventarios Sincronizados
|
||||
|
||||
**ID:** TRIGGER-MI-INVENTARIOS
|
||||
**Version:** 1.0.0
|
||||
**Prioridad:** P2 (Importante)
|
||||
**Activacion:** Post-tarea con cambios de codigo
|
||||
**Hereda de:** template-saas (INTEGRATES)
|
||||
|
||||
---
|
||||
|
||||
## Proposito
|
||||
|
||||
Mantener los inventarios del proyecto sincronizados con el codigo real.
|
||||
Detectar discrepancias entre lo documentado y lo implementado.
|
||||
|
||||
## Contexto del Proyecto
|
||||
|
||||
MiInventario tiene estructura monorepo con:
|
||||
- `apps/backend/` - API NestJS
|
||||
- `apps/mobile/` - App React Native (Expo)
|
||||
- Servicios AI para procesamiento de video
|
||||
|
||||
## Activacion
|
||||
|
||||
Este trigger se activa cuando:
|
||||
- Se completa una tarea que modifica codigo
|
||||
- Se ejecuta validacion manual con `@MI_VALIDATE_INVENTARIOS`
|
||||
- Se prepara release
|
||||
|
||||
## Inventarios a Validar
|
||||
|
||||
| Inventario | Ubicacion | Valida |
|
||||
|------------|-----------|--------|
|
||||
| DATABASE_INVENTORY.yml | orchestration/inventarios/ | Schemas, tablas, enums, funciones |
|
||||
| BACKEND_INVENTORY.yml | orchestration/inventarios/ | Modulos, services, entities, tests |
|
||||
| MOBILE_INVENTORY.yml | orchestration/inventarios/ | Screens, components, navigation |
|
||||
| MASTER_INVENTORY.yml | orchestration/inventarios/ | Totales consolidados |
|
||||
|
||||
## Validaciones
|
||||
|
||||
### 1. DATABASE_INVENTORY.yml
|
||||
|
||||
```bash
|
||||
# Validar schemas
|
||||
ls database/schemas/ | wc -l # Debe coincidir con total_schemas
|
||||
|
||||
# Validar tablas
|
||||
find database/schemas -name "*.sql" -path "*tables*" | wc -l
|
||||
```
|
||||
|
||||
### 2. BACKEND_INVENTORY.yml
|
||||
|
||||
```bash
|
||||
# Validar entities
|
||||
find apps/backend/src/modules -name "*.entity.ts" | wc -l
|
||||
|
||||
# Validar services
|
||||
find apps/backend/src/modules -name "*.service.ts" | wc -l
|
||||
|
||||
# Validar controllers
|
||||
find apps/backend/src/modules -name "*.controller.ts" | wc -l
|
||||
```
|
||||
|
||||
### 3. MOBILE_INVENTORY.yml
|
||||
|
||||
```bash
|
||||
# Validar screens
|
||||
find apps/mobile/src/screens -name "*.tsx" | wc -l
|
||||
|
||||
# Validar components
|
||||
find apps/mobile/src/components -name "*.tsx" | wc -l
|
||||
```
|
||||
|
||||
### 4. MASTER_INVENTORY.yml
|
||||
|
||||
```yaml
|
||||
# Totales deben coincidir con suma de inventarios individuales
|
||||
backend_entities: sum(BACKEND_INVENTORY.entities)
|
||||
mobile_screens: sum(MOBILE_INVENTORY.screens)
|
||||
database_tables: sum(DATABASE_INVENTORY.tablas)
|
||||
```
|
||||
|
||||
## Resultado de Validacion
|
||||
|
||||
### Exito
|
||||
```yaml
|
||||
status: "pass"
|
||||
inventarios:
|
||||
database: "sync"
|
||||
backend: "sync"
|
||||
mobile: "sync"
|
||||
master: "sync"
|
||||
discrepancias: 0
|
||||
```
|
||||
|
||||
### Advertencia
|
||||
```yaml
|
||||
status: "warning"
|
||||
inventarios:
|
||||
database: "sync"
|
||||
backend: "desync"
|
||||
mobile: "sync"
|
||||
master: "desync"
|
||||
discrepancias:
|
||||
- inventario: "BACKEND_INVENTORY.yml"
|
||||
campo: "total_entities"
|
||||
documentado: <doc>
|
||||
real: <real>
|
||||
accion: "Actualizar inventario"
|
||||
```
|
||||
|
||||
## Acciones Correctivas
|
||||
|
||||
1. **Actualizar totales:** Corregir numeros en inventarios
|
||||
2. **Agregar items faltantes:** Documentar nuevos artefactos
|
||||
3. **Eliminar items obsoletos:** Remover referencias a codigo eliminado
|
||||
4. **Actualizar MASTER:** Recalcular totales consolidados
|
||||
|
||||
## Referencias
|
||||
|
||||
- `@MI_INV_MASTER` - Inventario maestro
|
||||
- `@MI_INV_DB` - Inventario database
|
||||
- `@MI_INV_BE` - Inventario backend
|
||||
- `@MI_INV_MOBILE` - Inventario mobile
|
||||
Loading…
Reference in New Issue
Block a user