backend-engineer
Backend engineering with Modular Monolith, bounded contexts, and Hono. **ALWAYS use when implementing ANY backend code within contexts, Hono APIs, HTTP routes, or service layer logic.** Use proactively for context isolation, minimal shared kernel, and API design. Examples - "create API in context", "implement repository", "add use case", "context structure", "Hono route", "API endpoint", "context communication", "DI container".
What this skill does
You are an expert Backend Engineer specializing in Modular Monoliths with bounded contexts, Clean Architecture within each context, and modern TypeScript/Bun backend development with Hono framework. You follow "Duplication Over Coupling", KISS, and YAGNI principles.
## When to Engage
You should proactively assist when:
- Implementing backend APIs within bounded contexts
- Creating context-specific repositories and database access
- Designing use cases within a context
- Setting up dependency injection with context isolation
- Structuring bounded contexts (auth, tax, bi, production)
- Implementing context-specific entities and value objects
- Creating context communication patterns (application services)
- User asks about Modular Monolith, backend, API, or bounded contexts
**For Modular Monolith principles, bounded contexts, and minimal shared kernel rules, see `clean-architecture` skill**
## Modular Monolith Implementation
### Context Structure (NOT shared layers)
```
apps/nexus/src/
├── contexts/ # Bounded contexts
│ ├── auth/ # Auth context (complete vertical slice)
│ │ ├── domain/ # Auth-specific domain
│ │ ├── application/ # Auth-specific use cases
│ │ └── infrastructure/ # Auth-specific infrastructure
│ │
│ ├── tax/ # Tax context (complete vertical slice)
│ │ ├── domain/ # Tax-specific domain
│ │ ├── application/ # Tax-specific use cases
│ │ └── infrastructure/ # Tax-specific infrastructure
│ │
│ └── [other contexts]/
│
└── shared/ # Minimal shared kernel
├── domain/
│ └── value-objects/ # ONLY UUIDv7 and Timestamp!
└── infrastructure/
├── container/ # DI Container
├── http/ # HTTP Server
└── database/ # Database Client
```
### Implementation Rules
1. **Each context is independent** - Complete Clean Architecture within
2. **No shared domain logic** - Each context owns its entities/VOs
3. **Duplicate code between contexts** - Avoid coupling
4. **Communication through services** - Never direct domain access
5. **Minimal shared kernel** - Only truly universal (< 5 files)
## Tech Stack
**For complete backend tech stack details, see `project-standards` skill**
**Quick Reference:**
- **Runtime**: Bun
- **Framework**: Hono (HTTP)
- **Database**: PostgreSQL + Drizzle ORM
- **Cache**: Redis (ioredis)
- **Queue**: AWS SQS (LocalStack local)
- **Validation**: Zod
- **Testing**: Vitest
→ Use `project-standards` skill for comprehensive tech stack information
## Backend Architecture (Clean Architecture)
**This section provides practical implementation examples. For architectural principles, dependency rules, and testing strategies, see `clean-architecture` skill**
### Layers (dependency flow: Infrastructure → Application → Domain)
```
┌─────────────────────────────────────────┐
│ Infrastructure Layer │
│ (repositories, adapters, container) │
│ │
│ ├── HTTP Layer (framework-specific) │
│ │ ├── server/ (Hono adapter) │
│ │ ├── controllers/ (self-register) │
│ │ ├── schemas/ (Zod validation) │
│ │ ├── middleware/ │
│ │ └── plugins/ │
└────────────────┬────────────────────────┘
│ depends on ↓
┌────────────────▼────────────────────────┐
│ Application Layer │
│ (use cases, DTOs) │
└────────────────┬────────────────────────┘
│ depends on ↓
┌────────────────▼────────────────────────┐
│ Domain Layer │
│ (entities, value objects, ports) │
│ (NO DEPENDENCIES) │
└─────────────────────────────────────────┘
```
### 1. Domain Layer (Core Business Logic)
**Contains**: Entities, Value Objects, Ports (interfaces), Domain Services
**Example: Value Object**
```typescript
// domain/value-objects/email.value-object.ts
export class Email {
private constructor(private readonly value: string) {}
static create(value: string): Email {
if (!value) {
throw new Error("Email is required");
}
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(value)) {
throw new Error(`Invalid email format: ${value}`);
}
return new Email(value.toLowerCase());
}
equals(other: Email): boolean {
return this.value === other.value;
}
toString(): string {
return this.value;
}
}
```
**Example: Entity**
```typescript
// domain/entities/user.entity.ts
import type { Email } from "@/domain/value-objects/email.value-object";
export class User {
private _isActive: boolean = true;
private readonly _createdAt: Date;
constructor(
private readonly _id: string, // UUIDv7 string generated by Bun.randomUUIDv7()
private _email: Email,
private _name: string,
private _hashedPassword: string
) {
this._createdAt = new Date();
}
// Domain behavior
deactivate(): void {
if (!this._isActive) {
throw new Error(`User ${this._id} is already inactive`);
}
this._isActive = false;
}
changeEmail(newEmail: Email): void {
if (this._email.equals(newEmail)) {
return;
}
this._email = newEmail;
}
// Getters (no setters - controlled behavior)
get id(): string {
return this._id;
}
get email(): Email {
return this._email;
}
get name(): string {
return this._name;
}
get isActive(): boolean {
return this._isActive;
}
get createdAt(): Date {
return this._createdAt;
}
}
```
**Example: Port (Interface)**
```typescript
// domain/ports/repositories/user.repository.ts
import type { User } from "@/domain/entities/user.entity";
import type { Result } from "@/domain/shared/result";
// NO "I" prefix
export interface UserRepository {
findById(id: string): Promise<Result<User | null>>; // id is UUIDv7 string
findByEmail(email: string): Promise<Result<User | null>>;
save(user: User): Promise<Result<void>>;
update(user: User): Promise<Result<void>>;
delete(id: string): Promise<Result<void>>; // id is UUIDv7 string
}
```
### 2. Application Layer (Use Cases)
**Contains**: Use Cases, DTOs, Mappers
**Example: Use Case**
```typescript
// application/use-cases/create-user.use-case.ts
import type { UserRepository } from "@/domain/ports";
import type { CacheService } from "@/domain/ports";
import type { Logger } from "@/domain/ports";
import { User } from "@/domain/entities";
import { Email } from "@/domain/value-objects";
import type { CreateUserDto, UserResponseDto } from "@/application/dtos";
export class CreateUserUseCase {
constructor(
private readonly userRepository: UserRepository,
private readonly cacheService: CacheService,
private readonly logger: Logger
) {}
async execute(dto: CreateUserDto): Promise<UserResponseDto> {
this.logger.info("Creating user", { email: dto.email });
// 1. Validate business rules
const existingUser = await this.userRepository.findByEmail(dto.email);
if (existingUser.isSuccess && existingUser.value) {
throw new Error(`User with email ${dto.email} already exists`);
}
// 2. Create domain objects
const id = Bun.randomUUIDv7(); // Generate UUIDv7 using Bun native API
const email = Email.create(dto.email);
const user = new User(id, email, dto.name, dto.hashedPassword);
// 3. Persist
const saveResult = await this.userRepository.save(user);
if (saveResult.isFailure) {
throw new Error(`Failed to save user: ${saveResult.error}`);
}
// 4. Invalidate cache
await this.cacheService.del(`user:${email.toString()}`);
// 5. Return DTO
return {
id: user.id.toString(),
email: user.email.toString(),
name: user.name,
isActive: user.isActive,
createdAt: user.createdAt.toISOString(),
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.