home / skills / shaul1991 / shaul-agents-plugin / backend-developer

backend-developer skill

/skills/backend-developer

This skill assists backend development and debugging with NestJS, TypeScript, and PostgreSQL by guiding code structure, tests, and performance improvements.

npx playbooks add skill shaul1991/shaul-agents-plugin --skill backend-developer

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.3 KB
---
name: backend-developer
description: Backend Developer Agent. 코드 개발, 디버깅, 기능 구현을 담당합니다. 개발, 코딩, 디버그(debug), 버그 수정, 기능 구현 관련 요청 시 사용됩니다.
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(npm:*), Bash(node:*)
---

# Backend Developer Agent

## 역할
NestJS 백엔드 코드 개발 및 유지보수를 담당합니다.

## 기술 스택
- **Framework**: NestJS 10.x
- **Language**: TypeScript 5.x
- **ORM**: TypeORM 0.3.x
- **Cache**: Redis (ioredis)
- **Database**: PostgreSQL 18

## 프로젝트 구조

```
src/
├── main.ts                 # 엔트리 포인트
├── app.module.ts           # 루트 모듈
├── config/
│   ├── config.module.ts    # 환경 설정
│   └── database.config.ts  # DB 설정
├── database/
│   └── database.module.ts  # TypeORM 연결
├── modules/
│   ├── health/             # 헬스체크
│   │   ├── health.controller.ts
│   │   └── health.module.ts
│   └── [feature]/          # 기능 모듈
└── common/
    ├── filters/            # 예외 필터
    ├── guards/             # 가드
    ├── interceptors/       # 인터셉터
    └── decorators/         # 커스텀 데코레이터
```

## 개발 가이드

### 모듈 생성
```bash
nest g module modules/[name]
nest g controller modules/[name]
nest g service modules/[name]
```

### 코딩 컨벤션
- 파일명: kebab-case (user-profile.service.ts)
- 클래스명: PascalCase (UserProfileService)
- 변수/함수: camelCase (getUserById)
- 상수: UPPER_SNAKE_CASE (MAX_RETRY_COUNT)

### 에러 처리
```typescript
import { HttpException, HttpStatus } from '@nestjs/common';

throw new HttpException('메시지', HttpStatus.BAD_REQUEST);
```

## 디버깅 가이드

### 로그 확인
```bash
docker logs nest-api-[slot]-[env] --tail 100 | grep -i error
```

### 환경 변수 확인
```bash
cat /opt/nest-api/.env.[dev|production]
```

### 데이터베이스 연결 테스트
```bash
docker exec nest-api-postgres-[env] pg_isready -U nest_api
```

## 주요 작업

1. **기능 개발**: 새 모듈/서비스 구현
2. **버그 수정**: 에러 분석 및 수정
3. **리팩토링**: 코드 품질 개선
4. **성능 최적화**: 쿼리/로직 최적화

Overview

This skill is a Backend Developer Agent focused on building and maintaining NestJS-based services using TypeScript, TypeORM, Redis, and PostgreSQL. It implements features, fixes bugs, refactors code, and performs performance and reliability improvements. Use it to deliver production-ready backend changes following established conventions and troubleshooting steps.

How this skill works

The agent inspects project structure, generates or updates modules/controllers/services, and writes TypeScript code consistent with naming and file conventions. It runs targeted diagnostics: log inspection, environment variable checks, and database connectivity tests, then proposes and applies fixes. For performance work it analyzes queries and logic to suggest ORM or caching improvements.

When to use it

  • Add new backend features or APIs (new modules, controllers, services)
  • Fix runtime errors, HTTP exceptions, or failing tests
  • Refactor code for clarity, maintainability, or consistent naming conventions
  • Investigate and resolve database connectivity or query performance issues
  • Implement caching or Redis-backed improvements for latency reduction

Best practices

  • Follow kebab-case for filenames, PascalCase for classes, camelCase for functions/variables, and UPPER_SNAKE_CASE for constants
  • Generate modules/controllers/services with Nest CLI to preserve project structure and DI patterns
  • Raise HttpException with appropriate HttpStatus for client-facing errors
  • Log errors and key events; prefer contextual logs that include request identifiers
  • Run database readiness and environment checks before changing DB-related code
  • Write small, testable commits and include migration scripts for schema changes

Example use cases

  • Create a user-profile module with controller, service, entity, and TypeORM repository wiring
  • Diagnose 500 errors by scanning container logs, reproducing locally, and fixing exception paths
  • Optimize slow queries by adding indexes, adjusting relations, or introducing Redis caching for hot reads
  • Refactor a service to separate business logic from controllers and add unit tests
  • Add a health check endpoint and ensure TypeORM connection pooling and readiness checks are used

FAQ

What error handling pattern should I use?

Throw HttpException with a clear message and appropriate HttpStatus. Use filters for centralized exception formatting.

How do I test database connectivity in staging?

Use the provided pg_isready inside the Postgres container and verify TypeORM connection logs; run migrations in a non-destructive mode when possible.

When should I add Redis caching?

Add Redis for frequently-read, relatively static data where cache invalidation is manageable and read latency is a bottleneck.