Agent Skills: ๐ŸŽจ ํ”„๋กฌํ”„ํŠธ ์—”์ง€๋‹ˆ์–ด๋ง (Dev Prompt Engineering)

Anthropic์˜ Best Practice๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ณ ์„ฑ๋Šฅ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์„ค๊ณ„ํ•˜๊ณ  ์ตœ์ ํ™”ํ•ฉ๋‹ˆ๋‹ค.

UncategorizedID: lastdays03/claude_skills/dev-prompt-engineering

Install this agent skill to your local

pnpm dlx add-skill https://github.com/lastdays03/claude_skills/tree/HEAD/.agent/skills/dev-prompt-engineering

Skill Files

Browse the full folder contents for dev-prompt-engineering.

Download Skill

Loading file treeโ€ฆ

.agent/skills/dev-prompt-engineering/SKILL.md

Skill Metadata

Name
dev-prompt-engineering
Description
Anthropic์˜ Best Practice๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ณ ์„ฑ๋Šฅ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์„ค๊ณ„ํ•˜๊ณ  ์ตœ์ ํ™”ํ•ฉ๋‹ˆ๋‹ค.

๐ŸŽจ ํ”„๋กฌํ”„ํŠธ ์—”์ง€๋‹ˆ์–ด๋ง (Dev Prompt Engineering)

์ด ์›Œํฌํ”Œ๋กœ์šฐ๋Š” anthropics/prompt-eng-interactive-tutorial์˜ ์›์น™์„ ์‚ฌ์šฉํ•˜์—ฌ ์ตœ์ ์˜ Claude ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.

1. ์ดˆ๊ธฐํ™” (Initialization)

  1. ์Šคํ‚ฌ ๋กœ๋“œ: this document๋ฅผ ์ฝ์–ด "Anthropic Best Practices"๋ฅผ ํŒŒ์•…ํ•ฉ๋‹ˆ๋‹ค.
  2. ๋ชฉํ‘œ ์„ค์ •: ์‚ฌ์šฉ์ž์—๊ฒŒ ๋‹ค์Œ ์„ธ ๊ฐ€์ง€๋ฅผ ๋ฌป์Šต๋‹ˆ๋‹ค.
    • Role: ์—์ด์ „ํŠธ๊ฐ€ ์–ด๋–ค ํŽ˜๋ฅด์†Œ๋‚˜๋ฅผ ๊ฐ€์ ธ์•ผ ํ•ฉ๋‹ˆ๊นŒ?
    • Task: ์ˆ˜ํ–‰ํ•ด์•ผ ํ•  ํ•ต์‹ฌ ์ž‘์—…์€ ๋ฌด์—‡์ž…๋‹ˆ๊นŒ?
    • Constraint: ์ถœ๋ ฅ ํ˜•์‹(JSON, XML ๋“ฑ)์ด๋‚˜ ์ œ์•ฝ ์‚ฌํ•ญ์€ ๋ฌด์—‡์ž…๋‹ˆ๊นŒ?
  3. Language Check: ๋‹ค์Œ ๊ทœ์น™์„ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ธ์ง€์‹œํ‚ต๋‹ˆ๋‹ค.
    • ํ”„๋กฌํ”„ํŠธ ๋ณธ๋ฌธ: ๋ชจ๋ธ ์„ฑ๋Šฅ ๊ทน๋Œ€ํ™”๋ฅผ ์œ„ํ•ด ์˜์–ด๋กœ ์ž‘์„ฑ๋ฉ๋‹ˆ๋‹ค.
    • ์ตœ์ข… ๋‹ต๋ณ€: ์‚ฌ์šฉ์ž๊ฐ€ ์ฝ๊ธฐ ํŽธํ•˜๋„๋ก ํ•œ๊ตญ์–ด๋กœ ์ถœ๋ ฅ๋˜๋„๋ก ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

2. ์ดˆ์•ˆ ์ž‘์„ฑ (Drafting - Context & Role)

"Context First, Instructions Later"

  1. ํ…œํ”Œ๋ฆฟ ๋กœ๋“œ: resources/prompt-template.md๋ฅผ ๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.
  2. ์Šฌ๋กฏ ์ฑ„์šฐ๊ธฐ (Slot Filling): ์‚ฌ์šฉ์ž ์ž…๋ ฅ ์ •๋ณด๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ํ…œํ”Œ๋ฆฟ์˜ {{ }} ํ”Œ๋ ˆ์ด์Šคํ™€๋”๋ฅผ ์ฑ„์›๋‹ˆ๋‹ค.
    • {{DOMAIN}}: Role ์ •๋ณด
    • {{GOAL}}: Task ์ •๋ณด
    • {{YEARS}}: (Optional) ๊ฒฝ๋ ฅ ์—ฐ์ฐจ (๊ธฐ๋ณธ๊ฐ’: Senior/10+)
  3. Draft V1 (Strict Adherence):
    • ๊ตฌ์กฐ ์œ ์ง€: prompt-template.md์˜ ๋ชจ๋“  XML ํƒœ๊ทธ(<system_role>, <context_and_data> ๋“ฑ)์™€ ๋‚ด์šฉ์„ ๊ทธ๋Œ€๋กœ ์œ ์ง€ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    • ์ž‘์—… ๋‚ด์šฉ: ์˜ค์ง {{ }}๋กœ ๊ฐ์‹ธ์ง„ ํ”Œ๋ ˆ์ด์Šคํ™€๋”๋งŒ ์‚ฌ์šฉ์ž์˜ ์ž…๋ ฅ์œผ๋กœ ๊ต์ฒดํ•ฉ๋‹ˆ๋‹ค. ์ž„์˜๋กœ ์„น์…˜์„ ์ƒ๋žตํ•˜๊ฑฐ๋‚˜ ์š”์•ฝํ•˜์ง€ ๋งˆ์‹ญ์‹œ์˜ค.
    • ์ž‘์„ฑ๋œ ์ „์ฒด ํ”„๋กฌํ”„ํŠธ๋ฅผ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ œ์‹œํ•ฉ๋‹ˆ๋‹ค.

3. ๊ณ ๋„ํ™” (Refining - CoT & Few-Shot)

"์ƒ๊ฐํ•˜๊ฒŒ ๋งŒ๋“ค๊ณ , ์˜ˆ์‹œ๋ฅผ ๋ณด์—ฌ์ฃผ์„ธ์š”."

  1. ์˜ˆ์‹œ ์ถ”๊ฐ€ (Few-Shot): ์‚ฌ์šฉ์ž๊ฐ€ ์›ํ•˜๋Š” ์ด์ƒ์ ์ธ ์ž…์ถœ๋ ฅ ์˜ˆ์‹œ๋ฅผ 2~3๊ฐœ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.
  2. CoT ์ ์šฉ: ๋ณต์žกํ•œ ์ž‘์—…์ธ ๊ฒฝ์šฐ, <thinking> ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋‹จ๊ณ„๋ณ„๋กœ ์ถ”๋ก ํ•˜๋„๋ก ์œ ๋„ํ•ฉ๋‹ˆ๋‹ค. ("Think step-by-step")
  3. Draft V2: ๊ฐœ์„ ๋œ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค.

4. ๊ฒ€์ฆ ๋ฐ ์ตœ์ ํ™” (Verification)

  1. ์‹œ๋ฎฌ๋ ˆ์ด์…˜: ์ž‘์„ฑ๋œ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์—์ด์ „ํŠธ ์Šค์Šค๋กœ ํ‰๊ฐ€ํ•ด๋ด…๋‹ˆ๋‹ค. (Self-Correction)
  2. Edge Case ์ ๊ฒ€: "๋ชจ๋ฅด๊ฒ ์œผ๋ฉด ๋ชจ๋ฅธ๋‹ค๊ณ  ๋งํ•ด" ๋“ฑ์˜ ํ™˜๊ฐ(Hallucination) ๋ฐฉ์ง€ ๋ฌธ๊ตฌ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
  3. ์™„๋ฃŒ: ์ตœ์ข… ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

Standards & Rules

Prompt Engineering (Dev Prompt Engineering)

Core Principles (Anthropic Best Practices)

1. The "Context-First" Rule

  • Context: Always provide relevant context before the instruction.
  • Role: Assign a persona (e.g., "You are an expert Python architect").
  • XML Tags: Use XML tags (e.g., <documents>, <instruction>) to structure input. Claude loves XML.

2. The Power of Examples (Few-Shot)

  • Show, Don't Just Tell.
  • Provide 3+ examples of "Input -> Ideal Output" to guide style and format.
  • Anti-Hallucination: Include examples of how to say "I don't know" or handle edge cases.

3. Precognition (Chain of Thought)

  • Let Claude Think: For complex tasks, ask Claude to "Think step-by-step" before answering.
  • Thinking Tags: Use <thinking> blocks to verify logic before generating the final <answer>.

4. Language Strategy (Performance vs Usability)

  • Prompt Language: English. (LLMs reason better in English). All instructions, constraints, and system prompts must be in English.
  • Output Language: Korean. The final response meant for the user must be in Korean.
  • Rule: "Think in English, Speak in Korean."

๐Ÿ—๏ธ Structure of a Great Prompt

  1. Role & Goal: Who is Claude? What is the objective?
  2. Context/Data: Reference materials wrapped in XML.
  3. Rules & Constraints: Dos and Don'ts.
  4. Examples (Few-Shot): Golden samples.
  5. Instruction: The immediate task.
  6. Pre-computation: "Take a deep breath and think step by step..."

โœ… Quality Standards

  • Clarity: Unambiguous instructions.
  • Separation: Data and instructions are visually distinct (XML).
  • Iterative: Every prompt should be tested and refined.

Checklist

  • [ ] Persona: Is a specific role assigned?
  • [ ] XML Structuring: Are data parts wrapped in tags?
  • [ ] Examples: Are there at least 2-3 examples?
  • [ ] CoT: Is identifying the reasoning process (Thinking) required?