triflux 8.7.0 → 8.9.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
@@ -17,16 +17,11 @@
17
17
  <a href="https://www.npmjs.com/package/triflux"><img src="https://img.shields.io/npm/v/triflux?style=flat-square&color=FFAF00&label=npm" alt="npm version"></a>
18
18
  <a href="https://www.npmjs.com/package/triflux"><img src="https://img.shields.io/npm/dm/triflux?style=flat-square&color=F5C242" alt="npm downloads"></a>
19
19
  <a href="https://github.com/tellang/triflux/stargazers"><img src="https://img.shields.io/github/stars/tellang/triflux?style=flat-square&color=FFAF00" alt="GitHub stars"></a>
20
- <a href="https://github.com/tellang/triflux/actions"><img src="https://img.shields.io/github/actions/workflow/status/tellang/triflux/ci.yml?style=flat-square&label=CI" alt="CI"></a>
21
20
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-374151?style=flat-square" alt="License: MIT"></a>
22
21
  </p>
23
22
 
24
23
  <p align="center">
25
- <picture>
26
- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/demo-dark.gif">
27
- <source media="(prefers-color-scheme: light)" srcset="docs/assets/demo-light.gif">
28
- <img alt="triflux 데모" src="docs/assets/demo-dark.gif" width="680">
29
- </picture>
24
+ <img alt="triflux 데모" src="docs/assets/demo-multi.gif" width="680">
30
25
  </p>
31
26
 
32
27
  <p align="center">
@@ -40,6 +35,49 @@
40
35
 
41
36
  ---
42
37
 
38
+ ## 빠른 시작
39
+
40
+ ### 1. 설치
41
+
42
+ ```bash
43
+ npm install -g triflux
44
+ ```
45
+
46
+ ### 2. 설정
47
+
48
+ ```bash
49
+ tfx setup
50
+ ```
51
+
52
+ ### 3. 사용법
53
+
54
+ ```bash
55
+ # Light — 단일 모델로 빠르게 실행
56
+ /tfx-research "React 19 Server Actions best practices"
57
+ /tfx-review
58
+ /tfx-plan "add JWT auth middleware"
59
+
60
+ # Deep — 중요한 작업에 3자 합의 적용
61
+ /tfx-deep-research "microservice architecture comparison 2026"
62
+ /tfx-deep-review
63
+ /tfx-deep-plan "migrate REST to GraphQL"
64
+
65
+ # Debate — 3개의 독립적인 의견을 확보
66
+ /tfx-debate "Redis vs PostgreSQL LISTEN/NOTIFY for real-time events"
67
+
68
+ # Persistence — 완료될 때까지 멈추지 않음
69
+ /tfx-ralph "implement full auth flow with tests"
70
+
71
+ # Team — Multi-CLI 병렬 오케스트레이션
72
+ /tfx-multi "refactor auth + update UI + add tests"
73
+
74
+ # Remote — 원격 머신에 Claude 세션 생성
75
+ /tfx-remote-setup # 인터랙티브 호스트 설정 위저드 (Tailscale + SSH)
76
+ /tfx-remote-spawn "울트라에서 보안 리뷰 해" # 원격 호스트에서 세션 실행
77
+ ```
78
+
79
+ ---
80
+
43
81
  ## v8의 새로운 기능
44
82
 
45
83
  **triflux v8**은 **Tri-CLI Consensus Intelligence**를 도입합니다. Claude, Codex, Gemini가 각각 독립적으로 분석한 뒤, 구조화된 토론을 거쳐 교차 검증하는 근본적으로 새로운 접근 방식입니다. 모든 Deep 스킬은 Anti-Herding(편향 오염 방지)과 Consensus Gate를 통한 출력 보장을 제공합니다.
@@ -171,7 +209,8 @@ Phase 3: Resolution (합의율 < 70%일 경우)
171
209
  | `tfx-codex` | Codex 전용 오케스트레이터 |
172
210
  | `tfx-gemini` | Gemini 전용 오케스트레이터 |
173
211
  | `tfx-auto-codex` | Codex 주도 오케스트레이터 |
174
- | `remote-spawn` | psmux를 통한 원격 세션 관리 |
212
+ | `tfx-remote-spawn` | psmux를 통한 원격 세션 관리 |
213
+ | `tfx-remote-setup` | 원격 호스트 설정 위저드 (Tailscale + SSH) |
175
214
 
176
215
  ---
177
216
 
package/README.md CHANGED
@@ -17,16 +17,11 @@
17
17
  <a href="https://www.npmjs.com/package/triflux"><img src="https://img.shields.io/npm/v/triflux?style=flat-square&color=FFAF00&label=npm" alt="npm version"></a>
18
18
  <a href="https://www.npmjs.com/package/triflux"><img src="https://img.shields.io/npm/dm/triflux?style=flat-square&color=F5C242" alt="npm downloads"></a>
19
19
  <a href="https://github.com/tellang/triflux/stargazers"><img src="https://img.shields.io/github/stars/tellang/triflux?style=flat-square&color=FFAF00" alt="GitHub stars"></a>
20
- <a href="https://github.com/tellang/triflux/actions"><img src="https://img.shields.io/github/actions/workflow/status/tellang/triflux/ci.yml?style=flat-square&label=CI" alt="CI"></a>
21
20
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-374151?style=flat-square" alt="License: MIT"></a>
22
21
  </p>
23
22
 
24
23
  <p align="center">
25
- <picture>
26
- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/demo-dark.gif">
27
- <source media="(prefers-color-scheme: light)" srcset="docs/assets/demo-light.gif">
28
- <img alt="triflux demo" src="docs/assets/demo-dark.gif" width="680">
29
- </picture>
24
+ <img alt="triflux demo" src="docs/assets/demo-multi.gif" width="680">
30
25
  </p>
31
26
 
32
27
  <p align="center">
@@ -40,6 +35,49 @@
40
35
 
41
36
  ---
42
37
 
38
+ ## Quick Start
39
+
40
+ ### 1. Install
41
+
42
+ ```bash
43
+ npm install -g triflux
44
+ ```
45
+
46
+ ### 2. Setup
47
+
48
+ ```bash
49
+ tfx setup
50
+ ```
51
+
52
+ ### 3. Use
53
+
54
+ ```bash
55
+ # Light — single model, fast execution
56
+ /tfx-research "React 19 Server Actions best practices"
57
+ /tfx-review
58
+ /tfx-plan "add JWT auth middleware"
59
+
60
+ # Deep — 3-party consensus for critical work
61
+ /tfx-deep-research "microservice architecture comparison 2026"
62
+ /tfx-deep-review
63
+ /tfx-deep-plan "migrate REST to GraphQL"
64
+
65
+ # Debate — get 3 independent opinions
66
+ /tfx-debate "Redis vs PostgreSQL LISTEN/NOTIFY for real-time events"
67
+
68
+ # Persistence — don't stop until done
69
+ /tfx-ralph "implement full auth flow with tests"
70
+
71
+ # Team — Multi-CLI parallel orchestration
72
+ /tfx-multi "refactor auth + update UI + add tests"
73
+
74
+ # Remote — spawn Claude sessions on other machines
75
+ /tfx-remote-setup # interactive host wizard (Tailscale + SSH)
76
+ /tfx-remote-spawn "run security review on ultra4" # spawn on remote host
77
+ ```
78
+
79
+ ---
80
+
43
81
  ## What's New in v8
44
82
 
45
83
  **triflux v8** introduces **Tri-CLI Consensus Intelligence** — a fundamentally new approach where Claude, Codex, and Gemini independently analyze, then cross-validate through structured debate. Every Deep skill guarantees anti-herding (no bias contamination) and consensus-gated output.
@@ -171,7 +209,8 @@ Phase 3: Resolution (if consensus < 70%)
171
209
  | `tfx-codex` | Codex-only orchestrator |
172
210
  | `tfx-gemini` | Gemini-only orchestrator |
173
211
  | `tfx-auto-codex` | Codex-lead orchestrator |
174
- | `remote-spawn` | Remote session management via psmux |
212
+ | `tfx-remote-spawn` | Remote session management via psmux |
213
+ | `tfx-remote-setup` | Remote host setup wizard (Tailscale + SSH) |
175
214
 
176
215
  ---
177
216
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "8.7.0",
3
+ "version": "8.9.1",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "type": "module",
6
6
  "bin": {
@@ -66,13 +66,25 @@ function startHubDetached(port) {
66
66
  if (!existsSync(serverPath)) return false;
67
67
 
68
68
  try {
69
- const child = spawn(process.execPath, [serverPath], {
70
- env: { ...process.env, TFX_HUB_PORT: String(port) },
71
- detached: true,
72
- stdio: "ignore",
73
- windowsHide: true,
74
- });
75
- child.unref();
69
+ const env = { ...process.env, TFX_HUB_PORT: String(port) };
70
+ if (process.platform === "win32") {
71
+ // Windows: cmd.exe /c start /b → 완전 독립 프로세스 트리 생성
72
+ // hook timeout 시 프로세스 트리 킬에서 살아남음
73
+ const child = spawn("cmd.exe", ["/c", "start", "/b", "", process.execPath, serverPath], {
74
+ env,
75
+ detached: true,
76
+ stdio: "ignore",
77
+ windowsHide: true,
78
+ });
79
+ child.unref();
80
+ } else {
81
+ const child = spawn(process.execPath, [serverPath], {
82
+ env,
83
+ detached: true,
84
+ stdio: "ignore",
85
+ });
86
+ child.unref();
87
+ }
76
88
  return true;
77
89
  } catch {
78
90
  return false;
@@ -94,9 +106,16 @@ const { host, port } = resolveHubTarget();
94
106
  if (!(await isHubHealthy(host, port))) {
95
107
  const started = startHubDetached(port);
96
108
  if (started) {
97
- const ready = await waitForHubReady(host, port);
98
- if (!ready) {
99
- console.error("[tfx-hub-ensure] Hub 시작했으나 ready 대기 초과 — MCP 연결 실패 가능");
109
+ const ready = await waitForHubReady(host, port, 3000);
110
+ if (ready) {
111
+ process.stdout.write("hub: ok");
112
+ } else {
113
+ // fire-and-forget: hub이 아직 기동 중일 수 있음 — 에러가 아닌 경고
114
+ process.stdout.write("hub: starting");
100
115
  }
116
+ } else {
117
+ process.stderr.write("[hub-ensure] hub 시작 실패");
101
118
  }
119
+ } else {
120
+ process.stdout.write("hub: ok");
102
121
  }
@@ -1,114 +1,138 @@
1
- ---
2
- name: tfx-consensus
3
- description: 3자 합의 엔진 — 모든 Deep 스킬의 핵심 인프라. Claude/Codex/Gemini 독립 분석 결과를 교차검증하여 편향 없는 합의를 도출한다.
4
- triggers: []
5
- argument-hint: "(내부 전용 — Deep 스킬이 자동 호출)"
6
- ---
7
-
8
- # tfx-consensus — Tri-CLI Consensus Engine
9
-
10
- > 모든 Deep 스킬의 공통 기반. 3개 CLI의 독립 결과를 교차검증하여 합의 도출.
11
-
12
- ## Core Protocol
13
-
14
- 스킬은 직접 호출하지 않는다. `tfx-deep-*` 스킬이 내부적으로 사용한다.
15
-
16
- ## Consensus Algorithm
17
-
18
- ### Phase 1: Independent Analysis (Anti-Herding)
19
-
20
- 3개 CLI가 **동시에, 상호 결과를 보지 않고** 독립 분석한다. 이것이 핵심이다 — 한 CLI의 결과가 다른 CLI에 영향을 주면 편향이 발생한다.
21
-
22
- ```
23
- 실행 방식 (MANDATORY — headless dispatch):
24
- ├─ Claude (Opus/Sonnet): Agent(subagent_type, run_in_background=true)
25
- └─ CLI 워커 (Codex+Gemini): Bash("tfx multi --teammate-mode headless --auto-attach --dashboard \
26
- --assign 'codex:{prompt}:analyst' \
27
- --assign 'gemini:{prompt}:analyst' \
28
- --timeout 600")
29
-
30
- 각 CLI에게 동일한 프롬프트를 전달하되, 출력 형식을 JSON으로 강제:
31
- {
32
- "findings": [
33
- { "id": "F1", "category": "...", "severity": "critical|high|medium|low", "description": "...", "evidence": "..." }
34
- ],
35
- "summary": "...",
36
- "confidence": 0.0-1.0
37
- }
38
- ```
39
-
40
- ### Phase 2: Cross-Validation
41
-
42
- Claude가 3개 결과를 통합하여 교차검증한다:
43
-
44
- ```
45
- 입력: result_claude, result_codex, result_gemini
46
-
47
- for each finding in ALL results:
48
- agreement_count = count(CLIs that found this or similar finding)
49
-
50
- if agreement_count >= 2:
51
- mark as "CONSENSUS" (합의됨)
52
- elif agreement_count == 1:
53
- mark as "DISPUTED" (미합의 추가 검증 필요)
54
-
55
- consensus_score = len(CONSENSUS) / len(ALL_UNIQUE) * 100
56
- ```
57
-
58
- ### Phase 3: Resolution (consensus_score < 70일 때)
59
-
60
- ```
61
- 미합의 항목에 대해 2차 라운드:
62
- 1. CLI에게 다른 CLI의 반대 논거를 제시
63
- 2. "수용(accept) 또는 반박(rebut)으로 응답하라"
64
- 3. 수용이 2개 이상이면 CONSENSUS 승격
65
- 4. 여전히 미합의이면 사용자에게 판단 요청 (AskUserQuestion)
66
- ```
67
-
68
- ### Learned Weights (시간 기반 신뢰도)
69
-
70
- ```
71
- 각 CLI의 historical accuracy를 .omc/state/consensus-weights.json에 저장:
72
- {
73
- "claude": { "accuracy": 0.85, "total": 100, "correct": 85 },
74
- "codex": { "accuracy": 0.82, "total": 100, "correct": 82 },
75
- "gemini": { "accuracy": 0.78, "total": 100, "correct": 78 }
76
- }
77
-
78
- 가중 투표 시 accuracy를 weight로 사용:
79
- weighted_score = (claude_vote * 0.85 + codex_vote * 0.82 + gemini_vote * 0.78) / (0.85 + 0.82 + 0.78)
80
- ```
81
-
82
- ## Output Format
83
-
84
- ```json
85
- {
86
- "consensus_score": 85,
87
- "consensus_items": [...],
88
- "disputed_items": [...],
89
- "resolved_items": [...],
90
- "user_decision_needed": [...],
91
- "cli_weights": { "claude": 0.85, "codex": 0.82, "gemini": 0.78 }
92
- }
93
- ```
94
-
95
- ## Integration Point
96
-
97
- Deep 스킬에서 사용하는 방법:
98
-
99
- ```
100
- 1. 프롬프트 준비 (주제 + 분석 관점 + 출력 형식)
101
- 2. 3개 CLI 병렬 실행 (headless dispatch + Agent background)
102
- 3. 결과 수집
103
- 4. Consensus Algorithm 적용
104
- 5. consensus_score >= 70 → 확정
105
- 6. consensus_score < 70 → Resolution Phase 진입
106
- 7. 최종 결과를 호출 스킬에 반환
107
- ```
108
-
109
- ## Token Budget
110
-
111
- - Phase 1 (3x 독립분석): ~15K (각 5K)
112
- - Phase 2 (교차검증): ~3K
113
- - Phase 3 (Resolution, 필요 시): ~8K
114
- - **총합**: 18-26K tokens
1
+ ---
2
+ name: tfx-consensus
3
+ description: 3자 합의 엔진 — 모든 Deep 스킬의 핵심 인프라. Claude/Codex/Gemini 독립 분석 결과를 교차검증하여 편향 없는 합의를 도출한다.
4
+ triggers: []
5
+ argument-hint: "(내부 전용 — Deep 스킬이 자동 호출)"
6
+ ---
7
+
8
+ # tfx-consensus — Tri-CLI Consensus Engine
9
+
10
+ > 모든 Deep 스킬의 공통 기반. 3개 CLI의 독립 결과를 교차검증하여 합의 도출.
11
+
12
+ ## HARD RULES
13
+
14
+ > headless-guard가 규칙 위반을 **자동 차단**한다. 우회 불가.
15
+
16
+ 1. **`codex exec` / `gemini -p` 직접 호출 절대 금지**
17
+ 2. Codex·Gemini → `Bash("tfx multi --teammate-mode headless --auto-attach --dashboard --assign 'cli:프롬프트:역할' --timeout 600")` **만** 사용
18
+ 3. Claude `Agent(run_in_background=true)`
19
+ 4. Bash + Agent를 같은 메시지에서 동시 호출하여 병렬 실행
20
+
21
+ 이 스킬은 직접 호출하지 않는다. `tfx-deep-*` 스킬이 내부적으로 사용한다.
22
+
23
+ ## MODEL ROLES
24
+
25
+ | Model | Profile | 역할 | 강점 |
26
+ |-------|---------|------|------|
27
+ | Claude Opus | architect | 합의 통합 및 교차검증 조율 | 논리 분석, 불일치 해소 |
28
+ | Codex | analyst | 구현/보안 관점 독립 분석 | 코드 품질, 취약점 탐지 |
29
+ | Gemini | analyst | UX/문서화 관점 독립 분석 | DX, 접근성, 가독성 |
30
+
31
+ ## EXECUTION STEPS
32
+
33
+ ### Step 1: 독립 분석 dispatch (Anti-Herding)
34
+
35
+ 3개 CLI가 **동시에, 상호 결과를 보지 않고** 독립 분석한다. 한 CLI의 결과가 다른 CLI에 영향을 주면 편향이 발생한다.
36
+
37
+ **아래 2개 도구를 반드시 같은 응답에서 동시에 호출하라.**
38
+
39
+ **도구 1 — Claude (Opus/Sonnet) 독립 분석:**
40
+ ```
41
+ Agent(
42
+ subagent_type="oh-my-claudecode:architect",
43
+ model="opus",
44
+ run_in_background=true,
45
+ name="consensus-claude",
46
+ description="독립 분석 — Claude 관점",
47
+ prompt="{analysis_prompt} 출력 형식을 JSON으로 강제: { findings: [{ id: 'F1', category: '...', severity: 'critical|high|medium|low', description: '...', evidence: '...' }], summary: '...', confidence: 0.0-1.0 }"
48
+ )
49
+ ```
50
+
51
+ **도구 2 Codex+Gemini 독립 분석 headless dispatch:**
52
+ ```
53
+ Bash("tfx multi --teammate-mode headless --auto-attach --dashboard --assign 'codex:{analysis_prompt} 출력 형식을 JSON으로 강제: { findings: [{ id: string, category: string, severity: critical|high|medium|low, description: string, evidence: string }], summary: string, confidence: 0.0-1.0 }:analyst' --assign 'gemini:{analysis_prompt} 출력 형식을 JSON으로 강제: { findings: [{ id: string, category: string, severity: critical|high|medium|low, description: string, evidence: string }], summary: string, confidence: 0.0-1.0 }:analyst' --timeout 600")
54
+ ```
55
+
56
+ ### Step 2: 교차검증 (Cross-Validation)
57
+
58
+ 3개 결과(`result_claude`, `result_codex`, `result_gemini`)를 수집한 Claude가 통합 교차검증을 수행한다.
59
+
60
+ 합의 분류 알고리즘:
61
+ - finding에 대해 동의한 CLI 수를 집계
62
+ - `agreement_count >= 2` **CONSENSUS** (합의됨)
63
+ - `agreement_count == 1` → **DISPUTED** (미합의 추가 검증 필요)
64
+ - `consensus_score = len(CONSENSUS) / len(ALL_UNIQUE) * 100`
65
+
66
+ `consensus_score >= 70`이면 Step 4로 직행. 미만이면 Step 3 진행.
67
+
68
+ ### Step 3: Resolution (consensus_score < 70일 때만)
69
+
70
+ 미합의 항목에 대해 2차 라운드를 진행한다.
71
+
72
+ **아래 2개 도구를 반드시 같은 응답에서 동시에 호출하라.**
73
+
74
+ **도구 1 Claude 재검토:**
75
+ ```
76
+ Agent(
77
+ subagent_type="oh-my-claudecode:architect",
78
+ model="opus",
79
+ run_in_background=true,
80
+ name="consensus-resolve-claude",
81
+ description="미합의 항목 2차 검토",
82
+ prompt="미합의 항목 목록: {disputed_items}. 다른 두 CLI의 반대 논거: Codex — {codex_rebuttal}, Gemini — {gemini_rebuttal}. 각 항목에 대해 수용(accept) 또는 반박(rebut)으로 응답하라. 수용 시 근거 필수."
83
+ )
84
+ ```
85
+
86
+ **도구 2 — Codex+Gemini 재검토:**
87
+ ```
88
+ Bash("tfx multi --teammate-mode headless --auto-attach --dashboard --assign 'codex:미합의 항목 목록: {disputed_items}. 다른 두 CLI의 반대 논거: Claude — {claude_rebuttal}, Gemini — {gemini_rebuttal}. 각 항목에 대해 수용(accept) 또는 반박(rebut)으로 응답하라. 수용 시 근거 필수.:analyst' --assign 'gemini:미합의 항목 목록: {disputed_items}. 다른 두 CLI의 반대 논거: Claude — {claude_rebuttal}, Codex — {codex_rebuttal}. 각 항목에 대해 수용(accept) 또는 반박(rebut)으로 응답하라. 수용 시 근거 필수.:analyst' --timeout 600")
89
+ ```
90
+
91
+ Resolution 결과 처리:
92
+ - 수용 2개 이상 → CONSENSUS로 승격
93
+ - 여전히 미합의 → 사용자에게 판단 요청 (AskUserQuestion)
94
+
95
+ ### Step 4: 최종 합의 결과 반환
96
+
97
+ Learned Weights를 `.omc/state/consensus-weights.json`에서 읽어 가중 투표에 적용한다:
98
+
99
+ ```json
100
+ {
101
+ "claude": { "accuracy": 0.85, "total": 100, "correct": 85 },
102
+ "codex": { "accuracy": 0.82, "total": 100, "correct": 82 },
103
+ "gemini": { "accuracy": 0.78, "total": 100, "correct": 78 }
104
+ }
105
+ ```
106
+
107
+ 가중 투표:
108
+ `weighted_score = (claude_vote * 0.85 + codex_vote * 0.82 + gemini_vote * 0.78) / (0.85 + 0.82 + 0.78)`
109
+
110
+ 최종 결과를 호출 스킬에 반환한다:
111
+
112
+ ```json
113
+ {
114
+ "consensus_score": 85,
115
+ "consensus_items": [...],
116
+ "disputed_items": [...],
117
+ "resolved_items": [...],
118
+ "user_decision_needed": [...],
119
+ "cli_weights": { "claude": 0.85, "codex": 0.82, "gemini": 0.78 }
120
+ }
121
+ ```
122
+
123
+ ## ERROR RECOVERY
124
+
125
+ | 상황 | 대응 |
126
+ |------|------|
127
+ | headless timeout (600s) | Claude Agent로 해당 역할 대체 실행 |
128
+ | Codex 워커 실패 | Agent(oh-my-claudecode:architect, model="opus") 대체 |
129
+ | Gemini 워커 실패 | Agent(oh-my-claudecode:critic, model="sonnet") 대체 |
130
+
131
+ ## 토큰 예산
132
+
133
+ | Phase | 토큰 |
134
+ |-------|------|
135
+ | Phase 1 (3x 독립분석) | ~15K (각 5K) |
136
+ | Phase 2 (교차검증) | ~3K |
137
+ | Phase 3 (Resolution, 필요 시) | ~8K |
138
+ | **총합** | **18-26K** |