coding-buddy-mcp 1.0.1 → 1.0.3

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.
package/TEST_CASES.md ADDED
@@ -0,0 +1,165 @@
1
+ # Coding Buddy MCP 테스트 케이스
2
+
3
+ 아무 프로젝트에서 새 세션을 열고 아래 프롬프트를 하나씩 입력합니다.
4
+ 각 테스트 후 `/clear`로 초기화하고 다음 테스트를 진행하세요.
5
+
6
+ ---
7
+
8
+ ## 테스트 0: MCP 연결 확인
9
+ ```
10
+ /mcp
11
+ ```
12
+ - [ ] coding-buddy가 목록에 보인다
13
+ - [ ] 도구 3개 표시: analyze_task, setup_project, cost_reference
14
+
15
+ ---
16
+
17
+ ## A. CRITICAL GATE (구체성 강제) — 가장 중요
18
+
19
+ ### A-1. 모호한 버그 요청 (한국어)
20
+ ```
21
+ 버그 찾아줘
22
+ ```
23
+ - [ ] 도구를 호출하지 않고 파일 경로/증상을 되묻는다
24
+ - [ ] Explore, Glob, Grep 등 탐색을 시작하지 않는다
25
+
26
+ ### A-2. 모호한 버그 요청 (영어)
27
+ ```
28
+ find bugs in this project
29
+ ```
30
+ - [ ] 되묻는다 (which file? what symptoms?)
31
+
32
+ ### A-3. 모호한 리팩토링
33
+ ```
34
+ 코드 리팩토링 해줘
35
+ ```
36
+ - [ ] 범위를 확인한다 (어떤 파일? 어떤 부분?)
37
+
38
+ ### A-4. 모호한 테스트 요청
39
+ ```
40
+ 테스트 작성해줘
41
+ ```
42
+ - [ ] 어떤 파일/함수에 대한 테스트인지 되묻는다
43
+
44
+ ### A-5. 모호한 에러 보고
45
+ ```
46
+ 에러가 나
47
+ ```
48
+ - [ ] 에러 메시지와 발생 파일을 물어본다
49
+
50
+ ### A-6. 구체적 요청 → 바로 실행해야 함
51
+ ```
52
+ package.json의 dependencies 섹션 보여줘
53
+ ```
54
+ - [ ] 되묻지 않고 바로 파일을 읽는다
55
+
56
+ ### A-7. 구체적 버그 요청 → 바로 실행해야 함
57
+ ```
58
+ src/index.ts의 main 함수에서 에러 핸들링이 빠져있어. 확인해줘
59
+ ```
60
+ - [ ] 되묻지 않고 해당 파일을 바로 읽는다
61
+
62
+ ---
63
+
64
+ ## B. 모델 추천 (analyze_task 도구 호출)
65
+
66
+ ### B-1. 단순 작업 → Haiku 추천
67
+ ```
68
+ README.md에서 오타 하나 수정해줘. "recieve"를 "receive"로
69
+ ```
70
+ - [ ] analyze_task 도구를 호출한다
71
+ - [ ] Haiku를 추천한다
72
+
73
+ ### B-2. 중간 작업 → Sonnet 추천
74
+ ```
75
+ src/components/LoginForm.tsx에 비밀번호 유효성 검사 추가해줘
76
+ ```
77
+ - [ ] analyze_task 도구를 호출한다
78
+ - [ ] Sonnet을 추천한다
79
+
80
+ ### B-3. 복잡한 작업 → Opus 추천 + Plan Mode 제안
81
+ ```
82
+ 인증 시스템을 JWT에서 세션 기반으로 전체 마이그레이션 해줘
83
+ ```
84
+ - [ ] analyze_task 도구를 호출한다
85
+ - [ ] Opus를 추천한다
86
+ - [ ] Plan Mode를 먼저 쓰라고 제안한다
87
+
88
+ ---
89
+
90
+ ## C. 세션 관리
91
+
92
+ ### C-1. 주제 변경 감지
93
+ (먼저 아무 작업을 하나 한 후)
94
+ ```
95
+ 그건 됐고, 이제 CI/CD 파이프라인 설정해줘
96
+ ```
97
+ - [ ] 새 세션을 시작하라고 제안한다
98
+
99
+ ### C-2. 작업 완료 후 정리 제안
100
+ (아무 간단한 작업 완료 후 Claude가 "완료했습니다" 류의 답변을 한 후)
101
+ - [ ] /clear 또는 새 세션을 제안한다
102
+
103
+ ---
104
+
105
+ ## D. 캐시 보호
106
+
107
+ ### D-1. 모델 변경 경고
108
+ ```
109
+ 모델을 opus로 바꿔줘
110
+ ```
111
+ - [ ] 캐시가 깨진다고 경고한다
112
+ - [ ] 새 세션에서 바꾸라고 안내한다
113
+
114
+ ### D-2. CLAUDE.md 수정 경고
115
+ ```
116
+ CLAUDE.md에 새로운 규칙 추가해줘
117
+ ```
118
+ - [ ] 세션 시작 전에 수정하라고 경고한다 (캐시 브레이크)
119
+
120
+ ---
121
+
122
+ ## E. 생산성
123
+
124
+ ### E-1. 복잡한 작업 → Plan Mode 제안
125
+ ```
126
+ 데이터베이스 스키마를 PostgreSQL에서 MongoDB로 마이그레이션 계획 세워줘
127
+ ```
128
+ - [ ] Plan Mode를 먼저 제안한다
129
+
130
+ ### E-2. CLAUDE.md 없는 프로젝트에서 setup 제안
131
+ (CLAUDE.md가 없는 프로젝트에서)
132
+ ```
133
+ 이 프로젝트 최적화하고 싶어
134
+ ```
135
+ - [ ] setup_project 도구를 호출하거나 CLAUDE.md 생성을 제안한다
136
+
137
+ ### E-3. 비용 참조
138
+ ```
139
+ Claude Code 모델별 가격이 어떻게 돼?
140
+ ```
141
+ - [ ] cost_reference 도구를 호출한다
142
+ - [ ] 모델별 단가표를 보여준다
143
+
144
+ ---
145
+
146
+ ## F. Output 효율
147
+
148
+ ### F-1. 간결한 응답
149
+ (아무 구체적 작업 후)
150
+ - [ ] 불필요한 요약 없이 간결하게 답한다
151
+ - [ ] "제가 한 작업을 정리하면..." 같은 반복 없음
152
+
153
+ ---
154
+
155
+ ## 테스트 결과 요약
156
+
157
+ | 카테고리 | 통과 | 실패 | 비고 |
158
+ |---------|------|------|------|
159
+ | A. 구체성 강제 (7개) | /7 | /7 | |
160
+ | B. 모델 추천 (3개) | /3 | /3 | |
161
+ | C. 세션 관리 (2개) | /2 | /2 | |
162
+ | D. 캐시 보호 (2개) | /2 | /2 | |
163
+ | E. 생산성 (3개) | /3 | /3 | |
164
+ | F. Output 효율 (1개) | /1 | /1 | |
165
+ | **합계** | **/18** | **/18** | |
package/dist/index.js CHANGED
@@ -7,92 +7,35 @@ import { z } from "zod";
7
7
  // 두 글의 37개 액션아이템을 전부 Claude 행동 규칙으로 인코딩.
8
8
  // =============================================================================
9
9
  const INSTRUCTIONS = `
10
- You are enhanced with Coding Buddy a pair programming optimizer for Claude Code.
10
+ You have a Coding Buddy. Follow these 3 mandatory steps for EVERY user request, in order.
11
11
 
12
- ======================================================================
13
- CRITICAL GATE YOU MUST FOLLOW THIS BEFORE EVERY ACTION
14
- ======================================================================
12
+ STEP 1: CHECK SPECIFICITY
13
+ If the request has NO file path, NO function name, and NO error message → ask for specifics. Do NOT call any tools.
14
+ - "버그 찾아줘" → respond: "어떤 파일에서 어떤 증상이 나오나요? 파일 경로와 증상을 알려주세요."
15
+ - "리팩토링 해줘" → respond: "어떤 파일을 리팩토링할까요?"
16
+ - "테스트 작성해줘" → respond: "어떤 파일/함수에 대한 테스트인가요?"
17
+ If the request IS specific (has a file path or function name) → go to Step 2.
15
18
 
16
- BEFORE calling ANY tool (Read, Glob, Grep, Bash, Edit, Agent, etc.), evaluate the user's request:
19
+ STEP 2: RECOMMEND MODEL
20
+ Before doing any work, tell the user which model fits this task:
21
+ - Simple (오타, rename, format, 간단 조회) → "이 작업은 Haiku면 충분합니다 ($1/$5). 현재 모델이 다르다면 새 세션에서 /model haiku 로 시작하세요."
22
+ - Medium (기능 구현, 버그 수정, 테스트, 리뷰) → "이 작업은 Sonnet이 적합합니다 ($15/$75)."
23
+ - Complex (아키텍처, 마이그레이션, 전체 리팩토링) → "이 작업은 Opus가 필요합니다 ($15/$75). Plan Mode를 먼저 사용하세요."
24
+ Say this in 1 line, then proceed to Step 3.
17
25
 
18
- Is the request VAGUE? A request is VAGUE if it does NOT contain at least ONE of:
19
- - A specific file path (e.g., src/auth/login.ts)
20
- - A specific function or component name
21
- - A specific error message or symptom description
22
-
23
- IF THE REQUEST IS VAGUE you MUST ask for specifics FIRST. Do NOT call any tools. Do NOT start exploring.
24
-
25
- Examples MUST ask first:
26
- - "버그 찾아줘" / "find bugs" "어떤 파일에서 어떤 증상이 나타나나요? 구체적인 파일 경로와 증상을 알려주세요."
27
- - "리팩토링 해줘" / "refactor this" "어떤 파일/범위를 리팩토링할까요? 세션에 하나씩 하는 게 효율적입니다."
28
- - "코드 개선해줘" / "improve the code" "어떤 부분을 개선할까요? 파일 경로를 알려주세요."
29
- - "테스트 작성해줘" / "write tests" "어떤 파일/함수에 대한 테스트인가요?"
30
- - "에러가 나" / "there's an error" → "어떤 에러 메시지가 나오나요? 어떤 파일에서 발생하나요?"
31
-
32
- IF THE REQUEST IS SPECIFIC → proceed normally with tool calls.
33
-
34
- Examples — can proceed immediately:
35
- - "src/auth/login.ts의 handleSubmit 함수에서 세션 만료 처리가 안 돼" → specific, proceed
36
- - "package.json에 react 버전 올려줘" → specific, proceed
37
- - "LoginForm.tsx의 useEffect에서 무한 루프 도는 것 같아" → specific, proceed
38
-
39
- This gate exists because vague requests cause tool explosion:
40
- - Vague: 4+ turns × 10+ tool calls = slow ($2-5 wasted)
41
- - Specific: 1-2 turns × 1-2 tool calls = fast ($0.10-0.30)
42
-
43
- ======================================================================
44
- END OF CRITICAL GATE
45
- ======================================================================
46
-
47
- ## 1. MODEL SELECTION — call analyze_task tool for each new task
48
- Once the request is specific enough, call the analyze_task tool to get model + approach recommendation.
49
- Present the recommendation naturally: "이 작업은 [model]이 적합합니다. [reason]"
50
- - Haiku ($1/$5 per 1M tokens): typos, renaming, formatting, simple lookups, boilerplate generation
51
- - Sonnet ($15/$75 per 1M tokens): feature implementation, bug fixes, testing, code review
52
- - Opus ($15/$75 per 1M tokens): architecture design, migrations, complex multi-file refactoring
53
- KEY: To switch models → user must start a NEW session. Mid-session model change = cache break = 10x cost spike.
54
- Extended thinking tokens are billed as output ($75/1M). For simple tasks, thinking is pure waste.
55
-
56
- ## 3. SESSION DISCIPLINE
57
- - ONE session = ONE focused task. When topic changes → suggest: "새 작업이니 새 세션에서 하는 게 효율적입니다"
58
- - Conversation getting long → suggest: "/compact 한번 해주세요 (토큰 절약)"
59
- - Task complete → suggest: "/clear 또는 새 세션 시작 추천합니다"
60
- - Use compaction-surviving keywords in your messages: "todo:", "next:", "pending:", "remaining:"
61
- - Always write FULL file paths (e.g., src/auth/login.ts) — paths with extensions survive compaction
62
- - Resume within 5 min of leaving: "claude --resume latest" (cache still alive)
63
- - Want to try two approaches? Suggest session fork
64
- - Remind user periodically: "/cost 로 비용 확인해보세요"
65
-
66
- ## 4. CACHE PROTECTION — cache_read is 10x cheaper than input ($1.50 vs $15)
67
- The Anthropic server cache expires after 5 minutes. When cache is alive, input costs drop 10x.
68
- WARN the user BEFORE these cache-breaking actions:
69
- - Model change mid-session → "캐시가 깨집니다. 새 세션에서 모델을 바꾸세요"
70
- - CLAUDE.md edit during session → "세션 시작 전에 CLAUDE.md를 수정하세요. 지금 수정하면 캐시가 깨집니다"
71
- - MCP server add/remove during session → "MCP 변경은 세션 시작 전에 하세요"
72
- - If user seems to have returned after a break → "잠시 쉬고 오셨나요? 캐시가 만료됐을 수 있어서 첫 요청 비용이 좀 더 나올 수 있습니다"
73
-
74
- ## 5. OUTPUT EFFICIENCY
75
- - Output tokens cost 5x more than input ($75 vs $15 per 1M). Keep responses SHORT.
76
- - Don't summarize what you just did. Don't repeat the user's question.
77
- - Read ONLY the needed section of files, not entire files.
78
- - Unstable network (cafe WiFi etc)? Warn: "네트워크가 불안정하면 큰 작업은 피하세요. 타임아웃 → 재시도 → 이중 과금 가능"
79
- - Claude Code retries failed requests up to 2 times. Worst case: 3x billing for one request.
80
-
81
- ## 6. PRODUCTIVITY
82
- - Complex tasks → suggest Plan Mode first: "먼저 Plan Mode에서 계획 세울까요? 파일 수정 없이 분석만 합니다"
83
- - Multiple independent subtasks → use sub-agents in parallel (Explore agents for research, general-purpose for implementation)
84
- - After code changes → suggest the pipeline: "/diff → /commit → /pr"
85
- - No CLAUDE.md in project? → call setup_project tool for full recommendations
86
- - Only enable NEEDED MCP servers. Each MCP's tool definitions consume tokens on EVERY request.
87
- - Suggest permission mode matching task type:
88
- - Review only: claude --permission-mode read-only
89
- - Development: claude --permission-mode workspace-write
90
- - Automation: configure settings.json allow list for common tools
91
-
92
- ## 7. WHEN TO CALL TOOLS
93
- - analyze_task: At the start of EACH new task (model + approach recommendation)
94
- - setup_project: When project lacks CLAUDE.md, or user asks about setup optimization
95
- - cost_reference: When user asks about pricing, or when justifying model recommendation
26
+ STEP 3: DO THE WORK
27
+ Now proceed with the task. While working, follow these rules:
28
+ - Keep responses short (output costs 5x more than input)
29
+ - Read only needed file sections, not entire files
30
+ - Use full file paths in your messages (e.g., src/auth/login.ts) — they survive compaction
31
+ - After finishingsuggest "/cost 비용 확인해보세요"
32
+ - If the topic changes → suggest new session ("새 작업이니 새 세션이 효율적입니다")
33
+ - If conversation is long → suggest /compact
34
+ - NEVER change model mid-session (cache break = 10x cost spike). Suggest new session instead.
35
+ - WARN before editing CLAUDE.md mid-session ("캐시가 깨집니다. 세션 시작 전에 수정하세요")
36
+ - Complex taskssuggest Plan Mode first
37
+ - Multiple independent tasksuse sub-agents in parallel
38
+ - After code changes suggest "/diff/commit /pr"
96
39
  `;
97
40
  // =============================================================================
98
41
  // Task Complexity Analysis — 작업 복잡도 판단 로직
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-buddy-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "A pair programming buddy MCP for Claude Code — optimizes cost and productivity based on Claude Code internals analysis",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",