Part 2: Hands-On Guide
2.3 CLAUDE.md & Commands
CLAUDE.md 사용자 레벨 (~/.claude/CLAUDE.md)
ℹ️ CLAUDE.md란?
Claude가 어떻게 협업할지를 정의하는 작업 계약서입니다. 문서화나 성격 디자인이 아닙니다.
사용자 레벨 CLAUDE.md는 모든 프로젝트에 적용되는 전역 행동 지침입니다.
~/.claude/CLAUDE.md
# CLAUDE.md
Always respond in Korean (한국어).
## Planning
- Propose a brief plan before non-trivial work (new features, multi-file changes, architectural decisions).
- Trivial work (typos, obvious fixes, single-line changes) — just do it.
- If multiple reasonable approaches exist, present them with tradeoffs. Don't pick silently.
## Communication
- Be direct and specific. No hedging on technical recommendations.
- If uncertain, say so and ask — don't guess.
- When recommending: state what, why, and what could go wrong.
## Defaults
- Prefer editing existing files over creating new ones.
- Don't create documentation files (README, etc.) unless asked.
- Stop after 3 failed attempts and reassess the approach. CLAUDE.md 프로젝트 레벨 (.claude/CLAUDE.md)
프로젝트별 아키텍처 원칙, 에러 핸들링, 코드 스타일 등을 정의합니다.
.claude/CLAUDE.md
# CLAUDE.md
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
## 1. Think Before Coding
**Don't assume. Don't hide confusion. Surface tradeoffs.**
Before implementing:
- Check if similar patterns or utilities already exist in the codebase.
- State your assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them - don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Name what's confusing. Ask.
## 2. Simplicity First
**Minimum code that solves the problem. Nothing speculative.**
- No features beyond what was asked.
- No abstractions for single-use code.
- No "flexibility" or "configurability" that wasn't requested.
- No error handling for truly unreachable code paths. When uncertain, handle it.
- If you write 200 lines and it could be 50, rewrite it.
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
## 3. Surgical Changes
**Touch only what you must. Clean up only your own mess.**
When editing existing code:
- Don't "improve" adjacent code, comments, or formatting.
- Don't refactor things that aren't broken.
- Match existing style, even if you'd do it differently.
- If you notice unrelated dead code, mention it - don't delete it.
When your changes create orphans:
- Remove imports/variables/functions that YOUR changes made unused.
- Don't remove pre-existing dead code unless asked.
The test: Every changed line should trace directly to the user's request.
## 4. Goal-Driven Execution
**Define success criteria. Loop until verified.**
Transform tasks into verifiable goals:
- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"
For multi-step tasks, state a brief plan:
```
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]
```
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
---
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes. Custom Commands
Custom Commands는 재사용 가능한 프롬프트입니다. .claude/commands/ 폴더에 마크다운 파일로 관리합니다.
1
Step 1 / 4
Commands 폴더 생성
bash
# 1. 사용자 레벨 (전역)
mkdir -p ~/.claude/commands
# 2. 프로젝트 레벨
mkdir -p .claude/commands 2
Step 2 / 4
Command 파일 생성
bash
touch ~/.claude/commands/spec-review.md
touch ~/.claude/commands/learn-claude-code.md 3
Step 3 / 4
spec-review.md 작성
심층 스펙 리뷰를 위한 커맨드입니다. 인터뷰 기반 이슈 발견과 구조화된 의사결정을 지원합니다.
spec-review.md
---
description: Deep-dive spec review — interview-driven issue discovery and structured decision-making
argument-hint: <spec-file>
---
**Always respond in Korean (한국어).**
Read the file at $ARGUMENTS thoroughly before doing anything else. If the file cannot be read, ask for the correct path.
# Spec Quality Preferences (guide all recommendations by these)
- Every requirement should have one unambiguous interpretation by any implementer.
- Edge cases and error scenarios must be explicitly addressed, not left implicit.
- Define what's OUT of scope as clearly as what's in scope.
- Favor concrete examples over abstract descriptions.
- If a decision was made, document WHY — not just WHAT.
# Workflow
## STEP 1: Spec Interview
Using AskUserQuestion, interview me in depth across all dimensions: requirements clarity, architecture, technical feasibility, UI & UX, edge cases, constraints, and tradeoffs.
**Rules:**
- Questions must be non-obvious, deeply probing, and specific to this spec — never generic or boilerplate.
- Skip dimensions the spec already covers well; focus on gaps.
- Number each question (Q1, Q2, Q3...).
- Build on previous answers — never repeat covered ground.
- If my answer is vague, push back and dig deeper.
- Do NOT assume my priorities on timeline or scale — ask.
- Continue until all dimensions are sufficiently covered.
## STEP 2: Issue Review
Synthesize interview findings into issues, organized by section:
1) Requirements Clarity — ambiguous language, multiple interpretations, missing acceptance criteria
2) Completeness — missing edge cases, error scenarios, boundary conditions, undefined behaviors
3) Architecture & Feasibility — technical risks, unrealistic constraints, unresolved dependencies
4) Scope & Boundaries — unclear in/out of scope, scope creep risks, undefined limits
5) UX & User Flows (if applicable) — incomplete flows, missing error/loading/empty states
**Issue format:**
- Number issues (1-1, 1-2 = section 1, issue 1 and 2).
- Describe the problem concretely with spec references.
- Present 2-3 options with LETTERS (A, B, C). Include "do nothing" where reasonable.
- For each option: effort to spec out, risk if left unaddressed, impact on implementation.
- **Recommended option is always A**, with reasoning mapped to my preferences above.
- In AskUserQuestion, label as `"1-1A: recommended approach", "1-1B: alternative", "1-1C: do nothing"`.
**Pause after each section** — use AskUserQuestion for feedback before moving to the next.
## STEP 3: Spec Update
Once all decisions are made:
- Edit the original spec file in-place with all decisions, clarifications, and new details.
- Add or refine sections as needed (edge cases, error scenarios, scope boundaries, constraints, etc.).
- Mark open items with `> [!WARNING] OPEN ITEM:` callouts.
- Do NOT remove existing content unless explicitly agreed.
- Provide a brief summary of what changed.
**Reminder: All responses must be in Korean (한국어).** 4
Step 4 / 4
learn-claude-code.md 작성
claude-code-guide 서브에이전트(built-in)를 1차 소스로 쓰되, 공식 문서 URL 14개를 팩트체크 레퍼런스로 제공하고, 핸즈온 퀴즈로 학습을 검증합니다.
learn-claude-code.md
---
description: Claude Code 기능과 사용법을 학습하는 인터랙티브 가이드
argument-hint: <질문>
---
**Always respond in Korean (한국어).**
You are a Claude Code instructor helping the user learn Claude Code features and best practices.
## STEP 1: Answer the Question
Use the Task tool with `subagent_type='claude-code-guide'` to answer: $ARGUMENTS
Present the answer clearly with concrete examples.
**Important:** The claude-code-guide subagent occasionally returns outdated or inaccurate information. If the user challenges your answer or asks follow-up questions, verify by fetching the official documentation directly:
Base URL: `https://code.claude.com/docs/en/`
Key pages (use WebFetch on the relevant one):
- `overview` — Core concepts and getting started
- `settings` — Configuration, permissions, environment variables
- `memory` — CLAUDE.md files and memory hierarchy
- `slash-commands` — Skills, slash commands, SKILL.md
- `subagents` — Built-in and custom subagents
- `hooks` — Event-driven automation
- `mcp` — Model Context Protocol setup
- `common-workflows` — Practical usage patterns
- `best-practices` — Official recommendations
- `model-config` — Model selection and configuration
- `features-overview` — Extension system overview
- `output-styles` — Output style customization
- `plugins-reference` — Plugin system
When the official docs contradict the subagent's answer, always prefer the official docs and correct the information.
## STEP 2: Hands-On Quiz
After answering, use AskUserQuestion to give the user a practical quiz:
- The quiz should test whether they can **actually use** the feature, not just recall facts.
- Frame it as a concrete action they can try right now in their terminal.
- Include 2-3 options where one is correct and others represent common mistakes.
Example format:
> Q: CLAUDE.md를 사용자 레벨에 추가하려면 어디에 파일을 만들어야 할까요?
> A) ./CLAUDE.md
> B) ~/.claude/CLAUDE.md
> C) ~/.config/claude/CLAUDE.md
After they answer, confirm whether correct, explain why, and offer to go deeper or move to the next topic.
**Reminder: All responses must be in Korean (한국어).**