.internal-skills/backend-model/SKILL.md
Especialista em Model e Regras de Negócio MVC. Use para: - Modelar entidades e domínios - Implementar regras de negócio (DDD) - Otimizar queries e banco de dados - Integridade de dados - Migrations e schema
npx skillsauth add suportebahia/equipe-devs Equipe SBahia - Backend Model SpecialistInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
// Entidade com Validações de Negócio
class Order {
constructor(items, customer) {
this.id = generateId();
this.items = items;
this.customer = customer;
this.status = 'pending';
this.createdAt = new Date();
// Invariant de negócio
this.validate();
}
validate() {
if (this.items.length === 0) {
throw new BusinessError('Order must have at least one item');
}
if (!this.customer.isActive) {
throw new BusinessError('Cannot create order for inactive customer');
}
}
calculateTotal() {
return this.items.reduce((sum, item) =>
sum + (item.price * item.quantity), 0);
}
canCancel() {
return ['pending', 'confirmed'].includes(this.status);
}
cancel() {
if (!this.canCancel()) {
throw new BusinessError('Cannot cancel order in current status');
}
this.status = 'cancelled';
this.emit('OrderCancelled', { orderId: this.id });
}
}
// Event-Driven Architecture
class Order extends Entity {
cancel() {
this.status = 'cancelled';
// Domain events
this.addDomainEvent(new OrderCancelledEvent({
orderId: this.id,
customerId: this.customerId,
items: this.items,
}));
}
}
// Event Handler
class OrderCancelledHandler {
async handle(event) {
await this.inventoryService.reserveItems(event.items);
await this.notificationService.sendEmail(
event.customerId,
'order_cancelled'
);
await this.pointsService.reversePoints(event.customerId, event.items);
}
}
class OrderRepository {
async findById(id) {
return this.prisma.order.findUnique({
where: { id },
include: { items: true, customer: true },
});
}
async create(order) {
return this.prisma.order.create({
data: {
...order,
items: { create: order.items },
},
include: { items: true },
});
}
async findByCustomer(customerId, options = {}) {
const { page = 1, limit = 20, status } = options;
return this.prisma.order.findMany({
where: { customerId, ...(status && { status }) },
include: { items: true },
orderBy: { createdAt: 'desc' },
skip: (page - 1) * limit,
take: limit,
});
}
}
Order (Aggregate Root)
├── OrderId
├── CustomerId
├── Items[]
├── Total
└── Status
Customer (Aggregate Root)
├── CustomerId
├── Name
├── Email
├── Address[]
└── Points
// Imutável, sem ID
class Money {
constructor(amount, currency) {
this.amount = amount;
this.currency = currency;
}
add(other) {
if (this.currency !== other.currency) {
throw new Error('Cannot add different currencies');
}
return new Money(this.amount + other.amount, this.currency);
}
format() {
return new Intl.NumberFormat('pt-BR', {
style: 'currency',
currency: this.currency,
}).format(this.amount);
}
}
src/
├── domain/
│ ├── entities/ # Order, Customer, Product
│ ├── value-objects/ # Money, Address, CPF
│ ├── events/ # Domain events
│ ├── services/ # Domain services
│ └── repositories/ # Interfaces
├── infrastructure/
│ ├── persistence/ # Prisma/TypeORM models
│ ├── repositories/ # Implementations
│ └── migrations/
└── application/
├── use-cases/ # Application services
└── dto/ # Data transfer objects
testing
Sistema de agentes IA para coordenação de projetos de desenvolvimento. Use este skill para iniciar qualquer projeto. Este skill orquestra automaticamente os agentes especializados conforme a necessidade: - Análise e planejamento de projetos - Coordenação de múltiplos agentes - Gestão de tasks e dependências
development
Orquestrador principal do ecossistema de agentes IA Equipe SBahia. Use para: - Coordenar projetos de desenvolvimento web - Alocar agentes especializados - Gerenciar workflow completo - Garantir padrões MVC e de mercado Agents disponíveis: leadership-tech, uxui-designer, frontend-developer, backend-controller, backend-model, dba-specialist, security-specialist, api-gateway-specialist, mobile-developer, data-engineer, elastic-engineer, machine-learning-engineer, testing-specialist, error-handling-specialist, product-owner, devops-engineer, solutions-engineer
testing
Skill para Designer UX/UI. Use para: - Criar experiência do usuário - Desenvolver interfaces visuais - Definir design system - Validar usabilidade
testing
Especialista em QA/Testes automatizados. Use para: - Criar estratégia de testes completa - Implementar testes unitários, integração e E2E - TDD/BDD quando aplicável - Coverage analysis - Testes de performance e carga