triflux 8.11.2 → 8.12.2

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 (103) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/hooks/hooks.json +56 -51
  5. package/hub/pipeline/index.mjs +318 -318
  6. package/hub/routing/q-learning.mjs +2 -1
  7. package/hub/schema.sql +146 -146
  8. package/hub/team/cli/commands/kill.mjs +37 -37
  9. package/hub/team/cli/commands/start/index.mjs +3 -2
  10. package/hub/team/cli/commands/start/parse-args.mjs +5 -0
  11. package/hub/team/cli/commands/start/start-headless.mjs +2 -1
  12. package/hub/team/cli/commands/stop.mjs +31 -31
  13. package/hub/team/cli/commands/task.mjs +30 -30
  14. package/hub/team/cli/help.mjs +41 -40
  15. package/hub/team/cli/services/hub-client.mjs +208 -208
  16. package/hub/team/cli/services/native-control.mjs +118 -118
  17. package/hub/team/cli/services/runtime-mode.mjs +62 -62
  18. package/hub/team/cli/services/state-store.mjs +48 -48
  19. package/hub/team/dashboard-anchor.mjs +14 -0
  20. package/hub/team/dashboard.mjs +274 -274
  21. package/hub/team/headless.mjs +44 -19
  22. package/hub/team/native.mjs +649 -649
  23. package/hub/tools.mjs +554 -554
  24. package/hub/workers/delegator-mcp.mjs +21 -1
  25. package/package.json +1 -1
  26. package/scripts/__tests__/remote-spawn-transfer.test.mjs +117 -0
  27. package/scripts/__tests__/remote-spawn.test.mjs +78 -0
  28. package/scripts/cache-buildup.mjs +401 -0
  29. package/scripts/headless-guard.mjs +10 -3
  30. package/scripts/hub-ensure.mjs +120 -120
  31. package/scripts/lib/mcp-filter.mjs +720 -720
  32. package/scripts/lib/remote-spawn-transfer.mjs +196 -0
  33. package/scripts/mcp-check.mjs +237 -127
  34. package/scripts/mcp-gateway-ensure.mjs +6 -8
  35. package/scripts/mcp-gateway-integration-test.mjs +228 -0
  36. package/scripts/mcp-gateway-start.mjs +42 -16
  37. package/scripts/mcp-gateway-start.ps1 +17 -14
  38. package/scripts/mcp-gateway-verify.mjs +1 -1
  39. package/scripts/preflight-cache.mjs +137 -137
  40. package/scripts/remote-spawn.mjs +404 -40
  41. package/scripts/setup.mjs +18 -0
  42. package/scripts/tfx-route-worker.mjs +165 -165
  43. package/scripts/tfx-route.sh +85 -16
  44. package/scripts/token-snapshot.mjs +575 -575
  45. package/skills/tfx-analysis/SKILL.md +101 -101
  46. package/skills/tfx-autopilot/SKILL.md +112 -112
  47. package/skills/tfx-autoresearch/SKILL.md +1 -0
  48. package/skills/tfx-autoroute/SKILL.md +184 -184
  49. package/skills/tfx-codex-swarm/SKILL.md +449 -0
  50. package/skills/tfx-codex-swarm/evals/evals.json +26 -0
  51. package/skills/tfx-codex-swarm-workspace/iteration-1/benchmark.json +33 -0
  52. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/eval_metadata.json +42 -0
  53. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/grading.json +11 -0
  54. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/outputs/analysis.md +87 -0
  55. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/outputs/classification.md +35 -0
  56. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/outputs/commands.sh +275 -0
  57. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/outputs/routing.md +56 -0
  58. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/timing.json +5 -0
  59. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/grading.json +11 -0
  60. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/outputs/analysis.md +92 -0
  61. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/outputs/classification.md +71 -0
  62. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/outputs/commands.sh +264 -0
  63. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/outputs/routing.md +113 -0
  64. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/timing.json +5 -0
  65. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/eval_metadata.json +32 -0
  66. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/grading.json +9 -0
  67. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/outputs/analysis.md +96 -0
  68. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/outputs/classification.md +38 -0
  69. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/outputs/commands.sh +151 -0
  70. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/outputs/routing.md +51 -0
  71. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/timing.json +5 -0
  72. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/grading.json +9 -0
  73. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/outputs/analysis.md +127 -0
  74. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/outputs/classification.md +57 -0
  75. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/outputs/commands.sh +129 -0
  76. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/outputs/routing.md +84 -0
  77. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/timing.json +5 -0
  78. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/eval_metadata.json +27 -0
  79. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/grading.json +8 -0
  80. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/outputs/analysis.md +98 -0
  81. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/outputs/classification.md +65 -0
  82. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/outputs/commands.sh +123 -0
  83. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/outputs/routing.md +66 -0
  84. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/timing.json +5 -0
  85. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/grading.json +8 -0
  86. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/outputs/analysis.md +88 -0
  87. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/outputs/classification.md +40 -0
  88. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/outputs/commands.sh +130 -0
  89. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/outputs/routing.md +61 -0
  90. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/timing.json +5 -0
  91. package/skills/tfx-profile/SKILL.md +141 -51
  92. package/skills/tfx-qa/SKILL.md +117 -117
  93. package/skills/tfx-remote-spawn/references/hosts.json +16 -16
  94. package/skills/tfx-review/SKILL.md +51 -51
  95. package/skills/tfx-setup/SKILL.md +20 -0
  96. package/tui/gemini-profile.mjs +254 -0
  97. package/tui/setup.mjs +36 -1
  98. package/scripts/claude-logged.ps1 +0 -54
  99. package/scripts/demo-tui.mjs +0 -59
  100. package/skills/.omc/state/agent-replay-8f0e10a9-9693-4410-96f5-a6b07e8ed995.jsonl +0 -1
  101. package/skills/.omc/state/idle-notif-cooldown.json +0 -3
  102. package/skills/.omc/state/last-tool-error.json +0 -7
  103. package/skills/.omc/state/subagent-tracking.json +0 -7
@@ -0,0 +1,449 @@
1
+ ---
2
+ name: tfx-codex-swarm
3
+ description: OMX 스킬을 활용하는 Codex 다중 세션 스폰 오케스트레이터. PRD/태스크 파일을 스캔하여 각각 독립 git worktree + psmux 세션���로 Codex를 full-auto 실행한다. 'codex swarm', 'codex 다중', '코덱스 스웜', '코덱스 다중 실행', 'PRD 일괄 실행', 'codex spawn', '코덱스 스폰', '다중 코덱스', 'swarm codex', 'omx swarm' 같은 요청에 반드시 사용. PRD가 여러 개이거나 병렬 Codex 실행이 필요한 모든 상황에 적극 활용.
4
+ ---
5
+
6
+ # tfx-codex-swarm — Codex 다중 세션 스폰 오케스트레이터
7
+
8
+ > PRD/태스크 파일 N개를 각각 독립 worktree + psmux 세션으로 Codex full-auto 실행.
9
+ > AskUserQuestion 기반 인터랙티브 설정. 미지정 시 하네스가 자동 판단.
10
+
11
+ ## 전제 조건
12
+
13
+ - `codex` CLI 설치됨
14
+ - `psmux` 설치됨 (세션 관리)
15
+ - `git` (worktree 생성)
16
+ - Windows Terminal (탭 기반 attach)
17
+ - Windows Terminal (`wt.exe` 탭 기반 attach)
18
+
19
+ ## 워크플로우
20
+
21
+ ### Step 1: 태스크 파일 스캔
22
+
23
+ 아래 경로를 순서대로 스캔하여 PRD/태스크 파일을 수집한다:
24
+
25
+ ```
26
+ .omx/plans/*.md
27
+ .omc/plans/*.md
28
+ docs/prd/*.md
29
+ ```
30
+
31
+ 사용자가 경로를 명시했으면 해당 경로만 스캔.
32
+ 파일이 0개면 → "태스크 파일을 찾을 수 없습니다" 보고 후 종료.
33
+
34
+ ### Step 2: 태스크 선택
35
+
36
+ **사용자가 명시적��로 파일을 지정한 경우** → 바로 Step 3.
37
+
38
+ **미지정인 경우** → AskUserQuestion:
39
+
40
+ ```
41
+ question: "어떤 태스크를 실행하시겠습니까?"
42
+ header: "태스크 선택"
43
+ options:
44
+ - label: "전체 실행 ({N}개)"
45
+ description: "스캔된 모든 태스크를 병렬 실행"
46
+ - label: "선택 실행"
47
+ description: "실행할 태스크를 하나��� 선택"
48
+ - label: "최근 변경된 것만"
49
+ description: "최근 24시간 내 수정된 태스���만 실행"
50
+ ```
51
+
52
+ "선택 실행" 선택 시 → 파일 목록을 AskUserQuestion으로 하나씩 표시:
53
+
54
+ ```
55
+ question: "이 태스크를 포함하시겠습니까?"
56
+ header: "{filename}"
57
+ options:
58
+ - label: "포함"
59
+ - label: "제외"
60
+ - label: "나머지 전부 포함"
61
+ - label: "나머��� 전부 제외"
62
+ ```
63
+
64
+ ### Step 3: 태스크 분류 및 Codex 스킬 매핑
65
+
66
+ #### 3-1. 설치된 스킬 캐시 참조
67
+
68
+ `tfx setup` 또는 `tfx update` 실행 시 Codex 설치 스킬을 스캔하여 캐시에 저장한다.
69
+ 스웜 스킬은 매번 스캔하지 않고 **캐시 파일만 읽는다**.
70
+
71
+ ```
72
+ 캐시 경로: .omc/cache/codex-skills.json
73
+ 생성 시점: tfx setup / tfx update
74
+ ```
75
+
76
+ 캐시 구조:
77
+ ```json
78
+ {
79
+ "scanned_at": "2026-03-30T16:00:00Z",
80
+ "skills": [
81
+ {"name": "autopilot", "role": "auto", "description": "Full autonomous execution..."},
82
+ {"name": "ralph", "role": "persist", "description": "Persistent loop until..."},
83
+ {"name": "plan", "role": "plan", "description": "Strategic planning..."}
84
+ ]
85
+ }
86
+ ```
87
+
88
+ 캐시 미존재 시 → fallback으로 OMX 기본 매핑 사용 (하위 호환).
89
+
90
+ 역할 매핑 기준 (tfx setup이 스캔 시 description에서 추출):
91
+
92
+ | 역할 | description 키워드 매칭 | 예시 |
93
+ |------|------------------------|------|
94
+ | 계획 (plan) | "plan", "계획", "decompos" | `$plan` |
95
+ | 자율 실행 (auto) | "autonomous", "자율", "auto-execute" | `$autopilot` |
96
+ | 반복 완료 (persist) | "loop", "반복", "completion", "persist" | `$ralph` |
97
+ | 조사 (investigate) | "investigate", "research", "조사" | `$plan` (단독) |
98
+ | 코드 리뷰 (review) | "review", "리뷰" | `$code-review` |
99
+
100
+ **스킬 0개인 경우** → 스킬 없이 프롬프트 직접 전달 (codex에 지시만 포함).
101
+
102
+ #### 3-2. 태스크 유형 분류
103
+
104
+ 각 태스크 파일의 내용을 읽고 자동 분류한다:
105
+
106
+ | 유형 | 판별 기준 (파일 내용) | 기본 스킬 조합 |
107
+ |------|----------------------|---------------|
108
+ | 구현 (implement) | "구현", "implement", "추가", "변경", "fix" | plan → auto |
109
+ | 조사 (investigate) | "조사", "investigation", "재현", "reproduce" | plan (단독) |
110
+ | 리팩터링 (refactor) | "리팩터", "refactor", "정리", "개선" | plan → persist |
111
+
112
+ 유형이 결정되면 3-1에서 발견한 스킬 중 해당 역할에 매칭되는 스킬을 자동 선택.
113
+ 매칭 실패 시 → 프롬프트에 역할을 텍스트로 직접 기술.
114
+
115
+ #### 3-3. 사용자 오버라이드
116
+
117
+ **사용자가 스킬을 명시한 경우** → 해당 스킬 사용.
118
+
119
+ **미지정이고 자동 분류가 모호한 경우** → AskUserQuestion:
120
+
121
+ ```
122
+ question: "어떤 Codex 스킬을 사용하시겠습니까?"
123
+ header: "설치된 스킬 ({N}개 발견)"
124
+ options:
125
+ # 동적 생성: 발견된 스킬에서 옵션 구성
126
+ - label: "${plan_skill} → ${auto_skill}"
127
+ description: "{plan_skill.description} → {auto_skill.description}"
128
+ - label: "${plan_skill} → ${persist_skill}"
129
+ description: "계획 후 완료까지 반복 실행"
130
+ - label: "${plan_skill} 만"
131
+ description: "계획 수립만 (조사/분석용)"
132
+ - label: "스킬 없이 실행"
133
+ description: "프롬프트만 전달, $skill 미사용"
134
+ ```
135
+
136
+ ### Step 4: 프로파일 자동 라우팅
137
+
138
+ 각 태스크의 규모와 유형에 따라 최적 Codex 프로파일을 자동 선택한다.
139
+ 사용자가 프로파일을 명시하면 해당 프로파일로 고정.
140
+
141
+ #### 4-1. 태스크 규모 산정
142
+
143
+ PRD 파일을 읽고 아래 시그널에서 규모를 판단한다:
144
+
145
+ | 시그널 | 측정 방법 |
146
+ |--------|----------|
147
+ | PRD 길이 | 줄 수 (wc -l) |
148
+ | 영향 파일 수 | PRD 내 언급된 파일 경로 개수 |
149
+ | 키워드 복잡도 | "아키텍처", "마이그레이션", "리팩터링" 등 고비용 키워드 존재 |
150
+ | 의존성 깊이 | 다른 이슈/PRD 참조 여부 |
151
+
152
+ 규모 분류:
153
+
154
+ | 규모 | PRD 줄 수 | 영향 파일 | 고비용 키워드 |
155
+ |------|-----------|----------|-------------|
156
+ | XL (대규모) | 80+ 줄 | 6+ 파일 | 2개 이상 |
157
+ | L (표준) | 40-80 줄 | 3-5 파일 | 0-1개 |
158
+ | M (경량) | 20-40 줄 | 1-2 파일 | 없음 |
159
+ | S (사소) | 20줄 미만 | 1 파일 | 없음 |
160
+
161
+ #### 4-2. 프로파일 라우팅 테이블
162
+
163
+ 태스크 유형(Step 3)과 규모를 조합하여 프로파일을 결정한다:
164
+
165
+ | 유형 \ 규모 | XL | L | M | S |
166
+ |-------------|-----|-----|-----|-----|
167
+ | **구현** | `codex53_xhigh` | `codex53_high` | `codex53_med` | `codex53_low` |
168
+ | **조사** | `gpt54_high` | `gpt54_high` | `gpt54_low` | `mini54_med` |
169
+ | **리팩터링** | `codex53_xhigh` | `codex53_high` | `codex53_med` | `spark53_med` |
170
+ | **린트/포맷** | — | — | `spark53_med` | `spark53_low` |
171
+
172
+ 프로파일은 `~/.codex/config.toml`의 v9 체계(`{model}{ver}_{effort}`)를 `-p` 플래그로 직접 참조한다.
173
+ `-c` 하드코딩은 사용하지 않는다. (레거시 `fast/normal/high` 프로파일도 사용하지 않는다.)
174
+
175
+ ```bash
176
+ # 예시: -p 플래그로 프로파일 지정
177
+ codex -p codex53_high --dangerously-bypass-approvals-and-sandbox "prompt"
178
+ codex -p gpt54_high --dangerously-bypass-approvals-and-sandbox "prompt"
179
+ ```
180
+
181
+ #### 4-3. 라우팅 결과 표시
182
+
183
+ 프로파일 결정 후 테이블로 표시한다:
184
+
185
+ ```
186
+ | # | 태스크 | 규모 | 유형 | 프로파일 |
187
+ |---|--------|------|------|----------|
188
+ | 24 | file-transfer | L | 구현 | codex53_high |
189
+ | 25 | resize-blank | L | 조사 | gpt54_high |
190
+ | 28 | guard-deadlock | M | 구현 | codex53_med |
191
+ | 30 | terminal-minimize | M | 조사 | gpt54_low |
192
+ ```
193
+
194
+ 사용자가 "프로파일 바꿔", "전부 xhigh로" 등을 언급한 경우에만 AskUserQuestion으로 오버라이드:
195
+
196
+ ```
197
+ question: "프로파일 라우팅을 조정하시겠습니까?"
198
+ header: "프로파일"
199
+ options:
200
+ - label: "자동 라우팅 유지"
201
+ description: "태스크별 최적 프로파일 (위 테이블대로)"
202
+ - label: "전체 고정"
203
+ description: "모든 세션을 동일 프로파일로 실행"
204
+ - label: "개별 조정"
205
+ description: "태스크마다 수동 선택"
206
+ - label: "전부 최고 사양"
207
+ description: "codex53_xhigh 일괄 적용"
208
+ ```
209
+
210
+ #### 4-4. 기타 설정 기본값
211
+
212
+ | 설정 | 기본값 | 설명 |
213
+ |------|--------|------|
214
+ | 실행 모드 | `--dangerously-bypass-approvals-and-sandbox` | YOLO (승인+샌드박스 완전 해제). `--skip-git-repo-check`는 `codex exec` 전용이므로 대화식에서 사용 금지 |
215
+ | worktree | 활성화 | 세션당 독립 worktree |
216
+ | psmux | 활성화 | 세션 관리 |
217
+
218
+ ### Step 5: Worktree 생성
219
+
220
+ 각 태스크마다 독립 git worktree를 생성한다:
221
+
222
+ ```bash
223
+ # 브랜치 + worktree 생성
224
+ git worktree add .codex-swarm/wt-issue-{N} -b codex/issue-{N} 2>/dev/null || \
225
+ git worktree add .codex-swarm/wt-issue-{N} codex/issue-{N}
226
+ ```
227
+
228
+ 워크트리 경로 규칙:
229
+ - `.codex-swarm/wt-issue-{N}` — 이슈 번호 기반
230
+ - `.codex-swarm/wt-{slug}` — 파일명 기반 (이슈 번호 없을 때)
231
+
232
+ ### Step 6: 프롬프트 생성
233
+
234
+ 각 태스크에 대해 프롬프트 파일을 생성한다:
235
+
236
+ ```
237
+ .codex-swarm/prompts/prompt-{id}.md
238
+ ```
239
+
240
+ 프롬프트 구조:
241
+ ```markdown
242
+ {PROJECT_NAME} 프로젝트의 태스크를 {유형}해야 합니다.
243
+
244
+ 태스크 파일을 먼저 읽으세요: {원본_PRD_경로}
245
+
246
+ 작업 순서:
247
+ 1. 태스크 파일을 읽고 요구사항을 파악하세요
248
+ 2. {OMX_스킬_지시}
249
+ 3. {후속_지시}
250
+
251
+ 프로젝트 정보:
252
+ - {PROJECT_NAME}: {PROJECT_DESC}
253
+ - 언어: {PROJECT_LANG}, 테스트: {PROJECT_TEST_CMD}
254
+ ```
255
+
256
+ `{PROJECT_NAME}`, `{PROJECT_DESC}`, `{PROJECT_LANG}`, `{PROJECT_TEST_CMD}` 변수는 실행 시점에 자동 결정한다:
257
+
258
+ | 변수 | 결정 방법 |
259
+ |------|----------|
260
+ | `PROJECT_NAME` | `basename $(git rev-parse --show-toplevel)` |
261
+ | `PROJECT_DESC` | `package.json` → `description` 필드 (없으면 빈 문자열) |
262
+ | `PROJECT_LANG` | 루트에 `package.json` 있으면 "JavaScript/ESM (Node.js)", `*.py` 있으면 "Python", 그 외 자동 감지 |
263
+ | `PROJECT_TEST_CMD` | `package.json` → `scripts.test` 필드 (없으면 "테스트 없음") |
264
+
265
+ 태스크 파일은 원본 경로를 참조하되, worktree에도 복사한다:
266
+ ```bash
267
+ cp {PRD_PATH} .codex-swarm/wt-issue-{N}/{PRD_PATH}
268
+ ```
269
+
270
+ ### Step 7: psmux 세션 생성 + Codex 실행
271
+
272
+ 각 태스크에 대해 psmux 세션을 생성하고 Codex를 실행한다:
273
+
274
+ ```bash
275
+ # 세션 생성 (-s: 세션명, -d: detached 백그라운드)
276
+ # psmux 기본 셸이 PowerShell이므로, bash 런처 스크립트를 PowerShell에서 호출
277
+ psmux new-session -s "codex-swarm-{id}" -d
278
+
279
+ # bash 런처를 PowerShell 구문으로 실행 (경로는 Windows 형식)
280
+ BASH_WIN='C:\\Program Files\\Git\\bin\\bash.exe'
281
+ LAUNCH_DIR='C:\\path\\to\\.codex-swarm'
282
+ psmux send-keys -t "codex-swarm-{id}" \
283
+ "& '$BASH_WIN' '$LAUNCH_DIR\\launch-{id}.sh'" Enter
284
+
285
+ # launch-{id}.sh 내용:
286
+ # #!/bin/bash
287
+ # cd /c/path/.codex-swarm/wt-issue-{N} || exit 1
288
+ # prompt=$(cat /c/path/.codex-swarm/prompts/prompt-{id}.md)
289
+ # exec codex -p {PROFILE} --dangerously-bypass-approvals-and-sandbox "$prompt"
290
+ #
291
+ # {PROFILE}은 Step 4 라우팅 결과: codex53_high, gpt54_high 등 (v9 체계)
292
+ # --dangerously-bypass-approvals-and-sandbox: 진짜 YOLO (승인+샌드박스 완전 해제)
293
+ # --skip-git-repo-check: codex exec 전용이므로 대화식 모드에서 사용 불가
294
+ ```
295
+
296
+ ### Step 8: WT triflux 프로파일로 attach
297
+
298
+ > WT `triflux` 프로파일 사용 필수 (`commandline: "psmux"`, One Half Dark, acrylic).
299
+ > triflux 프로파일은 psmux를 기본 셸로 쓰므로 attach가 바로 동작한다.
300
+ > 탭 대신 split-pane 사용 (feedback: WT 새탭 금지, split+dashboard 기본).
301
+
302
+ ```bash
303
+ # 단일 세션: triflux 프로파일로 attach
304
+ wt.exe -w new -p triflux --title "{title1}" psmux attach-session -t codex-swarm-{id1}
305
+
306
+ # 다중 세션: split-pane (상/하 분할)
307
+ wt.exe -w new \
308
+ -p triflux --title "{title1}" psmux attach-session -t codex-swarm-{id1} \; \
309
+ split-pane -H -p triflux --title "{title2}" psmux attach-session -t codex-swarm-{id2}
310
+
311
+ # 3개 이상: 추가 split-pane
312
+ wt.exe -w new \
313
+ -p triflux --title "{title1}" psmux attach-session -t codex-swarm-{id1} \; \
314
+ split-pane -H -p triflux --title "{title2}" psmux attach-session -t codex-swarm-{id2} \; \
315
+ split-pane -V -p triflux --title "{title3}" psmux attach-session -t codex-swarm-{id3}
316
+ ```
317
+
318
+ ### Step 9: 상태 보고
319
+
320
+ 스폰 완료 후 요약 테이블을 표시:
321
+
322
+ ```
323
+ | # | 태스크 | 유형 | OMX 스킬 | Worktree | 세션 |
324
+ |---|--------|------|----------|----------|------|
325
+ | 24 | file-transfer | 구현 | $plan→$autopilot | wt-issue-24 | codex-swarm-24 |
326
+ | 25 | resize-blank | 조사 | $plan | wt-issue-25 | codex-swarm-25 |
327
+ ...
328
+ ```
329
+
330
+ ### Step 10: 후속 관리 (선택)
331
+
332
+ 스폰 후 AskUserQuestion:
333
+
334
+ ```
335
+ question: "세션이 모두 실행 중입니다. 추가 작업이 있습니까?"
336
+ header: "다음"
337
+ options:
338
+ - label: "상태 확인"
339
+ description: "각 세션의 진행 상태 조회"
340
+ - label: "결과 수집"
341
+ description: "완료된 세션의 변경사항 머지"
342
+ - label: "세션 추가"
343
+ description: "추가 태스크 스폰"
344
+ - label: "완료"
345
+ description: "작업 종료"
346
+ ```
347
+
348
+ **상태 확인**:
349
+ ```bash
350
+ for session in codex-swarm-*; do
351
+ psmux capture-pane -t "$session" -p
352
+ done
353
+ ```
354
+
355
+ **결과 수집** (worktree → main 머지):
356
+ ```bash
357
+ # 각 worktree에서 커밋 확인
358
+ cd .codex-swarm/wt-issue-{N}
359
+ git log --oneline main..HEAD
360
+
361
+ # 머지 (사용자 확인 후)
362
+ cd ../..
363
+ git merge codex/issue-{N}
364
+ git worktree remove .codex-swarm/wt-issue-{N}
365
+ ```
366
+
367
+ ## 에러 핸들링
368
+
369
+ ### Worktree 생성 실패
370
+
371
+ ```bash
372
+ git worktree add .codex-swarm/wt-issue-{N} -b codex/issue-{N}
373
+ # → fatal: 'codex/issue-{N}' is already checked out at ...
374
+ ```
375
+
376
+ - 브랜치가 이미 존재하는 경우: 기존 브랜치를 재사용한다
377
+ ```bash
378
+ git worktree add .codex-swarm/wt-issue-{N} codex/issue-{N} 2>/dev/null || true
379
+ ```
380
+ - worktree 경로가 이미 존재하는 경우: 경로 뒤에 `-v{timestamp}` suffix 추가
381
+ ```bash
382
+ git worktree add .codex-swarm/wt-issue-{N}-v$(date +%s) codex/issue-{N}
383
+ ```
384
+ - `git worktree` 명령 자체가 실패하면 해당 태스크만 건너뛰고 나머지를 계속 실행한다. 스킵된 태스크는 Step 9 상태 보고에 `SKIP (worktree 실패)` 로 표시한다.
385
+
386
+ ### psmux 세션 이름 충돌
387
+
388
+ ```bash
389
+ psmux new-session -s "codex-swarm-{id}"
390
+ # → duplicate session: codex-swarm-{id}
391
+ ```
392
+
393
+ - 기존 세션을 먼저 확인한다:
394
+ ```bash
395
+ psmux has-session -t "codex-swarm-{id}" 2>/dev/null && \
396
+ psmux kill-session -t "codex-swarm-{id}"
397
+ ```
398
+ - kill 실패 시 세션명에 `-v{timestamp}` suffix를 붙여 새 세션을 생성한다.
399
+ - 두 방법 모두 실패하면 해당 태스크를 스킵하고 Step 9에 `SKIP (세션 충돌)` 로 표시한다.
400
+
401
+ ### codex 미설치
402
+
403
+ ```bash
404
+ command -v codex >/dev/null 2>&1 || {
405
+ echo "ERROR: codex CLI가 설치되어 있지 않습니다."
406
+ echo "설치: npm install -g @openai/codex"
407
+ exit 1
408
+ }
409
+ ```
410
+
411
+ Step 1 진입 전에 사전 검사한다. 미설치 시 스캔을 시작하기 전에 즉시 중단한다.
412
+
413
+ ### psmux 미설치
414
+
415
+ ```bash
416
+ command -v psmux >/dev/null 2>&1 || {
417
+ echo "ERROR: psmux가 설치되어 있지 않습니다."
418
+ echo "설치: npm install -g psmux"
419
+ exit 1
420
+ }
421
+ ```
422
+
423
+ Step 1 진입 전에 사전 검사한다. 미설치 시 즉시 중단한다.
424
+
425
+ > 두 사전 검사(codex, psmux)를 하나의 preflight 블록으로 묶어 Step 1 전에 실행하는 것을 권장한다.
426
+
427
+ ```bash
428
+ # preflight 검사
429
+ for bin in codex psmux git; do
430
+ command -v "$bin" >/dev/null 2>&1 || {
431
+ echo "ERROR: '$bin' 이(가) PATH에 없습니다. 설치 후 재시도하세요."
432
+ exit 1
433
+ }
434
+ done
435
+ ```
436
+
437
+ ## 정리
438
+
439
+ 전체 스웜 종료 시:
440
+ ```bash
441
+ # 세션 종료
442
+ for s in $(psmux list-sessions -F '#{session_name}' 2>/dev/null | grep codex-swarm); do
443
+ psmux kill-session -t "$s"
444
+ done
445
+
446
+ # worktree 정리 (머지 완료된 것만)
447
+ git worktree prune
448
+ rm -rf .codex-swarm/
449
+ ```
@@ -0,0 +1,26 @@
1
+ {
2
+ "skill_name": "tfx-codex-swarm",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "name": "full-swarm-all-prds",
7
+ "prompt": ".omx/plans/ 에 PRD 7개 있는데 전부 codex swarm으로 돌려줘. 구현은 autopilot, 조사는 plan만 쓰고. 하나의 WT에 탭으로 넣어줘",
8
+ "expected_output": "7개 PRD를 스캔하고, 각각 유형 분류 + 프로파일 라우팅 + worktree 생성 + psmux 세션 생성 + WT 탭 attach 명령을 올바르게 생성",
9
+ "files": []
10
+ },
11
+ {
12
+ "id": 2,
13
+ "name": "selective-spawn-with-override",
14
+ "prompt": "issue 24하고 28번 PRD만 코덱스 스폰해줘. 둘 다 xhigh로 세팅하고 ralph로 끝까지 돌려",
15
+ "expected_output": "2개만 선택, 프로파일을 codex53_xhigh로 오버라이드, OMX 스킬을 $ralph로 설정, worktree 2개 생성",
16
+ "files": []
17
+ },
18
+ {
19
+ "id": 3,
20
+ "name": "implicit-swarm-no-keywords",
21
+ "prompt": "이 PRD 3개 파일을 각각 독립적으로 코덱스한테 맡겨서 병렬로 구현해줘. docs/prd/auth-refactor.md, docs/prd/api-v2.md, docs/prd/cache-layer.md",
22
+ "expected_output": "스킬 트리거, 3개 파일 경로 인식, 각각 worktree + psmux 세션 생성, 자동 분류 및 프로파일 라우팅",
23
+ "files": []
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "skill_name": "tfx-codex-swarm",
3
+ "iteration": 1,
4
+ "configurations": [
5
+ {
6
+ "name": "with_skill",
7
+ "pass_rate": {"mean": 1.0, "stddev": 0.0},
8
+ "total_tokens": {"mean": 30953, "stddev": 6089},
9
+ "duration_seconds": {"mean": 166.8, "stddev": 10.2},
10
+ "per_eval": [
11
+ {"eval_name": "full-swarm-all-prds", "pass_rate": 1.0, "assertions_passed": 7, "assertions_total": 7, "tokens": 37789, "duration_s": 178.4},
12
+ {"eval_name": "selective-spawn-with-override", "pass_rate": 1.0, "assertions_passed": 4, "assertions_total": 4, "tokens": 29085, "duration_s": 163.1},
13
+ {"eval_name": "implicit-swarm-no-keywords", "pass_rate": 1.0, "assertions_passed": 5, "assertions_total": 5, "tokens": 25984, "duration_s": 158.8}
14
+ ]
15
+ },
16
+ {
17
+ "name": "without_skill",
18
+ "pass_rate": {"mean": 0.875, "stddev": 0.144},
19
+ "total_tokens": {"mean": 53786, "stddev": 10873},
20
+ "duration_seconds": {"mean": 264.4, "stddev": 49.3},
21
+ "per_eval": [
22
+ {"eval_name": "full-swarm-all-prds", "pass_rate": 1.0, "assertions_passed": 7, "assertions_total": 7, "tokens": 50555, "duration_s": 218.2},
23
+ {"eval_name": "selective-spawn-with-override", "pass_rate": 1.0, "assertions_passed": 4, "assertions_total": 4, "tokens": 65928, "duration_s": 259.5},
24
+ {"eval_name": "implicit-swarm-no-keywords", "pass_rate": 0.6, "assertions_passed": 3, "assertions_total": 5, "tokens": 44875, "duration_s": 315.5}
25
+ ]
26
+ }
27
+ ],
28
+ "delta": {
29
+ "pass_rate": "+0.125 (87.5% → 100%)",
30
+ "tokens": "-42.5% (53.8K → 31.0K avg)",
31
+ "duration": "-36.9% (264s → 167s avg)"
32
+ }
33
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "eval_id": 1,
3
+ "eval_name": "full-swarm-all-prds",
4
+ "prompt": ".omx/plans/ 에 PRD 7개 있는데 전부 codex swarm으로 돌려줘. 구현은 autopilot, 조사는 plan만 쓰고. 하나의 WT에 탭으로 넣어줘",
5
+ "assertions": [
6
+ {
7
+ "name": "all-7-prds-found",
8
+ "description": "7개 PRD 파일 모두 스캔 및 나열",
9
+ "check": "classification.md에 issue 24~30 모든 PRD가 언급되어야 함"
10
+ },
11
+ {
12
+ "name": "correct-type-classification",
13
+ "description": "구현(24,26,27,28,29) vs 조사(25,30) 정확히 분류",
14
+ "check": "issue 25, 30은 조사/investigation으로, 나머지는 구현/implement로 분류"
15
+ },
16
+ {
17
+ "name": "profile-routing-varies",
18
+ "description": "조사 태스크에 gpt54, 구현에 codex53 프로파일 적용",
19
+ "check": "routing.md에서 조사=gpt54_*, 구현=codex53_* 매핑"
20
+ },
21
+ {
22
+ "name": "worktree-per-task",
23
+ "description": "7개 독립 git worktree 생성 명령 존재",
24
+ "check": "commands.sh에 git worktree add 명령이 7개"
25
+ },
26
+ {
27
+ "name": "psmux-sessions",
28
+ "description": "7개 psmux 세션 생성 + codex 실행 명령",
29
+ "check": "commands.sh에 psmux new-session이 7개, send-keys에 codex 명령 포함"
30
+ },
31
+ {
32
+ "name": "single-wt-window",
33
+ "description": "하나의 WT 윈도우에 7탭 attach",
34
+ "check": "commands.sh에 wt-new-window 1회 + wt-tab 6회 (또는 wt.exe -w new + new-tab)"
35
+ },
36
+ {
37
+ "name": "omx-skill-mapping",
38
+ "description": "구현=$autopilot, 조사=$plan 매핑",
39
+ "check": "classification.md 또는 commands.sh에서 구현 태스크에 $autopilot, 조사에 $plan"
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "expectations": [
3
+ {"text": "all-7-prds-found", "passed": true, "evidence": "classification.md에 issue 24~30 모두 나열됨"},
4
+ {"text": "correct-type-classification", "passed": true, "evidence": "25,30=investigate, 24,26,27,28,29=implement 정확"},
5
+ {"text": "profile-routing-varies", "passed": true, "evidence": "implement→codex53_high, investigate→gpt54_high"},
6
+ {"text": "worktree-per-task", "passed": true, "evidence": "commands.sh에 git worktree add 7개 확인"},
7
+ {"text": "psmux-sessions", "passed": true, "evidence": "7개 psmux new-session + send-keys with codex"},
8
+ {"text": "single-wt-window", "passed": true, "evidence": "wt-new-window 1회 + wt-tab 6회"},
9
+ {"text": "omx-skill-mapping", "passed": true, "evidence": "implement=$plan→$autopilot, investigate=$plan"}
10
+ ]
11
+ }
@@ -0,0 +1,87 @@
1
+ # Codex Swarm - Summary Analysis
2
+
3
+ > Generated: 2026-03-30
4
+ > Skill: `tfx-codex-swarm` (SKILL.md)
5
+ > Input: `.omx/plans/prd-issue-{24..30}.md` (7 PRDs)
6
+ > User request: "전부 codex swarm으로 돌려줘. 구현은 autopilot, 조사는 plan만 쓰고. 하나의 WT에 탭으로 넣어줘"
7
+
8
+ ## Scan Result (Step 1)
9
+
10
+ `.omx/plans/` contains 20 files total. Among them, 7 are PRD files matching `prd-issue-*.md`:
11
+
12
+ | # | File | Lines |
13
+ |---|------|-------|
14
+ | 24 | `prd-issue-24-remote-spawn-file-transfer.md` | 73 |
15
+ | 25 | `prd-issue-25-remote-spawn-resize-blank-screen.md` | 76 |
16
+ | 26 | `prd-issue-26-remote-spawn-session-cleanup.md` | 70 |
17
+ | 27 | `prd-issue-27-hud-dashboard-anchor.md` | 73 |
18
+ | 28 | `prd-issue-28-headless-guard-spawn-deadlock.md` | 69 |
19
+ | 29 | `prd-issue-29-headless-cwd-propagation.md` | 70 |
20
+ | 30 | `prd-issue-30-remote-spawn-terminal-minimize.md` | 70 |
21
+
22
+ The remaining 13 files are plans (`plan-issue-*`), autopilot specs/impls, and an issue-validity report -- not PRDs.
23
+
24
+ ## Selection (Step 2)
25
+
26
+ User said "전부" (all) -- skipped interactive selection. All 7 PRDs selected.
27
+
28
+ ## Classification (Step 3)
29
+
30
+ | Type | Count | Issues | OMX Skill |
31
+ |------|-------|--------|-----------|
32
+ | **implement** | 5 | 24, 26, 27, 28, 29 | `$plan` -> `$autopilot` |
33
+ | **investigate** | 2 | 25, 30 | `$plan` only |
34
+
35
+ User explicitly overrode default skill assignment:
36
+ - Implement tasks use `$autopilot` (not the default `$plan -> $autopilot` vs `$plan -> $ralph` choice)
37
+ - Investigate tasks use `$plan` only (no execution phase)
38
+
39
+ ## Routing (Step 4)
40
+
41
+ All 7 PRDs are size **L** (40-80 lines, 3-5 affected files, 0 high-cost keywords).
42
+
43
+ | Profile | Model | Effort | Count | Issues |
44
+ |---------|-------|--------|-------|--------|
45
+ | `codex53_high` | gpt-5.3-codex | high | 5 | 24, 26, 27, 28, 29 |
46
+ | `gpt54_high` | gpt-5.4 | high | 2 | 25, 30 |
47
+
48
+ Investigation tasks use `gpt-5.4` (better for analysis/reasoning) instead of `gpt-5.3-codex` (optimized for code generation).
49
+
50
+ ## Infrastructure (Steps 5-8)
51
+
52
+ ### Worktrees (Step 5)
53
+ - 7 independent git worktrees under `.codex-swarm/wt-issue-{24..30}`
54
+ - Each branched as `codex/issue-{N}` from current HEAD
55
+
56
+ ### Prompts (Step 6)
57
+ - 7 prompt files at `.codex-swarm/prompts/prompt-{24..30}.md`
58
+ - Implement prompts: read PRD -> `$plan` -> `$autopilot`
59
+ - Investigate prompts: read PRD -> `$plan` -> stop (no implementation)
60
+
61
+ ### Sessions (Step 7)
62
+ - 7 psmux sessions: `codex-swarm-{24..30}`
63
+ - Each runs `codex` with profile-specific flags + `--full-auto`
64
+
65
+ ### WT Layout (Step 8)
66
+ - Single WT window with 7 tabs
67
+ - First session opens new window, remaining 6 attach as tabs
68
+ - Fallback `wt.exe` command included for non-psmux-attach environments
69
+
70
+ ## Final Status Table (Step 9)
71
+
72
+ | # | Task | Type | OMX Skill | Profile | Worktree | Session |
73
+ |---|------|------|-----------|---------|----------|---------|
74
+ | 24 | file-transfer | implement | `$plan` -> `$autopilot` | `codex53_high` | `wt-issue-24` | `codex-swarm-24` |
75
+ | 25 | resize-blank | investigate | `$plan` | `gpt54_high` | `wt-issue-25` | `codex-swarm-25` |
76
+ | 26 | session-cleanup | implement | `$plan` -> `$autopilot` | `codex53_high` | `wt-issue-26` | `codex-swarm-26` |
77
+ | 27 | hud-dashboard-anchor | implement | `$plan` -> `$autopilot` | `codex53_high` | `wt-issue-27` | `codex-swarm-27` |
78
+ | 28 | guard-deadlock | implement | `$plan` -> `$autopilot` | `codex53_high` | `wt-issue-28` | `codex-swarm-28` |
79
+ | 29 | cwd-propagation | implement | `$plan` -> `$autopilot` | `codex53_high` | `wt-issue-29` | `codex-swarm-29` |
80
+ | 30 | terminal-minimize | investigate | `$plan` | `gpt54_high` | `wt-issue-30` | `codex-swarm-30` |
81
+
82
+ ## Notes
83
+
84
+ - **Dry run only** -- no commands were executed. All generated commands are in `commands.sh`.
85
+ - The investigate tasks (25, 30) will produce plans but not code changes, as the user requested.
86
+ - All 7 sessions share the same WT window via tabs, per user request.
87
+ - Cleanup after completion: `psmux kill-session --name "codex-swarm-*"` + `git worktree prune` + `rm -rf .codex-swarm/`