# Work Coding Debug Guide

> Use this skill when the user encounters an error, exception, or bug and needs help debugging. Triggers on: 'error', 'bug', 'exception', 'not working', 'debug this', 'why is this failing', '에러', '오류', '버그', '왜 안 되지', '디버그', '고쳐줘', 'stack trace'.

- **Type:** Skill
- **Install:** `agentstack add skill-jonayeon-claude-code-skills-work-coding-debug-guide`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [JoNaYeon](https://agentstack.voostack.com/s/jonayeon)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [JoNaYeon](https://github.com/JoNaYeon)
- **Source:** https://github.com/JoNaYeon/claude-code-skills/tree/master/work/coding/work_coding_debug-guide

## Install

```sh
agentstack add skill-jonayeon-claude-code-skills-work-coding-debug-guide
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Debug Guide

## 목적
에러 메시지와 스택 트레이스를 분석하여 원인을 파악하고 해결 방법을 제시합니다.

## 컨벤션 참조 (General / SEEMEDI 특이)
수정안은 레포 루트 `code-conventions/`의 에러 처리 규칙에 맞춥니다.
- **General(항상)** — `code-conventions/general/by-task/error-handling-logging.md`: 예외 2계층(도메인/기술), 예외 삼키기 금지, 원인 보존 재던지기, RFC 9457 problem+json, ECS 구조화 로깅, W3C traceId.
- **SEEMEDI 특이(SEEMEDI 레포에서만)** — `code-conventions/seemedi/by-task/patient-data-phi.md`: **로그·예외 메시지에 PHI/환자식별자 절대 금지**. 재현·로그 확인 시 환자 데이터가 노출되지 않도록 마스킹·합성 데이터만 사용.
- SEEMEDI 레포 판별: `governance.yaml`·`com.seemedi.*`·제품 접두 `ecg-/edo-/hel-/tlk-`.

## 지침

### 1. 에러 정보 수집
다음을 확인합니다:
- 에러 메시지 전문
- 스택 트레이스
- 에러가 발생하는 코드 파일
- 에러 재현 조건 (언제, 어떤 입력으로)
- 최근 변경 사항

### 2. 에러 유형 분류
- **Syntax Error**: 문법 오류 → 해당 라인 즉시 수정
- **Runtime Error**: 실행 중 오류 → 원인 코드 추적
- **Logic Error**: 잘못된 결과 → 로직 흐름 분석
- **Type Error**: 타입 불일치 → 타입 체인 추적
- **Network/IO Error**: 외부 연결 문제 → 환경 확인
- **Dependency Error**: 패키지 문제 → 버전/설치 확인

### 3. 원인 분석
스택 트레이스에서 **내 코드**가 나오는 마지막 프레임에 집중합니다.
관련 파일을 읽고 다음을 확인합니다:
- null/undefined 접근
- 배열 범위 초과
- 비동기 처리 오류
- 잘못된 변수 스코프
- 외부 API 응답 형식 불일치

### 4. 수정
원인이 명확하면 바로 수정합니다.
불명확하면 가설을 세우고 언어에 맞는 디버깅 포인트를 추가합니다:

```js
// JavaScript / TypeScript
console.log('[DEBUG]', 변수명, typeof 변수명);
```
```python
# Python
print(f"[DEBUG] {변수명=}, {type(변수명)=}")
import traceback; traceback.print_exc()
```
```go
// Go
log.Printf("[DEBUG] %+v (%T)\n", 변수명, 변수명)
```
```java
// Java
System.out.printf("[DEBUG] %s (%s)%n", 변수명, 변수명.getClass().getName());
```

### 5. 재발 방지
- 에러 핸들링 추가 제안
- 유사 패턴 코드에 동일 문제가 없는지 확인

## 출력 형식

```markdown
## 디버그 분석

**에러 유형**: Runtime Error (TypeError)
**발생 위치**: src/user.js:42

### 원인
`user` 객체가 null인 상태에서 `.name` 프로퍼티에 접근하고 있습니다.
API 응답이 빈 배열일 때 `users[0]`이 undefined가 됩니다.

### 수정
(수정된 코드)

### 재발 방지
- Optional chaining 사용: `user?.name`
- API 응답 검증 로직 추가
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [JoNaYeon](https://github.com/JoNaYeon)
- **Source:** [JoNaYeon/claude-code-skills](https://github.com/JoNaYeon/claude-code-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-jonayeon-claude-code-skills-work-coding-debug-guide
- Seller: https://agentstack.voostack.com/s/jonayeon
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
