Skip to content
cccskills
FreePublished on GitHub

go-clean-architecture

Arquitectura Go estilo Alizia-BE (Educabot). Clean Architecture híbrida KISS, DI manual, entities/providers/usecases/entrypoints/repositories. Multi-tenant OrgID scope.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3 stars(GitHub 3 + cccskills 0)
Works withPostgreSQL

Run score Not tested

See how to install

Files included (3)

  • SKILL.md3.8 KB
  • references/anti-patterns.md376 B
  • references/checklist.md552 B

SKILL.md (original)

Review the instructions the agent will receive before you install.

Go Clean Architecture (estilo Alizia-BE)

Arquitectura canónica backends Go Educabot. KISS + Clean by layers, DI manual, separación estricta.

Cuándo usar / NO usar

UsarNO usar
API backend nueva con lógica no trivialCLI simple / tool interno
Multi-tenant con OrgID scopePrototipo throwaway
Necesitás testabilidad por capaWorker de una sola función

Filosofía

  • Simpleza primero — no DDD pesado, no event sourcing, no CQRS prematuro
  • DI manual en cmd/ — no wire/fx/dig. Verbosidad es feature
  • One file = one responsibility (especialmente usecases)
  • Código en inglés, comunicación en español

Estructura de Directorios

cmd/                         ← Entry point + DI manual
  main.go, app.go, repositories.go, usecases.go, handlers.go, routes.go
src/core/                    ← DOMINIO PURO (sin imports infra)
  entities/                  ← Structs planos (sin tags GORM/JSON)
  providers/                 ← Interfaces (contratos) + errors.go
  usecases/{domain}/         ← Business logic, un archivo por usecase
src/entrypoints/rest/        ← HTTP handlers (sin lógica de negocio)
src/repositories/{domain}/   ← GORM impl (tags GORM acá, no en entities)
src/mocks/                   ← Un mock por provider
config/                      ← Env vars
db/migrations/               ← SQL up/down (golang-migrate)

Regla de Dependencias

entrypoints → usecases → providers (interfaces) ← repositories

  • Usecases NUNCA importan gorm/http/redis/openai — solo entities + providers
  • Interfaces en core/providers/ (consumer side, Go idiom)

Capas

CapaResponsabilidadReglas
EntitiesStructs del dominioSin tags GORM/JSON, sin lógica de persistencia
ProvidersInterfaces + errores sentinelErrValidation, ErrNotFound, ErrForbidden, etc.
UsecasesRequest.Validate() + Execute()Validate siempre primera línea. Validar OrgID siempre
EntrypointsHTTP ↔ Request translationSin lógica de negocio. Mapea sentinel → HTTP code
RepositoriesGORM impl de providersRow structs con tags GORM acá. Traducen row ↔ entity

Patrón Canónico Usecase

  • Struct CreateXxxRequest con Validate() error — wrappea con providers.ErrValidation
  • Interface CreateXxx con Execute(ctx, req) (result, error)
  • Impl createXxxImpl con deps como providers
  • Constructor NewCreateXxx(deps) CreateXxx

Multi-tenant (OrgID)

  • OrgID en cada Request de usecase, Validate() chequea OrgID != uuid.Nil
  • Cada query filtra por organization_id. RLS en Postgres como última barrera
  • Middleware JWT extrae OrgID del token → context

DI Manual en cmd/

  • cmd/repositories.go: buildRepositories(db) → struct con todos los repos
  • cmd/usecases.go: buildUseCases(repos) → struct con todos los usecases
  • cmd/handlers.go: buildHandlers(ucs) → struct con todos los handlers
  • Lectura completa del grafo de deps en un vistazo

Testing

CapaTipoHerramientas
UsecasesUnit con mockstestify + mocks por provider
RepositoriesIntegrationPostgres real (testcontainers)
HandlersHTTP con usecase mockeadohttptest + testify

Anti-patterns

→ Read references/anti-patterns.md for common architecture violations

Checklist

→ Read references/checklist.md for 11-item architecture compliance checklist

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Plan, design, and implement A/B tests and experiments with statistical rigor. Covers hypothesis frameworks, sample sizing, metrics, and result analysis.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Web/mobile accessibility decision guide: WCAG 2.2 AA, ARIA, keyboard nav, focus management, contrast, testing. Use for: a11y, accessibility, wcag, aria, screen reader, keyboard, contrast.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Generate, iterate, and scale ad creative for paid advertising across Google, Meta, LinkedIn, and X. Covers platform specs, creative frameworks, and quality validation.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Musica interactiva para juegos: layering vertical, re-secuenciacion horizontal, stingers, reglas de transicion con sync points, y mapeo de estados de gameplay a musica. Usar para: musica adaptativa, sistema de musica dinamica, transiciones musicales, combat music.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Design multi-agent systems, create agent architectures, define communication patterns, and build autonomous agent workflows with structured evaluation frameworks.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

Inter-agent communication protocol for C-suite agent teams. Defines invocation syntax, loop prevention, isolation rules, response formats, and quality loops.

The English summary is being prepared. Showing the original description.

SebastianLuser/claude-code-arcane3Updated Oct 27, 2026

See all skills by SebastianLuser

Report a problem with this skill