madappgang/claude-code/bunjs-architecture
- community
Checking that the SKILL.md file is still in the repository.
Use when implementing clean architecture (routes/controllers/services/repositories), establishing camelCase conventions, designing Prisma schemas, or planning structured workflows for Bun.js applications. See bunjs for basics, bunjs-production for deployment.
Install
npx vskill@latest install madappgang/claude-code/bunjs-architectureSKILL.md
Bun.js Clean Architecture Patterns
Overview
This skill covers layered architecture, clean code patterns, camelCase naming conventions, and structured implementation workflows for Bun.js TypeScript backend applications. Use this skill when building complex, maintainable applications that require strict separation of concerns.
When to use this skill:
- Implementing layered architecture (routes → controllers → services → repositories)
- Establishing coding conventions and naming standards
- Designing database schemas with Prisma
- Creating API endpoint specifications
- Planning implementation workflows
See also:
- dev:bunjs - Core Bun patterns, HTTP servers, basic database access
- dev:bunjs-production - Production deployment, Docker, AWS, Redis
- dev:bunjs-apidog - OpenAPI specifications and Apidog integration
Clean Architecture Principles
1. Layered Architecture
ALWAYS separate concerns into distinct layers with single responsibilities:
Critical Rules:
- Controllers NEVER contain business logic (only HTTP handling)
- Services NEVER access HTTP context (no
req,res,Context) - Repositories are the ONLY layer that touches Prisma/database
- Each layer depends only on layers below it
2. Dependency Flow
3. Separation of Concerns
| Layer | Responsibilities | Forbidden | |
|---|---|---|---|
| Routes | Define endpoints, attach middleware, map to controllers | Business logic, DB access | |
| Controllers | Extract data from HTTP, call services, format responses | Business logic, DB access, validation logic | |
| Services | Business logic, orchestrate operations, manage transactions | HTTP handling, direct DB access | |
| Repositories | Database queries, type-safe Prisma operations | Business logic, HTTP handling |
camelCase Conventions (CRITICAL)
Why camelCase Everywhere?
TypeScript-first full-stack development requires ONE naming convention across all layers:
- ✅ Database → Prisma → TypeScript → API → Frontend (1:1 mapping)
- ✅ Zero translation layer = zero mapping bugs
- ✅ Autocomplete works perfectly everywhere
- ✅ Type safety maintained end-to-end
This is non-negotiable for our stack.
API Field Naming: camelCase
CRITICAL: All JSON REST API field names MUST use camelCase.
Why:
- ✅ Native to JavaScript/JSON - No transformation needed
- ✅ Industry standard - Google, Microsoft, Facebook, AWS use camelCase
- ✅ TypeScript friendly - Direct mapping to interfaces
- ✅ OpenAPI/Swagger convention - Standard for API specs
- ✅ Auto-generated clients - Expected by code generation tools
Examples:
Consistent Application:
- Request Bodies: All fields in camelCase
- Response Bodies: All fields in camelCase
- Query Parameters: Use camelCase (
pageSize,sortBy,orderBy) - Zod Schemas: Define fields in camelCase
- TypeScript Interfaces: Match API camelCase
Database Naming: camelCase
CRITICAL: All database identifiers (tables, columns, indexes, constraints) use camelCase.
Why:
- ✅ Stack consistency - TypeScript is our primary language
- ✅ Zero translation layer - Database names map 1:1 with TypeScript types
- ✅ Reduced complexity - No snake_case ↔ camelCase conversion
- ✅ Modern ORM compatibility - Prisma, Drizzle, TypeORM work seamlessly
- ✅ Team productivity - Full-stack TypeScript developers think in camelCase
Naming Rules:
1. Tables: Singular, camelCase with @@map() to plural
2. Columns: camelCase
3. Primary Keys: {tableName}Id
4. Foreign Keys: Same as referenced primary key
5. Boolean Fields: Prefix with is/has/can
6. Timestamps: Consistent suffixes
7. Indexes: idx{TableName}{ColumnName}
8. Constraints:
Prisma Schema Example (Perfect Mapping)
TypeScript Types (Perfect Match)
Benefits of Single Convention
No Translation Needed:
Layer Templates
Route Template
Controller Template
Controller Rules:
- ✅ Extract validated data from context
- ✅ Call service layer functions
- ✅ Format HTTP responses
- ❌ NO business logic
- ❌ NO database access
- ❌ NO validation logic (use middleware)
Service Template
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/dev/skills/backend/bunjs-architecture/SKILL.md
Popularity
- Repository stars
- 279
- Repository forks
- 32
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 12 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/madappgang/claude-code/bunjs-architecture)