oh-my-ag 1.2.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 (77) hide show
  1. package/.agent/skills/_shared/api-contracts/README.md +56 -0
  2. package/.agent/skills/_shared/api-contracts/template.md +88 -0
  3. package/.agent/skills/_shared/clarification-protocol.md +217 -0
  4. package/.agent/skills/_shared/common-checklist.md +31 -0
  5. package/.agent/skills/_shared/context-budget.md +118 -0
  6. package/.agent/skills/_shared/context-loading.md +105 -0
  7. package/.agent/skills/_shared/difficulty-guide.md +55 -0
  8. package/.agent/skills/_shared/lessons-learned.md +113 -0
  9. package/.agent/skills/_shared/memory-protocol.md +79 -0
  10. package/.agent/skills/_shared/reasoning-templates.md +161 -0
  11. package/.agent/skills/_shared/skill-routing.md +80 -0
  12. package/.agent/skills/_shared/verify.sh +252 -0
  13. package/.agent/skills/backend-agent/SKILL.md +47 -0
  14. package/.agent/skills/backend-agent/resources/api-template.py +326 -0
  15. package/.agent/skills/backend-agent/resources/checklist.md +36 -0
  16. package/.agent/skills/backend-agent/resources/error-playbook.md +98 -0
  17. package/.agent/skills/backend-agent/resources/examples.md +85 -0
  18. package/.agent/skills/backend-agent/resources/execution-protocol.md +45 -0
  19. package/.agent/skills/backend-agent/resources/snippets.md +197 -0
  20. package/.agent/skills/backend-agent/resources/tech-stack.md +39 -0
  21. package/.agent/skills/commit/SKILL.md +121 -0
  22. package/.agent/skills/commit/config/commit-config.yaml +55 -0
  23. package/.agent/skills/commit/resources/conventional-commits.md +166 -0
  24. package/.agent/skills/debug-agent/SKILL.md +51 -0
  25. package/.agent/skills/debug-agent/resources/bug-report-template.md +332 -0
  26. package/.agent/skills/debug-agent/resources/checklist.md +30 -0
  27. package/.agent/skills/debug-agent/resources/common-patterns.md +734 -0
  28. package/.agent/skills/debug-agent/resources/debugging-checklist.md +362 -0
  29. package/.agent/skills/debug-agent/resources/error-playbook.md +94 -0
  30. package/.agent/skills/debug-agent/resources/examples.md +87 -0
  31. package/.agent/skills/debug-agent/resources/execution-protocol.md +51 -0
  32. package/.agent/skills/frontend-agent/SKILL.md +48 -0
  33. package/.agent/skills/frontend-agent/resources/checklist.md +38 -0
  34. package/.agent/skills/frontend-agent/resources/component-template.tsx +92 -0
  35. package/.agent/skills/frontend-agent/resources/error-playbook.md +108 -0
  36. package/.agent/skills/frontend-agent/resources/examples.md +77 -0
  37. package/.agent/skills/frontend-agent/resources/execution-protocol.md +49 -0
  38. package/.agent/skills/frontend-agent/resources/snippets.md +205 -0
  39. package/.agent/skills/frontend-agent/resources/tailwind-rules.md +343 -0
  40. package/.agent/skills/frontend-agent/resources/tech-stack.md +36 -0
  41. package/.agent/skills/mobile-agent/SKILL.md +46 -0
  42. package/.agent/skills/mobile-agent/resources/checklist.md +35 -0
  43. package/.agent/skills/mobile-agent/resources/error-playbook.md +106 -0
  44. package/.agent/skills/mobile-agent/resources/examples.md +79 -0
  45. package/.agent/skills/mobile-agent/resources/execution-protocol.md +49 -0
  46. package/.agent/skills/mobile-agent/resources/screen-template.dart +298 -0
  47. package/.agent/skills/mobile-agent/resources/snippets.md +235 -0
  48. package/.agent/skills/mobile-agent/resources/tech-stack.md +45 -0
  49. package/.agent/skills/orchestrator/SKILL.md +99 -0
  50. package/.agent/skills/orchestrator/config/cli-config.yaml +78 -0
  51. package/.agent/skills/orchestrator/resources/memory-schema.md +212 -0
  52. package/.agent/skills/orchestrator/resources/subagent-prompt-template.md +153 -0
  53. package/.agent/skills/orchestrator/scripts/parallel-run.sh +330 -0
  54. package/.agent/skills/orchestrator/scripts/spawn-agent.sh +263 -0
  55. package/.agent/skills/orchestrator/templates/backend-task.md +18 -0
  56. package/.agent/skills/orchestrator/templates/debug-task.md +16 -0
  57. package/.agent/skills/orchestrator/templates/frontend-task.md +17 -0
  58. package/.agent/skills/orchestrator/templates/mobile-task.md +17 -0
  59. package/.agent/skills/orchestrator/templates/qa-task.md +16 -0
  60. package/.agent/skills/orchestrator/templates/tasks-example.yaml +15 -0
  61. package/.agent/skills/pm-agent/SKILL.md +47 -0
  62. package/.agent/skills/pm-agent/resources/error-playbook.md +75 -0
  63. package/.agent/skills/pm-agent/resources/examples.md +121 -0
  64. package/.agent/skills/pm-agent/resources/execution-protocol.md +46 -0
  65. package/.agent/skills/pm-agent/resources/task-template.json +57 -0
  66. package/.agent/skills/qa-agent/SKILL.md +43 -0
  67. package/.agent/skills/qa-agent/resources/checklist.md +294 -0
  68. package/.agent/skills/qa-agent/resources/error-playbook.md +95 -0
  69. package/.agent/skills/qa-agent/resources/examples.md +100 -0
  70. package/.agent/skills/qa-agent/resources/execution-protocol.md +50 -0
  71. package/.agent/skills/qa-agent/resources/self-check.md +27 -0
  72. package/.agent/skills/workflow-guide/SKILL.md +57 -0
  73. package/.agent/skills/workflow-guide/resources/examples.md +68 -0
  74. package/README.ko.md +459 -0
  75. package/README.md +563 -0
  76. package/bin/cli.js +205 -0
  77. package/package.json +75 -0
@@ -0,0 +1,56 @@
1
+ # API Contracts
2
+
3
+ 이 디렉토리는 PM Agent가 생성하고, backend/frontend/mobile 에이전트가 참조하는 API 계약서를 담습니다.
4
+
5
+ ## 사용법
6
+
7
+ ### PM Agent (작성자)
8
+ 계획 단계에서 API 계약서를 여기에 생성:
9
+ ```
10
+ [WRITE]("api-contracts/{domain}.md", contract content)
11
+ ```
12
+
13
+ MCP 메모리 도구가 없을 경우 이 디렉토리에 직접 파일 생성.
14
+
15
+ ### Backend Agent (구현자)
16
+ 계약서를 읽고 그대로 구현:
17
+ ```
18
+ [READ]("api-contracts/{domain}.md")
19
+ ```
20
+
21
+ ### Frontend / Mobile Agent (소비자)
22
+ 계약서를 읽고 API 클라이언트를 그대로 연동:
23
+ ```
24
+ [READ]("api-contracts/{domain}.md")
25
+ ```
26
+
27
+ ## Tool Reference
28
+
29
+ 도구명은 `mcp.json → memoryConfig.tools`에서 설정:
30
+ - `[READ]` → default: `read_memory`
31
+ - `[WRITE]` → default: `write_memory`
32
+
33
+ ## 계약서 형식
34
+
35
+ ```markdown
36
+ # {Domain} API Contract
37
+
38
+ ## POST /api/{resource}
39
+ - **Auth**: Required (JWT Bearer)
40
+ - **Request Body**:
41
+ ```json
42
+ { "field": "type", "field2": "type" }
43
+ ```
44
+ - **Response 200**:
45
+ ```json
46
+ { "id": "uuid", "field": "value", "created_at": "ISO8601" }
47
+ ```
48
+ - **Response 401**: `{ "detail": "Not authenticated" }`
49
+ - **Response 422**: `{ "detail": [{ "field": "error message" }] }`
50
+ ```
51
+
52
+ ## 규칙
53
+ 1. PM Agent가 계획 시 반드시 생성
54
+ 2. Backend Agent는 계약서와 다르게 구현하면 안 됨
55
+ 3. Frontend/Mobile Agent는 계약서 기준으로 타입 정의
56
+ 4. 변경이 필요하면 PM Agent에게 재계획 요청
@@ -0,0 +1,88 @@
1
+ # {Domain} API Contract
2
+
3
+ > Generated by PM Agent | Session: {session-id} | Date: {YYYY-MM-DD}
4
+
5
+ ## Base URL
6
+ `/api/{domain}`
7
+
8
+ ## Authentication
9
+ All endpoints require JWT Bearer token unless marked as `Public`.
10
+
11
+ ---
12
+
13
+ ## Endpoints
14
+
15
+ ### POST /api/{domain}
16
+ - **Description**: Create a new {resource}
17
+ - **Auth**: Required
18
+ - **Request Body**:
19
+ ```json
20
+ {
21
+ "field1": "string (required)",
22
+ "field2": "number (optional, default: 0)"
23
+ }
24
+ ```
25
+ - **Response 201**:
26
+ ```json
27
+ {
28
+ "id": "uuid",
29
+ "field1": "string",
30
+ "field2": 0,
31
+ "created_at": "2024-01-01T00:00:00Z"
32
+ }
33
+ ```
34
+ - **Errors**: 401, 422
35
+
36
+ ### GET /api/{domain}
37
+ - **Description**: List {resources} (paginated)
38
+ - **Auth**: Required
39
+ - **Query Params**: `page` (default: 1), `size` (default: 20)
40
+ - **Response 200**:
41
+ ```json
42
+ {
43
+ "items": [...],
44
+ "total": 100,
45
+ "page": 1,
46
+ "size": 20
47
+ }
48
+ ```
49
+
50
+ ### GET /api/{domain}/{id}
51
+ - **Description**: Get single {resource}
52
+ - **Auth**: Required
53
+ - **Response 200**: Single resource object
54
+ - **Errors**: 401, 404
55
+
56
+ ### PATCH /api/{domain}/{id}
57
+ - **Description**: Update {resource}
58
+ - **Auth**: Required (owner only)
59
+ - **Request Body**: Partial update fields
60
+ - **Response 200**: Updated resource object
61
+ - **Errors**: 401, 403, 404, 422
62
+
63
+ ### DELETE /api/{domain}/{id}
64
+ - **Description**: Delete {resource}
65
+ - **Auth**: Required (owner only)
66
+ - **Response 204**: No content
67
+ - **Errors**: 401, 403, 404
68
+
69
+ ---
70
+
71
+ ## Data Models
72
+
73
+ ### {Resource}
74
+ | Field | Type | Required | Description |
75
+ |-------|------|----------|-------------|
76
+ | id | UUID | auto | Primary key |
77
+ | field1 | string | yes | Description |
78
+ | field2 | number | no | Default: 0 |
79
+ | user_id | UUID | auto | Owner (FK to users) |
80
+ | created_at | datetime | auto | ISO 8601 |
81
+ | updated_at | datetime | auto | ISO 8601 |
82
+
83
+ ---
84
+
85
+ ## Notes
86
+ - Pagination: offset-based (page/size)
87
+ - Sorting: `?sort=created_at&order=desc` (optional)
88
+ - Filtering: `?field1=value` (optional)
@@ -0,0 +1,217 @@
1
+ # Clarification Protocol
2
+
3
+ 요구사항이 모호할 때 "가정하고 진행"하면 대부분 잘못된 방향으로 간다.
4
+ 이 프로토콜을 따라 명확한 요구사항을 확보한 후 실행한다.
5
+
6
+ > **핵심 원칙**: "Agents learn when to ask for help rather than blindly attempting every task" - Ask early, ask often.
7
+
8
+ ---
9
+
10
+ ## 불확실성 레벨 정의 (Uncertainty Levels)
11
+
12
+ | 레벨 | 상태 | 행동 | 예시 |
13
+ |------|------|------|------|
14
+ | **LOW** | 명확함 | 기본값 적용 후 진행, 가정 기록 | "TODO 앱 만들어줘" |
15
+ | **MEDIUM** | 일부 모호 | 2-3개 옵션 제시 + 사용자 선택 요청 | "사용자 관리 시스템 만들어줘" |
16
+ | **HIGH** | 매우 모호 | **진행 불가**, 반드시 질문 | "좋은 앱 만들어줘" |
17
+
18
+ ---
19
+
20
+ ## 불확실성 트리거 (Uncertainty Triggers)
21
+
22
+ 다음 상황에서 자동으로 MEDIUM/HIGH 레벨로 분류:
23
+
24
+ ### HIGH (반드시 질문)
25
+ - [ ] 비즈니스 로직 결정 필요 (가격 정책, 승인 워크플로우 등)
26
+ - [ ] 보안/인증 관련 결정 (OAuth provider, 권한 모델 등)
27
+ - [ ] 기존 코드와 충돌 가능성 있음
28
+ - [ ] 요구사항이主관적 ("좋은", "빠른", "예쁜")
29
+ - [ ] 범위가 무제한으로 느껴짐
30
+
31
+ ### MEDIUM (옵션 제시)
32
+ - [ ] 기술 스택 선택 가능성 2개 이상
33
+ - [ ] 구현 방식에 대한 trade-off 존재
34
+ - [ ] 우선순위가 불명확한 다중 기능
35
+ - [ ] 외부 API/서비스 선택 필요
36
+
37
+ ---
38
+
39
+ ## 에스컬레이션 템플릿 (Escalation Templates)
40
+
41
+ ### LOW → 진행 (Assumed)
42
+ ```
43
+ ⚠️ Assumptions applied:
44
+ - JWT authentication included
45
+ - PostgreSQL database
46
+ - REST API
47
+ - MVP scope (CRUD only)
48
+
49
+ Proceeding with these defaults. Override if needed.
50
+ ```
51
+
52
+ ### MEDIUM → 선택 요청 (Options)
53
+ ```
54
+ 🔍 Uncertainty detected: {specific issue}
55
+
56
+ Option A: {approach}
57
+ ✅ Pros: {benefits}
58
+ ❌ Cons: {drawbacks}
59
+ 💰 Effort: {low/medium/high}
60
+
61
+ Option B: {approach}
62
+ ✅ Pros: {benefits}
63
+ ❌ Cons: {drawbacks}
64
+ 💰 Effort: {low/medium/high}
65
+
66
+ Option C: {approach}
67
+ ✅ Pros: {benefits}
68
+ ❌ Cons: {drawbacks}
69
+ 💰 Effort: {low/medium/high}
70
+
71
+ Which approach do you prefer? (A/B/C)
72
+ ```
73
+
74
+ ### HIGH → 차단 (Blocked)
75
+ ```
76
+ ❌ Cannot proceed: Requirements too ambiguous
77
+
78
+ Specific uncertainty: {what is unclear}
79
+
80
+ Questions needed:
81
+ 1. {specific question}
82
+ 2. {specific question}
83
+ 3. {specific question}
84
+
85
+ Impact of proceeding blindly: {what could go wrong}
86
+
87
+ Status: BLOCKED (awaiting clarification)
88
+ ```
89
+
90
+ ---
91
+
92
+ ## 필수 확인 항목
93
+
94
+ 아래 항목 중 하나라도 불명확하면 **가정하지 말고** 명시적으로 기록한다.
95
+
96
+ ### 모든 에이전트 공통
97
+ | 항목 | 확인 질문 | 기본값 (가정 시) | 불확실성 |
98
+ |------|----------|-----------------|----------|
99
+ | 대상 사용자 | 누가 쓰는 서비스인가? | 일반 웹 사용자 | LOW |
100
+ | 핵심 기능 | 반드시 포함해야 할 기능 3가지는? | 태스크 설명에서 추론 | MEDIUM |
101
+ | 기술 스택 | 특정 프레임워크 제약이 있는가? | 프로젝트 기본 스택 | LOW |
102
+ | 인증 | 로그인이 필요한가? | JWT 인증 포함 | MEDIUM |
103
+ | 범위 | MVP인가 완전한 기능인가? | MVP | LOW |
104
+
105
+ ### Backend Agent 추가 확인
106
+ | 항목 | 확인 질문 | 기본값 | 불확실성 |
107
+ |------|----------|--------|----------|
108
+ | DB 선택 | PostgreSQL? MongoDB? SQLite? | PostgreSQL | MEDIUM |
109
+ | API 스타일 | REST? GraphQL? gRPC? | REST | MEDIUM |
110
+ | 인증 방식 | JWT? Session? OAuth? | JWT (access + refresh) | HIGH |
111
+ | 파일 업로드 | 필요한가? 크기 제한은? | 불필요 | LOW |
112
+ | 배포 환경 | Serverless? Container? VM? | Container | MEDIUM |
113
+
114
+ ### Frontend Agent 추가 확인
115
+ | 항목 | 확인 질문 | 기본값 | 불확실성 |
116
+ |------|----------|--------|----------|
117
+ | SSR/CSR | Server-side rendering 필요? | Next.js App Router (SSR) | MEDIUM |
118
+ | 다크모드 | 지원 필요? | 지원 | LOW |
119
+ | 국제화 | 다국어 지원? | 불필요 | LOW |
120
+ | 기존 디자인 시스템 | 사용할 UI 라이브러리? | shadcn/ui | MEDIUM |
121
+ | 상태 관리 | Context? Redux? Zustand? | Zustand | MEDIUM |
122
+
123
+ ### Mobile Agent 추가 확인
124
+ | 항목 | 확인 질문 | 기본값 | 불확실성 |
125
+ |------|----------|--------|----------|
126
+ | 플랫폼 | iOS만? Android만? 둘 다? | 둘 다 | MEDIUM |
127
+ | 오프라인 | 오프라인 지원 필요? | 불필요 | LOW |
128
+ | 푸시 알림 | 필요한가? | 불필요 | LOW |
129
+ | 최소 OS | iOS/Android 최소 버전? | iOS 14+, Android API 24+ | LOW |
130
+ | 아키텍처 | MVC? MVVM? Clean? | MVVM | MEDIUM |
131
+
132
+ ---
133
+
134
+ ## 모호함 수준별 대응 (상세)
135
+
136
+ ### Level 1 (LOW): 약간 모호 (핵심은 명확, 세부사항 부족)
137
+ 예: "TODO 앱 만들어줘"
138
+
139
+ **대응**: 기본값을 적용하고, 가정 목록을 result에 기록
140
+ ```
141
+ ⚠️ Assumptions:
142
+ - JWT authentication included
143
+ - PostgreSQL database
144
+ - REST API
145
+ - MVP scope (CRUD only)
146
+ ```
147
+
148
+ ### Level 2 (MEDIUM): 상당히 모호 (핵심 기능이 불명확)
149
+ 예: "사용자 관리 시스템 만들어줘"
150
+
151
+ **대응**: 핵심 기능을 3가지로 좁혀서 명시하고 진행
152
+ ```
153
+ ⚠️ Interpreted scope (3 core features):
154
+ 1. User registration + login (JWT)
155
+ 2. Profile management (view/edit)
156
+ 3. Admin user list (admin role only)
157
+
158
+ NOT included (would need separate task):
159
+ - Role-based access control (beyond admin/user)
160
+ - Social login (OAuth)
161
+ - Email verification
162
+ ```
163
+
164
+ ### Level 3 (HIGH): 매우 모호 (방향 자체가 불명확)
165
+ 예: "좋은 앱 만들어줘", "이거 개선해줘"
166
+
167
+ **대응**: 진행하지 말고 구체화 요청을 result에 기록
168
+ ```
169
+ ❌ Cannot proceed: Requirements too ambiguous
170
+
171
+ Questions needed:
172
+ 1. What is the app's primary purpose?
173
+ 2. Who are the target users?
174
+ 3. What are the 3 must-have features?
175
+ 4. Are there existing designs or wireframes?
176
+
177
+ Status: blocked (awaiting clarification)
178
+ ```
179
+
180
+ ---
181
+
182
+ ## PM Agent 전용: 요구사항 구체화 프레임워크
183
+
184
+ PM Agent는 모호한 요청을 받으면 아래 프레임워크로 구체화한다:
185
+
186
+ ```
187
+ === 요구사항 구체화 ===
188
+
189
+ 원본 요청: "{사용자 원문}"
190
+
191
+ 1. 핵심 목표: {한 문장으로 정의}
192
+ 2. 사용자 스토리:
193
+ - "As a {user}, I want to {action} so that {benefit}"
194
+ - (최소 3개)
195
+ 3. 기능 범위:
196
+ - Must-have: {목록}
197
+ - Nice-to-have: {목록}
198
+ - Out-of-scope: {목록}
199
+ 4. 기술 제약:
200
+ - {기존 코드 / 스택 / 호환성}
201
+ 5. 성공 기준:
202
+ - {측정 가능한 조건}
203
+ ```
204
+
205
+ ---
206
+
207
+ ## 서브에이전트 모드에서의 적용
208
+
209
+ CLI 서브에이전트는 사용자에게 직접 질문할 수 없다.
210
+ 따라서:
211
+
212
+ 1. **Level 1**: 기본값 적용 + 가정 기록 → 진행
213
+ 2. **Level 2**: 범위를 좁혀서 해석 + 명시 → 진행
214
+ 3. **Level 3**: `Status: blocked` + 질문 목록 → 진행하지 않음
215
+
216
+ Orchestrator는 Level 3 결과를 받으면 사용자에게 질문을 전달하고,
217
+ 답변을 받은 후 해당 에이전트를 재실행한다.
@@ -0,0 +1,31 @@
1
+ # Common Code Quality Checklist
2
+
3
+ Apply these checks to ALL code before submitting, regardless of domain.
4
+
5
+ ## Code Quality
6
+ - [ ] No hardcoded secrets (API keys, passwords, tokens)
7
+ - [ ] No `TODO`/`FIXME` left unresolved
8
+ - [ ] Meaningful variable and function names
9
+ - [ ] Functions < 50 lines, files < 500 lines
10
+ - [ ] Cyclomatic complexity < 10 per function
11
+ - [ ] No deeply nested code (< 4 levels)
12
+
13
+ ## Error Handling
14
+ - [ ] All async operations have try/catch or error boundaries
15
+ - [ ] User-facing error messages are clear and actionable
16
+ - [ ] No silent failures (errors logged or surfaced)
17
+
18
+ ## Security
19
+ - [ ] No user input directly in SQL/shell/HTML
20
+ - [ ] Authentication checked on protected endpoints
21
+ - [ ] Sensitive data not in logs or error messages
22
+
23
+ ## Testing
24
+ - [ ] Unit tests for new business logic
25
+ - [ ] Edge cases covered (empty, null, boundary values)
26
+ - [ ] Tests actually assert meaningful behavior
27
+
28
+ ## Git Hygiene
29
+ - [ ] Commit message describes the "why", not the "what"
30
+ - [ ] No unrelated changes bundled
31
+ - [ ] No generated files or secrets committed
@@ -0,0 +1,118 @@
1
+ # Context Budget Management
2
+
3
+ 컨텍스트 윈도우는 유한하다. 특히 Flash급 모델에서는 불필요한 로딩이 성능을 직접 저하시킨다.
4
+ 이 가이드를 따라 컨텍스트를 효율적으로 사용한다.
5
+
6
+ ---
7
+
8
+ ## 핵심 원칙
9
+
10
+ 1. **전체 파일 읽기 금지** — 필요한 함수/클래스만 읽는다
11
+ 2. **중복 읽기 금지** — 이미 읽은 파일은 다시 읽지 않는다
12
+ 3. **리소스 지연 로딩** — 필요한 시점에 필요한 리소스만 로딩한다
13
+ 4. **기록 유지** — 읽은 파일과 심볼을 progress에 메모한다
14
+
15
+ ---
16
+
17
+ ## 파일 읽기 전략
18
+
19
+ ### Serena MCP 사용 시 (권장)
20
+
21
+ ```
22
+ ❌ 나쁜 예: read_file("app/api/todos.py") ← 전체 파일 500줄
23
+ ✅ 좋은 예: find_symbol("create_todo") ← 해당 함수 30줄
24
+ ✅ 좋은 예: get_symbols_overview("app/api") ← 함수 목록만
25
+ ✅ 좋은 예: find_referencing_symbols("TodoService") ← 사용처만
26
+ ```
27
+
28
+ ### Serena 없이 파일 읽기 시
29
+
30
+ ```
31
+ ❌ 나쁜 예: 파일 전체를 한 번에 읽기
32
+ ✅ 좋은 예: 파일의 첫 50줄 (import + 클래스 정의) 확인 → 필요한 함수만 추가 읽기
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 리소스 로딩 예산
38
+
39
+ ### Flash급 모델 (128K 컨텍스트)
40
+
41
+ | 구분 | 예산 | 비고 |
42
+ |------|------|------|
43
+ | SKILL.md | ~800 토큰 | 자동 로딩 |
44
+ | execution-protocol.md | ~500 토큰 | 항상 로딩 |
45
+ | 태스크 리소스 1개 | ~500 토큰 | 난이도별 선택 |
46
+ | 태스크 리소스 2개 | ~500 토큰 | Complex만 |
47
+ | error-playbook.md | ~800 토큰 | 에러 시만 |
48
+ | **총 리소스 예산** | **~3,100 토큰** | 전체의 ~2.4% |
49
+ | **작업용 예산** | **~125K 토큰** | 나머지 전부 |
50
+
51
+ ### Pro급 모델 (1M+ 컨텍스트)
52
+
53
+ | 구분 | 예산 | 비고 |
54
+ |------|------|------|
55
+ | 리소스 예산 | ~5,000 토큰 | 넉넉하게 로딩 가능 |
56
+ | 작업용 예산 | ~1M 토큰 | 큰 파일도 가능 |
57
+
58
+ Pro는 예산 압박이 적지만, 불필요한 로딩은 여전히 주의력을 분산시킨다.
59
+
60
+ ---
61
+
62
+ ## 읽은 파일 추적 (progress에 기록)
63
+
64
+ 에이전트는 progress 업데이트 시 읽은 파일/심볼을 기록한다:
65
+
66
+ ```markdown
67
+ ## Turn 3 Progress
68
+
69
+ ### 읽은 파일
70
+ - app/api/todos.py: create_todo(), update_todo() (find_symbol)
71
+ - app/models/todo.py: Todo class (find_symbol)
72
+ - app/schemas/todo.py: 전체 (짧은 파일, 40줄)
73
+
74
+ ### 아직 안 읽은 파일
75
+ - app/services/todo_service.py (다음 턴에 읽을 예정)
76
+ - tests/test_todos.py (구현 후 참조)
77
+
78
+ ### 수행한 작업
79
+ - TodoCreate 스키마에 priority 필드 추가
80
+ ```
81
+
82
+ 이렇게 하면:
83
+ - 같은 파일을 중복으로 읽지 않음
84
+ - 다음 턴에 뭘 할지 명확함
85
+ - Orchestrator가 에이전트 상태를 파악 가능
86
+
87
+ ---
88
+
89
+ ## 대형 파일 처리 전략
90
+
91
+ ### 500줄 이상 파일
92
+
93
+ 1. `get_symbols_overview`로 구조 파악
94
+ 2. 필요한 심볼만 `find_symbol`로 읽기
95
+ 3. 전체 파일은 절대 읽지 않음
96
+
97
+ ### 복잡한 컴포넌트 (React/Flutter)
98
+
99
+ 1. 컴포넌트의 props/state 정의만 먼저 읽기
100
+ 2. render/build 메서드는 수정이 필요할 때만 읽기
101
+ 3. 스타일 부분은 수정 대상이 아니면 스킵
102
+
103
+ ### 테스트 파일
104
+
105
+ 1. 구현 완료 후에만 읽기 (구현 전에는 불필요)
106
+ 2. 기존 테스트 패턴만 확인 (첫 1-2개 테스트 함수만)
107
+ 3. 나머지는 패턴을 따라서 작성
108
+
109
+ ---
110
+
111
+ ## 컨텍스트 초과 징후 & 대응
112
+
113
+ | 징후 | 의미 | 대응 |
114
+ |------|------|------|
115
+ | 앞서 읽은 코드를 잊음 | 컨텍스트 윈도우 소진 | progress에 핵심 정보 메모, 재참조 가능하게 |
116
+ | 같은 파일을 반복 읽음 | 추적 미비 | progress의 "읽은 파일" 목록 확인 |
117
+ | 출력이 갑자기 짧아짐 | 출력 토큰 부족 | 핵심만 작성, 부가 설명 생략 |
118
+ | 지시사항을 무시함 | SKILL.md 내용 잊음 | execution-protocol 핵심만 재참조 |
@@ -0,0 +1,105 @@
1
+ # Dynamic Context Loading Guide
2
+
3
+ 에이전트는 모든 리소스를 한 번에 읽지 말고, 태스크 유형에 따라 필요한 리소스만 로딩한다.
4
+ 이렇게 하면 컨텍스트 윈도우를 절약하고, 관련 없는 정보로 인한 혼란을 방지한다.
5
+
6
+ ---
7
+
8
+ ## 로딩 순서 (모든 에이전트 공통)
9
+
10
+ ### 항상 로딩 (필수)
11
+ 1. `SKILL.md` — 자동 로딩됨 (Antigravity가 제공)
12
+ 2. `resources/execution-protocol.md` — 실행 프로토콜
13
+
14
+ ### 태스크 시작 시 로딩
15
+ 3. `../_shared/difficulty-guide.md` — 난이도 판단 (Step 0)
16
+
17
+ ### 난이도에 따라 로딩
18
+ 4. **Simple**: 추가 로딩 없이 바로 구현
19
+ 5. **Medium**: `resources/examples.md` (유사 예시 참고)
20
+ 6. **Complex**: `resources/examples.md` + `resources/tech-stack.md` + `resources/snippets.md`
21
+
22
+ ### 실행 중 필요시 로딩
23
+ 7. `resources/checklist.md` — Step 4 (Verify) 시점에 로딩
24
+ 8. `resources/error-playbook.md` — 에러 발생 시에만 로딩
25
+ 9. `../_shared/common-checklist.md` — Complex 태스크의 최종 검증 시
26
+ 10. `../_shared/serena-memory-protocol.md` — CLI 모드일 때만
27
+
28
+ ---
29
+
30
+ ## 에이전트별 태스크 유형 → 리소스 매핑
31
+
32
+ ### Backend Agent
33
+
34
+ | 태스크 유형 | 필요 리소스 |
35
+ |------------|-----------|
36
+ | CRUD API 생성 | snippets.md (route, schema, model, test) |
37
+ | 인증 구현 | snippets.md (JWT, password) + tech-stack.md |
38
+ | DB 마이그레이션 | snippets.md (migration) |
39
+ | 성능 최적화 | examples.md (N+1 example) |
40
+ | 기존 코드 수정 | examples.md + Serena MCP |
41
+
42
+ ### Frontend Agent
43
+
44
+ | 태스크 유형 | 필요 리소스 |
45
+ |------------|-----------|
46
+ | 컴포넌트 생성 | snippets.md (component, test) + component-template.tsx |
47
+ | 폼 구현 | snippets.md (form + Zod) |
48
+ | API 연동 | snippets.md (TanStack Query) |
49
+ | 스타일링 | tailwind-rules.md |
50
+ | 페이지 레이아웃 | snippets.md (grid) + examples.md |
51
+
52
+ ### Mobile Agent
53
+
54
+ | 태스크 유형 | 필요 리소스 |
55
+ |------------|-----------|
56
+ | 화면 생성 | snippets.md (screen, provider) + screen-template.dart |
57
+ | API 연동 | snippets.md (repository, Dio) |
58
+ | 네비게이션 | snippets.md (GoRouter) |
59
+ | 오프라인 기능 | examples.md (offline example) |
60
+ | 상태 관리 | snippets.md (Riverpod) |
61
+
62
+ ### Debug Agent
63
+
64
+ | 태스크 유형 | 필요 리소스 |
65
+ |------------|-----------|
66
+ | 프론트엔드 버그 | common-patterns.md (Frontend section) |
67
+ | 백엔드 버그 | common-patterns.md (Backend section) |
68
+ | 모바일 버그 | common-patterns.md (Mobile section) |
69
+ | 성능 버그 | common-patterns.md (Performance section) + debugging-checklist.md |
70
+ | 보안 버그 | common-patterns.md (Security section) |
71
+
72
+ ### QA Agent
73
+
74
+ | 태스크 유형 | 필요 리소스 |
75
+ |------------|-----------|
76
+ | 보안 리뷰 | checklist.md (Security section) |
77
+ | 성능 리뷰 | checklist.md (Performance section) |
78
+ | 접근성 리뷰 | checklist.md (Accessibility section) |
79
+ | 전체 감사 | checklist.md (전체) + self-check.md |
80
+
81
+ ### PM Agent
82
+
83
+ | 태스크 유형 | 필요 리소스 |
84
+ |------------|-----------|
85
+ | 신규 프로젝트 계획 | examples.md + task-template.json + api-contracts/template.md |
86
+ | 기능 추가 계획 | examples.md + Serena MCP (기존 구조 파악) |
87
+ | 리팩토링 계획 | Serena MCP만 |
88
+
89
+ ---
90
+
91
+ ## Orchestrator 전용: 서브에이전트 프롬프트 구성 시
92
+
93
+ Orchestrator가 서브에이전트 프롬프트를 구성할 때, 위 매핑을 참조하여
94
+ 태스크 유형에 맞는 리소스 경로만 프롬프트에 포함시킨다.
95
+
96
+ ```
97
+ 프롬프트 구성:
98
+ 1. 에이전트 SKILL.md의 Core Rules 섹션
99
+ 2. execution-protocol.md
100
+ 3. 태스크 유형에 매칭되는 리소스 (위 표 참조)
101
+ 4. error-playbook.md (항상 포함 — 복구 필수)
102
+ 5. Serena Memory Protocol (CLI 모드)
103
+ ```
104
+
105
+ 이렇게 하면 불필요한 리소스를 로딩하지 않아 서브에이전트의 컨텍스트 효율이 극대화된다.
@@ -0,0 +1,55 @@
1
+ # Difficulty Assessment & Protocol Branching
2
+
3
+ 모든 에이전트는 태스크 시작 시 난이도를 판단하고, 그에 맞는 프로토콜 깊이를 적용한다.
4
+
5
+ ## 난이도 판단 기준
6
+
7
+ ### Simple (단순)
8
+ - 단일 파일 변경
9
+ - 명확한 요구사항 (예: "버튼 색상 변경", "필드 추가")
10
+ - 기존 패턴 반복
11
+ - **예상 턴**: 3-5
12
+
13
+ ### Medium (보통)
14
+ - 2-3 파일 변경
15
+ - 약간의 설계 판단 필요
16
+ - 기존 패턴을 새 도메인에 적용
17
+ - **예상 턴**: 8-15
18
+
19
+ ### Complex (복잡)
20
+ - 4개 이상 파일 변경
21
+ - 아키텍처 결정 필요
22
+ - 새로운 패턴 도입
23
+ - 다른 에이전트 결과물에 의존
24
+ - **예상 턴**: 15-25
25
+
26
+ ---
27
+
28
+ ## 프로토콜 분기
29
+
30
+ ### Simple → Fast Track
31
+ 1. ~~Step 1 (Analyze)~~: 스킵 — 바로 구현
32
+ 2. Step 3 (Implement): 구현
33
+ 3. Step 4 (Verify): 체크리스트 최소 항목만
34
+
35
+ ### Medium → Standard Protocol
36
+ 1. Step 1 (Analyze): 간략히
37
+ 2. Step 2 (Plan): 간략히
38
+ 3. Step 3 (Implement): 전체
39
+ 4. Step 4 (Verify): 전체
40
+
41
+ ### Complex → Extended Protocol
42
+ 1. Step 1 (Analyze): 전체 + Serena로 기존 코드 탐색
43
+ 2. Step 2 (Plan): 전체 + progress에 계획 기록
44
+ 3. **Step 2.5 (Checkpoint)**: 계획을 `progress-{agent-id}.md`에 기록
45
+ 4. Step 3 (Implement): 전체
46
+ 5. **Step 3.5 (Mid-check)**: 구현 50% 시점에서 progress 업데이트 + 방향 점검
47
+ 6. Step 4 (Verify): 전체 + `../_shared/common-checklist.md`도 실행
48
+
49
+ ---
50
+
51
+ ## 난이도 오판 복구
52
+
53
+ - Simple로 시작했는데 예상보다 복잡 → Medium 프로토콜로 전환, progress에 기록
54
+ - Medium으로 시작했는데 아키텍처 결정 필요 → Complex로 업그레이드
55
+ - Complex로 시작했는데 실제로 간단 → 그냥 빠르게 끝내면 됨 (오버헤드 최소)