@joseph0926/plan-loop 1.0.2 → 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/README.md +3 -1
- package/package.json +10 -11
- package/README.ko.md +0 -245
package/README.md
CHANGED
|
@@ -4,7 +4,9 @@ Plan Loop is an MCP server that enables an asynchronous plan review loop between
|
|
|
4
4
|
|
|
5
5
|
## Repository layout
|
|
6
6
|
|
|
7
|
-
- src/: MCP server source code (Node.js + TypeScript)
|
|
7
|
+
- packages/cli/src/: MCP server source code (Node.js + TypeScript)
|
|
8
|
+
- packages/core/src/: MCP core library (state + tools)
|
|
9
|
+
- packages/vscode/: VSCode extension (Marketplace only)
|
|
8
10
|
- .mcp.json.example: sample MCP server configuration (copy to `.mcp.json` to use)
|
|
9
11
|
|
|
10
12
|
## Quick start
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joseph0926/plan-loop",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"packageManager": "pnpm@10.28.0",
|
|
3
|
+
"version": "1.0.3",
|
|
5
4
|
"description": "MCP server for Claude-Code and Codex async collaboration with CLI setup",
|
|
6
5
|
"type": "module",
|
|
7
6
|
"main": "dist/index.js",
|
|
@@ -16,16 +15,13 @@
|
|
|
16
15
|
"node": ">=24.0.0"
|
|
17
16
|
},
|
|
18
17
|
"scripts": {
|
|
19
|
-
"build": "
|
|
20
|
-
"build:mcp": "tsc",
|
|
21
|
-
"build:packages": "turbo run build",
|
|
18
|
+
"build": "tsc",
|
|
22
19
|
"start": "node dist/index.js",
|
|
23
20
|
"dev": "tsc --watch",
|
|
24
|
-
"test": "
|
|
25
|
-
"test:mcp": "vitest run",
|
|
21
|
+
"test": "vitest run",
|
|
26
22
|
"test:watch": "vitest",
|
|
27
23
|
"test:coverage": "vitest run --coverage",
|
|
28
|
-
"prepublishOnly": "pnpm run build
|
|
24
|
+
"prepublishOnly": "pnpm run build"
|
|
29
25
|
},
|
|
30
26
|
"keywords": [
|
|
31
27
|
"mcp",
|
|
@@ -38,21 +34,24 @@
|
|
|
38
34
|
"license": "MIT",
|
|
39
35
|
"repository": {
|
|
40
36
|
"type": "git",
|
|
41
|
-
"url": "https://github.com/joseph0926/plan-loop
|
|
37
|
+
"url": "https://github.com/joseph0926/plan-loop",
|
|
38
|
+
"directory": "packages/cli"
|
|
42
39
|
},
|
|
43
40
|
"bugs": {
|
|
44
41
|
"url": "https://github.com/joseph0926/plan-loop/issues"
|
|
45
42
|
},
|
|
46
43
|
"homepage": "https://github.com/joseph0926/plan-loop#readme",
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@iarna/toml": "^2.2.5",
|
|
49
|
-
"@joseph0926/plan-loop-core": "
|
|
49
|
+
"@joseph0926/plan-loop-core": "workspace:*",
|
|
50
50
|
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^20.0.0",
|
|
54
54
|
"@vitest/coverage-v8": "^2.0.0",
|
|
55
|
-
"turbo": "^2.0.0",
|
|
56
55
|
"typescript": "^5.0.0",
|
|
57
56
|
"vitest": "^2.0.0"
|
|
58
57
|
}
|
package/README.ko.md
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
# Plan Loop
|
|
2
|
-
|
|
3
|
-
Plan Loop는 Claude-Code(설계자)와 Codex(검토자) 간의 비동기 계획 검토 루프를 디스크의 세션 상태 공유를 통해 가능하게 하는 MCP 서버입니다.
|
|
4
|
-
|
|
5
|
-
## 저장소 구조
|
|
6
|
-
|
|
7
|
-
- src/: MCP 서버 소스 코드 (Node.js + TypeScript)
|
|
8
|
-
- .mcp.json.example: MCP 서버 설정 샘플 (`.mcp.json`으로 복사하여 사용)
|
|
9
|
-
|
|
10
|
-
## 빠른 시작
|
|
11
|
-
|
|
12
|
-
1) 설치 및 설정 (권장)
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
# npx로 1회 실행 (설치 불필요)
|
|
16
|
-
npx @joseph0926/plan-loop setup
|
|
17
|
-
|
|
18
|
-
# 또는 글로벌 설치
|
|
19
|
-
npm install -g @joseph0926/plan-loop
|
|
20
|
-
plan-loop setup
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### 설정 옵션
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
plan-loop setup # Claude (project) + Codex (user) 모두 설정
|
|
27
|
-
plan-loop setup --claude # Claude Code만 (project scope)
|
|
28
|
-
plan-loop setup --claude --user # Claude Code (user scope, ~/.claude.json)
|
|
29
|
-
plan-loop setup --codex # Codex만 (user scope)
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
2) 수동 등록 (선택)
|
|
33
|
-
|
|
34
|
-
**Claude Code** - `.mcp.json` (프로젝트) 또는 `~/.claude.json` (사용자)에 추가:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"mcpServers": {
|
|
39
|
-
"plan-loop": {
|
|
40
|
-
"command": "npx",
|
|
41
|
-
"args": ["-y", "@joseph0926/plan-loop"]
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Codex** - `~/.codex/config.toml`에 추가:
|
|
48
|
-
|
|
49
|
-
```toml
|
|
50
|
-
[mcp_servers.plan-loop]
|
|
51
|
-
command = "npx"
|
|
52
|
-
args = ["-y", "@joseph0926/plan-loop"]
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
3) 도구 사용 예시
|
|
56
|
-
|
|
57
|
-
```text
|
|
58
|
-
pl_start({ goal: "로그인 기능 계획" })
|
|
59
|
-
pl_submit({ session_id: "abc123", plan: "1. ..." })
|
|
60
|
-
pl_get_plan({ session_id: "abc123" })
|
|
61
|
-
pl_feedback({ session_id: "abc123", rating: "🟢", content: "LGTM" })
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## 도구 목록
|
|
65
|
-
|
|
66
|
-
- pl_start: 세션 시작
|
|
67
|
-
- pl_submit: 계획 제출
|
|
68
|
-
- pl_get_plan: 최신 계획 조회
|
|
69
|
-
- pl_feedback: 최신 계획에 대한 피드백 제출
|
|
70
|
-
- pl_get_feedback: 최신 피드백 조회
|
|
71
|
-
- pl_status: 전체 세션 데이터 조회
|
|
72
|
-
- pl_list: 모든 세션 목록 (필터/정렬 지원)
|
|
73
|
-
- pl_delete: 세션 삭제
|
|
74
|
-
- pl_force_approve: exhausted 세션 강제 승인
|
|
75
|
-
|
|
76
|
-
## 에이전트 협업
|
|
77
|
-
|
|
78
|
-
Claude-Code(설계자)와 Codex(검토자)가 협업하여 계획을 검토합니다.
|
|
79
|
-
|
|
80
|
-
### 빠른 시작
|
|
81
|
-
|
|
82
|
-
```text
|
|
83
|
-
# 1. Claude-Code: 세션 시작 및 계획 제출
|
|
84
|
-
pl_start({ goal: "로그인 기능 구현" })
|
|
85
|
-
pl_submit({ session_id: "...", plan: "1. DB 스키마..." })
|
|
86
|
-
|
|
87
|
-
# 2. Codex: 계획 조회 및 피드백
|
|
88
|
-
pl_get_plan({ session_id: "..." })
|
|
89
|
-
pl_feedback({ session_id: "...", rating: "🟡", content: "인증 방식 명시 필요" })
|
|
90
|
-
|
|
91
|
-
# 3. Claude-Code: 피드백 확인 및 수정
|
|
92
|
-
pl_get_feedback({ session_id: "..." })
|
|
93
|
-
pl_submit({ session_id: "...", plan: "수정된 계획..." })
|
|
94
|
-
|
|
95
|
-
# 4. Codex: 승인
|
|
96
|
-
pl_feedback({ session_id: "...", rating: "🟢", content: "LGTM" })
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### 역할별 상세 지침
|
|
100
|
-
|
|
101
|
-
자세한 워크플로우와 피드백 자동완성 가이드는 [AGENTS.md](AGENTS.md) 참조.
|
|
102
|
-
|
|
103
|
-
## 상태 저장
|
|
104
|
-
|
|
105
|
-
세션 파일은 `~/.plan-loop/sessions/`에 저장됩니다.
|
|
106
|
-
|
|
107
|
-
## 상태 전이
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
pl_start
|
|
111
|
-
│
|
|
112
|
-
▼
|
|
113
|
-
[drafting]
|
|
114
|
-
│
|
|
115
|
-
pl_submit
|
|
116
|
-
│
|
|
117
|
-
▼
|
|
118
|
-
[pending_review]
|
|
119
|
-
│
|
|
120
|
-
pl_feedback
|
|
121
|
-
│
|
|
122
|
-
┌─────────────────────────┼─────────────────────────┐
|
|
123
|
-
▼ ▼ ▼
|
|
124
|
-
🔴 / 🟡 🟢 iteration >= max
|
|
125
|
-
│ │ │
|
|
126
|
-
▼ ▼ ▼
|
|
127
|
-
[pending_revision] [approved] [exhausted]
|
|
128
|
-
│ │ │
|
|
129
|
-
pl_submit pl_delete pl_force_approve
|
|
130
|
-
│ │ │
|
|
131
|
-
▼ ▼ ▼
|
|
132
|
-
[pending_review] [deleted] [approved]
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## 응답 형식
|
|
136
|
-
|
|
137
|
-
### 성공 응답 (데이터 있음)
|
|
138
|
-
```typescript
|
|
139
|
-
{ ready: true, data: { ... } }
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### 대기 응답 (데이터 없음)
|
|
143
|
-
```typescript
|
|
144
|
-
{ ready: false, reason: "no_plan_submitted" | "no_feedback_yet" | "awaiting_feedback" }
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
#### Pending reason 매핑
|
|
148
|
-
- `pl_get_plan`: plan 없음 → `no_plan_submitted`
|
|
149
|
-
- `pl_get_feedback`:
|
|
150
|
-
- plan 없음 → `no_plan_submitted`
|
|
151
|
-
- 최신 plan에 대한 피드백 대기 → `awaiting_feedback`
|
|
152
|
-
- 기타 피드백 없음 → `no_feedback_yet`
|
|
153
|
-
|
|
154
|
-
### 에러 응답
|
|
155
|
-
```typescript
|
|
156
|
-
{
|
|
157
|
-
isError: true,
|
|
158
|
-
content: [{ type: "text", text: "Invalid state: current='approved', expected=['drafting']" }]
|
|
159
|
-
}
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## 세션 관리
|
|
163
|
-
|
|
164
|
-
### pl_list 필터링 및 정렬
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
// status 필터
|
|
168
|
-
> pl_list({ status: "approved" })
|
|
169
|
-
> pl_list({ status: ["drafting", "pending_review"] })
|
|
170
|
-
|
|
171
|
-
// 정렬
|
|
172
|
-
> pl_list({ sort: "createdAt", order: "asc" })
|
|
173
|
-
> pl_list({ sort: "updatedAt", order: "desc" }) // 기본값
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### pl_delete 세션 삭제
|
|
177
|
-
|
|
178
|
-
```
|
|
179
|
-
// approved/exhausted 세션 삭제
|
|
180
|
-
> pl_delete({ session_id: "abc123" })
|
|
181
|
-
|
|
182
|
-
// 활성 세션 삭제 (force 필요)
|
|
183
|
-
> pl_delete({ session_id: "abc123", force: true })
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
## 버전 규칙
|
|
187
|
-
|
|
188
|
-
| 필드 | 증가 시점 |
|
|
189
|
-
|------|-----------|
|
|
190
|
-
| `version` | `pl_submit` 호출 시 +1 |
|
|
191
|
-
| `iteration` | `pl_feedback`에서 🔴/🟡 시 +1 |
|
|
192
|
-
|
|
193
|
-
`maxIterations`는 기본값 5이며 **1 이상의 정수**만 허용됩니다.
|
|
194
|
-
|
|
195
|
-
## 설계 결정
|
|
196
|
-
|
|
197
|
-
### 최신 plan 자동 매핑
|
|
198
|
-
- `pl_feedback`은 항상 최신 plan에 매핑됨
|
|
199
|
-
- planVersion 파라미터 없음 (단순화)
|
|
200
|
-
- **Trade-off**: 동시 호출 시 race condition 가능 → 운영 규칙으로 관리
|
|
201
|
-
|
|
202
|
-
### 역할 구분
|
|
203
|
-
- 서버는 호출자를 검증하지 않음
|
|
204
|
-
- Claude-Code는 submit 계열, Codex는 feedback 계열 사용 (약속)
|
|
205
|
-
|
|
206
|
-
### 상태 영속화
|
|
207
|
-
- `~/.plan-loop/sessions/{id}.json`
|
|
208
|
-
- Atomic write (temp → rename)
|
|
209
|
-
|
|
210
|
-
### goal 길이 제한
|
|
211
|
-
- `pl_list` 응답에서 goal은 30자(UTF-16 코드 유닛 기준) 초과 시 `...` 추가
|
|
212
|
-
- 최대 33자 (30자 + "...")
|
|
213
|
-
|
|
214
|
-
## 개발
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
npm run dev
|
|
218
|
-
npm run build
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
## 샘플 설정 파일
|
|
222
|
-
|
|
223
|
-
프로젝트에 MCP 설정을 추가하려면:
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
cp .mcp.json.example .mcp.json
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
## 테스트
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
npm test # 테스트 실행
|
|
233
|
-
npm run test:watch # 워치 모드
|
|
234
|
-
npm run test:coverage # 커버리지 리포트
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
테스트 격리를 위해 `PLAN_LOOP_STATE_DIR` 환경변수를 지원합니다:
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
PLAN_LOOP_STATE_DIR=/tmp/test-sessions npm test
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
## 라이선스
|
|
244
|
-
|
|
245
|
-
MIT
|