El-DT-Lightweight-Army / rules
Cursor rule4 starsChanged 20 days agoMITView on GitHub
Convenciones de arquitectura backend, APIs, capas, manejo de errores
In this repository163 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-orquestador-core.mdcCursor rule
- .cursor/rules/01-protocolos-dt.mdcCursor rule
- .cursor/rules/02-documentacion.mdcCursor rule
- .cursor/rules/03-catalogo-subagentes.mdcCursor rule
- .cursor/rules/05-multi-project-git.mdcCursor rule
- .cursor/rules/06-dt-colaboracion.mdcCursor rule
- .cursor/rules/07-orden-continuo.mdcCursor rule
- .cursor/rules/08-stack-web-default.mdcCursor rule
- .cursor/rules/15-engineering-reuse.mdcCursor rule
- .cursor/rules/16-numeric-grounding.mdcCursor rule
- .cursor/rules/17-canvas-first.mdcCursor rule
- .cursor/rules/18-drive-contexto.mdcCursor rule
- .cursor/rules/19-gmail-contexto.mdcCursor rule
- .cursor/rules/20-frontend-ui.mdcCursor rule
- .cursor/rules/21-calendar-contexto.mdcCursor rule
- .cursor/rules/30-testing.mdcCursor rule
- .cursor/rules/31-agent-inbox.mdcCursor rule
- .cursor/rules/40-devops.mdcCursor rule
- .cursor/rules/90-seguridad-secrets.mdcCursor rule
- analisis-propuestaSkill
- arquitectoSkill
- atelier-actualizarSkill
- atelierSkill
- auditoria-legalSkill
- bragSkill
- brand-guardianSkill
- content-creatorSkill
- data-auditorSkill
- deploySkill
- development-plannerSkill
- devopsSkill
- docSkill
- dt-actualizarSkill
- dt-bootstrapSkill
- dt-calendarSkill
- dt-configSkill
- dt-driveSkill
- dt-gmailSkill
- dt-oficialSkill
- dt-ordenarSkill
- dt-sessionSkill
- dt-setupSkill
- dt-skillsSkill
- engineering-reuseSkill
- feedback-synthesizerSkill
- frontendSkill
- git-actualizarSkill
- git-guardarSkill
- github-save-releaseSkill
- growth-hackerSkill
- hack-auditSkill
- marketing-strategistSkill
- operations-maintainerSkill
- pitch-specialistSkill
- prd-creatorSkill
- product-strategistSkill
- qaSkill
- The first 60 shown.
The file
Files
---
description: Convenciones de arquitectura backend, APIs, capas, manejo de errores
globs: "**/backend/**/*, **/api/**/*, **/*.py, **/*.go, **/*.ts, **/server/**/*"
alwaysApply: false
---
# Arquitectura Backend
Stack default del DT: ver regla `08-stack-web-default` y `vitals/data/engineering/web-stack.yaml`.
## Stack default (proyecto web nuevo)
- **Backend/API**: Cloud Functions for Firebase (Node.js LTS)
- **Base de datos**: Firestore (Realtime DB solo si el caso lo exige)
- **Auth**: Firebase Auth
- **Secrets**: Firebase Secrets (ver regla `90-seguridad-secrets`)
- **Escalation**: Cloud Run + Firestore para workers pesados; SQL solo con opt-out explícito
Si el repo ya usa otro stack, respetarlo (soft default).
## Convenciones
- **Capas**: Separar lógica de negocio, acceso a datos y presentación (API)
- **APIs**: Usar convenciones REST; nombres en snake_case o camelCase según el stack
- **Manejo de errores**: Capturar y propagar con contexto; no tragar excepciones
- **Patrones**: Repository para datos; Service para lógica de negocio
## Ejemplo de manejo de errores
```typescript
// Evitar
try { await fetchData(); } catch (e) {}
// Preferir
try {
await fetchData();
} catch (e) {
logger.error('Failed to fetch', { error: e });
throw new DataFetchError('Unable to retrieve data', { cause: e });
}
```
## APIs
- Documentar endpoints (OpenAPI/Swagger si aplica)
- Versionar APIs cuando sea necesario
- Validar input en el boundary
## Reutilización (reuse-first)
Regla transversal: `15-engineering-reuse` · skill `arquitecto` · `DOC-REF-006`.
- **Extender** handlers y services existentes antes de nuevos entrypoints paralelos
- **Validators compartidos** en boundary — no duplicar validación por handler
- **Repository/Service** existente: añadir métodos; evitar `*Repository2`, `*ServiceCopy`
- **Decisiones estructurales** (DB, breaking API): proponer ADR en `docs/05_decisions/` (ver skill `arquitecto/references/adr-triggers.md`)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

