C.W.K.
Stream
Lesson 08 of 08 · published

Sub-agents · slash commands · skills

~14 min · subagents, slash-commands, skills

Level 0Observer
0 XP0/64 lessons0/13 achievements
0/150 XP to next level150 XP to go0% complete

Task로 sub-agents

Task 도구가 sub-agent spawn — 자기 options, 프롬프트, 도구 셋 가진 fresh 서브프로세스, parent에서 isolated. 큰 작업 delegate(50-단계 워크플로우 run, summary만 반환)에 유용 — parent 컨텍스트 polluting 없이. Sub-agent 별도 청구; 그에 따라 예산.

User 단축으로서 slash command

Agent SDK가 ~/.claude/commands/(CLI-shared) 또는 프로젝트 안 Markdown 파일로 정의된 slash command 지원. Slash command가 parameterized 프롬프트 fragment — /review <file>이 구조화된 review 프롬프트로 expand. Claude Code CLI가 사용하는 같은 plumbing; SDK가 같은 정의 존중.

패키지된 행동으로서의 skill

Skills(portable agent 행동의 Anthropic 용어)가 metadata, instruction, optional 리소스 가진 폴더로 ~/.claude/skills/에 살아. Agent SDK가 사용 가능 skills 로드, 모델이 Skill 도구로 invoke. Skill이 'X 어떻게 하는지' 번들하는 법 — 세션·머신 사이 재사용 가능.

원칙: Delegation엔 sub-agents, 단축엔 slash commands, portable 행동엔 skills. 다른 재사용 패턴엔 다른 도구.

Code

Task로 sub-agent spawn·python
options = ClaudeAgentOptions(
    cwd="/srv",
    allowed_tools=["Task", "Read"],  # parent는 delegate와 read만
    system_prompt="You are a coordinator. Delegate file analysis to a sub-agent.",
)

# 에이전트 응답에 Task tool_use 블록 같은 거 봄:
# {"name": "Task", "input": {
#   "description": "Analyze /srv/large_file.csv for outliers",
#   "prompt": "Read the CSV, list the top 10 outlier rows by z-score.",
#   "subagent_type": "general-purpose",
# }}
Markdown 파일로서의 slash command·markdown
<!-- ~/.claude/commands/review.md -->
---
description: Review a file for quality and risks
argument-hint: <file path>
---

Read {{ARGS}} and produce a code review with three sections:
1. Quality concerns
2. Security concerns
3. Suggested improvements

Cite file:line for every finding.

External links

Exercise

오늘 프롬프트로 run하는 반복 워크플로우 하나 픽. Slash command 또는 skill로 변환. 이번 주 세 번 사용하고 rough edge 메모.
Hint
워크플로우가 hard-coded path나 args 가지면 slash command. 재사용 단계와 metadata 가지면 skill.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.