oh-my-customcode 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +287 -0
  3. package/dist/cli/index.js +13299 -0
  4. package/dist/index.js +927 -0
  5. package/package.json +74 -0
  6. package/templates/.claude/contexts/dev.md +20 -0
  7. package/templates/.claude/contexts/ecomode.md +63 -0
  8. package/templates/.claude/contexts/index.yaml +41 -0
  9. package/templates/.claude/contexts/research.md +28 -0
  10. package/templates/.claude/contexts/review.md +23 -0
  11. package/templates/.claude/hooks/hooks.json +185 -0
  12. package/templates/.claude/hooks/hud/index.yaml +27 -0
  13. package/templates/.claude/hooks/hud/update-status.sh +32 -0
  14. package/templates/.claude/hooks/index.yaml +46 -0
  15. package/templates/.claude/hooks/memory-persistence/pre-compact.sh +37 -0
  16. package/templates/.claude/hooks/memory-persistence/session-end.sh +64 -0
  17. package/templates/.claude/hooks/memory-persistence/session-start.sh +41 -0
  18. package/templates/.claude/hooks/strategic-compact/suggest-compact.sh +50 -0
  19. package/templates/.claude/install-hooks.sh +100 -0
  20. package/templates/.claude/rules/MAY-optimization.md +93 -0
  21. package/templates/.claude/rules/MUST-agent-design.md +107 -0
  22. package/templates/.claude/rules/MUST-agent-identification.md +108 -0
  23. package/templates/.claude/rules/MUST-continuous-improvement.md +132 -0
  24. package/templates/.claude/rules/MUST-intent-transparency.md +199 -0
  25. package/templates/.claude/rules/MUST-language-policy.md +62 -0
  26. package/templates/.claude/rules/MUST-orchestrator-coordination.md +266 -0
  27. package/templates/.claude/rules/MUST-parallel-execution.md +341 -0
  28. package/templates/.claude/rules/MUST-permissions.md +84 -0
  29. package/templates/.claude/rules/MUST-safety.md +69 -0
  30. package/templates/.claude/rules/MUST-sync-verification.md +219 -0
  31. package/templates/.claude/rules/MUST-tool-identification.md +112 -0
  32. package/templates/.claude/rules/SHOULD-ecomode.md +145 -0
  33. package/templates/.claude/rules/SHOULD-error-handling.md +102 -0
  34. package/templates/.claude/rules/SHOULD-hud-statusline.md +89 -0
  35. package/templates/.claude/rules/SHOULD-interaction.md +103 -0
  36. package/templates/.claude/rules/SHOULD-memory-integration.md +114 -0
  37. package/templates/.claude/rules/SHOULD-pipeline-mode.md +165 -0
  38. package/templates/.claude/rules/index.yaml +125 -0
  39. package/templates/.claude/uninstall-hooks.sh +52 -0
  40. package/templates/CLAUDE.md.en +259 -0
  41. package/templates/CLAUDE.md.ko +259 -0
  42. package/templates/agents/index.yaml +237 -0
  43. package/templates/agents/infra-engineer/aws-expert/AGENT.md +47 -0
  44. package/templates/agents/infra-engineer/aws-expert/index.yaml +27 -0
  45. package/templates/agents/infra-engineer/docker-expert/AGENT.md +47 -0
  46. package/templates/agents/infra-engineer/docker-expert/index.yaml +27 -0
  47. package/templates/agents/manager/creator/AGENT.md +274 -0
  48. package/templates/agents/manager/creator/index.yaml +66 -0
  49. package/templates/agents/manager/gitnerd/AGENT.md +91 -0
  50. package/templates/agents/manager/gitnerd/index.yaml +55 -0
  51. package/templates/agents/manager/sauron/AGENT.md +153 -0
  52. package/templates/agents/manager/sauron/index.yaml +52 -0
  53. package/templates/agents/manager/supplier/AGENT.md +142 -0
  54. package/templates/agents/manager/supplier/index.yaml +31 -0
  55. package/templates/agents/manager/sync-checker/AGENT.md +34 -0
  56. package/templates/agents/manager/sync-checker/index.yaml +32 -0
  57. package/templates/agents/manager/updater/AGENT.md +125 -0
  58. package/templates/agents/manager/updater/index.yaml +31 -0
  59. package/templates/agents/orchestrator/dev-lead/AGENT.md +116 -0
  60. package/templates/agents/orchestrator/dev-lead/index.yaml +73 -0
  61. package/templates/agents/orchestrator/planner/AGENT.md +102 -0
  62. package/templates/agents/orchestrator/planner/index.yaml +38 -0
  63. package/templates/agents/orchestrator/qa-lead/AGENT.md +92 -0
  64. package/templates/agents/orchestrator/qa-lead/index.yaml +40 -0
  65. package/templates/agents/orchestrator/secretary/AGENT.md +132 -0
  66. package/templates/agents/orchestrator/secretary/index.yaml +55 -0
  67. package/templates/agents/qa-team/qa-engineer/AGENT.md +98 -0
  68. package/templates/agents/qa-team/qa-engineer/index.yaml +59 -0
  69. package/templates/agents/qa-team/qa-planner/AGENT.md +75 -0
  70. package/templates/agents/qa-team/qa-planner/index.yaml +47 -0
  71. package/templates/agents/qa-team/qa-writer/AGENT.md +98 -0
  72. package/templates/agents/qa-team/qa-writer/index.yaml +44 -0
  73. package/templates/agents/sw-architect/documenter/AGENT.md +120 -0
  74. package/templates/agents/sw-architect/documenter/index.yaml +39 -0
  75. package/templates/agents/sw-architect/speckit-agent/AGENT.md +127 -0
  76. package/templates/agents/sw-architect/speckit-agent/index.yaml +78 -0
  77. package/templates/agents/sw-engineer/backend/express-expert/AGENT.md +132 -0
  78. package/templates/agents/sw-engineer/backend/express-expert/index.yaml +36 -0
  79. package/templates/agents/sw-engineer/backend/fastapi-expert/AGENT.md +47 -0
  80. package/templates/agents/sw-engineer/backend/fastapi-expert/index.yaml +27 -0
  81. package/templates/agents/sw-engineer/backend/go-backend-expert/AGENT.md +47 -0
  82. package/templates/agents/sw-engineer/backend/go-backend-expert/index.yaml +27 -0
  83. package/templates/agents/sw-engineer/backend/nestjs-expert/AGENT.md +107 -0
  84. package/templates/agents/sw-engineer/backend/nestjs-expert/index.yaml +43 -0
  85. package/templates/agents/sw-engineer/backend/springboot-expert/AGENT.md +103 -0
  86. package/templates/agents/sw-engineer/backend/springboot-expert/index.yaml +69 -0
  87. package/templates/agents/sw-engineer/frontend/svelte-agent/AGENT.md +71 -0
  88. package/templates/agents/sw-engineer/frontend/svelte-agent/index.yaml +41 -0
  89. package/templates/agents/sw-engineer/frontend/vercel-agent/AGENT.md +67 -0
  90. package/templates/agents/sw-engineer/frontend/vercel-agent/index.yaml +43 -0
  91. package/templates/agents/sw-engineer/frontend/vuejs-agent/AGENT.md +71 -0
  92. package/templates/agents/sw-engineer/frontend/vuejs-agent/index.yaml +48 -0
  93. package/templates/agents/sw-engineer/language/golang-expert/AGENT.md +47 -0
  94. package/templates/agents/sw-engineer/language/golang-expert/index.yaml +27 -0
  95. package/templates/agents/sw-engineer/language/java21-expert/AGENT.md +122 -0
  96. package/templates/agents/sw-engineer/language/java21-expert/index.yaml +51 -0
  97. package/templates/agents/sw-engineer/language/kotlin-expert/AGENT.md +47 -0
  98. package/templates/agents/sw-engineer/language/kotlin-expert/index.yaml +27 -0
  99. package/templates/agents/sw-engineer/language/python-expert/AGENT.md +47 -0
  100. package/templates/agents/sw-engineer/language/python-expert/index.yaml +27 -0
  101. package/templates/agents/sw-engineer/language/rust-expert/AGENT.md +47 -0
  102. package/templates/agents/sw-engineer/language/rust-expert/index.yaml +27 -0
  103. package/templates/agents/sw-engineer/language/typescript-expert/AGENT.md +47 -0
  104. package/templates/agents/sw-engineer/language/typescript-expert/index.yaml +27 -0
  105. package/templates/agents/sw-engineer/tooling/bun-expert/AGENT.md +73 -0
  106. package/templates/agents/sw-engineer/tooling/bun-expert/index.yaml +46 -0
  107. package/templates/agents/sw-engineer/tooling/npm-expert/AGENT.md +160 -0
  108. package/templates/agents/sw-engineer/tooling/npm-expert/index.yaml +45 -0
  109. package/templates/agents/sw-engineer/tooling/optimizer/AGENT.md +170 -0
  110. package/templates/agents/sw-engineer/tooling/optimizer/index.yaml +45 -0
  111. package/templates/agents/system/memory-keeper/AGENT.md +126 -0
  112. package/templates/agents/system/memory-keeper/index.yaml +45 -0
  113. package/templates/agents/system/naggy/AGENT.md +72 -0
  114. package/templates/agents/system/naggy/index.yaml +35 -0
  115. package/templates/commands/COMMANDS.md +136 -0
  116. package/templates/commands/creator/agent.md +121 -0
  117. package/templates/commands/dev/refactor.md +126 -0
  118. package/templates/commands/dev/review.md +82 -0
  119. package/templates/commands/git/branch.yaml +8 -0
  120. package/templates/commands/git/commit.yaml +4 -0
  121. package/templates/commands/git/pr.yaml +4 -0
  122. package/templates/commands/git/status.yaml +4 -0
  123. package/templates/commands/git/sync.yaml +4 -0
  124. package/templates/commands/index.yaml +225 -0
  125. package/templates/commands/intent/explain.md +144 -0
  126. package/templates/commands/memory/recall.md +164 -0
  127. package/templates/commands/memory/save.md +128 -0
  128. package/templates/commands/naggy/add.yaml +8 -0
  129. package/templates/commands/naggy/done.yaml +8 -0
  130. package/templates/commands/naggy/list.yaml +4 -0
  131. package/templates/commands/naggy/priority.yaml +11 -0
  132. package/templates/commands/naggy/remind.yaml +4 -0
  133. package/templates/commands/npm/audit.yaml +62 -0
  134. package/templates/commands/npm/publish.yaml +52 -0
  135. package/templates/commands/npm/version.yaml +62 -0
  136. package/templates/commands/optimize/analyze.yaml +34 -0
  137. package/templates/commands/optimize/bundle.yaml +50 -0
  138. package/templates/commands/optimize/report.yaml +56 -0
  139. package/templates/commands/pipeline/list.md +81 -0
  140. package/templates/commands/pipeline/run.md +127 -0
  141. package/templates/commands/sauron/quick.yaml +4 -0
  142. package/templates/commands/sauron/report.yaml +4 -0
  143. package/templates/commands/sauron/watch.yaml +4 -0
  144. package/templates/commands/supplier/audit.md +133 -0
  145. package/templates/commands/supplier/fix.md +121 -0
  146. package/templates/commands/sync/agents.yaml +4 -0
  147. package/templates/commands/sync/check.yaml +4 -0
  148. package/templates/commands/sync/commands.yaml +4 -0
  149. package/templates/commands/sync/docs.yaml +4 -0
  150. package/templates/commands/sync/fix.yaml +4 -0
  151. package/templates/commands/system/help.md +137 -0
  152. package/templates/commands/system/lists.md +86 -0
  153. package/templates/commands/system/status.md +163 -0
  154. package/templates/commands/updater/docs.md +165 -0
  155. package/templates/commands/updater/external.md +214 -0
  156. package/templates/guides/aws/common-patterns.md +169 -0
  157. package/templates/guides/aws/index.yaml +26 -0
  158. package/templates/guides/aws/well-architected.md +143 -0
  159. package/templates/guides/claude-code/01-overview.md +42 -0
  160. package/templates/guides/claude-code/03-tools.md +107 -0
  161. package/templates/guides/claude-code/04-agent-skills.md +90 -0
  162. package/templates/guides/claude-code/05-agent-sdk.md +129 -0
  163. package/templates/guides/claude-code/06-mcp.md +165 -0
  164. package/templates/guides/claude-code/07-prompt-engineering.md +100 -0
  165. package/templates/guides/claude-code/08-testing.md +58 -0
  166. package/templates/guides/claude-code/09-guardrails.md +80 -0
  167. package/templates/guides/claude-code/10-monitoring.md +89 -0
  168. package/templates/guides/claude-code/index.yaml +51 -0
  169. package/templates/guides/docker/compose-best-practices.md +284 -0
  170. package/templates/guides/docker/dockerfile-best-practices.md +262 -0
  171. package/templates/guides/docker/index.yaml +26 -0
  172. package/templates/guides/fastapi/best-practices.md +232 -0
  173. package/templates/guides/fastapi/index.yaml +21 -0
  174. package/templates/guides/go-backend/index.yaml +26 -0
  175. package/templates/guides/go-backend/project-layout.md +243 -0
  176. package/templates/guides/go-backend/uber-style.md +212 -0
  177. package/templates/guides/golang/concurrency.md +282 -0
  178. package/templates/guides/golang/effective-go.md +309 -0
  179. package/templates/guides/golang/error-handling.md +250 -0
  180. package/templates/guides/golang/index.yaml +27 -0
  181. package/templates/guides/index.yaml +101 -0
  182. package/templates/guides/kotlin/coding-conventions.md +247 -0
  183. package/templates/guides/kotlin/idioms.md +234 -0
  184. package/templates/guides/kotlin/index.yaml +26 -0
  185. package/templates/guides/python/index.yaml +26 -0
  186. package/templates/guides/python/pep8-style-guide.md +202 -0
  187. package/templates/guides/python/zen-of-python.md +79 -0
  188. package/templates/guides/rust/error-handling.md +262 -0
  189. package/templates/guides/rust/index.yaml +26 -0
  190. package/templates/guides/rust/ownership.md +180 -0
  191. package/templates/guides/springboot/best-practices.md +361 -0
  192. package/templates/guides/springboot/index.yaml +22 -0
  193. package/templates/guides/typescript/advanced-types.md +225 -0
  194. package/templates/guides/typescript/index.yaml +26 -0
  195. package/templates/guides/typescript/type-system.md +219 -0
  196. package/templates/guides/web-design/accessibility.md +66 -0
  197. package/templates/guides/web-design/index.yaml +20 -0
  198. package/templates/guides/web-design/performance.md +102 -0
  199. package/templates/pipelines/examples/code-review.yaml +66 -0
  200. package/templates/pipelines/index.yaml +18 -0
  201. package/templates/pipelines/templates/pipeline-template.yaml +50 -0
  202. package/templates/skills/backend/fastapi-best-practices/SKILL.md +269 -0
  203. package/templates/skills/backend/fastapi-best-practices/index.yaml +25 -0
  204. package/templates/skills/backend/go-backend-best-practices/SKILL.md +337 -0
  205. package/templates/skills/backend/go-backend-best-practices/index.yaml +26 -0
  206. package/templates/skills/backend/springboot-best-practices/SKILL.md +356 -0
  207. package/templates/skills/backend/springboot-best-practices/index.yaml +27 -0
  208. package/templates/skills/development/go-best-practices/SKILL.md +202 -0
  209. package/templates/skills/development/go-best-practices/index.yaml +25 -0
  210. package/templates/skills/development/kotlin-best-practices/SKILL.md +255 -0
  211. package/templates/skills/development/kotlin-best-practices/index.yaml +27 -0
  212. package/templates/skills/development/python-best-practices/SKILL.md +221 -0
  213. package/templates/skills/development/python-best-practices/index.yaml +25 -0
  214. package/templates/skills/development/react-best-practices/SKILL.md +100 -0
  215. package/templates/skills/development/react-best-practices/index.yaml +39 -0
  216. package/templates/skills/development/rust-best-practices/SKILL.md +266 -0
  217. package/templates/skills/development/rust-best-practices/index.yaml +26 -0
  218. package/templates/skills/development/typescript-best-practices/SKILL.md +320 -0
  219. package/templates/skills/development/typescript-best-practices/index.yaml +28 -0
  220. package/templates/skills/development/vercel-deploy/SKILL.md +73 -0
  221. package/templates/skills/development/vercel-deploy/index.yaml +30 -0
  222. package/templates/skills/development/web-design-guidelines/SKILL.md +117 -0
  223. package/templates/skills/development/web-design-guidelines/index.yaml +34 -0
  224. package/templates/skills/index.yaml +129 -0
  225. package/templates/skills/infrastructure/aws-best-practices/SKILL.md +279 -0
  226. package/templates/skills/infrastructure/aws-best-practices/index.yaml +27 -0
  227. package/templates/skills/infrastructure/docker-best-practices/SKILL.md +274 -0
  228. package/templates/skills/infrastructure/docker-best-practices/index.yaml +26 -0
  229. package/templates/skills/orchestration/intent-detection/SKILL.md +214 -0
  230. package/templates/skills/orchestration/intent-detection/index.yaml +30 -0
  231. package/templates/skills/orchestration/intent-detection/patterns/agent-triggers.yaml +333 -0
  232. package/templates/skills/orchestration/pipeline-execution/SKILL.md +188 -0
  233. package/templates/skills/orchestration/pipeline-execution/index.yaml +27 -0
  234. package/templates/skills/system/memory-management/SKILL.md +194 -0
  235. package/templates/skills/system/memory-management/index.yaml +30 -0
  236. package/templates/skills/system/result-aggregation/SKILL.md +163 -0
  237. package/templates/skills/system/result-aggregation/index.yaml +36 -0
@@ -0,0 +1,80 @@
1
+ # 가드레일 강화
2
+
3
+ > 이 문서는 Claude 공식 문서에서 해당 페이지가 아직 공개되지 않아 기본 구조만 제공합니다.
4
+
5
+ ## 개요
6
+
7
+ 가드레일은 AI 에이전트가 안전하고 의도된 범위 내에서 작동하도록 보장하는 메커니즘입니다.
8
+
9
+ ## 가드레일 유형
10
+
11
+ ### 1. 입력 가드레일
12
+ - 프롬프트 인젝션 방지
13
+ - 악의적인 입력 필터링
14
+ - 입력 유효성 검사
15
+
16
+ ### 2. 출력 가드레일
17
+ - 민감 정보 필터링
18
+ - 유해 콘텐츠 차단
19
+ - 형식 준수 확인
20
+
21
+ ### 3. 행동 가드레일
22
+ - 도구 사용 제한
23
+ - 파일 시스템 접근 제어
24
+ - 네트워크 요청 제한
25
+
26
+ ### 4. 리소스 가드레일
27
+ - 토큰 사용량 제한
28
+ - 실행 시간 제한
29
+ - API 호출 제한
30
+
31
+ ## 구현 전략
32
+
33
+ ### 권한 관리
34
+ ```python
35
+ options = ClaudeAgentOptions(
36
+ allowed_tools=["Read", "Glob", "Grep"], # 읽기 전용
37
+ permission_mode="bypassPermissions"
38
+ )
39
+ ```
40
+
41
+ ### 훅을 통한 검증
42
+ ```python
43
+ hooks={
44
+ "PreToolUse": [{
45
+ "matcher": "Bash",
46
+ "hooks": [{
47
+ "type": "command",
48
+ "command": "validate_command.sh"
49
+ }]
50
+ }]
51
+ }
52
+ ```
53
+
54
+ ### 도구 필터링
55
+ 특정 도구만 허용하거나 특정 도구를 차단하여 에이전트의 능력을 제한
56
+
57
+ ## 모범 사례
58
+
59
+ 1. **최소 권한 원칙**: 필요한 최소한의 권한만 부여
60
+ 2. **계층적 검증**: 여러 레벨에서 검증 수행
61
+ 3. **실패 안전**: 검증 실패 시 안전한 기본값으로 폴백
62
+ 4. **로깅 및 감사**: 모든 작업을 기록하여 추적 가능
63
+ 5. **정기적 검토**: 가드레일 효과성 주기적 평가
64
+
65
+ ## 보안 고려사항
66
+
67
+ ### 프롬프트 인젝션 방어
68
+ - 사용자 입력과 시스템 지침 분리
69
+ - XML 태그를 사용한 구조화
70
+ - 입력 이스케이프 처리
71
+
72
+ ### 데이터 보호
73
+ - 민감 데이터 마스킹
74
+ - 출력 스크러빙
75
+ - 접근 제어 적용
76
+
77
+ ### 코드 실행 안전
78
+ - 샌드박스 환경 사용
79
+ - 실행 시간 제한
80
+ - 리소스 쿼터 적용
@@ -0,0 +1,89 @@
1
+ # 관리 및 모니터링
2
+
3
+ > 이 문서는 Claude 공식 문서에서 해당 페이지가 아직 공개되지 않아 기본 구조만 제공합니다.
4
+
5
+ ## 개요
6
+
7
+ 프로덕션 환경에서 AI 에이전트를 효과적으로 관리하고 모니터링하는 방법입니다.
8
+
9
+ ## 모니터링 영역
10
+
11
+ ### 1. 성능 모니터링
12
+ - 응답 시간 (Latency)
13
+ - 처리량 (Throughput)
14
+ - 에러율 (Error Rate)
15
+ - 성공률 (Success Rate)
16
+
17
+ ### 2. 비용 모니터링
18
+ - 토큰 사용량
19
+ - API 호출 수
20
+ - 도구 실행 비용
21
+ - 월별/일별 비용 추이
22
+
23
+ ### 3. 품질 모니터링
24
+ - 출력 정확도
25
+ - 사용자 만족도
26
+ - 태스크 완료율
27
+ - 재시도 비율
28
+
29
+ ### 4. 안전 모니터링
30
+ - 가드레일 트리거 횟수
31
+ - 차단된 요청
32
+ - 보안 이벤트
33
+ - 이상 탐지
34
+
35
+ ## 로깅 전략
36
+
37
+ ### 구조화된 로깅
38
+ ```json
39
+ {
40
+ "timestamp": "2025-01-22T10:30:00Z",
41
+ "agent_id": "agent-123",
42
+ "action": "tool_use",
43
+ "tool": "Edit",
44
+ "input": {...},
45
+ "output": {...},
46
+ "duration_ms": 150,
47
+ "tokens_used": 500
48
+ }
49
+ ```
50
+
51
+ ### 로그 레벨
52
+ - **DEBUG**: 상세 디버깅 정보
53
+ - **INFO**: 일반 작업 정보
54
+ - **WARN**: 잠재적 문제
55
+ - **ERROR**: 오류 발생
56
+ - **CRITICAL**: 심각한 시스템 문제
57
+
58
+ ## 알림 설정
59
+
60
+ ### 임계값 기반 알림
61
+ - 에러율 > 5%
62
+ - 응답 시간 > 10초
63
+ - 일일 비용 > 예산
64
+
65
+ ### 패턴 기반 알림
66
+ - 비정상적인 사용 패턴
67
+ - 갑작스러운 트래픽 증가
68
+ - 연속 실패
69
+
70
+ ## 대시보드 구성
71
+
72
+ ### 핵심 메트릭
73
+ - 실시간 요청 수
74
+ - 평균 응답 시간
75
+ - 현재 에러율
76
+ - 활성 세션 수
77
+
78
+ ### 트렌드 분석
79
+ - 시간별 사용량
80
+ - 주간 비용 추이
81
+ - 성능 변화 추적
82
+
83
+ ## 운영 모범 사례
84
+
85
+ 1. **자동화된 모니터링**: 24/7 자동 모니터링 구축
86
+ 2. **알림 피로 방지**: 중요한 알림만 전송
87
+ 3. **인시던트 대응**: 명확한 대응 절차 수립
88
+ 4. **용량 계획**: 사용량 예측 및 확장 계획
89
+ 5. **정기 리뷰**: 주기적인 성능 검토 미팅
@@ -0,0 +1,51 @@
1
+ # Claude Code Guide Index
2
+ # Claude로 에이전트를 구축하기 위한 가이드 문서 인덱스
3
+
4
+ documents:
5
+ - name: overview
6
+ title: 기능 개요
7
+ description: Claude의 핵심 기능 및 도구 요약
8
+ path: ./01-overview.md
9
+
10
+ - name: tools
11
+ title: 도구 사용
12
+ description: Claude와 도구 통합 방법
13
+ path: ./03-tools.md
14
+
15
+ - name: agent-skills
16
+ title: 에이전트 스킬
17
+ description: Skills로 Claude 기능 확장
18
+ path: ./04-agent-skills.md
19
+
20
+ - name: agent-sdk
21
+ title: 에이전트 SDK
22
+ description: Python/TypeScript로 에이전트 구축
23
+ path: ./05-agent-sdk.md
24
+
25
+ - name: mcp
26
+ title: MCP 커넥터
27
+ description: Model Context Protocol 서버 연결
28
+ path: ./06-mcp.md
29
+
30
+ - name: prompt-engineering
31
+ title: 프롬프트 엔지니어링
32
+ description: 프롬프트 최적화 기법
33
+ path: ./07-prompt-engineering.md
34
+
35
+ - name: testing
36
+ title: 테스트 및 평가
37
+ description: 품질 보장을 위한 테스트 방법
38
+ path: ./08-testing.md
39
+ status: placeholder # 공식 문서 미공개
40
+
41
+ - name: guardrails
42
+ title: 가드레일 강화
43
+ description: 안전한 에이전트 운영을 위한 제약
44
+ path: ./09-guardrails.md
45
+ status: placeholder # 공식 문서 미공개
46
+
47
+ - name: monitoring
48
+ title: 관리 및 모니터링
49
+ description: 프로덕션 에이전트 운영
50
+ path: ./10-monitoring.md
51
+ status: placeholder # 공식 문서 미공개
@@ -0,0 +1,284 @@
1
+ # Docker Compose Best Practices
2
+
3
+ > Source: https://docs.docker.com/compose/compose-file/best-practices/
4
+
5
+ ## File Structure
6
+
7
+ ```yaml
8
+ version: "3.8"
9
+
10
+ services:
11
+ # Application services
12
+ app:
13
+ ...
14
+
15
+ # Infrastructure services
16
+ db:
17
+ ...
18
+
19
+ volumes:
20
+ # Named volumes
21
+
22
+ networks:
23
+ # Custom networks
24
+ ```
25
+
26
+ ## Service Configuration
27
+
28
+ ### Build Configuration
29
+
30
+ ```yaml
31
+ services:
32
+ app:
33
+ build:
34
+ context: .
35
+ dockerfile: Dockerfile
36
+ target: production
37
+ args:
38
+ - NODE_ENV=production
39
+ ```
40
+
41
+ ### Environment Variables
42
+
43
+ ```yaml
44
+ services:
45
+ app:
46
+ # From file
47
+ env_file:
48
+ - .env
49
+ - .env.local
50
+
51
+ # Inline
52
+ environment:
53
+ - DATABASE_URL=${DATABASE_URL}
54
+ - NODE_ENV=production
55
+ ```
56
+
57
+ ### Dependencies
58
+
59
+ ```yaml
60
+ services:
61
+ app:
62
+ depends_on:
63
+ db:
64
+ condition: service_healthy
65
+ redis:
66
+ condition: service_started
67
+ ```
68
+
69
+ ### Health Checks
70
+
71
+ ```yaml
72
+ services:
73
+ db:
74
+ image: postgres:16
75
+ healthcheck:
76
+ test: ["CMD-SHELL", "pg_isready -U postgres"]
77
+ interval: 10s
78
+ timeout: 5s
79
+ retries: 5
80
+ start_period: 30s
81
+ ```
82
+
83
+ ### Resource Limits
84
+
85
+ ```yaml
86
+ services:
87
+ app:
88
+ deploy:
89
+ resources:
90
+ limits:
91
+ cpus: "1"
92
+ memory: 512M
93
+ reservations:
94
+ cpus: "0.5"
95
+ memory: 256M
96
+ ```
97
+
98
+ ## Volumes
99
+
100
+ ### Named Volumes
101
+
102
+ ```yaml
103
+ services:
104
+ db:
105
+ volumes:
106
+ - postgres_data:/var/lib/postgresql/data
107
+
108
+ volumes:
109
+ postgres_data:
110
+ driver: local
111
+ ```
112
+
113
+ ### Bind Mounts (Development)
114
+
115
+ ```yaml
116
+ services:
117
+ app:
118
+ volumes:
119
+ - ./src:/app/src:ro
120
+ - ./config:/app/config:ro
121
+ ```
122
+
123
+ ## Networks
124
+
125
+ ### Custom Networks
126
+
127
+ ```yaml
128
+ services:
129
+ app:
130
+ networks:
131
+ - frontend
132
+ - backend
133
+
134
+ db:
135
+ networks:
136
+ - backend
137
+
138
+ networks:
139
+ frontend:
140
+ backend:
141
+ internal: true
142
+ ```
143
+
144
+ ## Multiple Environments
145
+
146
+ ### Override Files
147
+
148
+ ```bash
149
+ # Base configuration
150
+ docker-compose.yml
151
+
152
+ # Development overrides
153
+ docker-compose.override.yml
154
+
155
+ # Production overrides
156
+ docker-compose.prod.yml
157
+
158
+ # Usage
159
+ docker compose -f docker-compose.yml -f docker-compose.prod.yml up
160
+ ```
161
+
162
+ ### Example: Production
163
+
164
+ ```yaml
165
+ # docker-compose.prod.yml
166
+ services:
167
+ app:
168
+ build:
169
+ target: production
170
+ restart: always
171
+ deploy:
172
+ replicas: 3
173
+ resources:
174
+ limits:
175
+ cpus: "1"
176
+ memory: 1G
177
+
178
+ db:
179
+ restart: always
180
+ volumes:
181
+ - /mnt/data/postgres:/var/lib/postgresql/data
182
+ ```
183
+
184
+ ### Example: Development
185
+
186
+ ```yaml
187
+ # docker-compose.override.yml
188
+ services:
189
+ app:
190
+ build:
191
+ target: development
192
+ volumes:
193
+ - ./src:/app/src
194
+ environment:
195
+ - DEBUG=true
196
+ ports:
197
+ - "3000:3000"
198
+ - "9229:9229" # debugger
199
+ ```
200
+
201
+ ## Complete Example
202
+
203
+ ```yaml
204
+ version: "3.8"
205
+
206
+ services:
207
+ app:
208
+ build:
209
+ context: .
210
+ target: production
211
+ restart: unless-stopped
212
+ environment:
213
+ - DATABASE_URL=postgresql://user:pass@db:5432/myapp
214
+ - REDIS_URL=redis://redis:6379
215
+ ports:
216
+ - "8080:8080"
217
+ depends_on:
218
+ db:
219
+ condition: service_healthy
220
+ redis:
221
+ condition: service_started
222
+ healthcheck:
223
+ test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
224
+ interval: 30s
225
+ timeout: 10s
226
+ retries: 3
227
+ deploy:
228
+ resources:
229
+ limits:
230
+ cpus: "2"
231
+ memory: 1G
232
+ networks:
233
+ - frontend
234
+ - backend
235
+
236
+ db:
237
+ image: postgres:16-alpine
238
+ restart: unless-stopped
239
+ environment:
240
+ - POSTGRES_USER=user
241
+ - POSTGRES_PASSWORD=pass
242
+ - POSTGRES_DB=myapp
243
+ volumes:
244
+ - postgres_data:/var/lib/postgresql/data
245
+ healthcheck:
246
+ test: ["CMD-SHELL", "pg_isready -U user -d myapp"]
247
+ interval: 10s
248
+ timeout: 5s
249
+ retries: 5
250
+ networks:
251
+ - backend
252
+
253
+ redis:
254
+ image: redis:7-alpine
255
+ restart: unless-stopped
256
+ command: redis-server --appendonly yes
257
+ volumes:
258
+ - redis_data:/data
259
+ networks:
260
+ - backend
261
+
262
+ nginx:
263
+ image: nginx:1.25-alpine
264
+ restart: unless-stopped
265
+ ports:
266
+ - "80:80"
267
+ - "443:443"
268
+ volumes:
269
+ - ./nginx.conf:/etc/nginx/nginx.conf:ro
270
+ - ./certs:/etc/nginx/certs:ro
271
+ depends_on:
272
+ - app
273
+ networks:
274
+ - frontend
275
+
276
+ volumes:
277
+ postgres_data:
278
+ redis_data:
279
+
280
+ networks:
281
+ frontend:
282
+ backend:
283
+ internal: true
284
+ ```