triflux 10.9.19 → 10.9.21

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.
Files changed (113) hide show
  1. package/CLAUDE.md +212 -0
  2. package/hub/lib/bash-path.mjs +73 -0
  3. package/hub/team/dashboard-open.mjs +1 -68
  4. package/hub/team/native-supervisor.mjs +9 -2
  5. package/hub/team/psmux.mjs +5 -13
  6. package/hub/team/session.mjs +6 -26
  7. package/hub/team/swarm-hypervisor.mjs +205 -27
  8. package/hub/team/synapse-http.mjs +1 -0
  9. package/hub/team/tui-core.mjs +292 -0
  10. package/hub/team/tui-lite.mjs +20 -154
  11. package/hub/team/tui-synapse.mjs +213 -0
  12. package/hub/team/tui-widgets.mjs +262 -0
  13. package/hub/team/tui.mjs +159 -255
  14. package/hub/workers/delegator-mcp.mjs +2 -2
  15. package/package.json +21 -62
  16. package/references/hosts.json +46 -0
  17. package/scripts/__tests__/keyword-detector.test.mjs +4 -4
  18. package/scripts/cross-review-gate.mjs +13 -0
  19. package/scripts/remote-spawn.mjs +11 -46
  20. package/scripts/session-spawn-helper.mjs +8 -21
  21. package/scripts/test-tfx-route-no-claude-native.mjs +4 -2
  22. package/scripts/tfx-route.sh +13 -0
  23. package/skills/tfx-deep-interview/SKILL.md +6 -6
  24. package/skills/tfx-deep-interview/SKILL.md.tmpl +6 -6
  25. package/skills/tfx-index/SKILL.md +1 -1
  26. package/skills/tfx-index/SKILL.md.tmpl +1 -1
  27. package/skills/tfx-interview/SKILL.md +9 -9
  28. package/skills/tfx-interview/SKILL.md.tmpl +9 -9
  29. package/skills/tfx-plan/SKILL.md +1 -1
  30. package/skills/tfx-plan/SKILL.md.tmpl +1 -1
  31. package/skills/tfx-research/SKILL.md +1 -1
  32. package/skills/tfx-research/SKILL.md.tmpl +1 -1
  33. package/skills/tfx-workspace/async-tests/run-tests.sh +203 -0
  34. package/skills/tfx-workspace/evals/evals.json +79 -0
  35. package/skills/tfx-workspace/iteration-1/benchmark.json +524 -0
  36. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/eval_metadata.json +11 -0
  37. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/grading.json +25 -0
  38. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/outputs/analysis.md +154 -0
  39. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/old_skill/timing.json +5 -0
  40. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/grading.json +25 -0
  41. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/outputs/analysis.md +126 -0
  42. package/skills/tfx-workspace/iteration-1/codex-gemini-remap/with_skill/timing.json +5 -0
  43. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/eval_metadata.json +11 -0
  44. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/grading.json +25 -0
  45. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/outputs/analysis.md +119 -0
  46. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/old_skill/timing.json +5 -0
  47. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/grading.json +25 -0
  48. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/outputs/analysis.md +115 -0
  49. package/skills/tfx-workspace/iteration-1/doctor-diagnosis/with_skill/timing.json +5 -0
  50. package/skills/tfx-workspace/iteration-1/hub-start-sequence/eval_metadata.json +10 -0
  51. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/grading.json +20 -0
  52. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/outputs/analysis.md +86 -0
  53. package/skills/tfx-workspace/iteration-1/hub-start-sequence/old_skill/timing.json +5 -0
  54. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/grading.json +20 -0
  55. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/outputs/analysis.md +81 -0
  56. package/skills/tfx-workspace/iteration-1/hub-start-sequence/with_skill/timing.json +5 -0
  57. package/skills/tfx-workspace/iteration-1/multi-team-creation/eval_metadata.json +12 -0
  58. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/grading.json +30 -0
  59. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/outputs/analysis.md +316 -0
  60. package/skills/tfx-workspace/iteration-1/multi-team-creation/old_skill/timing.json +5 -0
  61. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/grading.json +30 -0
  62. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/outputs/analysis.md +352 -0
  63. package/skills/tfx-workspace/iteration-1/multi-team-creation/with_skill/timing.json +5 -0
  64. package/skills/tfx-workspace/iteration-1/review.html +1325 -0
  65. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/eval_metadata.json +12 -0
  66. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/grading.json +30 -0
  67. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/outputs/analysis.md +97 -0
  68. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/old_skill/timing.json +5 -0
  69. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/grading.json +30 -0
  70. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/outputs/analysis.md +94 -0
  71. package/skills/tfx-workspace/iteration-1/routing-implement-shortcut/with_skill/timing.json +5 -0
  72. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/eval_metadata.json +12 -0
  73. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/grading.json +30 -0
  74. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/outputs/analysis.md +209 -0
  75. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/old_skill/timing.json +5 -0
  76. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/grading.json +30 -0
  77. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/outputs/analysis.md +193 -0
  78. package/skills/tfx-workspace/iteration-1/routing-multi-task-triage/with_skill/timing.json +5 -0
  79. package/skills/tfx-workspace/iteration-2/benchmark.json +144 -0
  80. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/eval_metadata.json +13 -0
  81. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/grading.json +35 -0
  82. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/outputs/analysis.md +382 -0
  83. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/old_skill/timing.json +5 -0
  84. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/grading.json +35 -0
  85. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/outputs/analysis.md +333 -0
  86. package/skills/tfx-workspace/iteration-2/multi-team-creation-refactored/with_skill/timing.json +5 -0
  87. package/skills/tfx-workspace/iteration-2/review.html +1325 -0
  88. package/skills/tfx-workspace/skill-snapshot/tfx-auto/SKILL.md +217 -0
  89. package/skills/tfx-workspace/skill-snapshot/tfx-auto-codex/SKILL.md +77 -0
  90. package/skills/tfx-workspace/skill-snapshot/tfx-codex/SKILL.md +65 -0
  91. package/skills/tfx-workspace/skill-snapshot/tfx-doctor/SKILL.md +94 -0
  92. package/skills/tfx-workspace/skill-snapshot/tfx-gemini/SKILL.md +82 -0
  93. package/skills/tfx-workspace/skill-snapshot/tfx-hub/SKILL.md +133 -0
  94. package/skills/tfx-workspace/skill-snapshot/tfx-multi/SKILL.md +426 -0
  95. package/skills/tfx-workspace/skill-snapshot/tfx-setup/SKILL.md +101 -0
  96. package/.claude-plugin/marketplace.json +0 -34
  97. package/.claude-plugin/plugin.json +0 -22
  98. package/config/mcp-registry.json +0 -29
  99. package/scripts/__tests__/release-governance.test.mjs +0 -148
  100. package/scripts/release/bump-version.mjs +0 -77
  101. package/scripts/release/check-sync.mjs +0 -51
  102. package/scripts/release/lib.mjs +0 -303
  103. package/scripts/release/prepare.mjs +0 -85
  104. package/scripts/release/publish.mjs +0 -87
  105. package/scripts/release/verify.mjs +0 -81
  106. package/scripts/release/version-manifest.json +0 -26
  107. package/tui/codex-profile.mjs +0 -457
  108. package/tui/core.mjs +0 -266
  109. package/tui/doctor.mjs +0 -375
  110. package/tui/gemini-profile.mjs +0 -299
  111. package/tui/monitor-data.mjs +0 -152
  112. package/tui/monitor.mjs +0 -339
  113. package/tui/setup.mjs +0 -598
@@ -0,0 +1,382 @@
1
+ # tfx-multi Routing Accuracy Analysis
2
+
3
+ **Input:** `/tfx-multi 인증 리팩터링 + UI 개선 + 보안 리뷰`
4
+ **Skill Definition:** SKILL.md (tfx-multi v3)
5
+ **Analysis Type:** DRY RUN — no commands executed
6
+
7
+ ---
8
+
9
+ ## Phase 0: Preflight Checks
10
+
11
+ The skill specifies that in **auto mode** (no `N:agent` prefix, no `--agents` flag), Phase 0 (preflight) and Phase 2 (triage) run **concurrently in parallel**. Preflight does NOT block Phase 2.
12
+
13
+ The single combined Bash preflight check would be:
14
+
15
+ ```bash
16
+ Bash(
17
+ command: "curl -sf http://127.0.0.1:27888/status >/dev/null && test -f ~/.claude/scripts/tfx-route.sh && echo 'preflight: ok' || echo 'preflight: FAIL'",
18
+ description: "Hub status + tfx-route.sh existence check"
19
+ )
20
+ ```
21
+
22
+ **What is verified:**
23
+ 1. Hub is running and healthy at `http://127.0.0.1:27888/status` (not `/health` alone — `/status` is the required endpoint per policy)
24
+ 2. `~/.claude/scripts/tfx-route.sh` exists on the filesystem
25
+
26
+ **Output policy:** Lead only surfaces a one-line summary (e.g., `preflight: ok (route/hub)`). Individual Bash logs are not surfaced to the user unless preflight fails.
27
+
28
+ **Failure conditions that would be reported:**
29
+ - `tfx-route.sh` missing → advise running `tfx setup`
30
+ - Hub not running or unhealthy → advise starting Hub
31
+ - Required CLI (codex/gemini) not installed → the affected subtask would be reassigned to a claude worker
32
+
33
+ **Timing:** Preflight runs **simultaneously** with Phase 2 triage (Codex classification). Agent spawn begins at Phase 3, which waits for Phase 2 output. If preflight fails, Agent spawn is aborted.
34
+
35
+ ---
36
+
37
+ ## Phase 1: Input Parsing
38
+
39
+ **Raw input string:** `인증 리팩터링 + UI 개선 + 보안 리뷰`
40
+
41
+ **Parsing decision tree:**
42
+
43
+ | Check | Result |
44
+ |-------|--------|
45
+ | Is ARGUMENTS empty/whitespace? | No → proceed |
46
+ | Does input match `N:agent_type`? | No (no colon-separated numeric prefix) |
47
+ | Does input contain `--tmux` or `--psmux`? | No → not mux mode |
48
+ | Does input contain `--agents`? | No → not manual agent-list mode |
49
+ | Does input contain `--thorough`? | No → `--quick` mode (default) |
50
+ | Does input match a control command (`status`, `stop`, `kill`, `attach`, `list`, `send`)? | No → not a control command |
51
+
52
+ **Conclusion:** Input is parsed as **auto mode** with `--quick` (default). The full task string `인증 리팩터링 + UI 개선 + 보안 리뷰` is forwarded to Phase 2 triage.
53
+
54
+ Control commands would have dispatched directly to:
55
+ ```bash
56
+ Bash("node bin/triflux.mjs multi {cmd}")
57
+ ```
58
+ ...but that path is not taken here.
59
+
60
+ ---
61
+
62
+ ## Phase 2: Triage — Decomposition into Subtasks
63
+
64
+ Since this is auto mode, triage follows the **Codex classification → Opus decomposition** path.
65
+
66
+ ### Step 2a: Codex Classification (free, runs in parallel with preflight)
67
+
68
+ ```bash
69
+ Bash(
70
+ command: "codex exec --full-auto --skip-git-repo-check '다음 작업을 분석하고 각 부분에 적합한 agent를 분류하라.\n\n agent 선택:\n - codex: 코드 구현/수정/분석/리뷰/디버깅/설계 (기본값)\n - gemini: 문서/UI/디자인/멀티모달\n - claude: 코드베이스 탐색/테스트 실행/검증 (최후 수단)\n\n 모든 역할은 Codex/Gemini 우선 배정:\n - explore, verifier, test-engineer, qa-tester 포함 전 역할이 Codex/Gemini로 라우팅\n - Codex/Gemini 미설치 시에만 claude-native(sonnet/haiku) fallback\n - claude 타입은 최후 수단으로만 사용\n\n 작업: 인증 리팩터링 + UI 개선 + 보안 리뷰\n\n JSON만 출력:\n { \"parts\": [{ \"description\": \"...\", \"agent\": \"codex|gemini|claude\" }] }'"
71
+ )
72
+ ```
73
+
74
+ **Expected Codex JSON output (predicted):**
75
+ ```json
76
+ {
77
+ "parts": [
78
+ { "description": "인증 리팩터링", "agent": "codex" },
79
+ { "description": "UI 개선", "agent": "gemini" },
80
+ { "description": "보안 리뷰", "agent": "codex" }
81
+ ]
82
+ }
83
+ ```
84
+
85
+ Rationale per skill's agent selection rules:
86
+ - `인증 리팩터링` — code refactoring → **codex** (코드 구현/수정)
87
+ - `UI 개선` — UI/design improvement → **gemini** (UI/디자인/멀티모달)
88
+ - `보안 리뷰` — code review/analysis → **codex** (리뷰/분석)
89
+
90
+ **Fallback:** If Codex classification fails, Opus (the Lead orchestrator) directly classifies and decomposes without the Codex step.
91
+
92
+ ### Step 2b: Inline Decomposition
93
+
94
+ Opus maps the Codex output to the subtasks array:
95
+
96
+ ```
97
+ assignments = [
98
+ { cli: "codex", subtask: "인증 리팩터링", role: "executor" },
99
+ { cli: "gemini", subtask: "UI 개선", role: "designer" },
100
+ { cli: "codex", subtask: "보안 리뷰", role: "reviewer" }
101
+ ]
102
+ ```
103
+
104
+ Role mapping rationale:
105
+ - `인증 리팩터링` → implementation task → role: `executor`
106
+ - `UI 개선` → design/UI improvement → role: `designer`
107
+ - `보안 리뷰` → code review → role: `reviewer`
108
+
109
+ **Note:** `--quick` mode is the default (no `--thorough` flag detected), so **Phase 2.5 (Plan) and Phase 2.6 (PRD) are skipped entirely**. Execution proceeds directly to Phase 3.
110
+
111
+ ---
112
+
113
+ ## Phase 3: Exact Tool Call Parameters
114
+
115
+ ### Step 3a: TeamCreate
116
+
117
+ ```
118
+ TeamCreate({
119
+ team_name: "tfx-" + Date.now().toString(36).slice(-6), // e.g., "tfx-m7x2p1"
120
+ description: "tfx-multi: 인증 리팩터링 + UI 개선 + 보안 리뷰"
121
+ })
122
+ ```
123
+
124
+ `teamName` (e.g., `"tfx-m7x2p1"`) is stored and reused throughout all subsequent calls.
125
+
126
+ ### Step 3b: TaskCreate (one per subtask)
127
+
128
+ **TaskCreate #1 — 인증 리팩터링:**
129
+ ```
130
+ TaskCreate({
131
+ subject: "인증 리팩터링",
132
+ description: "CLI: codex, 역할: executor\n\n인증 관련 코드를 리팩터링하고 구조를 개선한다.",
133
+ metadata: { cli: "codex", role: "executor" }
134
+ })
135
+ → taskId_1 = <created task id>
136
+ → agentName_1 = "codex-worker-1"
137
+ ```
138
+
139
+ **TaskCreate #2 — UI 개선:**
140
+ ```
141
+ TaskCreate({
142
+ subject: "UI 개선",
143
+ description: "CLI: gemini, 역할: designer\n\nUI 컴포넌트 및 사용자 인터페이스를 개선한다.",
144
+ metadata: { cli: "gemini", role: "designer" }
145
+ })
146
+ → taskId_2 = <created task id>
147
+ → agentName_2 = "gemini-worker-1"
148
+ ```
149
+
150
+ **TaskCreate #3 — 보안 리뷰:**
151
+ ```
152
+ TaskCreate({
153
+ subject: "보안 리뷰",
154
+ description: "CLI: codex, 역할: reviewer\n\n코드베이스의 보안 취약점을 검토하고 리뷰한다.",
155
+ metadata: { cli: "codex", role: "reviewer" }
156
+ })
157
+ → taskId_3 = <created task id>
158
+ → agentName_3 = "codex-worker-2"
159
+ ```
160
+
161
+ runQueue after Step 3b:
162
+ ```
163
+ [
164
+ { taskId: taskId_1, agentName: "codex-worker-1", cli: "codex", subtask: "인증 리팩터링", role: "executor" },
165
+ { taskId: taskId_2, agentName: "gemini-worker-1", cli: "gemini", subtask: "UI 개선", role: "designer" },
166
+ { taskId: taskId_3, agentName: "codex-worker-2", cli: "codex", subtask: "보안 리뷰", role: "reviewer" }
167
+ ]
168
+ ```
169
+
170
+ ### Step 3c: Agent Slim Wrapper Spawns (codex and gemini items)
171
+
172
+ All three assignments in this input have `cli` of `"codex"` or `"gemini"`, so **all three go through Step 3c** (slim wrapper Agent spawn). None take the Step 3d (claude direct) path.
173
+
174
+ **Agent #1 — codex-worker-1 (인증 리팩터링):**
175
+ ```
176
+ Agent({
177
+ name: "codex-worker-1",
178
+ team_name: teamName, // e.g., "tfx-m7x2p1"
179
+ mode: "bypassPermissions",
180
+ run_in_background: true,
181
+ prompt: buildSlimWrapperPrompt("codex", {
182
+ subtask: "인증 리팩터링",
183
+ role: "executor",
184
+ teamName: teamName,
185
+ taskId: taskId_1,
186
+ agentName: "codex-worker-1",
187
+ leadName: "team-lead",
188
+ mcp_profile: <resolved mcp_profile>
189
+ })
190
+ })
191
+ ```
192
+
193
+ The slim wrapper prompt (generated by `hub/team/native.mjs:buildSlimWrapperPrompt()`) instructs the agent to:
194
+ 1. `TaskUpdate(taskId_1, status: "in_progress")` — claim
195
+ 2. `SendMessage(to: "team-lead", "작업 시작: codex-worker-1")` — turn boundary
196
+ 3. `Bash(command: "bash ~/.claude/scripts/tfx-route.sh executor '인증 리팩터링' <mcp_profile>", timeout: 1140000)` — execute via tfx-route.sh (1080s + 60s = 1140s = 1,140,000ms; executor role → default timeout)
197
+ 4. `SendMessage(to: "team-lead", "결과: <요약>")` — result boundary
198
+ 5. Await lead feedback; re-execute (Step 3) if directed
199
+ 6. On final completion: `TaskUpdate(taskId_1, status: "completed", metadata: {result: "success"|"failed"})` + `SendMessage`
200
+
201
+ **Agent #2 — gemini-worker-1 (UI 개선):**
202
+ ```
203
+ Agent({
204
+ name: "gemini-worker-1",
205
+ team_name: teamName,
206
+ mode: "bypassPermissions",
207
+ run_in_background: true,
208
+ prompt: buildSlimWrapperPrompt("gemini", {
209
+ subtask: "UI 개선",
210
+ role: "designer",
211
+ teamName: teamName,
212
+ taskId: taskId_2,
213
+ agentName: "gemini-worker-1",
214
+ leadName: "team-lead",
215
+ mcp_profile: <resolved mcp_profile>
216
+ })
217
+ })
218
+ ```
219
+
220
+ Internal slim wrapper execution:
221
+ ```bash
222
+ bash ~/.claude/scripts/tfx-route.sh designer 'UI 개선' <mcp_profile>
223
+ ```
224
+ Timeout: 1140000ms (1080s default + 60s buffer).
225
+
226
+ **Agent #3 — codex-worker-2 (보안 리뷰):**
227
+ ```
228
+ Agent({
229
+ name: "codex-worker-2",
230
+ team_name: teamName,
231
+ mode: "bypassPermissions",
232
+ run_in_background: true,
233
+ prompt: buildSlimWrapperPrompt("codex", {
234
+ subtask: "보안 리뷰",
235
+ role: "reviewer",
236
+ teamName: teamName,
237
+ taskId: taskId_3,
238
+ agentName: "codex-worker-2",
239
+ leadName: "team-lead",
240
+ mcp_profile: <resolved mcp_profile>
241
+ })
242
+ })
243
+ ```
244
+
245
+ Internal slim wrapper execution:
246
+ ```bash
247
+ bash ~/.claude/scripts/tfx-route.sh reviewer '보안 리뷰' <mcp_profile>
248
+ ```
249
+ Timeout: 3660000ms (reviewer role maps to "review" profile → 3600s + 60s buffer = 3,660,000ms).
250
+
251
+ > Note on Bash timeout: `getRouteTimeout(role, mcpProfile)` determines the timeout. The `reviewer` role with a `review`-type profile yields **3600s** (not the default 1080s), resulting in a 3,660,000ms Bash timeout. The `executor` and `designer` roles use the default 1080s, giving 1,140,000ms.
252
+
253
+ ### Step 3d: Claude Direct Agent (not applicable here)
254
+
255
+ No subtasks have `cli == "claude"` in this input. Step 3d is **not executed**.
256
+
257
+ ### Step 3e: User Notification
258
+
259
+ After all three Agent spawns:
260
+ ```
261
+ "팀 '{teamName}' 생성 완료.
262
+ Codex/Gemini 워커가 슬림 래퍼 Agent로 네비게이션에 등록되었습니다.
263
+ Shift+Down으로 다음 워커로 전환 (마지막→리드 wrap). Shift+Tab으로 이전 워커 전환."
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Phase 4: Result Collection
269
+
270
+ Phase 4 runs after all background Agent processes complete (or are awaited by the Lead).
271
+
272
+ **Step 1:** Lead awaits completion signals from all three background Agents.
273
+
274
+ **Step 2:** `team_task_list` is queried as the **single truth source**:
275
+ ```bash
276
+ Bash("node hub/bridge.mjs team-task-list --team tfx-m7x2p1")
277
+ ```
278
+
279
+ **Step 3:** For each task in the list:
280
+ - If `status == "completed"` AND `metadata.result == "failed"` → the task is retried using a Claude fallback worker (Step 3d pattern)
281
+ - If `status == "completed"` AND `metadata.result == "success"` → accepted as done
282
+
283
+ **Step 4:** After any fallback retries, `team-task-list` is queried again to confirm final state.
284
+
285
+ **Step 5:** `send-message` events and `result(task.result)` topic events are used only as **progress observation channels** — they do NOT determine the final outcome. Only `team_task_list` state is authoritative.
286
+
287
+ **Final report (example):**
288
+ ```markdown
289
+ ## tfx-multi 실행 결과
290
+
291
+ | # | Worker | CLI | 작업 | 상태 |
292
+ |---|--------|-----|------|------|
293
+ | 1 | codex-worker-1 | codex | 인증 리팩터링 | completed |
294
+ | 2 | gemini-worker-1 | gemini | UI 개선 | completed |
295
+ | 3 | codex-worker-2 | codex | 보안 리뷰 | completed |
296
+ ```
297
+
298
+ ---
299
+
300
+ ## Phase 5: Cleanup (TeamDelete)
301
+
302
+ Phase 5 is **mandatory** regardless of success or failure. It runs after Phase 4 result collection.
303
+
304
+ **Cleanup sequence:**
305
+
306
+ 1. Wait up to **30 seconds** for all background Agent processes to complete.
307
+ 2. If any Agent is still running after 30s, stop waiting and proceed with cleanup anyway.
308
+ 3. Call TeamDelete:
309
+ ```
310
+ TeamDelete(teamName) // e.g., TeamDelete("tfx-m7x2p1")
311
+ ```
312
+ 4. If TeamDelete fails (active members still present):
313
+ - Call `forceCleanupTeam(teamName)` (force cleanup utility)
314
+ - If that also fails → instruct user to manually run:
315
+ ```bash
316
+ rm -rf ~/.claude/teams/tfx-m7x2p1/ ~/.claude/tasks/tfx-m7x2p1/
317
+ ```
318
+ 5. Output the final summary report (from Phase 4).
319
+
320
+ **Why this is mandatory:** Without TeamDelete, `~/.claude/teams/{teamName}/` persists on disk and the OMC hook continuously detects "team executing," causing an infinite detection loop.
321
+
322
+ ---
323
+
324
+ ## Key Boolean Flags
325
+
326
+ ### `mode: "bypassPermissions"` in Agent calls
327
+
328
+ **YES — included in all three Agent spawns.**
329
+
330
+ The skill explicitly states (Phase 3c):
331
+ > **[필수] `mode: "bypassPermissions"` — 모든 Agent spawn에 반드시 포함한다.**
332
+ > 이 설정이 없으면 워커가 Bash 실행 시 사용자 승인을 요청하여 자동 실행이 중단된다.
333
+ > Codex/Gemini 래퍼, Claude 워커 모두 동일하게 적용한다.
334
+
335
+ All three `Agent({...})` calls in this analysis include `mode: "bypassPermissions"`.
336
+
337
+ ### `tfx-route.sh` usage inside Agent wrappers
338
+
339
+ **YES — all slim wrapper Agents use `tfx-route.sh` exclusively.**
340
+
341
+ The skill explicitly prohibits direct CLI invocation:
342
+ > **[금지] Lead 또는 Agent 래퍼가 `gemini -y -p "..."` 또는 `codex exec "..."`를 직접 호출하면 안 된다.**
343
+
344
+ The required form inside each slim wrapper Agent is:
345
+ ```bash
346
+ bash ~/.claude/scripts/tfx-route.sh {role} '{subtask}' {mcp_profile}
347
+ ```
348
+
349
+ This ensures that model specification (`-m gemini-3.1-pro-preview`), MCP filters, team bridge integration (`TFX_TEAM_*` env vars), Windows-compatible paths, timeouts, and post-processing (token tracking, issue logging) are all properly applied.
350
+
351
+ The three concrete `tfx-route.sh` invocations in this session:
352
+ ```bash
353
+ # codex-worker-1
354
+ bash ~/.claude/scripts/tfx-route.sh executor '인증 리팩터링' <mcp_profile>
355
+
356
+ # gemini-worker-1
357
+ bash ~/.claude/scripts/tfx-route.sh designer 'UI 개선' <mcp_profile>
358
+
359
+ # codex-worker-2
360
+ bash ~/.claude/scripts/tfx-route.sh reviewer '보안 리뷰' <mcp_profile>
361
+ ```
362
+
363
+ ---
364
+
365
+ ## Summary Table
366
+
367
+ | Phase | Action | Key Parameters / Notes |
368
+ |-------|--------|------------------------|
369
+ | 0 | Preflight (parallel with Phase 2) | `curl http://127.0.0.1:27888/status` + `test -f ~/.claude/scripts/tfx-route.sh` |
370
+ | 1 | Input parsed as **auto mode, --quick** | No `N:agent`, no `--tmux`, no `--thorough`, no control command |
371
+ | 2a | Codex classification | Task: `인증 리팩터링 + UI 개선 + 보안 리뷰` → codex / gemini / codex |
372
+ | 2b | Subtask array | 3 items: executor/designer/reviewer |
373
+ | 3a | TeamCreate | `team_name: "tfx-<6chars>"`, `description: "tfx-multi: 인증 리팩터링 + UI 개선 + 보안 리뷰"` |
374
+ | 3b | 3x TaskCreate | subjects: 인증 리팩터링, UI 개선, 보안 리뷰 |
375
+ | 3c | 3x Agent (slim wrapper) | `mode: "bypassPermissions"`, `run_in_background: true`, uses `tfx-route.sh` internally |
376
+ | 3d | 0x Agent (claude direct) | Not applicable — no `cli: "claude"` assignments |
377
+ | 4 | Result collection | `node hub/bridge.mjs team-task-list --team {teamName}` as truth source |
378
+ | 5 | TeamDelete | Mandatory; max 30s wait; force cleanup fallback if needed |
379
+
380
+ ---
381
+
382
+ *Analysis generated by DRY RUN — no commands were executed.*
@@ -0,0 +1,5 @@
1
+ {
2
+ "total_tokens": 27382,
3
+ "duration_ms": 133145,
4
+ "total_duration_seconds": 133.1
5
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "expectations": [
3
+ {
4
+ "text": "Creates exactly one TeamCreate with tfx- prefix naming",
5
+ "passed": true,
6
+ "evidence": "TeamCreate({ team_name: 'tfx-<hex6>' })"
7
+ },
8
+ {
9
+ "text": "Creates 3 TaskCreate calls (one per subtask)",
10
+ "passed": true,
11
+ "evidence": "3x TaskCreate with { subject, metadata: { cli, role } }"
12
+ },
13
+ {
14
+ "text": "Spawns 3 Agent wrappers with mode: bypassPermissions",
15
+ "passed": true,
16
+ "evidence": "3x Agent({ mode: bypassPermissions, run_in_background: true })"
17
+ },
18
+ {
19
+ "text": "Uses tfx-route.sh inside Agent wrapper (not direct codex/gemini)",
20
+ "passed": true,
21
+ "evidence": "bash ~/.claude/scripts/tfx-route.sh {role} '{subtask}' {mcp_profile}; direct codex exec is forbidden"
22
+ },
23
+ {
24
+ "text": "Includes Phase 5 cleanup (TeamDelete)",
25
+ "passed": true,
26
+ "evidence": "TeamDelete always executed, max 30s wait, skipping causes infinite loop"
27
+ },
28
+ {
29
+ "text": "References agent-wrapper-rules.md for detailed rules",
30
+ "passed": true,
31
+ "evidence": "agent-wrapper-rules.md provided 6-step interrupt protocol, dynamic timeout values, and 7 technical reasons for tfx-route.sh"
32
+ }
33
+ ],
34
+ "summary": { "passed": 6, "failed": 0, "total": 6, "pass_rate": 1.0 }
35
+ }