triflux 3.2.0-dev.3 → 3.2.0-dev.5

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,79 @@
1
+ ---
2
+ name: tfx-auto-codex
3
+ description: Codex 리드형 tfx-auto. Claude 네이티브 역할을 Codex로 치환하고 Gemini 사용은 유지합니다.
4
+ triggers:
5
+ - tfx-auto-codex
6
+ argument-hint: "\"작업 설명\" | N:agent_type \"작업 설명\""
7
+ ---
8
+
9
+ # tfx-auto-codex — Codex 리드형 tfx-auto
10
+
11
+ > 목적: 기존 `tfx-auto`의 오케스트레이션 패턴을 유지하면서
12
+ > Claude 네이티브 역할(`explore`, `verifier`, `test-engineer`, `qa-tester`)을
13
+ > Codex로 치환해 Codex/Gemini만으로 실행한다.
14
+
15
+ ## 핵심 원칙
16
+
17
+ 1. **Codex 라우팅 유지**
18
+ - 구현/분석/리뷰/디버깅/검증은 Codex 우선.
19
+ 2. **Gemini 유지**
20
+ - `designer`, `writer`는 Gemini 경로를 그대로 사용.
21
+ 3. **Claude 네이티브 제거**
22
+ - 실행 시 `TFX_NO_CLAUDE_NATIVE=1`로 강제.
23
+ 4. **고난도 설계는 xhigh**
24
+ - 설계/분해/비판 검토 성격의 작업은 `codex --profile xhigh` 기준으로 운용.
25
+
26
+ ## 사용법
27
+
28
+ ```bash
29
+ /tfx-auto-codex "인증 리팩터링 + UI 개선 + 테스트 보강"
30
+ /tfx-auto-codex 3:codex "src/api, src/auth, src/payment 병렬 리뷰"
31
+ /tfx-auto-codex 2:gemini "온보딩 UI 카피 + 접근성 개선"
32
+ ```
33
+
34
+ ## 실행 규칙
35
+
36
+ `tfx-auto` 워크플로우(입력 파싱 → 트리아지 → 분해 → DAG 실행 → 수집/보고)를 그대로 사용한다.
37
+
38
+ 단, **실행 명령은 아래 환경변수를 반드시 포함**한다:
39
+
40
+ ```bash
41
+ TFX_NO_CLAUDE_NATIVE=1 bash ~/.claude/scripts/tfx-route.sh {agent} '{prompt}' {mcp_profile}
42
+ ```
43
+
44
+ ### 역할 치환 (자동)
45
+
46
+ `TFX_NO_CLAUDE_NATIVE=1`일 때:
47
+
48
+ - `explore` -> Codex `fast`
49
+ - `verifier` -> Codex `thorough review`
50
+ - `test-engineer` -> Codex `high`
51
+ - `qa-tester` -> Codex `thorough review`
52
+
53
+ ## 트리아지 기준
54
+
55
+ - `codex`: 코드 구현/수정/분석/리뷰/디버깅/테스트/검증/리서치
56
+ - `gemini`: 문서/UI/디자인/멀티모달
57
+
58
+ Claude 타입 반환은 기본적으로 허용하지 않는다.
59
+ 분류 결과에 `claude`가 포함되면 `codex`로 치환 후 분해를 진행한다.
60
+ 단, Codex CLI 미설치 환경에서는 실행 안전성을 위해 `claude-native` fallback이 유지될 수 있다.
61
+
62
+ ## 권장 프로필
63
+
64
+ - 설계/계획/비판적 검토: `xhigh`
65
+ - 일반 구현/수정: `high`
66
+ - 리뷰: `thorough`
67
+ - 빠른 탐색: `fast`
68
+
69
+ ## 의존성
70
+
71
+ - `~/.claude/scripts/tfx-route.sh` 최신 동기화 상태
72
+ - Codex CLI 설치
73
+ - Gemini CLI 설치 (UI/문서 경로 사용 시)
74
+
75
+ ## Troubleshooting
76
+
77
+ 1. `/tfx-doctor` — 진단
78
+ 2. `/tfx-doctor --fix` — 자동 수정
79
+ 3. `/tfx-doctor --reset` — 캐시 초기화
@@ -6,28 +6,30 @@ triggers:
6
6
  argument-hint: '"작업 설명" | --agents codex,gemini "작업" | --tmux "작업" | status | stop'
7
7
  ---
8
8
 
9
- # tfx-team v2.1Lead Direct Bash 기반 멀티-CLI 팀 오케스트레이터
10
-
11
- > Claude Code Native Teams 유지하되, Codex/Gemini 실행 경로에서 Claude teammate 래퍼를 제거한다.
12
- > 리드가 `tfx-route.sh`를 직접 병렬 실행하고, task 상태는 `team_task_list`를 truth source로 검증한다.
13
-
14
- | 구분 | v2 (기존) | v2.1 (현재) |
15
- |--|--|--|
16
- | 실행 | `Agent(teammate)` → `Bash(tfx-route.sh)` | `Lead` → `Bash(tfx-route.sh)` 직접 |
17
- | teammate | Claude Opus 인스턴스 × N | Codex/Gemini용 없음 |
18
- | task claim | teammate가 `TaskUpdate` 호출 | `tfx-route.sh`가 Hub bridge로 claim |
19
- | 결과 보고 | teammate가 `SendMessage` 호출 | `tfx-route.sh`가 Hub bridge로 `send-message` 호출 |
20
- | 결과 수집 | SendMessage 자동 수신 중심 | `team_task_list` 폴링 + stdout/결과 로그 |
21
- | 정리 | `shutdown_request` × N `TeamDelete` | `TeamDelete` 직접 |
22
- | Opus 토큰 | N × 래퍼 오버헤드 | 래퍼 오버헤드 0 |
9
+ # tfx-team v2.2슬림 래퍼 + 네비게이션 복원 기반 멀티-CLI 팀 오케스트레이터
10
+
11
+ > Claude Code Native Teams Shift+Down 네비게이션을 복원한다.
12
+ > Codex/Gemini 워커마다 최소 프롬프트(~100 토큰)의 슬림 Agent 래퍼를 spawn하여 네비게이션에 등록하고,
13
+ > 실제 작업은 `tfx-route.sh`가 수행한다. task 상태는 `team_task_list`를 truth source로 검증한다.
14
+
15
+ | 구분 | v2 (기존) | v2.1 | v2.2 (현재) |
16
+ |--|--|--|--|
17
+ | 실행 | `Agent(teammate)` → `Bash(tfx-route.sh)` | `Lead` `Bash` 직접 | `Agent(슬림)` `Bash(tfx-route.sh)` |
18
+ | teammate | Claude Opus 인스턴스 × N | 없음 | 슬림 래퍼 × N |
19
+ | Shift+Down | | | (복원) |
20
+ | task claim | teammate `TaskUpdate` | Hub bridge | Hub bridge (변경 없음) |
21
+ | 결과 보고 | teammate `SendMessage` | Hub bridge | 슬림 래퍼 `SendMessage` + Hub bridge |
22
+ | 결과 수집 | SendMessage 중심 | `team_task_list` 폴링 | `team_task_list` 폴링 (변경 없음) |
23
+ | 정리 | `shutdown_request` × N | `TeamDelete` 직접 | `TeamDelete` 직접 |
24
+ | Opus 토큰 | N × ~800 토큰 | 0 | N × ~180 토큰 (77% 절감) |
23
25
 
24
26
  ## 사용법
25
27
 
26
- ```
27
- /tfx-team "인증 리팩터링 + UI 개선 + 보안 리뷰"
28
- /tfx-team --agents codex,gemini "프론트+백엔드"
29
- /tfx-team --tmux "작업" # 레거시 tmux 모드
30
- /tfx-team status
28
+ ```
29
+ /tfx-team "인증 리팩터링 + UI 개선 + 보안 리뷰"
30
+ /tfx-team --agents codex,gemini "프론트+백엔드"
31
+ /tfx-team --tmux "작업" # 레거시 tmux 모드
32
+ /tfx-team status
31
33
  /tfx-team stop
32
34
  ```
33
35
 
@@ -42,13 +44,13 @@ argument-hint: '"작업 설명" | --agents codex,gemini "작업" | --tmux "작
42
44
  입력: "status" → 제어 커맨드
43
45
  입력: "stop" → 제어 커맨드
44
46
  ```
45
-
46
- **제어 커맨드 감지:**
47
- - `status`, `stop`, `kill`, `attach`, `list`, `send` → `Bash("node bin/triflux.mjs team {cmd}")` 직행
48
- (`bin/triflux.mjs` 절대경로는 triflux 패키지 루트 기준)
49
- - 그 외 → Phase 2 트리아지
50
-
51
- **--tmux 감지:** 입력에 `--tmux`가 포함되면 Phase 3-tmux로 분기.
47
+
48
+ **제어 커맨드 감지:**
49
+ - `status`, `stop`, `kill`, `attach`, `list`, `send` → `Bash("node bin/triflux.mjs team {cmd}")` 직행
50
+ (`bin/triflux.mjs` 절대경로는 triflux 패키지 루트 기준)
51
+ - 그 외 → Phase 2 트리아지
52
+
53
+ **--tmux 감지:** 입력에 `--tmux`가 포함되면 Phase 3-tmux로 분기.
52
54
 
53
55
  ### Phase 2: 트리아지 (tfx-auto와 동일)
54
56
 
@@ -69,16 +71,16 @@ Bash("codex exec --full-auto --skip-git-repo-check '다음 작업을 분석하
69
71
  { \"parts\": [{ \"description\": \"...\", \"agent\": \"codex|gemini|claude\" }] }
70
72
  '")
71
73
  ```
72
-
73
- > Codex 분류 실패 시 → Opus(오케스트레이터)가 직접 분류+분해
74
-
75
- ```
76
- # Step 2b: 인라인 분해
77
- 분류 결과 → 서브태스크 배열 구성:
78
- [{ cli: "codex", subtask: "인증 리팩터링", role: "executor" },
79
- { cli: "gemini", subtask: "UI 개선", role: "designer" },
80
- { cli: "codex", subtask: "보안 리뷰", role: "reviewer" }]
81
- ```
74
+
75
+ > Codex 분류 실패 시 → Opus(오케스트레이터)가 직접 분류+분해
76
+
77
+ ```
78
+ # Step 2b: 인라인 분해
79
+ 분류 결과 → 서브태스크 배열 구성:
80
+ [{ cli: "codex", subtask: "인증 리팩터링", role: "executor" },
81
+ { cli: "gemini", subtask: "UI 개선", role: "designer" },
82
+ { cli: "codex", subtask: "보안 리뷰", role: "reviewer" }]
83
+ ```
82
84
 
83
85
  #### 수동 모드 (`N:agent_type` 또는 `--agents`)
84
86
 
@@ -90,12 +92,12 @@ Codex 분류 건너뜀 → Opus가 직접 N개 서브태스크 분해.
90
92
 
91
93
  #### Step 3a: 팀 생성
92
94
 
93
- ```
94
- teamName = "tfx-" + Date.now().toString(36).slice(-6)
95
-
96
- TeamCreate({
97
- team_name: teamName,
98
- description: "tfx-team: {원본 작업 요약}"
95
+ ```
96
+ teamName = "tfx-" + Date.now().toString(36).slice(-6)
97
+
98
+ TeamCreate({
99
+ team_name: teamName,
100
+ description: "tfx-team: {원본 작업 요약}"
99
101
  })
100
102
  ```
101
103
 
@@ -116,18 +118,43 @@ for each assignment in assignments (index i):
116
118
  runQueue.push({ taskId, agentName, ...assignment })
117
119
  ```
118
120
 
119
- #### Step 3c: 리드가 직접 Bash 병렬 실행 (teammate 스폰 제거)
121
+ #### Step 3c: 슬림 래퍼 Agent 실행 (v2.2 네비게이션 복원)
120
122
 
121
- Codex/Gemini 서브태스크는 teammate를 만들지 않고, 리드가 직접 `Bash(..., run_in_background=true)`를 병렬 호출한다.
123
+ Codex/Gemini 서브태스크마다 최소 프롬프트의 Agent를 spawn하여 네비게이션에 등록한다.
124
+ Agent 내부에서 `Bash(tfx-route.sh)` 1회 실행 후 결과 보고하고 종료한다.
122
125
 
123
126
  ```
124
127
  for each item in runQueue where item.cli in ["codex", "gemini"]:
125
- Bash(
126
- "TFX_TEAM_NAME={teamName} TFX_TEAM_TASK_ID={item.taskId} TFX_TEAM_AGENT_NAME={item.agentName} TFX_TEAM_LEAD_NAME=team-lead bash ~/.claude/scripts/tfx-route.sh {item.role} \"{item.subtask}\" {mcp_profile}",
127
- run_in_background=true
128
- )
128
+ Agent({
129
+ name: item.agentName,
130
+ team_name: teamName,
131
+ run_in_background: true,
132
+ prompt: buildSlimWrapperPrompt(item.cli, {
133
+ subtask: item.subtask,
134
+ role: item.role,
135
+ teamName: teamName,
136
+ taskId: item.taskId,
137
+ agentName: item.agentName,
138
+ leadName: "team-lead",
139
+ mcp_profile: mcp_profile
140
+ })
141
+ })
129
142
  ```
130
143
 
144
+ 슬림 래퍼 프롬프트 (~100 토큰):
145
+ ```
146
+ Bash 1회 실행 후 종료.
147
+
148
+ TFX_TEAM_NAME={teamName} TFX_TEAM_TASK_ID={taskId} TFX_TEAM_AGENT_NAME={agentName} TFX_TEAM_LEAD_NAME=team-lead bash ~/.claude/scripts/tfx-route.sh {role} '{subtask}' {mcp_profile}
149
+
150
+ 완료 → TaskUpdate(status: completed) + SendMessage(to: team-lead).
151
+ 실패 → TaskUpdate(status: failed) + SendMessage(to: team-lead).
152
+ ```
153
+
154
+ `buildSlimWrapperPrompt()`는 `hub/team/native.mjs`에 정의.
155
+
156
+ **핵심 차이 vs v2:** 프롬프트 ~100 토큰 (v2의 ~500), task claim/complete/report는 tfx-route.sh Hub bridge가 수행.
157
+
131
158
  `tfx-route.sh` 팀 통합 동작(이미 구현됨, `TFX_TEAM_*` 기반):
132
159
  - `TFX_TEAM_NAME`: 팀 식별자
133
160
  - `TFX_TEAM_TASK_ID`: 작업 식별자
@@ -164,8 +191,8 @@ Agent({
164
191
 
165
192
  ```
166
193
  "팀 '{teamName}' 생성 완료.
167
- Codex/Gemini 작업은 리드가 백그라운드 Bash병렬 실행 중이며,
168
- claude 작업만 teammate로 실행됩니다."
194
+ Codex/Gemini 워커가 슬림 래퍼 Agent네비게이션에 등록되었습니다.
195
+ Shift+Down으로 워커 전환이 가능합니다."
169
196
  ```
170
197
 
171
198
  ### Phase 4: 결과 수집 (truth source = team_task_list)
@@ -192,25 +219,25 @@ Bash("curl -sf http://127.0.0.1:27888/bridge/team/task-list -H \"Content-Type: a
192
219
  | 3 | claude-worker-1 | claude | 실패 fallback 재시도 | completed |
193
220
  ```
194
221
 
195
- ### Phase 5: 정리 (간소화)
222
+ ### Phase 5: 정리
196
223
 
197
- teammate 래퍼를 제거했으므로 `shutdown_request` 브로드캐스트를 사용하지 않는다.
198
- 정리 단계는 `TeamDelete()` 직접 호출로 마무리한다.
224
+ 슬림 래퍼 Agent는 Bash 완료 자동 종료된다.
225
+ claude 타입 Agent와 슬림 래퍼 Agent 모두 완료 확인 후 `TeamDelete()`를 호출한다.
199
226
 
200
- > **중요:** claude 타입 백그라운드 Agent가 아직 실행 중이면 `TeamDelete`가 실패할 수 있다. 해당 작업 완료를 확인한 뒤 삭제한다.
227
+ > **중요:** 슬림 래퍼 Agent가 아직 실행 중이면 `TeamDelete`가 실패할 수 있다. 모든 워커 완료를 확인한 뒤 삭제한다.
201
228
 
202
229
  ### Phase 3-tmux: 레거시 tmux 모드
203
230
 
204
231
  `--tmux` 플래그가 있으면 기존 v1 방식으로 실행:
205
-
206
- ```bash
207
- # PKG_ROOT: triflux 패키지 루트 (Bash로 확인)
208
- Bash("node {PKG_ROOT}/bin/triflux.mjs team --no-attach --agents {agents.join(',')} \"{task}\"")
209
- ```
210
-
211
- 이후 Phase 4-5 대신 사용자에게 tmux 세션 안내:
212
-
213
- ```
232
+
233
+ ```bash
234
+ # PKG_ROOT: triflux 패키지 루트 (Bash로 확인)
235
+ Bash("node {PKG_ROOT}/bin/triflux.mjs team --no-attach --agents {agents.join(',')} \"{task}\"")
236
+ ```
237
+
238
+ 이후 Phase 4-5 대신 사용자에게 tmux 세션 안내:
239
+
240
+ ```
214
241
  "tmux 세션이 생성되었습니다.
215
242
  tmux attach -t {sessionId} 세션 연결
216
243
  Ctrl+B → 방향키 pane 전환
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env node
2
- // scripts/team-keyword.mjs — "team" 매직 키워드 → /tfx-team 라우팅
3
- // UserPromptSubmit 훅에서 실행. stdin으로 프롬프트 수신.
4
- import { readFileSync } from "node:fs";
5
-
6
- // stdin에서 프롬프트 읽기
7
- let prompt = "";
8
- try {
9
- prompt = readFileSync(0, "utf8");
10
- } catch {
11
- process.exit(0);
12
- }
13
-
14
- // 코드 블록 제거 (오탐 방지)
15
- const cleaned = prompt
16
- .replace(/```[\s\S]*?```/g, "")
17
- .replace(/`[^`]+`/g, "")
18
- .replace(/https?:\/\/\S+/g, "");
19
-
20
- // "team" 키워드 감지 (소유격/관사 뒤는 제외)
21
- const hasTeam =
22
- /(?<!\b(?:my|the|our|a|his|her|their|its|omc|oh-my-claudecode)\s)\bteam\b/i.test(cleaned) ||
23
- /\btfx[\s-]?team\b/i.test(cleaned);
24
-
25
- if (hasTeam) {
26
- console.log("[MAGIC KEYWORD: tfx-team]");
27
- console.log("");
28
- console.log("You MUST invoke the skill using the Skill tool:");
29
- console.log("");
30
- console.log("Skill: tfx-team");
31
- console.log("");
32
- console.log(`User request:\n${prompt.trim()}`);
33
- console.log("");
34
- console.log("IMPORTANT: Invoke the skill IMMEDIATELY. Do not proceed without loading the skill instructions.");
35
- }