peer-bridge 0.6.0 → 0.7.1

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.ko.md CHANGED
@@ -1,132 +1,213 @@
1
- # peer-bridge (`v0.6.0`)
1
+ # peer-bridge (`pbridge`)
2
2
 
3
3
  [English](README.md) | **한국어**
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/peer-bridge?color=cb3837&logo=npm)](https://www.npmjs.com/package/peer-bridge)
6
+ [![CI](https://github.com/hwanyong/peer-bridge/actions/workflows/ci.yml/badge.svg)](https://github.com/hwanyong/peer-bridge/actions/workflows/ci.yml)
5
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
8
  [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22.13-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
7
9
  [![Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](package.json)
8
10
 
9
- **외부 npm 의존성 0개**로 동작하는 로컬 메시지 브로커(`pbridged`), 멀티 AI 협업 오케스트레이터(`cross-review` / `fanout-join`), MCP/Channel 서버(`pbridge-mcp`), 그리고 **LLM 토큰 소비 `0`의 독립 터미널 뷰어(`pbridge tui`)** 입니다. **Claude Code (`cc`)**, **Google Antigravity (`agy`)**, **Codex CLI (`codex`)**, **Gemini CLI (`gemini`)**, **Paseo (`paseo`)** 세션 간 즉각적인 협업과 통합 모니터링을 지원합니다.
11
+ > **MCP 설정 지옥 없음 · 무거운 데스크톱 GUI 없음 · AI 코딩 CLI 간 Zero-Config UNIX 메시지 버스**
10
12
 
11
- ---
12
-
13
- ## 핵심 설계 원칙
13
+ **`peer-bridge` (`pbridge`)** 는 **Claude Code**, **Google Antigravity**, **OpenAI Codex CLI**, **Google Gemini CLI**, **Paseo** AI 코딩 에이전트를 **macOS · Linux · Windows** 에서 하나로 연결하는 오픈소스, **외부 의존성 0개** 기반의 **이기종 CLI UNIX 메시지 버스 · 멀티 AI 워크플로우 오케스트레이터 · 선택형 MCP 서버 · 0 LLM 토큰 독립 터미널 뷰어(`TUI`)** 입니다.
14
14
 
15
- 1. **단일 중앙 데몬 + 프로젝트별 스코프/뷰어 분리**
16
- - `~/.peer-bridge` 단일 데몬(`pbridged`) 1개를 공유하면서 프로젝트(`cwd` / Git 루트) 단위로 피어 이름·목록·뷰어를 격리합니다.
17
- - 서로 다른 프로젝트에서 동일한 이름(`cc:reviewer`)을 충돌 없이 동시 스폰할 수 있으며, 필요할 때만 `cc:other-project/reviewer`로 교차 프로젝트 라우팅이 가능합니다.
18
- - `pbridge tui`는 프로젝트 폴더 안에서 실행 시 현재 프로젝트만 보여주며, 뷰어 내 **`p` 키** 하나로 `Current Project` ↔ `All Projects`를 즉시 전환합니다.
19
- 2. **기존 런타임 워크플로우 100% 보존**
20
- - Claude Code의 네이티브 `SendMessage`와 `~/.claude/sessions`·`~/.claude/teams` 세션은 가로채지 않고 패스스루합니다.
21
- - 어댑터 설치(`pbridge install`)는 기본적으로 프로젝트 단위(`--project`)로 비파괴 병합(`.bak` 백업 생성)되며 전역 설정을 건드리지 않습니다.
22
- 3. **0 토큰 독립 모니터링 & 소유권 안전장치**
23
- - `pbridge tui`는 브로커 스냅샷과 호스트 메타데이터를 로컬 파일시스템으로만 읽어 **LLM 토큰을 전혀 소비하지 않습니다.**
24
- - `[x]` 종료 키는 `peer-bridge`가 직접 스폰한 워커(`origin="spawned"`)에만 허용되며, 사용자가 직접 연 세션(`attached`/`host`)은 보호됩니다.
25
- - 무한 루프 가드(`max_hops`, `reply_expected=false`)를 브로커 레벨에서 강제합니다.
15
+ **한 번 설치(`npm install -g peer-bridge`), 설정은 0개.** 기존 `settings.json`·훅·`.mcp.json`을 전혀 건드리지 않고 AI 스킬(`SKILL.md`)만 자동 등록되므로, 매 턴 MCP 도구 스키마로 낭비되는 **유휴 컨텍스트 토큰이 `0`** 입니다. 평소처럼 프롬프트에 **`peer-bridge`** 만 언급하면 단일 모델의 맹점(*모델 단일문화*)을 깨는 다중 라운드 교차 리뷰, 디스크 산출물 검증, 병렬 감사까지 자동으로 처리합니다.
26
16
 
27
17
  ---
28
18
 
29
- ## 빠른 시작 (Quickstart)
19
+ ## 빠른 시작 (2단계 · 설정 0개)
30
20
 
31
- ### 요구 사항
32
- - **Node.js `>= 22.13.0`** (내장 `node:sqlite` 사용)
21
+ **Node.js `>= 22.13.0`** 이 필요합니다(내장 `node:sqlite` 사용, 외부 npm 의존성 `0개`).
33
22
 
34
- ### 설치 / CLI 연결
23
+ ### 1단계 — 전역 설치 (최초 1회)
35
24
  ```bash
36
- git clone <your-repo-url> peer-bridge
37
- cd peer-bridge
38
- npm link # pbridge, pbridged, pbridge-mcp, pbridge-tui를 PATH에 등록
39
- # 또는 링크 없이 직접 실행:
40
- node bin/pbridge.mjs --help
25
+ npm install -g peer-bridge
41
26
  ```
27
+ 설치 시 `pbridge` CLI와 함께 AI 스킬(`~/.agents/skills`, `~/.claude/skills`, 그리고 폴더가 있을 경우 `~/.codex/skills`·`~/.gemini/skills`)이 **자동으로 등록**됩니다. *(기존 훅·설정 파일 무변경)*
28
+
29
+ *(만약 `postinstall`을 차단하는 `pnpm` / `bun`을 쓰신다면 `pbridge skills install`을 한 번만 실행해 주세요.)*
30
+
31
+ ### 2단계 — 평소 쓰는 AI 프롬프트에 `peer-bridge`만 언급
32
+ 어느 프로젝트 폴더에서든 **Claude Code**, **Antigravity**, **Codex CLI**, **Gemini CLI**를 열고 자연어로 지시하세요:
33
+
34
+ > *"peer-bridge 써서 Antigravity로 `src/widget.mjs` 구현하고, Claude Code로 교차 리뷰해 줘."*
42
35
 
43
- ### 1. 독립 터미널 뷰어 실행 (데몬 미실행 시에도 호스트 세션 단독 조회 가능)
36
+ > *"peer-bridge 데몬 띄우고 Codex와 Gemini에게 성능·보안 점검을 병렬로 맡긴 뒤 종합해 줘."*
37
+
38
+ 데몬을 직접 띄워두거나 옆 터미널에서 실시간 진행 상황을 보고 싶을 때만 아래 명령을 쓰면 됩니다:
44
39
  ```bash
45
- pbridge tui # 현재 프로젝트 피어만 표시 ([p] 키로 전체/프로젝트 전환)
46
- pbridge tui --all # 전체 프로젝트 피어 표시 (현재 프로젝트 그룹 최상단 고정)
47
- pbridge tui --once # 1회 스냅샷 출력 (비대화형)
48
- pbridge tui --json # JSON 스냅샷 출력
49
- pbridge tui --tmux-split # tmux 분할 패인에서 실행 (macOS / Linux / WSL)
40
+ pbridge daemon start # 선택: 공유 로컬 데몬 직접 시작
41
+ pbridge tui # 선택: 전체 피어 실시간 모니터링 (LLM 토큰 소비 0)
50
42
  ```
51
43
 
52
- ### 2. 데몬 시작 및 멀티 AI 협업
53
- ```bash
54
- # 단일 공유 데몬 시작
55
- pbridge daemon start
56
- pbridge daemon status
44
+ ---
57
45
 
58
- # 현재 프로젝트에 헤드리스 워커 스폰
59
- pbridge spawn cc --name reviewer --no-mcp --mode headless
60
- pbridge spawn agy --name ui-builder --model flash --mode headless
46
+ ## 실제 동작 화면 및 워크플로우 가이드
47
+
48
+ ### 1. 설치 → 프롬프트 한 줄 → 자동 멀티 AI 교차 리뷰 (설정 0개)
49
+
50
+ 복잡한 CLI 플래그를 외우거나 `.mcp.json`을 편집할 필요가 없습니다. 프롬프트에 `peer-bridge`만 언급하면 자동 설치된 스킬이 작동해 데몬 실행, 프로젝트별 워커 스폰, 산출물 디스크 검증(`verifyArtifacts`), `cross-review` 승인 루프, 임시 워커 정리까지 한 번에 처리합니다.
51
+
52
+ ![설치 후 프롬프트 한 줄로 자동 교차 리뷰가 동작하는 화면](https://raw.githubusercontent.com/hwanyong/peer-bridge/main/docs/assets/03-live-workflow-walkthrough.png)
53
+
54
+ ```mermaid
55
+ sequenceDiagram
56
+ autonumber
57
+ participant User as 개발자 프롬프트
58
+ participant Agent as 메인 AI (Skill: peer-bridge)
59
+ participant Broker as pbridged (SQLite WAL)
60
+ participant Author as agy:ui-author (헤드리스)
61
+ participant Reviewer as cc:code-reviewer (헤드리스)
62
+ participant TUI as pbridge tui (0 LLM 토큰)
63
+
64
+ User->>Agent: "peer-bridge로 src/widget.mjs 만들고 Claude로 교차 리뷰해 줘"
65
+ Agent->>Broker: pbridge daemon start & workflow cross-review
66
+ Broker->>TUI: monitor.push (Working)
67
+ Broker->>Author: <task-contract> src/widget.mjs 구현
68
+ Author-->>Broker: src/widget.mjs 생성 + 요약
69
+ Broker->>Broker: verifyArtifacts(["src/widget.mjs"]) ✔
70
+ Broker->>Reviewer: <task-contract> src/widget.mjs 교차 리뷰
71
+ Reviewer-->>Broker: VERDICT: APPROVED
72
+ Broker->>TUI: monitor.push (Done · approved=true)
73
+ Broker-->>Agent: { status: "completed", rounds: 1, approved: true }
74
+ Agent-->>User: 완료! src/widget.mjs 구현 및 교차 리뷰 승인.
75
+ ```
61
76
 
62
- # 메시지 송신 (현재 프로젝트 피어로 자동 라우팅)
63
- pbridge send cc:reviewer "src/engine.mjs 엣지 케이스를 점검해 줘" --wait-reply
77
+ ### 2. 전체 프로젝트 · 멀티 런타임 실시간 통합 모니터 (`pbridge tui --all`)
64
78
 
65
- # 교차 프로젝트 메시지 송신
66
- pbridge send cc:other-project/reviewer "API 스키마 변경 내역을 공유해 줘"
79
+ `pbridge tui`는 **브로커 스폰 워커**(`[cc+]`, `[agy+]`, `[codex+]`, `[gemini+]`), **연결된 대화형 세션**, 그리고 **로컬 호스트 세션**(`~/.claude`, `~/.codex`, `~/.paseo`)을 한 화면에 보여줍니다. **LLM 토큰 소비는 `0`** 이며, `[x]` 종료 키는 `peer-bridge`가 스폰한 워커에만 작동해 사용자가 직접 띄운 세션을 보호합니다.
67
80
 
68
- # 산출물 검증을 포함한 구조화 작업 계약 위임
69
- pbridge task delegate cc:reviewer "단위 테스트 작성" --artifact test/engine.test.mjs --require-artifacts --wait
81
+ ![pbridge tui --all 멀티 런타임 통합 터미널 모니터](https://raw.githubusercontent.com/hwanyong/peer-bridge/main/docs/assets/01-tui-all-peers.png)
70
82
 
71
- # 자동 교차 리뷰 워크플로우 실행
72
- pbridge workflow cross-review \
73
- --author agy:ui-builder \
74
- --reviewer cc:reviewer \
75
- --prompt "CLI 렌더러 구현 및 교차 리뷰" \
76
- --rounds 2
83
+ ### 3. 단일 중앙 데몬 + 프로젝트별 스코프 분리 (`[p]` 키 전환)
77
84
 
78
- # 피어 조회 및 스폰 워커 종료
79
- pbridge peers # 현재 프로젝트 기준 (--all로 전체 조회)
80
- pbridge close cc:reviewer --archive
81
- ```
85
+ 머신 전체에서 **`pbridged` 데몬 단 1개**(`~/.peer-bridge`)만 공유하면서도 각 Git/프로젝트 폴더 안에서 실행하면 자동으로 해당 프로젝트 피어와 이름(`cc:reviewer`)을 격리합니다. 뷰어에서 **`p` 키** 하나로 `Current Project` ↔ `All Projects`를 즉시 전환할 수 있습니다.
86
+
87
+ ![pbridge tui 프로젝트별 스코프 분리 화면](https://raw.githubusercontent.com/hwanyong/peer-bridge/main/docs/assets/02-tui-project-scope.png)
88
+
89
+ ### 4. `peer-bridge` 멀티 에이전트로 완성한 실제 쇼케이스 (`examples/ansi-snake`)
90
+
91
+ [`examples/ansi-snake/`](examples/ansi-snake/)는 `peer-bridge` 멀티 에이전트 협업으로 제작·교차 리뷰한 Zero-Dependency Truecolor 터미널 스네이크 게임입니다(5개 테마 스테이지, 5종 아이템, 포털, 이동 장애물, 콤보, 방향성 파티클, 컬러 웨이브, 하이스코어, 오토파일럿 데모).
92
+
93
+ ![peer-bridge로 개발한 examples/ansi-snake Truecolor 터미널 게임](https://raw.githubusercontent.com/hwanyong/peer-bridge/main/docs/assets/04-ansi-snake-showcase.png)
82
94
 
83
- ### 3. 프로젝트별 런타임 어댑터 설치 (선택)
84
95
  ```bash
85
- pbridge install cc --project /path/to/repo
86
- pbridge install agy --project /path/to/repo
87
- pbridge install codex --project /path/to/repo
88
- pbridge install gemini --project /path/to/repo
89
- pbridge install all --project /path/to/repo --dry-run
96
+ node examples/ansi-snake/bin/ansi-snake.mjs --demo 400
97
+ npm --prefix examples/ansi-snake test
90
98
  ```
91
99
 
92
100
  ---
93
101
 
102
+ ## 왜 `peer-bridge`인가? (생태계 포지셔닝 및 장점 비교)
103
+
104
+ 멀티 에이전트 코딩 도구들은 크게 네 진영으로 나뉘며 각자 뚜렷한 트레이드오프가 있습니다. **단일 CLI 내장 팀 기능**은 같은 모델끼리 같은 맹점을 공유하는 *모델 단일문화* 한계가 있고, **MCP 기반 CLI 브릿지**는 호스트마다 `.mcp.json`을 설정해야 하며 매 턴 스키마 토큰을 소모합니다. **`tmux` 세션 매니저**는 사람이 직접 탭을 오가며 조종해야 하고 Windows 네이티브 지원이 어렵습니다. **풀스택 데스크톱/웹 ADE**는 강력하지만 가벼운 터미널 워크플로우에는 체급이 무겁습니다.
105
+
106
+ `peer-bridge`는 그 빈틈을 정확히 채웁니다 — **외부 의존성 0개, 설정 0개의 이기종 AI CLI 전용 초경량 UNIX 메시지 버스.**
107
+
108
+ | 비교 항목 | **`peer-bridge` (`pbridge`)** | 단일 CLI 내장 팀 *(Claude Agent Teams, Antigravity `/swarm`)* | MCP 기반 CLI 브릿지 *(`pal-mcp-server` / `clink`, `multicli`)* | `tmux` 세션 매니저 *(`Claude Squad`, `Agent Deck`)* | 풀스택 데스크톱 / 웹 ADE *(`Paseo`, `Superset`, `Overstory`)* |
109
+ | :--- | :--- | :--- | :--- | :--- | :--- |
110
+ | **핵심 아키텍처** | **Zero-Config 로컬 IPC + SQLite WAL UNIX 메시지 버스** | 단일 벤더 내장 팀원 버스 | 호스트별 MCP 서버 래퍼 | 사람 주도 `tmux` + 워크트리 탭 | 무거운 데몬 + 데스크톱/웹/모바일 GUI |
111
+ | **초기 설정 난이도** | **`npm i -g` 1줄 (스킬 자동 설치, 설정 수정 0개)** | 내장 / 환경변수 플래그 | CLI별 `.mcp.json` + 런타임 설정 | 바이너리 + `tmux` 설치 필수 | 앱 설치 + 데몬 + 프로필 구성 |
112
+ | **이기종 벤더 협업** (`cc` ↔ `agy` ↔ `codex` ↔ `gemini` ↔ `paseo`) | **완전 지원 — 단일 모델 맹점 돌파** | 불가 (단일 벤더/모델 전용) | 지원 | 사람이 패널 간 수동 복사·붙여넣기 | 지원 |
113
+ | **유휴 컨텍스트 / 스키마 토큰 오버헤드** | **0 토큰** (필요 시 CLI 스킬만 로드, MCP 선택형) | 낮음 (네이티브) | 높음 (매 턴 MCP 도구 스키마 주입) | 0 토큰 | 낮음~중간 |
114
+ | **검증된 엔지니어링 워크플로우** | **SHA-256 `verifyArtifacts` + 다중 라운드 `cross-review` · `fanout-join` 내장** | 프롬프트 기반 조율 | 주로 동기식 / 읽기 전용 자문 | 없음 (인간 수동 조종) | 주로 읽기 전용 자문 / 칸반 보드 라우팅 |
115
+ | **실시간 관제 (`0` LLM 토큰)** | **`pbridge tui`가 스폰 워커 + 패시브 `~/.claude`·`~/.codex`·`~/.paseo` 통합 표시** | 단일 CLI 범위 한정 | 로그 / 호스트 채팅 의존 | `tmux` 패널 (직접 띄운 세션만) | 풀 GUI 대시보드 |
116
+ | **의존성 및 데스크탑 OS 호환성** | **외부 npm 패키지 0개 (`node:sqlite`); macOS·Linux·Windows Named Pipe 네이티브** | 호스트 CLI 종속 | Python / Node 의존성 트리 | `tmux` 필수 (네이티브 Win32 불가) | Electron / Swift / Rust + 웹 스택 |
117
+ | **호스트 설정·세션 안전성** | **`settings.json`·훅 무수정; `[x]`는 `spawned` 피어만 종료** | 네이티브 | 호스트 MCP 설정 파일 변경 | `tmux` 패널 제어 | 별도 앱 상태 관리 |
118
+
119
+ ### 언제 `peer-bridge`를 선택하면 좋은가요?
120
+
121
+ - **`peer-bridge`가 최적일 때**: 터미널 중심으로 작업하면서 Claude · Antigravity · Codex · Gemini가 실제 코드를 구현·교차 리뷰하고 디스크 산출물을 SHA-256으로 검증하게 만들고 싶지만, `.mcp.json` 관리나 무거운 데스크톱 앱 설치는 원치 않을 때.
122
+ - **단일 CLI 내장 서브에이전트 / Agent Teams가 적합할 때**: 단일 모델 계열만으로 충분한 짧은 보조 작업을 현재 CLI 안에서 빠르게 처리할 때.
123
+ - **풀스택 ADE(예: Paseo)와 병행할 때**: 모바일 원격 제어, 클라우드 릴레이, 시각적 Git 워크트리 GUI가 필요할 때 — `peer-bridge`는 내장 `paseo` 런타임 어댑터를 제공하므로 두 도구가 충돌 없이 함께 동작합니다.
124
+
125
+ ---
126
+
94
127
  ## 데스크탑 OS 지원 현황
95
128
 
96
- | 운영체제 | 데몬 (`pbridged`) | CLI & 헤드리스 워커 | 독립 뷰어 (`pbridge tui`) | `tmux` 부가 옵션 |
97
- | :--- | :---: | :---: | :---: | :---: |
98
- | **macOS** | Unix Socket (`broker.sock`) | 완전 지원 | 완전 지원 | 지원 |
99
- | **Linux** | Unix Socket (`broker.sock`) | 완전 지원 | 완전 지원 | 지원 |
100
- | **Windows 10/11** | Named Pipe (`\\.\pipe\peer-bridge-*`) | 완전 지원 (`.cmd`/`.exe` 자동 처리) | 완전 지원 (Windows Terminal / PS) | WSL2 전용 |
129
+ | 운영체제 | IPC 전송 계층 (`pbridged`) | CLI & 헤드리스 워커 | 독립 뷰어 (`pbridge tui`) | `tmux` 부가 옵션 |
130
+ | :--- | :--- | :---: | :---: | :---: |
131
+ | **macOS** | Unix Socket (`~/.peer-bridge/broker.sock`) | 완전 지원 | 완전 지원 | 지원 (`--tmux-split`, `--tmux-popup`) |
132
+ | **Linux** | Unix Socket (`~/.peer-bridge/broker.sock`) | 완전 지원 | 완전 지원 | 지원 (`--tmux-split`, `--tmux-popup`) |
133
+ | **Windows 10 / 11** | Named Pipe (`\\.\pipe\peer-bridge-<hash>`) | 완전 지원 (`.cmd`/`.exe`/`.mjs` 자동 처리) | 완전 지원 (Windows Terminal / PowerShell) | WSL2 전용 |
101
134
 
102
135
  ---
103
136
 
104
- ## 예제 쇼케이스
137
+ ## 자주 묻는 질문 (FAQ)
138
+
139
+ ### 사용하기 전에 `.mcp.json`이나 훅(hooks)을 따로 설정해야 하나요?
140
+ 아니요. `npm install -g peer-bridge` 실행 시 전역 AI 스킬 경로(`~/.agents/skills/peer-bridge`, `~/.claude/skills/peer-bridge` 등)에 CLI 직결형 `SKILL.md`가 자동 설치됩니다. 별도 설정 없이 프롬프트에 `peer-bridge`만 언급하면 바로 동작합니다.
141
+
142
+ ### `pbridge tui` 독립 뷰어는 LLM API 토큰을 추가로 소비하나요?
143
+ 아니요. **토큰 소비는 `0`** 입니다. 로컬 브로커의 IPC 이벤트와 호스트 메타데이터 파일만 읽기 전용으로 조회합니다.
144
+
145
+ ### 기존 Claude Code 훅, `/agents`, 네이티브 `SendMessage`와 충돌하지 않나요?
146
+ 충돌하지 않습니다. 기본 설치는 `~/.claude/settings.json`이나 훅 파일을 전혀 건드리지 않습니다.
105
147
 
106
- [`examples/ansi-snake/`](examples/ansi-snake/)는 `peer-bridge` 멀티 에이전트 오케스트레이션으로 제작된 Zero-Dependency Truecolor 터미널 스네이크 게임 패키지입니다(5개 테마 스테이지, 5종 아이템, 포털, 이동 장애물, 콤보, 파티클, 컬러 웨이브, 하이스코어, 오토파일럿 데모).
148
+ ### 데몬 1개로 여러 프로젝트를 동시에 운용할 때 피어 이름이 겹치지 않나요?
149
+ 겹치지 않습니다. `pbridged`는 Git/프로젝트 루트(`cwd`) 단위로 피어 이름과 라우팅을 격리하므로 여러 프로젝트에서 동시에 `cc:reviewer`를 스폰해 운영할 수 있으며, 프로젝트 간 통신이 필요할 때만 `cc:project-b/reviewer` 형식을 사용합니다.
150
+
151
+ ---
152
+
153
+ ## 고급 / 내부 레퍼런스
154
+
155
+ <details>
156
+ <summary>CLI 세부 명령어 레퍼런스 (AI 스킬이 내부적으로 호출하는 명령 · 스크립팅용)</summary>
107
157
 
108
158
  ```bash
109
- node examples/ansi-snake/bin/ansi-snake.mjs --demo 400
110
- npm --prefix examples/ansi-snake test
159
+ # 데몬 및 스킬 관리
160
+ pbridge daemon start | status | stop
161
+ pbridge skills status | install | uninstall
162
+
163
+ # 독립 TUI 뷰어
164
+ pbridge tui # 현재 프로젝트 기준 ([p] 키로 전체/프로젝트 전환)
165
+ pbridge tui --all # 전체 프로젝트 보기 (현재 프로젝트 최상단 고정)
166
+ pbridge tui --once | --json # 1회 스냅샷 / JSON 출력
167
+
168
+ # 수동 스폰 · 메시지 · 워크플로우 호출
169
+ pbridge spawn agy --name ui-author --model flash --mode headless
170
+ pbridge spawn cc --name code-reviewer --no-mcp --mode headless
171
+ pbridge send cc:code-reviewer "src/engine.mjs 엣지 케이스 점검" --wait-reply
172
+ pbridge send cc:other-project/code-reviewer "API 스키마 변경 공유"
173
+ pbridge task delegate agy:ui-author "src/widget.mjs 구현" --artifact src/widget.mjs --require-artifacts --wait
174
+ pbridge workflow cross-review --author agy:ui-author --reviewer cc:code-reviewer --prompt "구현 및 리뷰" --rounds 2
175
+ pbridge workflow fanout --workers agy:ui-author,codex:perf-auditor --prompt "성능 점검" --join cc:code-reviewer
176
+ pbridge peers # 현재 프로젝트 기준 (--all로 전체 조회)
177
+ pbridge close agy:ui-author --archive
111
178
  ```
112
179
 
113
- ---
180
+ </details>
181
+
182
+ <details>
183
+ <summary>고급(선택): 대화형 TUI 간 실시간 Push 훅 & MCP 서버 설치 (<code>pbridge install</code>)</summary>
114
184
 
115
- ## 테스트 실행
185
+ 이미 켜져 있는 **두 개의 대화형 사용자 터미널 창**끼리 실시간 Push(MCP `claude/channel` / 훅 Wakeup)를 주고받고 싶을 때만 선택적으로 사용하는 고급 옵션입니다. 기본값이 `--project` 스코프라 전역 설정을 건드리지 않습니다(`.bak` 자동 백업):
116
186
 
117
187
  ```bash
118
- npm test # 단위·통합 테스트 (19개)
119
- npm --prefix examples/ansi-snake test # 예제 게임 테스트 (9개)
188
+ pbridge install all --project /path/to/repo --dry-run
120
189
  ```
121
190
 
122
- ---
191
+ 제공 MCP 도구 (`pbridge-mcp`, 9종): `list_peers`, `send_peer_message`, `wait_peer_messages`, `spawn_peer`, `close_peer`, `delegate_task`, `complete_task`, `get_task_status`, `run_workflow`.
192
+
193
+ </details>
123
194
 
124
- ## 설계 문서
195
+ <details>
196
+ <summary>개발 · 테스트 · 설계 문서</summary>
197
+
198
+ ```bash
199
+ git clone https://github.com/hwanyong/peer-bridge.git
200
+ cd peer-bridge
201
+ npm test # 코어 단위·통합 테스트 (20개)
202
+ npm --prefix examples/ansi-snake test # 쇼케이스 게임 테스트 (9개)
203
+ ```
125
204
 
126
205
  - [`docs/01-feasibility.md`](docs/01-feasibility.md) — 런타임 확장 인터페이스 및 메시지 전달 메커니즘 분석
127
206
  - [`docs/02-architecture.md`](docs/02-architecture.md) — 로컬 브로커, SQLite WAL 상태 및 오케스트레이터 아키텍처
128
207
  - [`docs/03-interface-spec.md`](docs/03-interface-spec.md) — 단일 주소 해석, 루프 가드 및 소유권 보호 명세
129
208
 
209
+ </details>
210
+
130
211
  ---
131
212
 
132
213
  ## 라이선스
package/README.md CHANGED
@@ -1,160 +1,254 @@
1
- # peer-bridge
1
+ # peer-bridge (`pbridge`)
2
2
 
3
3
  **English** | [한국어](README.ko.md)
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/peer-bridge?color=cb3837&logo=npm)](https://www.npmjs.com/package/peer-bridge)
6
+ [![CI](https://github.com/hwanyong/peer-bridge/actions/workflows/ci.yml/badge.svg)](https://github.com/hwanyong/peer-bridge/actions/workflows/ci.yml)
5
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
8
  [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D22.13-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
7
9
  [![Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](package.json)
8
10
 
9
- A **zero-dependency** local message broker (`pbridged`), multi-AI orchestrator (`cross-review` / `fanout-join`), MCP/Channel server (`pbridge-mcp`), and **zero-LLM-token standalone terminal viewer** (`pbridge tui`) that bridges **Claude Code (`cc`)**, **Google Antigravity (`agy`)**, **Codex CLI (`codex`)**, **Gemini CLI (`gemini`)**, and **Paseo (`paseo`)** sessions across projects.
11
+ > **No MCP Bloat. No Heavy Desktop GUI. Zero-Config UNIX Message Bus Across AI Coding CLIs.**
12
+
13
+ **`peer-bridge` (`pbridge`)** is an open-source, zero-dependency **cross-CLI UNIX message bus, multi-agent workflow orchestrator, optional MCP server, and zero-LLM-token terminal UI (`TUI`) monitor** bridging **Claude Code**, **Google Antigravity**, **OpenAI Codex CLI**, **Google Gemini CLI**, and **Paseo** on **macOS, Linux, and Windows**.
14
+
15
+ **Install once (`npm install -g peer-bridge`), configure nothing.** The universal `peer-bridge` AI skill is automatically installed into your coding CLIs without touching `settings.json`, hooks, or `.mcp.json` — burning **0 idle context tokens** on MCP tool schemas. Simply mention **`peer-bridge`** in any prompt to break single-model blind spots (*model monoculture*) with multi-round cross-reviews, verified disk artifacts, and parallel fan-out audits.
10
16
 
11
17
  ---
12
18
 
13
- ## Standalone All-Peer Terminal Viewer (`pbridge tui`)
19
+ ## Quickstart (2 Steps, Zero Configuration)
20
+
21
+ Requires **Node.js `>= 22.13.0`** (uses built-in `node:sqlite`, zero external npm dependencies).
22
+
23
+ ### Step 1 — Install Once
24
+ ```bash
25
+ npm install -g peer-bridge
26
+ ```
27
+ That automatically installs both the `pbridge` CLI and the `peer-bridge` AI skill (`~/.agents/skills`, `~/.claude/skills`, and `~/.codex/skills` / `~/.gemini/skills` when present) — **zero config files to edit, zero hooks modified**.
14
28
 
15
- Monitor broker-registered, dynamically spawned, and passively discovered host AI sessions side-by-side in real time with **zero LLM token overhead** and **ownership-protected stop** (`[x]` only stops `peer-bridge`-spawned workers; external host sessions are read-only).
29
+ *(Using `pnpm` or `bun`, which skip `postinstall` scripts? Run `pbridge skills install` once.)*
16
30
 
17
- ```text
18
- peer-bridge v0.6.0 daemon online · 1 workflow [all projects · all]
19
- 1 awaiting input · 2 working · 2 completed · 1 stopped · 2 spawned
31
+ ### Step 2 — Just Mention `peer-bridge` in Any AI Prompt
32
+ Open **Claude Code**, **Antigravity**, **Codex CLI**, or **Gemini CLI** in any project and ask in plain language:
20
33
 
21
- ~/projects/webapp
22
- > * [cc+] reviewer Working · Tool: Read src/engine.mjs 4s
23
- • [agy+] ui-builder Working · Tool: Write src/renderer.mjs 9s
24
- • [cc] webapp-main Done · Merged layout PR and verified tests 3m
34
+ > *"Use peer-bridge: implement `src/widget.mjs` with Antigravity and cross-review it with Claude Code."*
25
35
 
26
- ~/projects/api-server
27
- * [cc] api-main Needs input · Waiting for schema migration confirmation 12m
28
- • [codex] migration-bot Done · Audited SQLite WAL indices 18m
29
- • [gemini] docs-helper Stopped · stopped 2h
36
+ > *"Start peer-bridge and fan out a security & performance audit across Codex and Gemini, then summarize the findings."*
30
37
 
31
- [↑/↓,j/k] Navigate [x] Stop spawned [p] Project/All [f] Runtime [a] Active [r] Refresh [q] Quit
38
+ Prefer starting the daemon yourself or watching live progress in a side terminal?
39
+ ```bash
40
+ pbridge daemon start # optional: start the shared background broker yourself
41
+ pbridge tui # optional: watch all peers live (0 LLM tokens)
32
42
  ```
33
43
 
34
44
  ---
35
45
 
36
- ## Key Features
37
-
38
- - **Zero External Dependencies**: Pure Node.js `>=22.13` ESM + built-in `node:sqlite` WAL storage + Unix Domain Sockets / Windows Named Pipes.
39
- - **Single Central Daemon + Per-Project Scoping**:
40
- - Run one shared `pbridged` daemon (`~/.peer-bridge`) across all repositories.
41
- - Inside any project directory, `pbridge tui`, `pbridge peers`, `pbridge task list`, and `pbridge workflow list` automatically scope to the current Git/project root.
42
- - Spawn identically named workers (e.g., `cc:reviewer`) in multiple projects simultaneously with zero collisions; route locally with `cc:reviewer` or cross-project with `cc:other-project/reviewer`.
43
- - Press **`p`** inside `pbridge tui` (or pass `--all`) to toggle instantly between `Current Project` and `All Projects`.
44
- - **Non-Invasive Runtime Integration**:
45
- - Preserves Claude Code's native `SendMessage` and `~/.claude/teams` / `~/.claude/sessions` workflows via passthrough hooks.
46
- - Supports real-time MCP `claude/channel` push, Antigravity hooks + `pbridge wait` reactive wakeup, and headless JSON-stream workers (`cc`, `agy`, `codex`, `gemini`, `paseo`).
47
- - **Task Contracts & Multi-AI Orchestration**:
48
- - Structured `<task-contract>` delegation with expected artifact verification (`verifyArtifacts`) and automatic completion callbacks.
49
- - Built-in `cross-review` (iterative author/reviewer approval loop) and `fanout-join` (parallel multi-worker fan-out with synthesis).
50
- - **Ownership Safety Guards**:
51
- - User-opened `origin="attached"` and passive `origin="host"` sessions cannot be destructively closed without explicit override.
52
- - Built-in loop guards (`max_hops`, `reply_expected=false`) prevent infinite agent reply loops.
46
+ ## Visual Walkthrough: How `peer-bridge` Works in Action
47
+
48
+ ### 1. Install → Prompt → Automated Multi-Agent Cross-Review (Zero Config)
49
+
50
+ You never need to memorize CLI flags or edit `.mcp.json`. Mention `peer-bridge` in your prompt and your agent activates the auto-installed skill to start `pbridged`, spawn project-scoped workers, verify disk artifacts (`verifyArtifacts`), run the `cross-review` loop, and archive ephemeral workers:
51
+
52
+ ![Zero-config npm install to prompt-driven cross-review walkthrough](https://raw.githubusercontent.com/hwanyong/peer-bridge/main/docs/assets/03-live-workflow-walkthrough.png)
53
+
54
+ ```mermaid
55
+ sequenceDiagram
56
+ autonumber
57
+ participant User as Developer Prompt
58
+ participant Agent as Primary AI (Skill: peer-bridge)
59
+ participant Broker as pbridged (SQLite WAL)
60
+ participant Author as agy:ui-author (Headless)
61
+ participant Reviewer as cc:code-reviewer (Headless)
62
+ participant TUI as pbridge tui (0 LLM Tokens)
63
+
64
+ User->>Agent: "Use peer-bridge: build src/widget.mjs & cross-review with Claude"
65
+ Agent->>Broker: pbridge daemon start & workflow cross-review
66
+ Broker->>TUI: monitor.push (Working)
67
+ Broker->>Author: <task-contract> Implement src/widget.mjs
68
+ Author-->>Broker: Writes src/widget.mjs + summary
69
+ Broker->>Broker: verifyArtifacts(["src/widget.mjs"]) ✔
70
+ Broker->>Reviewer: <task-contract> Review src/widget.mjs
71
+ Reviewer-->>Broker: VERDICT: APPROVED
72
+ Broker->>TUI: monitor.push (Done · approved=true)
73
+ Broker-->>Agent: { status: "completed", rounds: 1, approved: true }
74
+ Agent-->>User: Done! src/widget.mjs implemented & approved.
75
+ ```
53
76
 
54
- ---
77
+ ### 2. Monitor Every AI Agent Across All Projects (`pbridge tui --all`)
55
78
 
56
- ## Quickstart
79
+ `pbridge tui` merges **broker-spawned workers** (`[cc+]`, `[agy+]`, `[codex+]`, `[gemini+]`), **attached interactive sessions**, and **passively discovered host sessions** (`~/.claude`, `~/.codex`, `~/.paseo`) into one CJK-aligned terminal dashboard. Monitoring uses **0 LLM tokens** (local IPC + read-only filesystem metadata only), and `[x]` only terminates `peer-bridge`-spawned workers while protecting your live interactive sessions.
57
80
 
58
- ### Requirements
59
- - **Node.js `>= 22.13.0`** (uses built-in `node:sqlite`)
81
+ ![pbridge tui --all multi-runtime terminal monitor](https://raw.githubusercontent.com/hwanyong/peer-bridge/main/docs/assets/01-tui-all-peers.png)
60
82
 
61
- ### Install / Link CLI
62
- ```bash
63
- git clone <your-repo-url> peer-bridge
64
- cd peer-bridge
65
- npm link # exposes pbridge, pbridged, pbridge-mcp, pbridge-tui on PATH
66
- # Or run directly without linking:
67
- node bin/pbridge.mjs --help
68
- ```
83
+ ### 3. Single Central Daemon, Per-Project Isolation (`[p]` Toggle)
84
+
85
+ Run **one** central `pbridged` daemon (`~/.peer-bridge`) across your machine while keeping every repository isolated. Running `pbridge tui` inside a Git repository automatically scopes the view and peer names (`cc:reviewer`) to that project; press **`p`** inside the viewer (or pass `--all`) to toggle between **Current Project** and **All Projects**.
86
+
87
+ ![pbridge tui per-project scoped view](https://raw.githubusercontent.com/hwanyong/peer-bridge/main/docs/assets/02-tui-project-scope.png)
88
+
89
+ ### 4. Real-World Showcase Built End-to-End with `peer-bridge`
90
+
91
+ [`examples/ansi-snake/`](examples/ansi-snake/) is a playable, zero-dependency Truecolor terminal Snake game (5 themed stages, 5 item types, portals, moving hazards, combos, directional particle bursts, head-to-tail color waves, high-score persistence, and autopilot) built and cross-reviewed by `peer-bridge` agents.
92
+
93
+ ![examples/ansi-snake truecolor terminal game built with peer-bridge](https://raw.githubusercontent.com/hwanyong/peer-bridge/main/docs/assets/04-ansi-snake-showcase.png)
69
94
 
70
- ### 1. Launch the Standalone Viewer (Works Even Without Daemon)
71
95
  ```bash
72
- pbridge tui # Scoped to current project ([p] toggles Project / All)
73
- pbridge tui --all # Show all projects (current project pinned on top)
74
- pbridge tui --once # Single non-interactive snapshot
75
- pbridge tui --json # Machine-readable JSON snapshot
76
- pbridge tui --tmux-split # Open inside a tmux split pane (macOS / Linux / WSL)
96
+ node examples/ansi-snake/bin/ansi-snake.mjs --demo 400
97
+ npm --prefix examples/ansi-snake test
77
98
  ```
78
99
 
79
- ### 2. Start the Local Broker & Collaborate Across Runtimes
80
- ```bash
81
- # Start the single shared daemon
82
- pbridge daemon start
83
- pbridge daemon status
100
+ ---
84
101
 
85
- # Spawn headless workers in the current project
86
- pbridge spawn cc --name reviewer --no-mcp --mode headless
87
- pbridge spawn agy --name ui-builder --model flash --mode headless
102
+ ## System Architecture
103
+
104
+ ```mermaid
105
+ flowchart LR
106
+ subgraph Clients["AI Coding Agents (Auto-Installed CLI Skill)"]
107
+ CC["Claude Code (cc)"]
108
+ AGY["Google Antigravity (agy)"]
109
+ CDX["OpenAI Codex CLI (codex)"]
110
+ GEM["Google Gemini CLI (gemini)"]
111
+ PAS["Paseo (paseo)"]
112
+ end
113
+
114
+ subgraph Daemon["Single Central Daemon (pbridged)"]
115
+ IPC["Unix Domain Socket (macOS/Linux)<br/>Windows Named Pipe (win32)"]
116
+ ROUTER["Project-Scoped Resolver<br/>& Loop Guard (max_hops)"]
117
+ ORCH["Workflow Orchestrator<br/>cross-review · fanout-join"]
118
+ DB[("node:sqlite WAL<br/>peers · messages · tasks · workflows")]
119
+ end
120
+
121
+ TUI["Standalone Viewer (pbridge tui)<br/>0 LLM Tokens · Read-Only Host Discovery"]
122
+
123
+ CC <--> IPC
124
+ AGY <--> IPC
125
+ CDX <--> IPC
126
+ GEM <--> IPC
127
+ PAS <--> IPC
128
+ IPC <--> ROUTER
129
+ ROUTER <--> ORCH
130
+ ROUTER <--> DB
131
+ IPC -. "monitor.subscribe" .-> TUI
132
+ ```
88
133
 
89
- # Send messages (automatically scoped to the current project)
90
- pbridge send cc:reviewer "Review src/engine.mjs for edge cases" --wait-reply
134
+ ---
91
135
 
92
- # Cross-project messaging when needed
93
- pbridge send cc:other-project/reviewer "Share the API schema diff"
136
+ ## Why `peer-bridge`? (Ecosystem Positioning & Comparison)
94
137
 
95
- # Delegate a structured task with artifact verification
96
- pbridge task delegate cc:reviewer "Write unit tests" --artifact test/engine.test.mjs --require-artifacts --wait
138
+ Multi-agent coding tools generally fall into four buckets — each with a trade-off. **Native single-CLI teams** suffer from *model monoculture* (one vendor reviewing its own blind spots). **MCP-only CLI bridges** require editing `.mcp.json` per host and inject tool schemas into every turn's context window. **`tmux` session switchers** keep humans manually juggling panes and rarely run natively on Windows. **Full-stack desktop/web ADEs** are powerful platforms, but heavy when you just want a fast terminal workflow.
97
139
 
98
- # Run an automated cross-review workflow
99
- pbridge workflow cross-review \
100
- --author agy:ui-builder \
101
- --reviewer cc:reviewer \
102
- --prompt "Implement and review the CLI renderer" \
103
- --rounds 2
140
+ `peer-bridge` fills the lightweight gap: **a zero-dependency, zero-config UNIX message bus across AI CLIs.**
104
141
 
105
- # List peers & gracefully close spawned workers
106
- pbridge peers # Current project only (--all for all projects)
107
- pbridge close cc:reviewer --archive
108
- ```
142
+ | Capability | **`peer-bridge` (`pbridge`)** | Native Single-CLI Teams *(Claude Agent Teams, Antigravity `/swarm`)* | MCP-Based CLI Bridges *(`pal-mcp-server` / `clink`, `multicli`)* | `tmux` Session Switchers *(`Claude Squad`, `Agent Deck`)* | Full-Stack Desktop / Web ADEs *(`Paseo`, `Superset`, `Overstory`)* |
143
+ | :--- | :--- | :--- | :--- | :--- | :--- |
144
+ | **Core Architecture** | **Zero-config local IPC + SQLite WAL UNIX message bus** | Built-in intra-vendor teammate bus | Per-host MCP server wrappers | Human-driven `tmux` + worktree tabs | Heavy daemon + Desktop/Web/Mobile GUI |
145
+ | **Setup Friction** | **`npm i -g` (1 command, auto-skill, 0 config edits)** | Built-in / env flag | Per-CLI `.mcp.json` + runtime setup | Binary + `tmux` dependency | App install + daemon + profile setup |
146
+ | **Cross-Vendor Collaboration** (`cc` ↔ `agy` ↔ `codex` ↔ `gemini` ↔ `paseo`) | **Yes — breaks single-model blind spots** | No (single vendor / model family only) | Yes | Manual human copy-paste across panes | Yes |
147
+ | **Idle Context / Schema Token Overhead** | **0 tokens** (CLI skill loaded on-demand; MCP optional) | Low (native) | High (MCP tool schemas injected every turn) | 0 tokens | Low–Medium |
148
+ | **Verified Engineering Workflows** | **Built-in SHA-256 `verifyArtifacts` + multi-round `cross-review` & `fanout-join`** | Prompt-only coordination | Mostly synchronous / read-only advice | None (manual human steering) | Mostly advisor / Kanban ticket routing |
149
+ | **Live Monitoring (`0` LLM Tokens)** | **`pbridge tui` merges spawned + passive `~/.claude`, `~/.codex`, `~/.paseo` sessions** | Single-CLI scope only | Logs / host chat only | `tmux` panes (spawned sessions only) | Full GUI dashboard |
150
+ | **Dependencies & Native OS Support** | **0 npm deps (`node:sqlite`); native macOS, Linux & Windows Named Pipes** | Host CLI | Python / Node dependency trees | Requires `tmux` (no native Win32) | Electron / Swift / Rust + Web stack |
151
+ | **Host Config & Session Safety** | **Never edits `settings.json`/hooks; `[x]` only closes `spawned` peers** | Native | Modifies host MCP configs | Controls `tmux` panes | Isolated app state |
109
152
 
110
- ### 3. Optional Project-Scoped Runtime Adapters
111
- `pbridge install` defaults to **`--project` scope** (non-destructive JSON/TOML merge with `.bak` backups) so global user configs stay untouched:
112
- ```bash
113
- pbridge install cc --project /path/to/repo
114
- pbridge install agy --project /path/to/repo
115
- pbridge install codex --project /path/to/repo
116
- pbridge install gemini --project /path/to/repo
117
- pbridge install all --project /path/to/repo --dry-run
118
- ```
153
+ ### When to Choose `peer-bridge` (and When to Combine It)
154
+
155
+ - **Choose `peer-bridge` when** you live in the terminal, want heterogeneous models (Claude + Antigravity + Codex + Gemini) to implement and cross-review real code with SHA-256 verified disk artifacts, and refuse to maintain `.mcp.json` configs, hooks, or heavy desktop apps.
156
+ - **Use native subagents / Agent Teams when** a quick bounded sub-task only needs one model family inside a single CLI.
157
+ - **Combine with a full-stack ADE (like Paseo) when** you want mobile remote control, cloud relays, or visual Git worktree GUIs — `peer-bridge` includes a built-in `paseo` runtime adapter so both work together cleanly.
119
158
 
120
159
  ---
121
160
 
122
161
  ## Desktop OS Compatibility
123
162
 
124
- | OS | Daemon (`pbridged`) | CLI & Headless Workers | Standalone TUI (`pbridge tui`) | Optional `tmux` Modes |
125
- | :--- | :---: | :---: | :---: | :---: |
126
- | **macOS** | Unix Socket (`broker.sock`) | Full | Full | Supported |
127
- | **Linux** | Unix Socket (`broker.sock`) | Full | Full | Supported |
128
- | **Windows 10/11** | Named Pipe (`\\.\pipe\peer-bridge-*`) | Full (`.cmd`/`.exe` aware) | Full (Windows Terminal / PS) | WSL2 only |
163
+ | Operating System | IPC Transport (`pbridged`) | CLI & Headless Workers | Standalone Viewer (`pbridge tui`) | Optional `tmux` Modes |
164
+ | :--- | :--- | :---: | :---: | :---: |
165
+ | **macOS** | Unix Domain Socket (`~/.peer-bridge/broker.sock`) | Full | Full | Supported (`--tmux-split`, `--tmux-popup`) |
166
+ | **Linux** | Unix Domain Socket (`~/.peer-bridge/broker.sock`) | Full | Full | Supported (`--tmux-split`, `--tmux-popup`) |
167
+ | **Windows 10 / 11** | Named Pipe (`\\.\pipe\peer-bridge-<hash>`) | Full (`.cmd`/`.exe`/`.mjs` aware) | Full (Windows Terminal / PowerShell) | WSL2 only |
129
168
 
130
169
  ---
131
170
 
132
- ## Showcase Example
171
+ ## Frequently Asked Questions (FAQ)
172
+
173
+ ### Do I need to configure `.mcp.json` or hooks before using `peer-bridge`?
174
+ No. `npm install -g peer-bridge` automatically installs a CLI-first `SKILL.md` into your global AI skill folders (`~/.agents/skills/peer-bridge`, `~/.claude/skills/peer-bridge`, plus `~/.codex/skills` and `~/.gemini/skills` if present). Just mention `peer-bridge` in your AI prompt — zero config files, hooks, or MCP setup required.
133
175
 
134
- [`examples/ansi-snake/`](examples/ansi-snake/) contains a complete, zero-dependency Truecolor terminal Snake game (5 themed stages, 5 item types, portals, moving hazards, combos, directional particles, color waves, persistent high scores, and autopilot demo) built end-to-end using `peer-bridge` multi-agent orchestration.
176
+ ### Does the `pbridge tui` terminal viewer consume extra LLM API tokens?
177
+ No. `pbridge tui` consumes **zero LLM tokens**. It subscribes to lightweight local IPC state events from `pbridged` and reads passive host session metadata files (`~/.claude/jobs/*/state.json`, `~/.claude/sessions/*.json`, `~/.codex/sessions/**/*.jsonl`) directly via `node:fs`.
178
+
179
+ ### Will `peer-bridge` interfere with my existing Claude Code hooks, `/agents`, or `SendMessage`?
180
+ No. The default zero-config installation **never touches `~/.claude/settings.json` or any hooks**. Even if you later opt into the optional project-scoped push-hook adapter (`pbridge install cc --project .`), it passes through all native Claude Code sessions/teams untouched.
181
+
182
+ ### Can one `pbridged` daemon manage multiple projects without name collisions?
183
+ Yes. `pbridged` scopes active peer uniqueness and routing by Git/project root (`cwd`). You can run `cc:reviewer` in `project-a` and `cc:reviewer` in `project-b` simultaneously on one daemon without collisions. Commands run inside `project-a` resolve `cc:reviewer` to `project-a`, while cross-project messages use `<runtime>:<project>/<name>` (e.g., `cc:project-b/reviewer`).
184
+
185
+ ### Does `peer-bridge` work natively on Windows, macOS, and Linux?
186
+ Yes. The core daemon (`pbridged`), CLI (`pbridge`), headless workers, MCP server (`pbridge-mcp`), and standalone TUI viewer (`pbridge tui`) run natively on macOS, Linux, and Windows 10/11 (Node.js `>= 22.13.0`). On Windows, `peer-bridge` automatically switches from Unix domain sockets to deterministic Windows Named Pipes (`\\.\pipe\peer-bridge-*`) and handles `.cmd`/`.exe`/`.mjs` binary execution. Only optional `tmux` pane flags require macOS, Linux, or WSL2.
187
+
188
+ ---
189
+
190
+ ## Under the Hood & Advanced Options
191
+
192
+ <details>
193
+ <summary>CLI Reference (What the AI Skill Runs Under the Hood / Manual Scripting)</summary>
135
194
 
136
195
  ```bash
137
- node examples/ansi-snake/bin/ansi-snake.mjs --demo 400
138
- npm --prefix examples/ansi-snake test
196
+ # Daemon & Skill management
197
+ pbridge daemon start | status | stop
198
+ pbridge skills status | install | uninstall
199
+
200
+ # Standalone TUI monitor
201
+ pbridge tui # Current project only ([p] toggles Project / All)
202
+ pbridge tui --all # All projects (current project pinned on top)
203
+ pbridge tui --once | --json # Non-interactive snapshot / JSON
204
+
205
+ # Spawn, message, delegate, and orchestrate manually
206
+ pbridge spawn agy --name ui-author --model flash --mode headless
207
+ pbridge spawn cc --name code-reviewer --no-mcp --mode headless
208
+ pbridge send cc:code-reviewer "Audit src/engine.mjs" --wait-reply
209
+ pbridge send cc:other-project/code-reviewer "Share API schema diff"
210
+ pbridge task delegate agy:ui-author "Create src/widget.mjs" --artifact src/widget.mjs --require-artifacts --wait
211
+ pbridge workflow cross-review --author agy:ui-author --reviewer cc:code-reviewer --prompt "Build & review" --rounds 2
212
+ pbridge workflow fanout --workers agy:ui-author,codex:perf-auditor --prompt "Audit repo" --join cc:code-reviewer
213
+ pbridge peers # Current project only (--all for all projects)
214
+ pbridge close agy:ui-author --archive
139
215
  ```
140
216
 
141
- ---
217
+ </details>
218
+
219
+ <details>
220
+ <summary>Advanced (Optional): Real-Time Push Hooks & MCP Server (<code>pbridge install</code>)</summary>
142
221
 
143
- ## Testing
222
+ Only needed if you want two **already-open interactive human TUI sessions** (e.g., a live Claude Code terminal + a live Antigravity terminal) to push-wake each other mid-conversation via MCP `claude/channel` or hooks. Defaults to `--project` scope (non-destructive merge with `.bak` backups) so global user configs stay untouched:
144
223
 
145
224
  ```bash
146
- npm test # Unit & integration test suite (19 tests)
147
- npm --prefix examples/ansi-snake test # Showcase game test suite (9 tests)
225
+ pbridge install cc --project /path/to/repo
226
+ pbridge install agy --project /path/to/repo
227
+ pbridge install codex --project /path/to/repo
228
+ pbridge install gemini --project /path/to/repo
229
+ pbridge install all --project /path/to/repo --dry-run
148
230
  ```
149
231
 
150
- ---
232
+ Exposed MCP tools (`pbridge-mcp`, 9 tools): `list_peers`, `send_peer_message`, `wait_peer_messages`, `spawn_peer`, `close_peer`, `delegate_task`, `complete_task`, `get_task_status`, `run_workflow`.
151
233
 
152
- ## Architecture Docs
234
+ </details>
235
+
236
+ <details>
237
+ <summary>Development, Testing & Architecture Docs</summary>
238
+
239
+ ```bash
240
+ git clone https://github.com/hwanyong/peer-bridge.git
241
+ cd peer-bridge
242
+ npm test # Core unit & integration test suite (20 tests)
243
+ npm --prefix examples/ansi-snake test # Showcase game test suite (9 tests)
244
+ ```
153
245
 
154
246
  - [`docs/01-feasibility.md`](docs/01-feasibility.md) — Runtime extension interfaces & delivery mechanisms
155
247
  - [`docs/02-architecture.md`](docs/02-architecture.md) — Local broker, SQLite WAL state, and orchestrator design
156
248
  - [`docs/03-interface-spec.md`](docs/03-interface-spec.md) — Unified addressing, loop guards, and ownership safety rules
157
249
 
250
+ </details>
251
+
158
252
  ---
159
253
 
160
254
  ## License
@@ -8,7 +8,8 @@ description: >-
8
8
  # Peer-Bridge Collaboration Guide (Claude Code)
9
9
 
10
10
  ## Sending Messages
11
- - **Preferred (noise-free)**: Use the `peer-bridge` MCP tools (`list_peers`, `send_peer_message`, `spawn_peer`, `close_peer`, `wait_peer_messages`).
11
+ - **Zero-config CLI (always available)**: Run `pbridge daemon start`, `pbridge peers --json`, `pbridge spawn <runtime> --name <role> --no-mcp --mode headless`, `pbridge send <runtime>:<role> "<msg>" --wait-reply`, or `pbridge workflow cross-review ...`.
12
+ - **MCP tools (when installed)**: Use `list_peers`, `send_peer_message`, `spawn_peer`, `close_peer`, `delegate_task`, `run_workflow`.
12
13
  - **Native `SendMessage` compatibility**: Calling `SendMessage(to="agy:<name>", ...)` or an external peer's bare name automatically routes through `pbridged`. When the hook returns `[peer-bridge DELIVERED — NOT AN ERROR]`, treat the delivery as **succeeded** and do NOT retry.
13
14
  - **Ambiguous names**: If a name exists in both native Claude teams and `peer-bridge`, specify an explicit prefix (`cc:<name>` or `agy:<name>`).
14
15
 
@@ -5,7 +5,7 @@ description: Cross-runtime peer messaging, task contracts, and workflow orchestr
5
5
 
6
6
  # Peer-Bridge for Codex CLI
7
7
 
8
- Use the `peer-bridge` MCP tools (`list_peers`, `send_peer_message`, `delegate_task`, `complete_task`, `spawn_peer`, `close_peer`, `run_workflow`) to collaborate with Antigravity (`agy:*`), Claude Code (`cc:*`), Gemini CLI (`gemini:*`), and Paseo (`paseo:*`) peers.
8
+ Use either the zero-config `pbridge` CLI (`pbridge daemon start`, `pbridge peers --json`, `pbridge spawn`, `pbridge send`, `pbridge task delegate`, `pbridge workflow cross-review|fanout`) or the `peer-bridge` MCP tools (`list_peers`, `send_peer_message`, `delegate_task`, `complete_task`, `spawn_peer`, `close_peer`, `run_workflow`) to collaborate with Antigravity (`agy:*`), Claude Code (`cc:*`), Gemini CLI (`gemini:*`), and Paseo (`paseo:*`) peers.
9
9
 
10
10
  - Incoming `<peer-message>` and `<task-contract>` notifications are injected via `SessionStart`, `UserPromptSubmit`, `PostToolUse`, and `Stop` hooks.
11
11
  - When finishing a delegated `<task-contract request-id="...">`, call `complete_task` (or `pbridge task complete <request_id> "<summary>"`).
@@ -5,7 +5,7 @@ description: Cross-runtime peer messaging, task contracts, and workflow orchestr
5
5
 
6
6
  # Peer-Bridge for Gemini CLI
7
7
 
8
- Use the `peer-bridge` MCP tools (`list_peers`, `send_peer_message`, `delegate_task`, `complete_task`, `spawn_peer`, `close_peer`, `run_workflow`) to collaborate with Antigravity (`agy:*`), Claude Code (`cc:*`), Codex (`codex:*`), and Paseo (`paseo:*`) peers.
8
+ Use either the zero-config `pbridge` CLI (`pbridge daemon start`, `pbridge peers --json`, `pbridge spawn`, `pbridge send`, `pbridge task delegate`, `pbridge workflow cross-review|fanout`) or the `peer-bridge` MCP tools (`list_peers`, `send_peer_message`, `delegate_task`, `complete_task`, `spawn_peer`, `close_peer`, `run_workflow`) to collaborate with Antigravity (`agy:*`), Claude Code (`cc:*`), Codex (`codex:*`), and Paseo (`paseo:*`) peers.
9
9
 
10
10
  - Incoming `<peer-message>` and `<task-contract>` messages arrive automatically via Gemini CLI hooks (`SessionStart`, `BeforeAgent`, `AfterTool`, `AfterAgent`).
11
11
  - When completing a `<task-contract request-id="...">`, call `complete_task` (or `pbridge task complete <request_id> "<summary>"`).
package/package.json CHANGED
@@ -1,20 +1,35 @@
1
1
  {
2
2
  "name": "peer-bridge",
3
- "version": "0.6.0",
4
- "description": "Zero-dependency local message broker, multi-AI orchestrator, MCP/Channel server, and standalone TUI viewer bridging Claude Code, Antigravity, Codex CLI, Gemini CLI, and Paseo sessions",
3
+ "version": "0.7.1",
4
+ "description": "No-MCP-bloat, zero-config, zero-dependency UNIX message bus, multi-AI workflow orchestrator, and 0-token TUI monitor bridging Claude Code, Antigravity, Codex CLI, Gemini CLI, and Paseo",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Hwanyong Yoo",
8
+ "homepage": "https://github.com/hwanyong/peer-bridge#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/hwanyong/peer-bridge.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/hwanyong/peer-bridge/issues"
15
+ },
8
16
  "keywords": [
17
+ "model-context-protocol",
18
+ "mcp-server",
9
19
  "ai-agents",
20
+ "ai-coding-agents",
10
21
  "claude-code",
11
22
  "antigravity",
12
- "codex",
23
+ "codex-cli",
13
24
  "gemini-cli",
14
25
  "paseo",
15
- "mcp",
16
- "multi-agent",
17
- "orchestrator",
26
+ "multi-agent-orchestration",
27
+ "cross-review",
28
+ "code-review",
29
+ "zero-config",
30
+ "agent-to-agent",
31
+ "message-bus",
32
+ "terminal-ui",
18
33
  "tui"
19
34
  ],
20
35
  "engines": {
@@ -24,20 +39,24 @@
24
39
  "bin/",
25
40
  "src/",
26
41
  "adapters/",
42
+ "skills/",
43
+ "scripts/",
27
44
  "README.md",
28
45
  "README.ko.md",
29
46
  "LICENSE"
30
47
  ],
31
48
  "bin": {
32
- "pbridge": "./bin/pbridge.mjs",
33
- "pbridged": "./bin/pbridged.mjs",
34
- "pbridge-mcp": "./bin/pbridge-mcp.mjs",
35
- "pbridge-tui": "./bin/pbridge-tui.mjs"
49
+ "pbridge": "bin/pbridge.mjs",
50
+ "pbridged": "bin/pbridged.mjs",
51
+ "pbridge-mcp": "bin/pbridge-mcp.mjs",
52
+ "pbridge-tui": "bin/pbridge-tui.mjs"
36
53
  },
37
54
  "exports": {
38
55
  ".": "./src/index.mjs"
39
56
  },
40
57
  "scripts": {
58
+ "postinstall": "node scripts/postinstall.mjs",
59
+ "preuninstall": "node scripts/preuninstall.mjs",
41
60
  "test": "node --test test/unit/*.test.mjs",
42
61
  "test:e2e": "node --test test/e2e/*.test.mjs"
43
62
  }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import { installGlobalSkills } from '../src/skills.mjs';
3
+
4
+ if (process.env.CI || process.env.PBRIDGE_SKIP_POSTINSTALL === '1') {
5
+ process.exit(0);
6
+ }
7
+
8
+ const isGlobal =
9
+ process.env.npm_config_global === 'true' ||
10
+ process.env.npm_config_location === 'global';
11
+
12
+ if (!isGlobal) {
13
+ process.exit(0);
14
+ }
15
+
16
+ try {
17
+ const res = installGlobalSkills();
18
+ if (res.installed.length > 0) {
19
+ process.stdout.write(
20
+ `peer-bridge: AI skill auto-installed (${res.installed.length} skill dir${res.installed.length === 1 ? '' : 's'}). Mention "peer-bridge" in any AI prompt to collaborate!\n`,
21
+ );
22
+ }
23
+ } catch {
24
+ // Never fail npm install due to read-only or sandboxed home directories
25
+ }
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ import { uninstallGlobalSkills } from '../src/skills.mjs';
3
+
4
+ if (process.env.CI || process.env.PBRIDGE_SKIP_POSTINSTALL === '1') {
5
+ process.exit(0);
6
+ }
7
+
8
+ const isGlobal =
9
+ process.env.npm_config_global === 'true' ||
10
+ process.env.npm_config_location === 'global';
11
+
12
+ if (!isGlobal) {
13
+ process.exit(0);
14
+ }
15
+
16
+ try {
17
+ uninstallGlobalSkills();
18
+ } catch {
19
+ // Never fail npm uninstall
20
+ }
@@ -0,0 +1,70 @@
1
+ ---
2
+ name: peer-bridge
3
+ description: >-
4
+ Collaborate across AI coding agents (Claude Code, Google Antigravity, Codex CLI,
5
+ Gemini CLI, Paseo) via the peer-bridge (pbridge) local broker with zero configuration.
6
+ Use whenever the user mentions "peer-bridge", "pbridge", "피어 브리지", cross-reviewing
7
+ with another AI CLI, fanning out tasks across multiple AI agents, or monitoring peers.
8
+ ---
9
+ <!-- peer-bridge:managed-skill -->
10
+
11
+ # peer-bridge (Zero-Config CLI Skill)
12
+
13
+ Orchestrate and message other AI coding agents (`cc`, `agy`, `codex`, `gemini`, `paseo`) directly through the `pbridge` CLI — no `.mcp.json` or hook configuration required. (If `peer-bridge` MCP tools are also loaded in this session, they talk to the exact same local broker.)
14
+
15
+ All commands below assume `pbridge` is on `PATH` (`npm install -g peer-bridge`). If `pbridge` is missing, fall back to `npx -p peer-bridge pbridge`.
16
+
17
+ ## 1. Ensure the Local Daemon Is Running
18
+ ```bash
19
+ pbridge daemon status --json
20
+ # If running is false and the user asked to use peer-bridge:
21
+ pbridge daemon start --json
22
+ ```
23
+
24
+ ## 2. Inspect or Spawn Collaborator Peers (Auto-Scoped to Current Project)
25
+ Commands automatically scope to the current Git/project root (`--all` lists peers across all projects).
26
+ ```bash
27
+ pbridge peers --json
28
+
29
+ # Spawn headless workers for this project (--no-mcp avoids loading desktop MCP servers in cc workers)
30
+ pbridge spawn cc --name reviewer --no-mcp --mode headless --json
31
+ pbridge spawn agy --name author --model flash --mode headless --json
32
+ pbridge spawn codex --name auditor --mode headless --json
33
+ pbridge spawn gemini --name researcher --mode headless --json
34
+ ```
35
+ *Tip*: Instruct headless workers to run non-interactive tests/checks only (no interactive TTY prompts).
36
+
37
+ ## 3. Collaborate (`send`, `task delegate`, `cross-review`, `fanout`)
38
+ - **Direct message / question** (routes within the current project; use `<runtime>:<project>/<role>` for cross-project):
39
+ ```bash
40
+ pbridge send cc:reviewer "Review src/auth.mjs for edge cases" --wait-reply --json
41
+ ```
42
+ - **Structured task delegation with disk artifact verification**:
43
+ ```bash
44
+ pbridge task delegate agy:author "Implement src/auth.mjs" \
45
+ --artifact src/auth.mjs --require-artifacts --wait --json
46
+ ```
47
+ - **Iterative author + reviewer approval loop (`cross-review`)**:
48
+ ```bash
49
+ pbridge workflow cross-review \
50
+ --author agy:author \
51
+ --reviewer cc:reviewer \
52
+ --prompt "Implement and verify src/auth.mjs" \
53
+ --artifact src/auth.mjs \
54
+ --rounds 2 --json
55
+ ```
56
+ - **Parallel multi-agent fan-out with optional join synthesizer**:
57
+ ```bash
58
+ pbridge workflow fanout \
59
+ --workers agy:author,codex:auditor \
60
+ --prompt "Audit performance and security" \
61
+ --join cc:reviewer --json
62
+ ```
63
+
64
+ ## 4. Ownership-Safe Cleanup & Live Monitoring
65
+ - Close ephemeral peers you spawned once their work is complete:
66
+ ```bash
67
+ pbridge close cc:reviewer --archive --json
68
+ ```
69
+ - **Safety rule**: Never force-close `origin: "attached"` user sessions unless explicitly asked.
70
+ - Let the user know they can monitor all peers live with **0 LLM tokens** in any terminal tab using `pbridge tui` (press `p` to toggle Current Project vs All Projects).
package/src/cli/main.mjs CHANGED
@@ -19,6 +19,11 @@ import { runAntigravityHook } from '../adapters/antigravity/hooks.mjs';
19
19
  import { runCodexHook } from '../adapters/codex/hooks.mjs';
20
20
  import { runGeminiHook } from '../adapters/gemini/hooks.mjs';
21
21
  import { installAdapter } from '../adapters/installer.mjs';
22
+ import {
23
+ getGlobalSkillsStatus,
24
+ installGlobalSkills,
25
+ uninstallGlobalSkills,
26
+ } from '../skills.mjs';
22
27
  import { runTuiViewer } from '../tui/viewer.mjs';
23
28
 
24
29
  function parseArgs(argv) {
@@ -94,6 +99,7 @@ Usage:
94
99
  pbridge mcp [--runtime agy|cc|codex|gemini] [--channel] [--name <n>] [--session <id>]
95
100
  pbridge hook <cc|agy|codex|gemini> <event>
96
101
  pbridge install <cc|agy|codex|gemini|all> [--project <dir> | --global] [--dry-run] [--json]
102
+ pbridge skills [status|install|uninstall] [--all] [--dry-run] [--json]
97
103
  pbridge tui|agents [--runtime <r>] [--cwd <dir>] [--all] [--broker-only] [--active] [--once] [--json] [--tmux-split | --tmux-popup]
98
104
  `;
99
105
  process.stdout.write(help);
@@ -120,6 +126,13 @@ export async function runCli(argv = process.argv.slice(2)) {
120
126
  const config = getConfig();
121
127
 
122
128
  if (sub === 'start') {
129
+ if (!process.env.PBRIDGE_HOME && !process.env.CI && process.env.PBRIDGE_NO_AUTO_SKILL !== '1') {
130
+ try {
131
+ installGlobalSkills();
132
+ } catch {
133
+ // best-effort fallback for package managers that skip postinstall
134
+ }
135
+ }
123
136
  if (flags.foreground) {
124
137
  const server = new BrokerServer({ config });
125
138
  const status = await server.start();
@@ -686,6 +699,49 @@ export async function runCli(argv = process.argv.slice(2)) {
686
699
  return 0;
687
700
  }
688
701
 
702
+ if (cmd === 'skills') {
703
+ const sub = positionals[1] || 'status';
704
+ if (sub === 'install') {
705
+ const res = installGlobalSkills({
706
+ includeAll: Boolean(flags.all),
707
+ dryRun: Boolean(flags['dry-run']),
708
+ });
709
+ if (asJson) {
710
+ printJson(res);
711
+ } else {
712
+ for (const p of res.installed) {
713
+ process.stdout.write(`Installed skill${res.dry_run ? ' (dry-run)' : ''}: ${p}\n`);
714
+ }
715
+ for (const s of res.skipped) {
716
+ process.stdout.write(`Skipped (${s.reason}): ${s.path}\n`);
717
+ }
718
+ }
719
+ return 0;
720
+ }
721
+ if (sub === 'uninstall' || sub === 'remove') {
722
+ const res = uninstallGlobalSkills({ dryRun: Boolean(flags['dry-run']) });
723
+ if (asJson) {
724
+ printJson(res);
725
+ } else {
726
+ if (!res.removed.length) process.stdout.write('No managed peer-bridge skills found.\n');
727
+ for (const p of res.removed) {
728
+ process.stdout.write(`Removed skill${res.dry_run ? ' (dry-run)' : ''}: ${p}\n`);
729
+ }
730
+ }
731
+ return 0;
732
+ }
733
+ const res = getGlobalSkillsStatus();
734
+ if (asJson) {
735
+ printJson(res);
736
+ } else {
737
+ for (const s of res.skills) {
738
+ const state = s.installed ? (s.managed ? 'installed (managed)' : 'installed (custom)') : 'not installed';
739
+ process.stdout.write(`${pad(s.runtime, 8)} ${pad(state, 22)} ${s.path}\n`);
740
+ }
741
+ }
742
+ return 0;
743
+ }
744
+
689
745
  if (cmd === 'tui' || cmd === 'agents') {
690
746
  const res = await runTuiViewer({
691
747
  config: getConfig(),
package/src/index.mjs CHANGED
@@ -48,6 +48,13 @@ export { runAntigravityHook } from './adapters/antigravity/hooks.mjs';
48
48
  export { runCodexHook } from './adapters/codex/hooks.mjs';
49
49
  export { runGeminiHook } from './adapters/gemini/hooks.mjs';
50
50
  export { installAdapter } from './adapters/installer.mjs';
51
+ export {
52
+ MANAGED_SKILL_MARKER,
53
+ getGlobalSkillsStatus,
54
+ getSkillTargetDirs,
55
+ installGlobalSkills,
56
+ uninstallGlobalSkills,
57
+ } from './skills.mjs';
51
58
  export { discoverHostPeers, mergeAllPeers } from './runtime/host-discovery.mjs';
52
59
  export { renderFrame } from './tui/render.mjs';
53
60
  export { runTuiViewer } from './tui/viewer.mjs';
package/src/skills.mjs ADDED
@@ -0,0 +1,115 @@
1
+ import fs from 'node:fs';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
+ const REPO_ROOT = path.resolve(__dirname, '..');
8
+
9
+ export const MANAGED_SKILL_MARKER = '<!-- peer-bridge:managed-skill -->';
10
+ export const CANONICAL_SKILL_PATH = path.join(REPO_ROOT, 'skills', 'peer-bridge', 'SKILL.md');
11
+
12
+ export function getSkillCandidateDirs(homeDir = os.homedir()) {
13
+ return [
14
+ { runtime: 'agents', parent: path.join(homeDir, '.agents'), dir: path.join(homeDir, '.agents', 'skills', 'peer-bridge'), always: true },
15
+ { runtime: 'claude', parent: path.join(homeDir, '.claude'), dir: path.join(homeDir, '.claude', 'skills', 'peer-bridge'), always: true },
16
+ { runtime: 'codex', parent: path.join(homeDir, '.codex'), dir: path.join(homeDir, '.codex', 'skills', 'peer-bridge'), always: false },
17
+ { runtime: 'gemini', parent: path.join(homeDir, '.gemini'), dir: path.join(homeDir, '.gemini', 'skills', 'peer-bridge'), always: false },
18
+ ];
19
+ }
20
+
21
+ export function getSkillTargetDirs({ homeDir = os.homedir(), includeAll = false } = {}) {
22
+ return getSkillCandidateDirs(homeDir)
23
+ .filter((entry) => includeAll || entry.always || fs.existsSync(entry.parent))
24
+ .map((entry) => entry.dir);
25
+ }
26
+
27
+ export function readCanonicalSkill() {
28
+ return fs.readFileSync(CANONICAL_SKILL_PATH, 'utf8');
29
+ }
30
+
31
+ export function installGlobalSkills({ homeDir = os.homedir(), includeAll = false, dryRun = false } = {}) {
32
+ const content = readCanonicalSkill();
33
+ const targetDirs = getSkillTargetDirs({ homeDir, includeAll });
34
+ const installed = [];
35
+ const skipped = [];
36
+
37
+ for (const dir of targetDirs) {
38
+ const destFile = path.join(dir, 'SKILL.md');
39
+ if (fs.existsSync(destFile)) {
40
+ try {
41
+ const existing = fs.readFileSync(destFile, 'utf8');
42
+ if (!existing.includes(MANAGED_SKILL_MARKER)) {
43
+ skipped.push({ path: destFile, reason: 'custom_user_skill' });
44
+ continue;
45
+ }
46
+ } catch {
47
+ skipped.push({ path: destFile, reason: 'unreadable' });
48
+ continue;
49
+ }
50
+ }
51
+
52
+ if (!dryRun) {
53
+ fs.mkdirSync(dir, { recursive: true });
54
+ fs.writeFileSync(destFile, content, 'utf8');
55
+ }
56
+ installed.push(destFile);
57
+ }
58
+
59
+ return { installed, skipped, dry_run: dryRun };
60
+ }
61
+
62
+ export function uninstallGlobalSkills({ homeDir = os.homedir(), dryRun = false } = {}) {
63
+ const candidates = getSkillCandidateDirs(homeDir);
64
+ const removed = [];
65
+ const skipped = [];
66
+
67
+ for (const entry of candidates) {
68
+ const destFile = path.join(entry.dir, 'SKILL.md');
69
+ if (!fs.existsSync(destFile)) continue;
70
+ try {
71
+ const existing = fs.readFileSync(destFile, 'utf8');
72
+ if (!existing.includes(MANAGED_SKILL_MARKER)) {
73
+ skipped.push({ path: destFile, reason: 'custom_user_skill' });
74
+ continue;
75
+ }
76
+ if (!dryRun) {
77
+ fs.rmSync(destFile, { force: true });
78
+ try {
79
+ if (fs.readdirSync(entry.dir).length === 0) {
80
+ fs.rmdirSync(entry.dir);
81
+ }
82
+ } catch {
83
+ // ignore non-empty dir
84
+ }
85
+ }
86
+ removed.push(destFile);
87
+ } catch {
88
+ skipped.push({ path: destFile, reason: 'error' });
89
+ }
90
+ }
91
+
92
+ return { removed, skipped, dry_run: dryRun };
93
+ }
94
+
95
+ export function getGlobalSkillsStatus({ homeDir = os.homedir() } = {}) {
96
+ const skills = getSkillCandidateDirs(homeDir).map((entry) => {
97
+ const destFile = path.join(entry.dir, 'SKILL.md');
98
+ const installed = fs.existsSync(destFile);
99
+ let managed = false;
100
+ if (installed) {
101
+ try {
102
+ managed = fs.readFileSync(destFile, 'utf8').includes(MANAGED_SKILL_MARKER);
103
+ } catch {
104
+ managed = false;
105
+ }
106
+ }
107
+ return {
108
+ runtime: entry.runtime,
109
+ path: destFile,
110
+ installed,
111
+ managed,
112
+ };
113
+ });
114
+ return { skills };
115
+ }
@@ -271,7 +271,7 @@ export function renderFrame(
271
271
  compact = false,
272
272
  nowMs = Date.now(),
273
273
  homeDir = os.homedir(),
274
- version = '0.6.0',
274
+ version = '0.7.1',
275
275
  } = {},
276
276
  ) {
277
277
  const cols = Math.max(56, Number(width) || 100);