@elyun/bylane 1.0.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.
@@ -0,0 +1,324 @@
1
+ # byLane — Frontend Development Harness for Claude Code
2
+
3
+ **Date:** 2026-04-04
4
+ **Status:** Draft
5
+
6
+ ---
7
+
8
+ ## 1. 목적
9
+
10
+ byLane은 Claude Code 위에서 동작하는 프론트엔드 개발 자동화 하네스다. GitHub Issues(또는 Linear)에서 시작해 코드 구현, 테스트, 커밋, PR 생성, 리뷰, 리뷰 반영까지 전체 개발 워크플로우를 에이전트 기반으로 자동화한다.
11
+
12
+ 각 에이전트는 독립 실행도 가능하고, 타인의 원격 작업(이슈, PR, 리뷰 등)을 대상으로도 동작한다.
13
+
14
+ ---
15
+
16
+ ## 2. 핵심 결정 사항
17
+
18
+ | 항목 | 결정 |
19
+ |---|---|
20
+ | 배포 형태 | Skills 파일 세트 (`~/.claude/` 하위), 별도 인프라 없음 |
21
+ | 트리거 방식 | 혼합 — `/bylane [자연어]` slash command + 자연어 감지 |
22
+ | 에이전트 아키텍처 | 오케스트레이터 + 워커 에이전트 패턴 |
23
+ | 이슈 트래커 | GitHub Issues 주, Linear 선택적 |
24
+ | 알림 | Slack / Telegram 선택 (설치 시 설정) |
25
+ | Figma MCP | 선택적 활성화 — 이슈 분석 단계에서 스펙 추출 |
26
+ | 피드백 루프 | 기본값 3회 + 사용자 설정 오버라이드 |
27
+ | 모니터링 | `/bylane monitor` — 2열 그리드 터미널 TUI 대시보드 |
28
+
29
+ ---
30
+
31
+ ## 3. 전체 아키텍처
32
+
33
+ ```
34
+ byLane/
35
+ ├── skills/
36
+ │ ├── orchestrator.md # 전체 워크플로우 총괄
37
+ │ ├── setup.md # 최초 설치 셋업 위자드
38
+ │ ├── monitor.md # 실시간 터미널 대시보드
39
+ │ │
40
+ │ ├── issue-agent.md # 이슈 생성/분석 (GitHub + Linear)
41
+ │ ├── code-agent.md # 코드 구현 (Figma MCP 선택적)
42
+ │ ├── test-agent.md # 테스트 실행 및 검증
43
+ │ ├── commit-agent.md # 커밋 생성
44
+ │ ├── pr-agent.md # PR 생성/관리
45
+ │ ├── review-agent.md # PR 리뷰 수행
46
+ │ ├── respond-agent.md # 리뷰 반박/반영
47
+ │ └── notify-agent.md # 최종 알림 (Slack/Telegram)
48
+
49
+ ├── hooks/
50
+ │ ├── post-tool-use.md # 외부 이벤트 감지 (타인의 PR, 리뷰)
51
+ │ └── natural-language.md # 자연어 트리거 감지
52
+
53
+ ├── config/
54
+ │ └── bylane.json # 설치 시 생성되는 설정 파일
55
+
56
+ └── commands/
57
+ ├── bylane.md # /bylane 메인 커맨드
58
+ └── bylane-monitor.md # /bylane-monitor 대시보드
59
+ ```
60
+
61
+ ---
62
+
63
+ ## 4. 워크플로우
64
+
65
+ ### 오케스트레이터 동작 방식
66
+
67
+ `/bylane [자연어]` 실행 시 오케스트레이터가 의도를 파싱하여 어디서 시작하고 어디서 끝낼지 결정한다.
68
+
69
+ ```
70
+ /bylane 다크모드 토글 추가해줘
71
+ → issue-agent (이슈 생성) → code-agent → test-agent → commit-agent
72
+ → pr-agent → review-agent → notify-agent
73
+
74
+ /bylane issue #123 구현해줘
75
+ → issue-agent (분석만) → code-agent → ... → notify-agent
76
+
77
+ /bylane PR #45 리뷰해줘
78
+ → review-agent만 실행
79
+
80
+ /bylane 리뷰 #45 반영해줘
81
+ → respond-agent만 실행
82
+ ```
83
+
84
+ ### 전체 파이프라인
85
+
86
+ ```
87
+ [진입점]
88
+ /bylane [자연어] OR 자연어 감지 OR 외부 이벤트 (hooks)
89
+
90
+
91
+ [orchestrator] ── 의도 파악 + bylane.json 설정 로드
92
+
93
+ ├─► [issue-agent] 이슈 분석, Figma 링크 있으면 스펙 추출
94
+ │ ↓
95
+ ├─► [code-agent] 구현 (Figma 스펙 참조)
96
+ │ ↓
97
+ ├─► [test-agent] 테스트 실행
98
+ │ ↕ FAIL 시 code-agent로 피드백 루프 (최대 maxRetries)
99
+ │ ↓ PASS
100
+ ├─► [commit-agent] 커밋 생성
101
+ │ ↓
102
+ ├─► [pr-agent] PR 생성
103
+ │ ↓
104
+ ├─► [review-agent] 자동 리뷰
105
+ │ ↓
106
+ ├─► [respond-agent] 반박 or 반영 → LGTM까지 루프
107
+ │ ↓
108
+ └─► [notify-agent] Slack/Telegram 완료 알림
109
+ ```
110
+
111
+ ### 에이전트 역할
112
+
113
+ | 에이전트 | 트리거 | 입력 | 출력 |
114
+ |---|---|---|---|
115
+ | **orchestrator** | `/bylane`, 자연어 | 사용자 의도 | 에이전트 실행 계획 |
116
+ | **issue-agent** | 수동 or 오케스트레이터 | 이슈 텍스트/번호 | 구현 스펙 JSON |
117
+ | **code-agent** | 수동 or 오케스트레이터 | 스펙 + 코드베이스 | 변경된 파일들 |
118
+ | **test-agent** | 수동 or 코드 완료 후 | 변경 파일들 | 통과/실패 + 피드백 |
119
+ | **commit-agent** | 수동 or 테스트 통과 후 | 변경 파일들 | 커밋 SHA |
120
+ | **pr-agent** | 수동 or 커밋 후 | 커밋 목록 | PR URL |
121
+ | **review-agent** | 수동 or PR 오픈 후 | PR diff | 리뷰 코멘트 |
122
+ | **respond-agent** | 수동 or 리뷰 수신 후 | 리뷰 코멘트 | 반박/수정 커밋 |
123
+ | **notify-agent** | 수동 or 워크플로우 완료 | 결과 요약 | Slack/Telegram 메시지 |
124
+
125
+ ### 피드백 루프 규칙
126
+
127
+ ```
128
+ 루프 최대 횟수: bylane.json의 maxRetries (기본값: 3)
129
+ 에스컬레이션 조건:
130
+ - maxRetries 초과 시
131
+ - 에이전트가 "해결 불가" 판단 시
132
+ 에스컬레이션: notify-agent로 "개입 필요" 알림 후 대기
133
+ ```
134
+
135
+ ### 외부 이벤트 처리
136
+
137
+ ```
138
+ hooks/post-tool-use → GitHub PR 오픈 감지 → review-agent 자동 실행
139
+ → 리뷰 코멘트 수신 감지 → respond-agent 자동 실행
140
+ → CI 실패 감지 → code-agent 재실행
141
+ ```
142
+
143
+ ---
144
+
145
+ ## 5. 슬래시 커맨드
146
+
147
+ | 커맨드 | 동작 |
148
+ |---|---|
149
+ | `/bylane [자연어]` | 오케스트레이터 — 전체 워크플로우 자동 실행 |
150
+ | `/bylane setup` | 셋업 위자드 (재실행 가능) |
151
+ | `/bylane monitor` | 실시간 TUI 대시보드 |
152
+ | `/bylane issue [#번호 or 텍스트]` | issue-agent 단독 실행 |
153
+ | `/bylane code [#번호]` | code-agent 단독 실행 |
154
+ | `/bylane test` | test-agent 단독 실행 |
155
+ | `/bylane commit` | commit-agent 단독 실행 |
156
+ | `/bylane pr` | pr-agent 단독 실행 |
157
+ | `/bylane review [PR번호]` | review-agent 단독 실행 |
158
+ | `/bylane respond [PR번호]` | respond-agent 단독 실행 |
159
+ | `/bylane notify` | notify-agent 단독 실행 |
160
+ | `/bylane status` | 현재 워크플로우 상태 한 줄 요약 |
161
+
162
+ ---
163
+
164
+ ## 6. 모니터링 대시보드 (`/bylane monitor`)
165
+
166
+ 2열 그리드 터미널 TUI. Node.js `blessed` 또는 `ink` 기반.
167
+
168
+ ```
169
+ ╔══════════════════════════════════════════════════════════════════════════════════╗
170
+ ║ byLane Monitor Issue #123: "Add dark mode toggle" Elapsed: 4m 31s 17:32:41║
171
+ ╠═══════════════════════════════════════╦════════════════════════════════════════ ║
172
+ ║ AGENT PIPELINE ║ AGENT LOG [LIVE] ║
173
+ ║ ║ ║
174
+ ║ issue-agent [✓] 완료 2m 12s ║ 17:32:38 code-agent ║
175
+ ║ code-agent [▶] 실행중 ████░ 67% ║ → ThemeToggle.tsx 생성 ║
176
+ ║ test-agent [○] 대기 ║ 17:32:35 code-agent ║
177
+ ║ commit-agent [○] 대기 ║ → useTheme hook 구현 중... ║
178
+ ║ pr-agent [○] 대기 ║ 17:32:21 code-agent ║
179
+ ║ review-agent [○] 대기 ║ → Figma color token 로드 ║
180
+ ║ respond-agent [○] 대기 ║ 17:30:09 issue-agent ║
181
+ ║ notify-agent [○] 대기 ║ → ✓ 완료 - spec.json 저장됨 ║
182
+ ║ ║ 17:28:14 orchestrator ║
183
+ ║ Retries: 1/3 maxRetries: 3 ║ → workflow 시작 (Issue #123) ║
184
+ ╠═══════════════════════════════════════╬════════════════════════════════════════╣
185
+ ║ QUEUE ║ SYSTEM STATUS ║
186
+ ║ ║ ║
187
+ ║ # TYPE TARGET STATUS ║ GitHub ✓ 연결됨 ║
188
+ ║ 1 Issue #124 code 대기중 ║ Linear ✗ 비활성 ║
189
+ ║ 2 PR #45 review 대기중 ║ Figma MCP ✓ 활성 ║
190
+ ║ 3 Issue #125 full-flow 예약됨 ║ Slack ✓ #dev-alerts ║
191
+ ║ ║ Telegram ✗ 미설정 ║
192
+ ║ ║ ║
193
+ ║ ║ 팀 모드 ✓ 활성 (3명) ║
194
+ ║ ║ 권한 범위 write (코드/PR) ║
195
+ ╚═══════════════════════════════════════╩════════════════════════════════════════╝
196
+ [q]종료 [p]일시정지 [c]현재작업취소 [Tab]포커스전환 [↑↓]로그스크롤 [?]도움말
197
+ ```
198
+
199
+ **패널 구성:**
200
+
201
+ | 패널 | 위치 | 내용 |
202
+ |---|---|---|
203
+ | Header | 상단 전체 | 현재 작업명 + 경과시간 + 시각 |
204
+ | Agent Pipeline | 좌상 | 파이프라인 상태 + 재시도 현황 |
205
+ | Agent Log | 우상 | 실시간 로그 스크롤 (최근 50줄) |
206
+ | Queue | 좌하 | 대기/예약 작업 목록 |
207
+ | System Status | 우하 | 연동 서비스 상태 + 설정 요약 |
208
+ | Footer | 하단 전체 | 키보드 단축키 |
209
+
210
+ **데이터 소스:** `.bylane/state/*.json` 파일 폴링(1초 간격)
211
+
212
+ ---
213
+
214
+ ## 7. 셋업 위자드 (`/bylane setup`)
215
+
216
+ 최초 설치 또는 재설정 시 실행. 6단계 인터랙티브 프롬프트.
217
+
218
+ ```
219
+ 1/6 이슈 트래커 GitHub Issues (주) / Linear (선택) / 둘 다
220
+ 2/6 알림 채널 Slack / Telegram / 둘 다 / 건너뜀
221
+ 3/6 팀 모드 활성화 여부 + 팀원 GitHub 핸들 입력
222
+ 4/6 권한 범위 read-only / write(코드+PR) / full(머지 포함)
223
+ 5/6 고급 설정 maxRetries (기본 3), Figma MCP 활성화, 루프 타임아웃
224
+ 6/6 브랜치 네이밍 패턴 선택 또는 커스텀 토큰 조합
225
+ ```
226
+
227
+ ---
228
+
229
+ ## 8. 설정 파일 (`bylane.json`)
230
+
231
+ ```json
232
+ {
233
+ "version": "1.0",
234
+ "trackers": {
235
+ "primary": "github",
236
+ "linear": { "enabled": false, "apiKey": "$LINEAR_API_KEY" }
237
+ },
238
+ "notifications": {
239
+ "slack": { "enabled": true, "channel": "#dev-alerts" },
240
+ "telegram": { "enabled": false, "chatId": "" }
241
+ },
242
+ "team": {
243
+ "enabled": true,
244
+ "members": ["@alice", "@bob"],
245
+ "reviewAssignment": "round-robin"
246
+ },
247
+ "permissions": {
248
+ "scope": "write",
249
+ "allowMerge": false,
250
+ "allowForceClose": false
251
+ },
252
+ "workflow": {
253
+ "maxRetries": 3,
254
+ "loopTimeoutMinutes": 30,
255
+ "autoEscalate": true
256
+ },
257
+ "branch": {
258
+ "pattern": "{tracker}-{issue-number}-{custom-id}",
259
+ "tokens": {
260
+ "tracker": "issues",
261
+ "type": "feature",
262
+ "custom-id": ""
263
+ },
264
+ "separator": "-",
265
+ "caseStyle": "kebab-case"
266
+ },
267
+ "extensions": {
268
+ "figma": {
269
+ "enabled": true,
270
+ "useAt": "issue-analysis"
271
+ }
272
+ }
273
+ }
274
+ ```
275
+
276
+ **브랜치 네이밍 토큰:**
277
+
278
+ | 토큰 | 예시 |
279
+ |---|---|
280
+ | `{tracker}` | `issues`, `feat` |
281
+ | `{issue-number}` | `32` |
282
+ | `{custom-id}` | `C-12` (비어있으면 토큰 제외) |
283
+ | `{type}` | `feature`, `fix` |
284
+ | `{title-slug}` | `add-dark-mode` |
285
+ | `{date}` | `20260404` |
286
+ | `{username}` | `jhyoon` |
287
+
288
+ **패턴 예시:**
289
+ - `{tracker}-{issue-number}-{custom-id}` → `issues-32-C-12` 또는 `issues-32`
290
+ - `{type}/{issue-number}-{title-slug}` → `feature/32-add-dark-mode`
291
+
292
+ ---
293
+
294
+ ## 9. 상태 관리
295
+
296
+ 각 에이전트는 작업 중 `.bylane/state/{agent-name}.json`에 상태를 기록한다.
297
+
298
+ ```json
299
+ {
300
+ "agent": "code-agent",
301
+ "status": "in_progress",
302
+ "startedAt": "2026-04-04T17:28:10Z",
303
+ "progress": 67,
304
+ "currentTask": "ThemeToggle.tsx 구현 중",
305
+ "retries": 1,
306
+ "log": [
307
+ { "ts": "17:32:38", "msg": "ThemeToggle.tsx 생성" },
308
+ { "ts": "17:32:35", "msg": "useTheme hook 구현 중..." }
309
+ ]
310
+ }
311
+ ```
312
+
313
+ ---
314
+
315
+ ## 10. 구현 스택
316
+
317
+ | 항목 | 선택 |
318
+ |---|---|
319
+ | 하네스 형태 | Claude Code skills/agents/hooks 파일 세트 |
320
+ | MCP 의존성 | GitHub MCP, Figma MCP (선택), Slack MCP, Telegram MCP |
321
+ | 대시보드 | Node.js + `blessed` 또는 `ink` (터미널 TUI) |
322
+ | 상태 저장 | `.bylane/state/*.json` (파일 기반) |
323
+ | 설정 | `.bylane/bylane.json` |
324
+ | 외부 인프라 | 없음 |
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: bylane-post-tool-use
3
+ description: GitHub 이벤트 감지 후 적절한 byLane 에이전트를 자동 트리거한다.
4
+ trigger: post-tool-use
5
+ ---
6
+
7
+ # byLane External Event Hook
8
+
9
+ GitHub MCP 도구 사용 후 결과를 분석하여 자동으로 에이전트를 트리거한다.
10
+
11
+ ## 비활성화 조건
12
+
13
+ `.bylane/bylane.json`에 `"hookAutoTrigger": false`가 있으면 이 hook을 실행하지 않는다.
14
+
15
+ ## 감지 규칙
16
+
17
+ ### PR 오픈 감지
18
+
19
+ GitHub MCP 도구 결과에서 다음 조건이 모두 충족될 때:
20
+ - `state: "open"`인 PR 존재
21
+ - `user.login`이 `.bylane/bylane.json`의 `team.members` 중 하나
22
+ - `team.enabled: true`
23
+
24
+ → `bylane-review-agent` 스킬 실행 (PR 번호 전달)
25
+
26
+ ### 리뷰 코멘트 수신 감지
27
+
28
+ GitHub MCP 결과에서 다음 조건이 충족될 때:
29
+ - 내 PR에 `review_state: "changes_requested"` 발견
30
+
31
+ → `bylane-respond-agent` 스킬 실행 (PR 번호 전달)
32
+
33
+ ### CI 실패 감지
34
+
35
+ GitHub MCP `get_pull_request_status` 결과에서:
36
+ - `state: "failure"` 발견
37
+
38
+ → `.bylane/state/code-agent.json`의 `retries` 확인
39
+ → `retries < config.workflow.maxRetries`이면 `bylane-code-agent` 재실행
40
+ → 초과 시 `bylane-notify-agent`로 에스컬레이션
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@elyun/bylane",
3
+ "version": "1.0.0",
4
+ "description": "Frontend development harness for Claude Code",
5
+ "type": "module",
6
+ "bin": {
7
+ "bylane": "./src/cli.js",
8
+ "bylane-monitor": "./src/monitor/index.js"
9
+ },
10
+ "scripts": {
11
+ "monitor": "node src/monitor/index.js",
12
+ "test": "vitest run",
13
+ "test:watch": "vitest"
14
+ },
15
+ "dependencies": {
16
+ "blessed": "^0.1.81",
17
+ "chokidar": "^3.6.0"
18
+ },
19
+ "devDependencies": {
20
+ "vitest": "^1.6.0"
21
+ }
22
+ }
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: bylane-code-agent
3
+ description: issue-agent의 스펙을 기반으로 프론트엔드 코드를 구현한다.
4
+ ---
5
+
6
+ # Code Agent
7
+
8
+ ## 입력
9
+
10
+ `.bylane/state/issue-agent.json`에서 `spec` 읽기. 없으면 사용자에게 스펙 텍스트 직접 입력 요청.
11
+
12
+ ## 실행 전 상태 기록
13
+
14
+ ```bash
15
+ node -e "
16
+ import('./src/state.js').then(({writeState}) => {
17
+ writeState('code-agent', {
18
+ status: 'in_progress',
19
+ startedAt: new Date().toISOString(),
20
+ progress: 0,
21
+ currentTask: '코드 구현 시작',
22
+ retries: 0,
23
+ log: []
24
+ })
25
+ })
26
+ "
27
+ ```
28
+
29
+ ## 실행 흐름
30
+
31
+ 1. `.bylane/state/issue-agent.json` 로드하여 `spec` 추출
32
+ 2. `spec.checklist` 항목을 순서대로 구현
33
+ 3. Figma 스펙이 있으면 (`spec.figmaSpec.enabled === true`):
34
+ - `colorTokens`를 CSS 변수 또는 Tailwind config 값으로 변환
35
+ - 컴포넌트 구조를 Figma 계층에 맞게 구현
36
+ 4. 기존 코드베이스 패턴 파악 후 동일 스타일로 작성 (TypeScript, 테스트 파일 위치 등)
37
+ 5. 각 파일 구현 후 `appendLog` 호출:
38
+ ```bash
39
+ node -e "import('./src/state.js').then(({appendLog})=>appendLog('code-agent','FILENAME 구현 완료'))"
40
+ ```
41
+ 6. 구현 완료 후 상태 업데이트:
42
+ ```bash
43
+ node -e "
44
+ import('./src/state.js').then(({writeState}) => {
45
+ writeState('code-agent', {
46
+ status: 'completed',
47
+ progress: 100,
48
+ currentTask: '구현 완료',
49
+ retries: 0,
50
+ changedFiles: CHANGED_FILES_ARRAY
51
+ })
52
+ })
53
+ "
54
+ ```
55
+
56
+ ## 코딩 원칙
57
+
58
+ - 함수형 컴포넌트 + hooks 우선
59
+ - 파일당 단일 책임
60
+ - 200줄 초과 시 분리 고려
61
+ - 불변성 패턴 유지 (객체 직접 수정 금지)
62
+
63
+ ## 출력
64
+
65
+ `.bylane/state/code-agent.json`의 `changedFiles`: 변경된 파일 경로 배열
66
+
67
+ ## 수동 실행
68
+
69
+ `/bylane code #123`
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: bylane-commit-agent
3
+ description: 변경된 파일들을 conventional commit 형식으로 커밋한다.
4
+ ---
5
+
6
+ # Commit Agent
7
+
8
+ ## 입력
9
+
10
+ - `.bylane/state/code-agent.json`의 `changedFiles`
11
+ - `.bylane/state/issue-agent.json`의 `spec.title`, `issueNumber`
12
+ - `.bylane/bylane.json`의 `branch` 설정
13
+
14
+ ## 실행 전 상태 기록
15
+
16
+ ```bash
17
+ node -e "import('./src/state.js').then(({writeState})=>writeState('commit-agent',{status:'in_progress',startedAt:new Date().toISOString(),progress:0,retries:0,log:[]}))"
18
+ ```
19
+
20
+ ## 실행 흐름
21
+
22
+ 1. 브랜치명 생성:
23
+ ```bash
24
+ node -e "
25
+ Promise.all([
26
+ import('./src/branch.js'),
27
+ import('./src/config.js')
28
+ ]).then(([{buildBranchNameFromConfig},{loadConfig}]) => {
29
+ const config = loadConfig()
30
+ const branch = buildBranchNameFromConfig(config, ISSUE_NUMBER)
31
+ console.log(branch)
32
+ })
33
+ "
34
+ ```
35
+
36
+ 2. 브랜치 생성 및 체크아웃:
37
+ ```bash
38
+ git checkout -b BRANCH_NAME
39
+ ```
40
+
41
+ 3. 변경 파일 스테이징:
42
+ ```bash
43
+ git add CHANGED_FILES
44
+ ```
45
+
46
+ 4. 커밋 타입 결정:
47
+ - 새 기능: `feat:`
48
+ - 버그 수정: `fix:`
49
+ - 리팩토링: `refactor:`
50
+
51
+ 5. 커밋 실행:
52
+ ```bash
53
+ git commit -m "feat: SPEC_TITLE
54
+
55
+ Closes #ISSUE_NUMBER"
56
+ ```
57
+
58
+ 6. 상태 업데이트:
59
+ ```bash
60
+ node -e "
61
+ import('./src/state.js').then(({writeState})=>writeState('commit-agent',{
62
+ status:'completed',
63
+ progress:100,
64
+ branchName:'BRANCH_NAME',
65
+ commitSha:'COMMIT_SHA'
66
+ }))
67
+ "
68
+ ```
69
+
70
+ ## 출력
71
+
72
+ `.bylane/state/commit-agent.json`:
73
+ ```json
74
+ {
75
+ "agent": "commit-agent",
76
+ "status": "completed",
77
+ "progress": 100,
78
+ "branchName": "issues-123-add-dark-mode",
79
+ "commitSha": "abc1234"
80
+ }
81
+ ```
82
+
83
+ ## 수동 실행
84
+
85
+ `/bylane commit`
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: bylane-issue-agent
3
+ description: GitHub Issue 생성 및 분석. Figma 링크 감지 시 스펙 추출.
4
+ ---
5
+
6
+ # Issue Agent
7
+
8
+ ## 입력
9
+
10
+ - 자유 텍스트 (새 이슈 생성용) OR GitHub Issue 번호 (#N)
11
+
12
+ ## 실행 흐름
13
+
14
+ ### 새 이슈 생성 모드 (텍스트 입력)
15
+
16
+ 1. 입력 텍스트에서 다음을 추출:
17
+ - 제목 (50자 이내)
18
+ - 상세 설명
19
+ - 구현 체크리스트 (예상 가능한 경우)
20
+ - Figma URL (있는 경우)
21
+
22
+ 2. GitHub MCP로 이슈 생성:
23
+ - `title`: 추출된 제목
24
+ - `body`: Markdown 형식 설명 + 체크리스트
25
+ - `labels`: `bylane-auto` 라벨 추가 (라벨이 없으면 생성)
26
+
27
+ 3. Figma MCP 활성화 여부 확인 (`.bylane/bylane.json` → `extensions.figma.enabled`):
28
+ - `true`이고 Figma URL이 있으면 → **Figma 분석** 단계 실행
29
+ - `false`이면 → 텍스트 기반 스펙만 생성
30
+
31
+ ### 기존 이슈 분석 모드 (Issue 번호 입력)
32
+
33
+ 1. GitHub MCP로 이슈 내용 로드
34
+ 2. 본문에서 Figma URL 추출 시도
35
+ 3. 스펙 생성 (아래 참조)
36
+
37
+ ### Figma 분석 (활성화된 경우)
38
+
39
+ Figma MCP `get_file` 또는 `get_node` 도구로 해당 프레임/컴포넌트 분석:
40
+ - 컴포넌트 계층 구조
41
+ - 색상 토큰
42
+ - 타이포그래피
43
+ - 스페이싱 값
44
+
45
+ 추출 결과를 스펙에 포함.
46
+
47
+ **Figma 분석 실패 시 fallback:**
48
+ - MCP 미설치 또는 URL 유효하지 않은 경우: 경고 로그 기록 후 텍스트 기반 스펙만 사용
49
+ - `figmaSpec.enabled = false`로 출력
50
+
51
+ ## 출력: 구현 스펙
52
+
53
+ `.bylane/state/issue-agent.json`에 저장:
54
+
55
+ ```json
56
+ {
57
+ "agent": "issue-agent",
58
+ "status": "completed",
59
+ "progress": 100,
60
+ "issueNumber": 123,
61
+ "issueUrl": "https://github.com/...",
62
+ "spec": {
63
+ "title": "다크모드 토글 버튼 추가",
64
+ "description": "...",
65
+ "checklist": ["ThemeToggle 컴포넌트 생성", "useTheme hook 구현"],
66
+ "figmaSpec": {
67
+ "enabled": false,
68
+ "components": [],
69
+ "colorTokens": {}
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ 상태 기록:
76
+ ```bash
77
+ node -e "
78
+ import('./src/state.js').then(({writeState, appendLog}) => {
79
+ writeState('issue-agent', {
80
+ status: 'in_progress',
81
+ startedAt: new Date().toISOString(),
82
+ progress: 0,
83
+ retries: 0
84
+ })
85
+ })
86
+ "
87
+ ```
88
+
89
+ ## 수동 실행
90
+
91
+ `/bylane issue #123` 또는 `/bylane issue 다크모드 토글 추가해줘`