[SEMANA-3-AGENTES] feat: Add IDE configurations (L3)
Some checks failed
CI/CD Pipeline / Backend CI (push) Has been cancelled
CI/CD Pipeline / Frontend CI (push) Has been cancelled
CI/CD Pipeline / WhatsApp Service CI (push) Has been cancelled
CI/CD Pipeline / Mobile CI (push) Has been cancelled
CI/CD Pipeline / Docker Build (./apps/backend, ./apps/backend/Dockerfile, backend) (push) Has been cancelled
CI/CD Pipeline / Docker Build (./apps/frontend, ./apps/frontend/Dockerfile, frontend) (push) Has been cancelled
CI/CD Pipeline / Docker Build (./apps/whatsapp-service, ./apps/whatsapp-service/Dockerfile, whatsapp-service) (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
Some checks failed
CI/CD Pipeline / Backend CI (push) Has been cancelled
CI/CD Pipeline / Frontend CI (push) Has been cancelled
CI/CD Pipeline / WhatsApp Service CI (push) Has been cancelled
CI/CD Pipeline / Mobile CI (push) Has been cancelled
CI/CD Pipeline / Docker Build (./apps/backend, ./apps/backend/Dockerfile, backend) (push) Has been cancelled
CI/CD Pipeline / Docker Build (./apps/frontend, ./apps/frontend/Dockerfile, frontend) (push) Has been cancelled
CI/CD Pipeline / Docker Build (./apps/whatsapp-service, ./apps/whatsapp-service/Dockerfile, whatsapp-service) (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
- Add CLAUDE.md with project-specific instructions - Add .trae/rules/ and AGENT-CAPABILITIES.md - Add .windsurf/rules/ and AGENT-CAPABILITIES.md - Add .gemini/antigravity/README.md - Stack: NestJS 10.3.0 + React 19.2.0 + React Native (Expo) - Type: CONSUMER (receives from template-saas) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
6c78f05f38
commit
631250df84
147
.gemini/antigravity/README.md
Normal file
147
.gemini/antigravity/README.md
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
# Gemini Agent Configuration - MiChangarrito
|
||||||
|
|
||||||
|
**Proyecto:** michangarrito
|
||||||
|
**Tipo:** CONSUMER (de template-saas)
|
||||||
|
**Sistema:** SIMCO v4.3.0 + NEXUS v4.0
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Herencia
|
||||||
|
|
||||||
|
Este proyecto hereda configuraciones de:
|
||||||
|
- `workspace-v2/.gemini/antigravity/`
|
||||||
|
- `workspace-v2/orchestration/agents/configs/SHARED-PLATFORM-CONFIG.yml`
|
||||||
|
- `workspace-v2/orchestration/agents/configs/SHARED-PROJECT-REGISTRY.yml`
|
||||||
|
- `template-saas/` (patrones SaaS)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Identificación del Proyecto
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
aliases: ["michangarrito", "mch", "changarrito"]
|
||||||
|
root: "projects/michangarrito/"
|
||||||
|
type: "CONSUMER"
|
||||||
|
nivel_nexus: "L2"
|
||||||
|
dominio: "Retail/POS"
|
||||||
|
mercado: "México"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Stack Tecnológico
|
||||||
|
|
||||||
|
| Componente | Tecnología |
|
||||||
|
|------------|------------|
|
||||||
|
| Backend | NestJS 10.3.0 |
|
||||||
|
| Frontend Web | React 19.2.0 |
|
||||||
|
| Mobile | React Native (Expo) |
|
||||||
|
| Database | PostgreSQL 16+ |
|
||||||
|
| Cache | Redis 7 |
|
||||||
|
| WhatsApp | Meta Business API |
|
||||||
|
| LLM | OpenRouter/Claude/GPT-4 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Credenciales BD
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
db_name: michangarrito_dev
|
||||||
|
db_user: michangarrito_dev
|
||||||
|
db_pass: mch_dev_2026
|
||||||
|
db_port: 5432
|
||||||
|
redis_port: 6389
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Boot Sequence
|
||||||
|
|
||||||
|
Al trabajar en este proyecto:
|
||||||
|
|
||||||
|
1. Cargar `workspace-v2/CLAUDE.md`
|
||||||
|
2. Cargar `projects/michangarrito/CLAUDE.md`
|
||||||
|
3. Cargar `orchestration/agents/configs/SHARED-PLATFORM-CONFIG.yml`
|
||||||
|
4. Identificar plataforma (backend/frontend/mobile)
|
||||||
|
5. Cargar contexto específico según tarea
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Apps en el Monorepo
|
||||||
|
|
||||||
|
| App | Descripción | Puerto |
|
||||||
|
|-----|-------------|--------|
|
||||||
|
| backend | NestJS API (23 módulos) | 3141 |
|
||||||
|
| frontend | React Web App | 3140 |
|
||||||
|
| mobile | React Native (Expo) | 8081 |
|
||||||
|
| mcp-server | Gateway LLM (15 tools) | 3142 |
|
||||||
|
| whatsapp-service | Meta Cloud API | 3143 |
|
||||||
|
| database | DDL (11 schemas) | - |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Módulos Backend (23)
|
||||||
|
|
||||||
|
```
|
||||||
|
auth, billing, categories, codi-spei, customers,
|
||||||
|
delivery, exports, integrations, inventory, invoices,
|
||||||
|
marketplace, messaging, notifications, onboarding,
|
||||||
|
orders, payments, products, referrals, sales,
|
||||||
|
settings, subscriptions, templates, widgets
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Paths de Trabajo
|
||||||
|
|
||||||
|
```
|
||||||
|
Backend: projects/michangarrito/apps/backend/src/
|
||||||
|
Frontend: projects/michangarrito/apps/frontend/src/
|
||||||
|
Mobile: projects/michangarrito/apps/mobile/src/
|
||||||
|
WhatsApp: projects/michangarrito/apps/whatsapp-service/
|
||||||
|
MCP Server: projects/michangarrito/apps/mcp-server/
|
||||||
|
Database: projects/michangarrito/apps/database/
|
||||||
|
Docs: projects/michangarrito/docs/
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Reglas de Seguridad
|
||||||
|
|
||||||
|
### Multi-Tenancy
|
||||||
|
- Cada changarrito es un tenant aislado
|
||||||
|
- RLS obligatorio en todas las queries
|
||||||
|
- NUNCA acceder a datos de otro tenant
|
||||||
|
|
||||||
|
### Pagos México
|
||||||
|
- CoDi/SPEI en sandbox únicamente
|
||||||
|
- Validar montos en MXN
|
||||||
|
- Usar cuentas de prueba
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Estado del Proyecto
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
mvp_completado: 95%
|
||||||
|
en_produccion: false
|
||||||
|
modo: multi-tenant
|
||||||
|
bloqueadores:
|
||||||
|
- Meta Business verificada
|
||||||
|
- API keys producción
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Propagación
|
||||||
|
|
||||||
|
Como CONSUMER, NO propaga a otros proyectos.
|
||||||
|
Recibe cambios de template-saas cuando aplique.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Referencias
|
||||||
|
|
||||||
|
- CLAUDE.md: `projects/michangarrito/CLAUDE.md`
|
||||||
|
- Inventarios: `projects/michangarrito/orchestration/inventarios/`
|
||||||
|
- Docs: `projects/michangarrito/docs/`
|
||||||
79
.trae/AGENT-CAPABILITIES.md
Normal file
79
.trae/AGENT-CAPABILITIES.md
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
# Agent Capabilities - Trae IDE (MiChangarrito)
|
||||||
|
|
||||||
|
**Proyecto:** michangarrito
|
||||||
|
**Versión:** 1.0.0
|
||||||
|
**Sistema:** SIMCO v4.3.0
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Herencia
|
||||||
|
|
||||||
|
Este archivo extiende:
|
||||||
|
- `workspace-v2/.trae/rules.md`
|
||||||
|
- `workspace-v2/orchestration/agents/configs/SHARED-PLATFORM-CONFIG.yml`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Capacidades en este Proyecto
|
||||||
|
|
||||||
|
### Operaciones Permitidas
|
||||||
|
|
||||||
|
| Operación | Status | Notas |
|
||||||
|
|-----------|--------|-------|
|
||||||
|
| Crear módulos backend | ✅ | NestJS en apps/backend/ |
|
||||||
|
| Crear componentes frontend | ✅ | React en apps/frontend/ |
|
||||||
|
| Crear componentes mobile | ✅ | React Native en apps/mobile/ |
|
||||||
|
| Modificar WhatsApp service | ✅ | Con validación de templates |
|
||||||
|
| Modificar MCP server | ✅ | 15 herramientas LLM |
|
||||||
|
| Modificar DDL | ✅ | 11 schemas en apps/database/ |
|
||||||
|
| Escribir tests | ✅ | Jest |
|
||||||
|
| Git operations | ✅ | Commit, push, pull |
|
||||||
|
|
||||||
|
### Limitaciones Específicas
|
||||||
|
|
||||||
|
1. **NO acceder** a datos de otros tenants
|
||||||
|
2. **NO usar** API keys de producción
|
||||||
|
3. **NO enviar** mensajes WhatsApp sin template aprobado
|
||||||
|
4. **SIEMPRE** verificar que funciona en web Y mobile
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Validaciones Requeridas
|
||||||
|
|
||||||
|
Antes de marcar tarea como completada:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Backend
|
||||||
|
cd apps/backend
|
||||||
|
npm run build
|
||||||
|
npm run lint
|
||||||
|
npm run test
|
||||||
|
|
||||||
|
# Frontend Web
|
||||||
|
cd apps/frontend
|
||||||
|
npm run build
|
||||||
|
npm run lint
|
||||||
|
|
||||||
|
# Mobile
|
||||||
|
cd apps/mobile
|
||||||
|
npx expo doctor
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Contexto del Proyecto
|
||||||
|
|
||||||
|
- **23 módulos** backend activos
|
||||||
|
- **6 apps** en monorepo
|
||||||
|
- **11 schemas** de base de datos
|
||||||
|
- **15 herramientas** LLM en MCP server
|
||||||
|
- **Tipo** CONSUMER (hereda de template-saas)
|
||||||
|
- **Estado** MVP 95% completado
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Quick Reference
|
||||||
|
|
||||||
|
- CLAUDE.md: `projects/michangarrito/CLAUDE.md`
|
||||||
|
- Rules: `projects/michangarrito/.trae/rules/project_rules.md`
|
||||||
|
- Docs: `projects/michangarrito/docs/`
|
||||||
101
.trae/rules/project_rules.md
Normal file
101
.trae/rules/project_rules.md
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
# Project Rules - MiChangarrito (Trae IDE)
|
||||||
|
|
||||||
|
**Proyecto:** michangarrito
|
||||||
|
**Tipo:** CONSUMER (de template-saas)
|
||||||
|
**Sistema:** SIMCO v4.3.0
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Reglas Heredadas
|
||||||
|
|
||||||
|
Este proyecto hereda TODAS las reglas de:
|
||||||
|
- `workspace-v2/CLAUDE.md`
|
||||||
|
- `workspace-v2/.trae/rules.md`
|
||||||
|
- `template-saas/` (patrones SaaS)
|
||||||
|
|
||||||
|
Las reglas aquí son EXTENSIONES específicas del proyecto.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Stack
|
||||||
|
|
||||||
|
- **Backend:** NestJS 10.3.0 + TypeScript
|
||||||
|
- **Frontend Web:** React 19.2.0 + Vite
|
||||||
|
- **Mobile:** React Native (Expo SDK 51)
|
||||||
|
- **Database:** PostgreSQL 16+
|
||||||
|
- **Cache:** Redis 7
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Credenciales BD
|
||||||
|
|
||||||
|
```
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_PORT=5432
|
||||||
|
DB_NAME=michangarrito_dev
|
||||||
|
DB_USER=michangarrito_dev
|
||||||
|
DB_PASS=mch_dev_2026
|
||||||
|
REDIS_PORT=6389
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Reglas Específicas
|
||||||
|
|
||||||
|
### 1. Multi-Tenancy (Changarritos)
|
||||||
|
|
||||||
|
- Cada changarrito es un tenant
|
||||||
|
- RLS obligatorio en todas las queries
|
||||||
|
- NUNCA acceder a datos de otro tenant
|
||||||
|
|
||||||
|
### 2. Plataformas Múltiples
|
||||||
|
|
||||||
|
- Todo cambio debe funcionar en WEB y MOBILE
|
||||||
|
- Usar componentes compartidos cuando sea posible
|
||||||
|
- Probar en ambas plataformas
|
||||||
|
|
||||||
|
### 3. Pagos México
|
||||||
|
|
||||||
|
- CoDi/SPEI: Solo sandbox de Banxico
|
||||||
|
- MercadoPago: Cuenta de pruebas
|
||||||
|
- Validar montos en MXN
|
||||||
|
|
||||||
|
### 4. WhatsApp Business
|
||||||
|
|
||||||
|
- Meta Cloud API únicamente
|
||||||
|
- Templates pre-aprobados
|
||||||
|
- Respetar rate limits
|
||||||
|
|
||||||
|
### 5. Tests
|
||||||
|
|
||||||
|
Cobertura mínima: 70%
|
||||||
|
Comando: `npm run test`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Paths de Trabajo
|
||||||
|
|
||||||
|
```
|
||||||
|
Backend: projects/michangarrito/apps/backend/src/
|
||||||
|
Frontend: projects/michangarrito/apps/frontend/src/
|
||||||
|
Mobile: projects/michangarrito/apps/mobile/src/
|
||||||
|
WhatsApp: projects/michangarrito/apps/whatsapp-service/
|
||||||
|
MCP Server: projects/michangarrito/apps/mcp-server/
|
||||||
|
Database: projects/michangarrito/apps/database/
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Propagación
|
||||||
|
|
||||||
|
Como CONSUMER, michangarrito:
|
||||||
|
- **NO propaga** a otros proyectos
|
||||||
|
- Recibe cambios de template-saas (cuando aplique)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Referencias
|
||||||
|
|
||||||
|
- CLAUDE.md local: `projects/michangarrito/CLAUDE.md`
|
||||||
|
- Directivas: `projects/michangarrito/orchestration/directivas/`
|
||||||
|
- Inventarios: `projects/michangarrito/orchestration/inventarios/`
|
||||||
78
.windsurf/AGENT-CAPABILITIES.md
Normal file
78
.windsurf/AGENT-CAPABILITIES.md
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
# Agent Capabilities - Windsurf IDE (MiChangarrito)
|
||||||
|
|
||||||
|
**Proyecto:** michangarrito
|
||||||
|
**Versión:** 1.0.0
|
||||||
|
**Modelo:** Cascade AI (NO-RAZONADOR)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Paradigma NO-RAZONADOR
|
||||||
|
|
||||||
|
Windsurf NO toma decisiones autónomas.
|
||||||
|
Ejecuta instrucciones LITERALES únicamente.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Capacidades
|
||||||
|
|
||||||
|
| Capacidad | Status |
|
||||||
|
|-----------|--------|
|
||||||
|
| Edición de archivos | ✅ |
|
||||||
|
| Creación de archivos | ✅ |
|
||||||
|
| Ejecución de comandos | ✅ |
|
||||||
|
| Git operations | ✅ |
|
||||||
|
| Decisiones autónomas | ❌ |
|
||||||
|
| Resolución de ambigüedad | ❌ |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Limitaciones Críticas
|
||||||
|
|
||||||
|
1. **NO puede** interpretar instrucciones vagas
|
||||||
|
2. **NO puede** elegir entre alternativas
|
||||||
|
3. **NO puede** modificar plan sin aprobación
|
||||||
|
4. **Max 50 líneas** por operación
|
||||||
|
5. **NO puede** acceder a datos de otros tenants
|
||||||
|
6. **NO puede** enviar WhatsApp sin template aprobado
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Formato de Tarea Atómica
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
tarea:
|
||||||
|
id: "TASK-XXX-T01"
|
||||||
|
archivo: "path/to/file.ts"
|
||||||
|
plataforma: "backend" # backend|frontend|mobile|whatsapp|mcp
|
||||||
|
operacion: "EDITAR"
|
||||||
|
lineas_desde: 45
|
||||||
|
lineas_hasta: 52
|
||||||
|
codigo_actual: |
|
||||||
|
// código exacto actual
|
||||||
|
codigo_nuevo: |
|
||||||
|
// código exacto nuevo
|
||||||
|
validacion:
|
||||||
|
- "npm run build"
|
||||||
|
- "npm run lint"
|
||||||
|
verificacion_multi_plataforma:
|
||||||
|
- "Funciona en web: SI/NO"
|
||||||
|
- "Funciona en mobile: SI/NO"
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Protocolo de Bloqueo
|
||||||
|
|
||||||
|
Si hay ambigüedad:
|
||||||
|
1. DETENER inmediatamente
|
||||||
|
2. NO intentar resolver
|
||||||
|
3. Reportar en BLOCKED-TASKS.yml
|
||||||
|
4. Esperar resolución de agente superior
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Referencias
|
||||||
|
|
||||||
|
- Shared configs: `orchestration/agents/configs/`
|
||||||
|
- Platform config: `orchestration/agents/configs/SHARED-PLATFORM-CONFIG.yml`
|
||||||
|
- Project rules: `.windsurf/rules/project_rules.md`
|
||||||
120
.windsurf/rules/project_rules.md
Normal file
120
.windsurf/rules/project_rules.md
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
# Project Rules - MiChangarrito (Windsurf IDE)
|
||||||
|
|
||||||
|
**Proyecto:** michangarrito
|
||||||
|
**Tipo:** CONSUMER
|
||||||
|
**Sistema:** SIMCO v4.3.0
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## IMPORTANTE: Windsurf es NO-RAZONADOR
|
||||||
|
|
||||||
|
Windsurf con Cascade NO razona autónomamente.
|
||||||
|
Sigue instrucciones LITERALMENTE.
|
||||||
|
|
||||||
|
Si hay ambigüedad:
|
||||||
|
1. DETENER
|
||||||
|
2. Reportar en orchestration/trazas/BLOCKED-TASKS.yml
|
||||||
|
3. Esperar resolución
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Reglas Heredadas
|
||||||
|
|
||||||
|
Hereda TODAS las reglas de:
|
||||||
|
- `workspace-v2/CLAUDE.md`
|
||||||
|
- `workspace-v2/.windsurf/rules.md`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Stack del Proyecto
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
backend: NestJS 10.3.0 + TypeScript
|
||||||
|
frontend_web: React 19.2.0 + Vite
|
||||||
|
mobile: React Native (Expo SDK 51)
|
||||||
|
database: PostgreSQL 16+
|
||||||
|
cache: Redis 7
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Credenciales BD
|
||||||
|
|
||||||
|
```
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_PORT=5432
|
||||||
|
DB_NAME=michangarrito_dev
|
||||||
|
DB_USER=michangarrito_dev
|
||||||
|
DB_PASS=mch_dev_2026
|
||||||
|
REDIS_PORT=6389
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Paths Absolutos
|
||||||
|
|
||||||
|
```
|
||||||
|
Backend: C:\Empresas\ISEM\workspace-v2\projects\michangarrito\apps\backend\src\
|
||||||
|
Frontend: C:\Empresas\ISEM\workspace-v2\projects\michangarrito\apps\frontend\src\
|
||||||
|
Mobile: C:\Empresas\ISEM\workspace-v2\projects\michangarrito\apps\mobile\src\
|
||||||
|
WhatsApp: C:\Empresas\ISEM\workspace-v2\projects\michangarrito\apps\whatsapp-service\
|
||||||
|
Database: C:\Empresas\ISEM\workspace-v2\projects\michangarrito\apps\database\
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Reglas de Edición
|
||||||
|
|
||||||
|
1. **Max 50 líneas** por cambio
|
||||||
|
2. **NO usar placeholders** (// ... resto del código)
|
||||||
|
3. **Código LITERAL** siempre
|
||||||
|
4. **Verificar** archivo existe antes de editar
|
||||||
|
5. **Verificar** que cambio funciona en web Y mobile
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Validaciones Post-Cambio
|
||||||
|
|
||||||
|
```cmd
|
||||||
|
cd C:\Empresas\ISEM\workspace-v2\projects\michangarrito\apps\backend
|
||||||
|
npm run build
|
||||||
|
npm run lint
|
||||||
|
|
||||||
|
cd C:\Empresas\ISEM\workspace-v2\projects\michangarrito\apps\frontend
|
||||||
|
npm run build
|
||||||
|
npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Módulos Backend (23)
|
||||||
|
|
||||||
|
```
|
||||||
|
auth, billing, categories, codi-spei, customers,
|
||||||
|
delivery, exports, integrations, inventory, invoices,
|
||||||
|
marketplace, messaging, notifications, onboarding,
|
||||||
|
orders, payments, products, referrals, sales,
|
||||||
|
settings, subscriptions, templates, widgets
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Seguridad Multi-Tenant
|
||||||
|
|
||||||
|
**OBLIGATORIO:**
|
||||||
|
- Validar tenant_id en toda query
|
||||||
|
- Usar RLS de PostgreSQL
|
||||||
|
- NUNCA acceder a datos de otro changarrito
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Bloqueos
|
||||||
|
|
||||||
|
Si encuentras:
|
||||||
|
- Ambigüedad en instrucciones → BLOQUEAR
|
||||||
|
- Archivo no existe → BLOQUEAR
|
||||||
|
- Acceso a otro tenant → BLOQUEAR
|
||||||
|
- WhatsApp sin template → BLOQUEAR
|
||||||
|
- Solo funciona en web o solo en mobile → BLOQUEAR
|
||||||
|
|
||||||
|
Reportar en: `orchestration/trazas/BLOCKED-TASKS.yml`
|
||||||
224
CLAUDE.md
Normal file
224
CLAUDE.md
Normal file
@ -0,0 +1,224 @@
|
|||||||
|
# CLAUDE.md - MiChangarrito
|
||||||
|
|
||||||
|
**Hereda de:** workspace-v2/CLAUDE.md, template-saas
|
||||||
|
**Sistema:** SIMCO v4.3.0 + NEXUS v4.0
|
||||||
|
**Proyecto:** michangarrito
|
||||||
|
**Tipo:** CONSUMER (de template-saas)
|
||||||
|
**Versión:** 0.9.5
|
||||||
|
**Actualizado:** 2026-01-24
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## EXTENSIONES LOCALES
|
||||||
|
|
||||||
|
Este archivo EXTIENDE (no reemplaza) las reglas del workspace.
|
||||||
|
Para reglas base, ver: `../../CLAUDE.md`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## DESCRIPCION DEL PROYECTO
|
||||||
|
|
||||||
|
MiChangarrito es un SaaS para tienditas/changarros mexicanos con:
|
||||||
|
- Punto de Venta (POS) móvil y web
|
||||||
|
- Gestión de inventario inteligente
|
||||||
|
- Integración WhatsApp Business
|
||||||
|
- Pagos múltiples (Stripe, MercadoPago, CoDi, SPEI)
|
||||||
|
- Asistente IA para comerciantes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## STACK TECNOLOGICO
|
||||||
|
|
||||||
|
| Capa | Tecnología | Versión |
|
||||||
|
|------|------------|---------|
|
||||||
|
| Backend | NestJS | 10.3.0 |
|
||||||
|
| Frontend Web | React + Vite | 19.2.0 |
|
||||||
|
| Mobile | React Native (Expo) | SDK 51 |
|
||||||
|
| Database | PostgreSQL | 16+ |
|
||||||
|
| Cache | Redis | 7 |
|
||||||
|
| ORM | TypeORM | 0.3.x |
|
||||||
|
| WhatsApp | Meta Business API | - |
|
||||||
|
| LLM | OpenRouter/Claude/GPT-4 | Multi-provider |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## CREDENCIALES BD
|
||||||
|
|
||||||
|
```
|
||||||
|
Database: michangarrito_dev
|
||||||
|
User: michangarrito_dev
|
||||||
|
Password: mch_dev_2026
|
||||||
|
Port: 5432
|
||||||
|
Host: localhost
|
||||||
|
Redis Port: 6389
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ESTRUCTURA DEL MONOREPO
|
||||||
|
|
||||||
|
```
|
||||||
|
michangarrito/
|
||||||
|
├── apps/
|
||||||
|
│ ├── backend/ → NestJS API (23 módulos)
|
||||||
|
│ ├── frontend/ → React Web App
|
||||||
|
│ ├── mobile/ → React Native (Expo)
|
||||||
|
│ ├── mcp-server/ → Gateway LLM (15 herramientas)
|
||||||
|
│ ├── whatsapp-service/ → Meta Cloud API
|
||||||
|
│ └── database/ → DDL (11 schemas)
|
||||||
|
├── orchestration/ → Sistema SIMCO
|
||||||
|
└── docs/ → Documentación
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## MODULOS BACKEND (23)
|
||||||
|
|
||||||
|
| Módulo | Descripción |
|
||||||
|
|--------|-------------|
|
||||||
|
| auth | JWT + OTP + PIN + Biométrico |
|
||||||
|
| billing | Suscripciones |
|
||||||
|
| categories | Catálogos |
|
||||||
|
| codi-spei | Pagos QR Banxico |
|
||||||
|
| customers | Clientes + Fiados |
|
||||||
|
| delivery | Entregas domicilio |
|
||||||
|
| exports | Exportación datos |
|
||||||
|
| integrations | Integraciones |
|
||||||
|
| inventory | Control inventario |
|
||||||
|
| invoices | Facturación |
|
||||||
|
| marketplace | Marketplace B2B |
|
||||||
|
| messaging | Mensajería |
|
||||||
|
| notifications | Push/Email/WhatsApp |
|
||||||
|
| onboarding | Onboarding inteligente |
|
||||||
|
| orders | Pedidos |
|
||||||
|
| payments | Gateway pagos |
|
||||||
|
| products | Catálogo productos |
|
||||||
|
| referrals | Programa referidos |
|
||||||
|
| sales | Punto de venta |
|
||||||
|
| settings | Configuración |
|
||||||
|
| subscriptions | Planes suscripción |
|
||||||
|
| templates | Templates catálogos |
|
||||||
|
| widgets | Widgets/Atajos |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## PUERTOS DE SERVICIOS
|
||||||
|
|
||||||
|
| Servicio | Puerto |
|
||||||
|
|----------|--------|
|
||||||
|
| Backend API | 3141 |
|
||||||
|
| Frontend Web | 3140 |
|
||||||
|
| Mobile (Expo) | 8081 |
|
||||||
|
| MCP Server | 3142 |
|
||||||
|
| WhatsApp Service | 3143 |
|
||||||
|
| PostgreSQL | 5432 |
|
||||||
|
| Redis | 6389 |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## HERENCIA
|
||||||
|
|
||||||
|
### Este proyecto hereda de:
|
||||||
|
- `workspace-v2/orchestration/` → Directivas globales
|
||||||
|
- `template-saas/` → Patrones SaaS, multi-tenancy, auth
|
||||||
|
|
||||||
|
### NO exporta a otros proyectos
|
||||||
|
- Es aplicación final (CONSUMER)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## REGLAS ESPECIFICAS
|
||||||
|
|
||||||
|
### 1. Multi-Tenancy
|
||||||
|
|
||||||
|
- Cada changarrito es un tenant
|
||||||
|
- RLS obligatorio en queries
|
||||||
|
- Datos completamente aislados
|
||||||
|
|
||||||
|
### 2. Pagos México
|
||||||
|
|
||||||
|
- CoDi/SPEI: Validar con Banxico sandbox
|
||||||
|
- MercadoPago: Usar cuenta de pruebas
|
||||||
|
- Clip: Solo modo sandbox
|
||||||
|
|
||||||
|
### 3. WhatsApp Business
|
||||||
|
|
||||||
|
- Meta Cloud API únicamente
|
||||||
|
- Validar templates antes de enviar
|
||||||
|
- Rate limits estrictos
|
||||||
|
|
||||||
|
### 4. LLM Integration
|
||||||
|
|
||||||
|
- MCP Server agnóstico a proveedor
|
||||||
|
- OpenRouter como fallback
|
||||||
|
- Caché de respuestas para costos
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## VALIDACIONES ADICIONALES
|
||||||
|
|
||||||
|
Además de las validaciones del workspace:
|
||||||
|
|
||||||
|
1. **Backend:**
|
||||||
|
```bash
|
||||||
|
cd apps/backend && npm run build && npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Frontend:**
|
||||||
|
```bash
|
||||||
|
cd apps/frontend && npm run build && npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Mobile:**
|
||||||
|
```bash
|
||||||
|
cd apps/mobile && npx expo doctor
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ALIASES LOCALES
|
||||||
|
|
||||||
|
- `@BACKEND` → apps/backend/src/modules/
|
||||||
|
- `@FRONTEND` → apps/frontend/src/
|
||||||
|
- `@MOBILE` → apps/mobile/src/
|
||||||
|
- `@WHATSAPP` → apps/whatsapp-service/
|
||||||
|
- `@MCP` → apps/mcp-server/
|
||||||
|
- `@DDL` → apps/database/
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ANTES DE IMPLEMENTAR
|
||||||
|
|
||||||
|
1. Verificar especificación en `docs/`
|
||||||
|
2. Consultar si ya existe en `template-saas`
|
||||||
|
3. Revisar herencia - NO duplicar lo heredado
|
||||||
|
4. Considerar impacto en móvil Y web
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## DESPUES DE IMPLEMENTAR
|
||||||
|
|
||||||
|
1. Actualizar inventarios locales
|
||||||
|
2. Verificar que funciona en web Y móvil
|
||||||
|
3. Commit y push siguiendo SIMCO-GIT
|
||||||
|
4. **NO propagar** - es CONSUMER
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ESTADO ACTUAL
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
Madurez: Pre-producción
|
||||||
|
MVP: 95% completado
|
||||||
|
En Producción: No
|
||||||
|
Modo: Multi-tenant
|
||||||
|
|
||||||
|
Bloqueadores para Producción:
|
||||||
|
- Cuenta Meta Business verificada
|
||||||
|
- API keys Stripe producción
|
||||||
|
- API keys LLM producción
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*MiChangarrito v0.9.5 - Sistema SIMCO v4.3.0*
|
||||||
Loading…
Reference in New Issue
Block a user