Library/API ์ค๊ณ ํ๋จ ๊ธฐ์ค. `/design` command์ D step์์ ๊ธฐ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค๊ณํ ๋ ์ฐธ์กฐ.
From designnpx claudepluginhub seonghyeonkimm/my-claude-code-config --plugin designThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
/design command์ D step์์ ๊ธฐ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ค๊ณํ ๋ ์ฐธ์กฐํ๋ ํ๋จ ๊ธฐ์ค.
์ฌ์ฉ ๋ฐฉ๋ฒ:
/design command์ D step์์ ์๋ ์ฐธ์กฐ๋จ์๋ ์ค 2๊ฐ ์ด์ ํด๋นํ๋ฉด Library Design ๋ฅ๋ค์ด๋ธ๊ฐ ํ์ํ๋ค:
Phase 1: ์๋น์์ ๋ฉํ ๋ชจ๋ธ์ ์ ์ํ๋ค (๋๊ฐ, ์ด๋ป๊ฒ ์ฐ๋๊ฐ)
โ
Phase 2: ๊ณต๊ฐํ ๊ฒ๊ณผ ์จ๊ธธ ๊ฒ์ ๊ฒฝ๊ณ๋ฅผ ๊ธ๋๋ค (API Surface)
โ
Phase 3: ๊ฒฝ๊ณ ์์์ ๊ตฌ์ฒด์ ์ผ๋ก ์ค๊ณํ๋ค
- ํ์
์ผ๋ก ์๋ชป๋ ์ฌ์ฉ์ ๋ง๊ณ (Type Contract)
- ํ์ฅ ๋ฐฉ๋ฒ์ ์ ํ๊ณ (Extension Point)
- ์์ ์ฑ ์ฝ์์ ์ ํ๋ค (Stability Commitment)
"์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฐ๋ ๊ฐ๋ฐ์๊ฐ ๋จธ๋ฆฟ์์ ๊ฐ์ ธ์ผ ํ ๊ฐ๋ ์?"
| ์ง๋ฌธ | ์์ |
|---|---|
| ๋๊ฐ ์ฐ๋๊ฐ? | ์ฑ ๊ฐ๋ฐ์ / ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ฐ๋ฐ์ / ๋ด๋ถ ํ |
| ์๋ จ๋๋? | ์ด๊ธ โ ๊ฐ๊ฒฐํ API, ์๊ธ โ ์ธ๋ฐํ ์ ์ด |
| ํ ๋ฌธ์ฅ ์ ์ | "{X}๋ฅผ ํ๊ธฐ ์ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ" |
๊ฒ์ฆ ์ง๋ฌธ:
์๋น์๊ฐ ์์์ผ ํ ๊ฐ๋ ์ 3~5๊ฐ๋ก ์ ๋ฆฌํ๋ค.
| ๊ฐ๋ | ์ ์ | ์ฝ๋์์์ ํํ |
|---|---|---|
| {๋ช ์ฌ} | {ํ ๋ฌธ์ฅ ์ ์} | {class/type/function ์ด๋ฆ} |
๊ฒ์ฆ ์ง๋ฌธ:
๊ตฌํ ์ ์ ์ฌ์ฉ ์์๋ฅผ ๋จผ์ ์์ฑํ๋ค.
Simple (1์ค): ๊ฐ์ฅ ํํ ์ฌ์ฉ๋ฒ. 80%์ ์ผ์ด์ค.
Advanced: ์ค์ ์ ๋ฐ๊พธ๊ฑฐ๋ ๋์์ ์ปค์คํฐ๋ง์ด์ฆ. 19%.
Escape Hatch: ์ถ์ํ๋ฅผ ์ฐํํด ๋ด๋ถ์ ์ง์ ์ ๊ทผ. 1%.
๊ฒ์ฆ ์ง๋ฌธ:
"๋ฌด์์ ๊ณต๊ฐํ๊ณ , ๋ฌด์์ ์จ๊ธฐ๋๊ฐ?"
Q: ์ด ์ฌ๋ณผ์ ๊ณต๊ฐํด์ผ ํ๋๊ฐ?
โโ ์๋น์์ use case์ ํ์ํ๋ค โ Public
โโ ๋ด๋ถ ๊ตฌํ ํธ์๋ฅผ ์ํ ๊ฒ์ด๋ค โ Internal
ํต์ฌ ์์น: "ํ์ ์ด ์์ผ๋ฉด ๋นผ๋ผ" (Bloch)
3๊ณ์ธต์ผ๋ก API๋ฅผ ์ค๊ณํ๋ค:
| ๊ณ์ธต | ์ค๋ช | ์ค๊ณ ๊ธฐ์ค |
|---|---|---|
| Layer 1: Simple | ๊ฐ์ฅ ํํ ์ผ์ด์ค | ์ต์ ํ๋ผ๋ฏธํฐ, ์ข์ ๊ธฐ๋ณธ๊ฐ |
| Layer 2: Configurable | ์ปค์คํฐ๋ง์ด์ฆ ํ์ | options object, ์ ํ์ ํ๋ผ๋ฏธํฐ |
| Layer 3: Escape Hatch | ์ถ์ํ ์ฐํ ํ์ | ๋ด๋ถ primitive ๋ ธ์ถ |
๊ฒ์ฆ ์ง๋ฌธ:
ํ๋จ ๊ธฐ์ค:
Q: import ๊ฒฝ๋ก๊ฐ ๊น์๊ฐ?
โโ 3๋จ๊ณ ์ด์ โ flatํ๊ฒ ์ฌ๊ตฌ์ฑ ๊ณ ๋ ค
โโ 2๋จ๊ณ ์ดํ โ OK
"ํ์ ์ผ๋ก ์๋ชป๋ ์ฌ์ฉ์ ์ปดํ์ผ ํ์์ ๋ง์ ์ ์๋๊ฐ?"
๊ฒฐ์ ํธ๋ฆฌ:
Q: ์ ํจํ์ง ์์ ์ํ๊ฐ ํ์
์ผ๋ก ํํ ๊ฐ๋ฅํ๊ฐ?
โโ Yes โ Q: ๊ทธ ์ํ๊ฐ ์กฐ์ฉํ ์ค๋์์ ์ ๋ฐํ๋๊ฐ?
โ โโ Yes โ ํ์
์ผ๋ก ๋ฐฉ์ง (discriminated union, branded type)
โ โโ No โ ๋ฐํ์ ๊ฒ์ฆ + ๋ช
ํํ ์๋ฌ ๋ฉ์์ง๋ก ์ถฉ๋ถ
โโ No โ ๋ฌธ์ํ๋ก ์๋ด
๊ธฐ๋ฒ:
| ๊ธฐ๋ฒ | ์ธ์ | ์์ |
|---|---|---|
| Discriminated Union | ์ํธ ๋ฐฐํ์ ์ํ | { kind: "email"; email: string } | { kind: "postal"; address: Address } |
| Smart Constructor | ์์ฑ ์ ๊ฒ์ฆ ํ์ | EmailAddress.parse(raw) โ Result<EmailAddress, Error> |
| Branded Type | ๊ฐ์ ์์ ํ์ ์ด์ง๋ง ์๋ฏธ๊ฐ ๋ค๋ฆ | UserId vs OrderId (๋ ๋ค string์ด์ง๋ง ํผ์ฉ ๋ฐฉ์ง) |
| Non-empty Collection | ๋น ์ ๋ ฅ์ด ์๋ฏธ ์์ | [T, ...T[]] |
์ ์ฉํ์ง ์์ ๋:
Q: ํธ์ถ์๊ฐ ์๋ฌ๋ฅผ ํ๋ก๊ทธ๋๋ฐ์ ์ผ๋ก ๋ถ๊ธฐํด์ผ ํ๋๊ฐ?
โโ Yes โ typed exception ๋๋ Result type
โโ No โ ๋ฉ์์ง๋ง ํฌํจ๋ ์ผ๋ฐ ์๋ฌ
์์น:
"์๋น์๊ฐ ๋์์ ํ์ฅํด์ผ ํ๋ ์ง์ ์ ์ด๋์ธ๊ฐ?"
ํจํด ์ ํ:
| ํจํด | ์ ์ด ํ๋ฆ | ๊ฒฐํฉ๋ | ์ ํฉํ ๊ฒฝ์ฐ |
|---|---|---|---|
| Plugin | ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ํธ์ถ | ๋ฎ์ | ์ ์ฒด ๊ธฐ๋ฅ ์ถ๊ฐ (ํ์, ํฌ๋งคํฐ, ๋ฐฑ์๋) |
| Middleware | ์ฒด์ธ, ๊ฐ๊ฐ next() ํธ์ถ | ์ค๊ฐ | ์์ฒญ/์๋ต ํ์ดํ๋ผ์ธ, ์ ํ ์ฒ๋ฆฌ |
| Hook/Event | Pub-Sub, fire-and-forget | ๋งค์ฐ ๋ฎ์ | ๊ด์ฐฐ๋ง ํ์, ๋์ ๋ณ๊ฒฝ ๋ถํ์ |
| Adapter | ์ธํฐํ์ด์ค ๋ณํ | ๋ฎ์ | ์ธ๋ถ ๊ตฌํ ์ฃผ์ (HTTP ํด๋ผ์ด์ธํธ, ๋ก๊ฑฐ) |
ํ๋จ ํ๋ฆ:
Q: ํ์ฅ์ด ๋์์ ๋ณ๊ฒฝํ๋๊ฐ, ๊ด์ฐฐ๋ง ํ๋๊ฐ?
โโ ๊ด์ฐฐ๋ง โ Hook/Event
โโ ๋ณ๊ฒฝ โ Q: ์ ํ ์ฒ๋ฆฌ ํ์ดํ๋ผ์ธ์ธ๊ฐ?
โโ Yes โ Middleware
โโ No โ Q: ๊ธฐ๋ฅ ๋จ์๋ก ๊ต์ฒด ๊ฐ๋ฅํ๊ฐ?
โโ Yes โ Plugin
โโ No โ Adapter (์ธ๋ถ ์์กด ์ฃผ์
)
Extension interface ์ค๊ณ ์์น:
"๊ณต๊ฐํ ๋ชจ๋ ๊ฒ์ ์์ํ ์ฝ์์ด๋ค"
Hyrum's Law: "์ถฉ๋ถํ ์ฌ์ฉ์๊ฐ ์์ผ๋ฉด, ๋ฌธ์ํํ์ง ์์ ๊ด์ธก ๊ฐ๋ฅํ ํ์์๋ ๋๊ตฐ๊ฐ ์์กดํ๋ค"
์ฒดํฌ๋ฆฌ์คํธ:
| ์ค์ | ๋ฌธ์ | ํด๊ฒฐ |
|---|---|---|
| ๊ตฌํ๋ถํฐ ์์ | API๊ฐ ๋ด๋ถ ๊ตฌ์กฐ๋ฅผ ๋ฐ์ | ์ฌ์ฉ ์์(README)๋ฅผ ๋จผ์ ์์ฑ |
| ๋ชจ๋ ๊ฒ์ public | ๋ชจ๋ ๋ณ๊ฒฝ์ด breaking change | ๊ธฐ๋ณธ private, ํ์ํ ๊ฒ๋ง ๊ณต๊ฐ |
| string/any ํ๋ผ๋ฏธํฐ ๋จ์ฉ | ๋ฐํ์ ์๋ฌ, ๋ฌธ์์ด ํ์ฑ | ์ ์ฉ ํ์ , enum, value object |
| nullable return | ํธ์ถ์๊ฐ null ์ฒดํฌ ๋๋ฝ | ๋น ์ปฌ๋ ์ , Option/Result ํ์ |
| ๊ธด positional ํ๋ผ๋ฏธํฐ | ์ธ์ ์์ ์ค์ | options object ๋๋ builder |
| escape hatch ์์ | ์ถ์ํ ์คํจ ์ ๋งํ | Layer 3 raw access ์ ๊ณต |
| ๋ฌด๊ฑฐ์ด ์์กด์ฑ | ๋ฒ๋ค ๋น๋, ๋ฒ์ ์ถฉ๋ | dep ์ต์ํ, ์ฃผ์ ํ์ฉ |
| global mutable ์ค์ | ๋ณต์ ์ธ์คํด์ค ๊ฐ ๊ฐ์ญ | ์ธ์คํด์ค ๊ธฐ๋ฐ ์ค์ (class/closure) |
| ์๋ฌ์ ๋ฌธ์์ด๋ง | ํธ์ถ์๊ฐ ์๋ฌ ๋ฌธ์์ด ํ์ฑ | typed exception + ๋จธ์ ๋ฆฌ๋๋ธ ํ๋ |