Corporate backend development with strict quality enforcement, Testing Trophy methodology, and Bun runtime standards for AI-powered microservices.
Corporate backend microservices development environment with strict quality enforcement and measurable guarantees.
This skill provides comprehensive development standards for building production-grade backend services using Bun runtime, TypeScript, and Elysia framework. It enforces Testing Trophy methodology, strict quality gates, and enterprise health check patterns.
When working on a Bun backend project following this standard, you MUST:
**Type Checking:**
**Linting:**
**Formatting:**
**Test Distribution Requirements:**
**Testing Commands:**
```bash
bun run test # Run all tests
bun run test:unit # Unit tests only
bun run test:integration # Integration tests only
bun run test:contract # Contract tests only
bun run test:e2e # End-to-end tests only
bun run test:coverage # Run with coverage report (80% minimum)
bun run test:watch # Watch mode for development
```
**Testing Philosophy:**
```
project/
├── src/
│ └── index.ts # Main application entry point
├── tests/
│ ├── unit/ # Unit test examples (25-30%)
│ ├── integration/ # Integration test examples (45-50%)
│ ├── contract/ # Contract test examples (10-15%)
│ ├── e2e/ # E2E test examples (10-15%)
│ └── test-utils.ts # Minimal test utilities
├── .claude/ # Claude Code hooks
├── .husky/ # Git hooks (NEVER bypass)
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript strict config
├── eslint.config.js # ESLint flat config v9+
├── .prettierrc # Prettier config
└── bunfig.toml # Bun configuration
```
**Always implement these standardized endpoints:**
**Health Endpoint (`GET /health`):**
```typescript
{
"status": "ok" | "degraded" | "unhealthy",
"timestamp": "ISO8601",
"uptime": number,
"environment": string,
"version": string
}
```
**Readiness Endpoint (`GET /ready`):**
```typescript
{
"status": "ready" | "not_ready",
"timestamp": "ISO8601",
"latency": number,
"dependencies": {
"database": {
"status": "healthy" | "unhealthy",
"latency": number,
"last_checked": "ISO8601",
"endpoint": string,
"error"?: string
},
"email": {
"status": "healthy" | "unhealthy",
"latency": number,
"last_checked": "ISO8601",
"endpoint": string,
"error"?: string
}
}
}
```
**Pre-commit Requirements:**
**⚠️ CRITICAL:** NEVER use `git commit --no-verify` or bypass pre-commit hooks. This is tracked and prohibited.
**Development:**
**Code Quality:**
**Maintenance:**
When building services, ensure:
Maintain three-tier documentation:
1. **Starting a new feature:**
```bash
bun run start:dev
bun run test:watch # In separate terminal
```
2. **Writing code:**
- Implement feature in `src/`
- Add tests following Testing Trophy distribution
- Run `bun run type-check` frequently
3. **Before committing:**
```bash
bun run lint:fix
bun run format
bun run test:coverage # Must show ≥80%
bun run type-check
git commit -m "feat: add feature" # Hooks run automatically
```
4. **If hooks fail:**
- Fix the reported issues
- DO NOT use `--no-verify`
- Re-run quality checks until they pass
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/bun-ai-backend-development-standards/raw