oh-my-codex 0.3.4 → 0.3.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.
- package/README.md +128 -271
- package/dist/cli/__tests__/index.test.js +19 -1
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +44 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +48 -1
- package/dist/cli/setup.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +100 -0
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/tmux-session.d.ts +1 -1
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +44 -4
- package/dist/team/tmux-session.js.map +1 -1
- package/package.json +1 -1
- package/prompts/analyst.md +102 -105
- package/prompts/api-reviewer.md +90 -93
- package/prompts/architect.md +102 -104
- package/prompts/build-fixer.md +81 -84
- package/prompts/code-reviewer.md +98 -100
- package/prompts/critic.md +79 -82
- package/prompts/debugger.md +85 -88
- package/prompts/deep-executor.md +105 -107
- package/prompts/dependency-expert.md +91 -94
- package/prompts/designer.md +96 -98
- package/prompts/executor.md +92 -94
- package/prompts/explore.md +104 -107
- package/prompts/git-master.md +84 -87
- package/prompts/information-architect.md +28 -29
- package/prompts/performance-reviewer.md +86 -89
- package/prompts/planner.md +108 -111
- package/prompts/product-analyst.md +28 -29
- package/prompts/product-manager.md +33 -34
- package/prompts/qa-tester.md +90 -93
- package/prompts/quality-reviewer.md +98 -100
- package/prompts/quality-strategist.md +33 -34
- package/prompts/researcher.md +88 -91
- package/prompts/scientist.md +84 -87
- package/prompts/security-reviewer.md +119 -121
- package/prompts/style-reviewer.md +79 -82
- package/prompts/test-engineer.md +96 -98
- package/prompts/ux-researcher.md +28 -29
- package/prompts/verifier.md +87 -90
- package/prompts/vision.md +67 -70
- package/prompts/writer.md +78 -81
- package/skills/analyze/SKILL.md +1 -1
- package/skills/autopilot/SKILL.md +11 -16
- package/skills/code-review/SKILL.md +1 -1
- package/skills/configure-discord/SKILL.md +6 -6
- package/skills/configure-telegram/SKILL.md +6 -6
- package/skills/doctor/SKILL.md +47 -45
- package/skills/ecomode/SKILL.md +1 -1
- package/skills/frontend-ui-ux/SKILL.md +2 -2
- package/skills/help/SKILL.md +1 -1
- package/skills/learner/SKILL.md +5 -5
- package/skills/omx-setup/SKILL.md +47 -1109
- package/skills/plan/SKILL.md +1 -1
- package/skills/project-session-manager/SKILL.md +5 -5
- package/skills/release/SKILL.md +3 -3
- package/skills/research/SKILL.md +10 -15
- package/skills/security-review/SKILL.md +1 -1
- package/skills/skill/SKILL.md +20 -20
- package/skills/tdd/SKILL.md +1 -1
- package/skills/ultrapilot/SKILL.md +11 -16
- package/skills/writer-memory/SKILL.md +1 -1
- package/templates/AGENTS.md +7 -7
package/README.md
CHANGED
|
@@ -4,337 +4,190 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
6
|
|
|
7
|
-
Multi-agent orchestration for [OpenAI Codex CLI](https://github.com/openai/codex).
|
|
7
|
+
Multi-agent orchestration layer for [OpenAI Codex CLI](https://github.com/openai/codex).
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
OMX turns Codex from a single-session agent into a coordinated system with:
|
|
10
|
+
- Role prompts (`/prompts:name`) for specialized agents
|
|
11
|
+
- Workflow skills (`$name`) for repeatable execution modes
|
|
12
|
+
- Team orchestration in tmux (`omx team`, `$team`)
|
|
13
|
+
- Persistent state + memory via MCP servers
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
## Why OMX
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
| No multi-agent coordination | Team pipeline with verify/fix loops, up to 6 concurrent agents |
|
|
19
|
-
| No verification protocol | Evidence-backed verification with architect sign-off |
|
|
17
|
+
Codex CLI is strong for direct tasks. OMX adds structure for larger work:
|
|
18
|
+
- Decomposition and staged execution (`team-plan -> team-prd -> team-exec -> team-verify -> team-fix`)
|
|
19
|
+
- Persistent mode lifecycle state (`.omx/state/`)
|
|
20
|
+
- Memory + notepad surfaces for long-running sessions
|
|
21
|
+
- Operational controls for launch, verification, and cancellation
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
OMX is an add-on, not a fork. It uses Codex-native extension points.
|
|
22
24
|
|
|
23
|
-
##
|
|
25
|
+
## Requirements
|
|
24
26
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- **OpenAI API key** configured
|
|
27
|
+
- macOS or Linux (Windows via WSL2)
|
|
28
|
+
- Node.js >= 20
|
|
29
|
+
- Codex CLI installed (`npm install -g @openai/codex`)
|
|
30
|
+
- Codex auth configured
|
|
30
31
|
|
|
31
|
-
##
|
|
32
|
+
## Quickstart (3 minutes)
|
|
32
33
|
|
|
33
34
|
```bash
|
|
34
|
-
# Install
|
|
35
35
|
npm install -g oh-my-codex
|
|
36
|
-
|
|
37
|
-
# Setup (installs prompts, skills, configures Codex CLI)
|
|
38
36
|
omx setup
|
|
39
|
-
|
|
40
|
-
# Verify installation
|
|
41
37
|
omx doctor
|
|
42
|
-
|
|
43
|
-
# Recommended launch profile (trusted / externally sandboxed environments)
|
|
44
|
-
omx --xhigh --madmax
|
|
45
38
|
```
|
|
46
39
|
|
|
47
|
-
|
|
40
|
+
Recommended trusted-environment launch profile:
|
|
48
41
|
|
|
42
|
+
```bash
|
|
43
|
+
omx --xhigh --madmax
|
|
49
44
|
```
|
|
50
|
-
> /prompts:architect "analyze the authentication module"
|
|
51
|
-
> /prompts:executor "add input validation to the login flow"
|
|
52
|
-
> $autopilot "build a REST API for user management"
|
|
53
|
-
> $team 3:executor "fix all TypeScript errors"
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Team-First Workflow
|
|
57
45
|
|
|
58
|
-
|
|
46
|
+
## First Session
|
|
59
47
|
|
|
60
|
-
|
|
61
|
-
- Use `omx team` from terminal when you want tmux worker panes plus shared task/mailbox state.
|
|
62
|
-
- OMX includes a HUD + tmux hook workaround path for Codex CLI behavior that is not natively supported yet.
|
|
48
|
+
Inside Codex:
|
|
63
49
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
```text
|
|
51
|
+
/prompts:architect "analyze current auth boundaries"
|
|
52
|
+
/prompts:executor "implement input validation in login"
|
|
53
|
+
$plan "ship OAuth callback safely"
|
|
54
|
+
$team 3:executor "fix all TypeScript errors"
|
|
68
55
|
```
|
|
69
56
|
|
|
70
|
-
|
|
57
|
+
From terminal:
|
|
71
58
|
|
|
72
59
|
```bash
|
|
73
|
-
# Inside Codex
|
|
74
|
-
$team 3:executor "fix all TypeScript errors across the project"
|
|
75
|
-
$team ralph "ship a complete feature with persistence + verification"
|
|
76
|
-
|
|
77
|
-
# From terminal
|
|
78
60
|
omx team 4:executor "parallelize a multi-module refactor"
|
|
79
|
-
omx
|
|
80
|
-
|
|
81
|
-
# Recommended high-throughput launch profile
|
|
82
|
-
omx --xhigh --madmax
|
|
61
|
+
omx team status <team-name>
|
|
62
|
+
omx team shutdown <team-name>
|
|
83
63
|
```
|
|
84
64
|
|
|
85
|
-
##
|
|
65
|
+
## Core Model
|
|
86
66
|
|
|
87
|
-
OMX installs
|
|
67
|
+
OMX installs and wires these layers:
|
|
88
68
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
User -> Codex CLI -> AGENTS.md (orchestration brain)
|
|
100
|
-
-> ~/.codex/prompts/*.md (30 agents)
|
|
101
|
-
-> ~/.agents/skills/*/SKILL.md (39 skills)
|
|
102
|
-
-> config.toml (MCP, notify, features)
|
|
103
|
-
-> .omx/ (state, memory, notepad, plans)
|
|
69
|
+
```text
|
|
70
|
+
User
|
|
71
|
+
-> Codex CLI
|
|
72
|
+
-> AGENTS.md (orchestration brain)
|
|
73
|
+
-> ~/.codex/prompts/*.md (30 agent prompts)
|
|
74
|
+
-> ~/.agents/skills/*/SKILL.md (40 skills)
|
|
75
|
+
-> ~/.codex/config.toml (features, notify, MCP)
|
|
76
|
+
-> .omx/ (runtime state, memory, plans, logs)
|
|
104
77
|
```
|
|
105
78
|
|
|
106
|
-
##
|
|
107
|
-
|
|
108
|
-
Invoke agents with `/prompts:name` in Codex CLI.
|
|
109
|
-
|
|
110
|
-
### Build & Analysis
|
|
111
|
-
| Agent | Tier | Description |
|
|
112
|
-
|-------|------|-------------|
|
|
113
|
-
| `/prompts:explore` | Low | Codebase discovery, symbol/file mapping |
|
|
114
|
-
| `/prompts:analyst` | High | Requirements clarity, acceptance criteria |
|
|
115
|
-
| `/prompts:planner` | High | Task sequencing, execution plans, risk flags |
|
|
116
|
-
| `/prompts:architect` | High | System design, boundaries, interfaces |
|
|
117
|
-
| `/prompts:debugger` | Standard | Root-cause analysis, failure diagnosis |
|
|
118
|
-
| `/prompts:executor` | Standard | Code implementation, refactoring |
|
|
119
|
-
| `/prompts:deep-executor` | High | Complex autonomous goal-oriented tasks |
|
|
120
|
-
| `/prompts:verifier` | Standard | Completion evidence, claim validation |
|
|
121
|
-
|
|
122
|
-
### Review
|
|
123
|
-
| Agent | Tier | Description |
|
|
124
|
-
|-------|------|-------------|
|
|
125
|
-
| `/prompts:style-reviewer` | Low | Formatting, naming, lint conventions |
|
|
126
|
-
| `/prompts:quality-reviewer` | Standard | Logic defects, anti-patterns |
|
|
127
|
-
| `/prompts:api-reviewer` | Standard | API contracts, versioning |
|
|
128
|
-
| `/prompts:security-reviewer` | Standard | Vulnerabilities, OWASP Top 10 |
|
|
129
|
-
| `/prompts:performance-reviewer` | Standard | Hotspots, complexity optimization |
|
|
130
|
-
| `/prompts:code-reviewer` | High | Comprehensive review across concerns |
|
|
131
|
-
|
|
132
|
-
### Domain Specialists
|
|
133
|
-
| Agent | Tier | Description |
|
|
134
|
-
|-------|------|-------------|
|
|
135
|
-
| `/prompts:dependency-expert` | Standard | External SDK/API evaluation |
|
|
136
|
-
| `/prompts:test-engineer` | Standard | Test strategy, coverage |
|
|
137
|
-
| `/prompts:quality-strategist` | Standard | Release readiness, risk assessment |
|
|
138
|
-
| `/prompts:build-fixer` | Standard | Build/toolchain failures |
|
|
139
|
-
| `/prompts:designer` | Standard | UX/UI architecture |
|
|
140
|
-
| `/prompts:writer` | Low | Docs, migration notes |
|
|
141
|
-
| `/prompts:qa-tester` | Standard | Interactive CLI validation |
|
|
142
|
-
| `/prompts:scientist` | Standard | Data/statistical analysis |
|
|
143
|
-
| `/prompts:git-master` | Standard | Commit strategy, history hygiene |
|
|
144
|
-
| `/prompts:researcher` | Standard | External documentation research |
|
|
145
|
-
|
|
146
|
-
### Product
|
|
147
|
-
| Agent | Tier | Description |
|
|
148
|
-
|-------|------|-------------|
|
|
149
|
-
| `/prompts:product-manager` | Standard | Problem framing, PRDs |
|
|
150
|
-
| `/prompts:ux-researcher` | Standard | Heuristic audits, usability |
|
|
151
|
-
| `/prompts:information-architect` | Standard | Taxonomy, navigation |
|
|
152
|
-
| `/prompts:product-analyst` | Standard | Product metrics, experiments |
|
|
153
|
-
|
|
154
|
-
### Coordination
|
|
155
|
-
| Agent | Tier | Description |
|
|
156
|
-
|-------|------|-------------|
|
|
157
|
-
| `/prompts:critic` | High | Plan/design critical challenge |
|
|
158
|
-
| `/prompts:vision` | Standard | Image/screenshot analysis |
|
|
159
|
-
|
|
160
|
-
## Skills (39 skills)
|
|
161
|
-
|
|
162
|
-
Invoke skills with `$name` in Codex CLI (e.g., `$autopilot "build a REST API"`).
|
|
163
|
-
|
|
164
|
-
### Execution Modes
|
|
165
|
-
| Skill | Description |
|
|
166
|
-
|-------|-------------|
|
|
167
|
-
| `$autopilot` | Full autonomous execution from idea to working code |
|
|
168
|
-
| `$ralph` | Persistence loop with architect verification |
|
|
169
|
-
| `$ultrawork` (`$ulw`) | Maximum parallelism with parallel agent orchestration |
|
|
170
|
-
| `$team` | N coordinated agents on shared task list |
|
|
171
|
-
| `$pipeline` | Sequential agent chaining with data passing |
|
|
172
|
-
| `$ecomode` | Token-efficient execution using lightweight models |
|
|
173
|
-
| `$ultrapilot` | Parallel autopilot with file ownership partitioning |
|
|
174
|
-
| `$ultraqa` | QA cycling: test, verify, fix, repeat |
|
|
175
|
-
|
|
176
|
-
### Planning
|
|
177
|
-
| Skill | Description |
|
|
178
|
-
|-------|-------------|
|
|
179
|
-
| `$plan` | Strategic planning with optional consensus/review modes |
|
|
180
|
-
| `$ralplan` | Consensus planning (planner + architect + critic) |
|
|
181
|
-
|
|
182
|
-
### Agent Shortcuts
|
|
183
|
-
| Skill | Routes To | Trigger |
|
|
184
|
-
|-------|-----------|---------|
|
|
185
|
-
| `$analyze` | debugger | "analyze", "debug", "investigate" |
|
|
186
|
-
| `$deepsearch` | explore | "search", "find in codebase" |
|
|
187
|
-
| `$tdd` | test-engineer | "tdd", "test first" |
|
|
188
|
-
| `$build-fix` | build-fixer | "fix build", "type errors" |
|
|
189
|
-
| `$code-review` | code-reviewer | "review code" |
|
|
190
|
-
| `$security-review` | security-reviewer | "security review" |
|
|
191
|
-
| `$frontend-ui-ux` | designer | UI/component work |
|
|
192
|
-
| `$git-master` | git-master | Git/commit work |
|
|
193
|
-
|
|
194
|
-
### Utilities
|
|
195
|
-
`$cancel` `$doctor` `$help` `$note` `$trace` `$skill` `$learner` `$research` `$deepinit` `$release` `$hud` `$omx-setup` `$configure-telegram` `$configure-discord` `$writer-memory` `$psm` `$ralph-init` `$learn-about-omx` `$review`
|
|
196
|
-
|
|
197
|
-
## MCP Servers
|
|
198
|
-
|
|
199
|
-
OMX provides two MCP servers configured via `config.toml`:
|
|
200
|
-
|
|
201
|
-
- **`omx_state`** -- Mode lifecycle state (autopilot, ralph, ultrawork, team, etc.)
|
|
202
|
-
- **`omx_memory`** -- Project memory and session notepad
|
|
203
|
-
|
|
204
|
-
## Magic Keywords
|
|
205
|
-
|
|
206
|
-
The AGENTS.md orchestration brain detects keywords and activates skills automatically:
|
|
207
|
-
|
|
208
|
-
| Say this... | Activates |
|
|
209
|
-
|-------------|-----------|
|
|
210
|
-
| "ralph", "don't stop", "keep going" | `$ralph` persistence loop |
|
|
211
|
-
| "autopilot", "build me" | `$autopilot` autonomous pipeline |
|
|
212
|
-
| "team", "coordinated team" | `$team` multi-agent orchestration |
|
|
213
|
-
| "plan this", "let's plan" | `$plan` strategic planning |
|
|
214
|
-
| "fix build", "type errors" | `$build-fix` build error resolution |
|
|
215
|
-
|
|
216
|
-
## CLI Commands
|
|
79
|
+
## Main Commands
|
|
217
80
|
|
|
218
81
|
```bash
|
|
219
|
-
omx
|
|
220
|
-
omx
|
|
221
|
-
omx
|
|
222
|
-
omx --
|
|
223
|
-
omx
|
|
224
|
-
omx
|
|
225
|
-
omx
|
|
226
|
-
omx
|
|
227
|
-
omx tmux-hook #
|
|
228
|
-
omx
|
|
229
|
-
omx
|
|
230
|
-
omx cancel # Cancel active execution modes
|
|
231
|
-
omx hud # Show HUD statusline (--watch, --json, --preset=NAME)
|
|
232
|
-
omx version # Print version info
|
|
233
|
-
omx help # Usage guide
|
|
82
|
+
omx # Launch Codex (+ HUD in tmux when available)
|
|
83
|
+
omx setup # Install prompts, skills, config wiring, AGENTS.md
|
|
84
|
+
omx doctor # Installation/runtime diagnostics
|
|
85
|
+
omx doctor --team # Team/swarm diagnostics
|
|
86
|
+
omx team ... # Start/status/resume/shutdown tmux team workers
|
|
87
|
+
omx status # Show active modes
|
|
88
|
+
omx cancel # Cancel active execution modes
|
|
89
|
+
omx reasoning <mode> # low|medium|high|xhigh
|
|
90
|
+
omx tmux-hook ... # init|status|validate|test
|
|
91
|
+
omx hud ... # --watch|--json|--preset
|
|
92
|
+
omx help
|
|
234
93
|
```
|
|
235
94
|
|
|
236
|
-
## Launch
|
|
95
|
+
## Launch Flags
|
|
237
96
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
Launches Codex with reasoning effort set to `high` (default).
|
|
248
|
-
|
|
249
|
-
- `--xhigh`
|
|
250
|
-
Launches Codex with reasoning effort set to `xhigh` (recommended).
|
|
97
|
+
```bash
|
|
98
|
+
--yolo
|
|
99
|
+
--high
|
|
100
|
+
--xhigh
|
|
101
|
+
--madmax
|
|
102
|
+
--force
|
|
103
|
+
--dry-run
|
|
104
|
+
--verbose
|
|
105
|
+
```
|
|
251
106
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
Use this for maximum throughput in trusted environments with external sandboxing.
|
|
107
|
+
`--madmax` maps to Codex `--dangerously-bypass-approvals-and-sandbox`.
|
|
108
|
+
Use it only in trusted/external sandbox environments.
|
|
255
109
|
|
|
256
|
-
##
|
|
110
|
+
## Codex-First Prompt Control
|
|
257
111
|
|
|
258
|
-
|
|
112
|
+
By default, OMX injects:
|
|
259
113
|
|
|
260
|
-
|
|
114
|
+
```text
|
|
115
|
+
-c model_instructions_file="<cwd>/AGENTS.md"
|
|
116
|
+
```
|
|
261
117
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
- Guardrails: allowed-mode gating, dedupe keying, cooldown, max injections/session, marker loop guard
|
|
265
|
-
- Failures are non-fatal and logged
|
|
118
|
+
This layers project `AGENTS.md` guidance into Codex launch instructions.
|
|
119
|
+
It extends Codex behavior, but does not replace/bypass Codex core system policies.
|
|
266
120
|
|
|
267
|
-
|
|
121
|
+
Controls:
|
|
268
122
|
|
|
269
123
|
```bash
|
|
270
|
-
omx
|
|
124
|
+
OMX_BYPASS_DEFAULT_SYSTEM_PROMPT=0 omx # disable AGENTS.md injection
|
|
125
|
+
OMX_MODEL_INSTRUCTIONS_FILE=/path/to/instructions.md omx
|
|
271
126
|
```
|
|
272
127
|
|
|
273
|
-
|
|
128
|
+
## Team Mode
|
|
274
129
|
|
|
275
|
-
|
|
276
|
-
omx tmux-hook status
|
|
277
|
-
```
|
|
130
|
+
Use team mode for broad work that benefits from parallel workers.
|
|
278
131
|
|
|
279
|
-
|
|
132
|
+
Lifecycle:
|
|
280
133
|
|
|
281
|
-
```
|
|
282
|
-
|
|
134
|
+
```text
|
|
135
|
+
start -> assign scoped lanes -> monitor -> verify terminal tasks -> shutdown
|
|
283
136
|
```
|
|
284
137
|
|
|
285
|
-
|
|
138
|
+
Operational commands:
|
|
286
139
|
|
|
287
140
|
```bash
|
|
288
|
-
omx
|
|
141
|
+
omx team <args>
|
|
142
|
+
omx team status <team-name>
|
|
143
|
+
omx team resume <team-name>
|
|
144
|
+
omx team shutdown <team-name>
|
|
289
145
|
```
|
|
290
146
|
|
|
291
|
-
|
|
292
|
-
Runtime state: `.omx/state/tmux-hook-state.json`
|
|
293
|
-
Structured logs: `.omx/logs/tmux-hook-YYYY-MM-DD.jsonl`
|
|
294
|
-
|
|
295
|
-
Compatibility note:
|
|
296
|
-
- OMX writes `notify` as a TOML array by default.
|
|
297
|
-
- Override with `OMX_NOTIFY_FORMAT=string` before `omx setup` for environments that require string notify syntax.
|
|
147
|
+
Important rule: do not shutdown while tasks are still `in_progress` unless aborting.
|
|
298
148
|
|
|
299
|
-
##
|
|
149
|
+
## What `omx setup` writes
|
|
300
150
|
|
|
301
|
-
|
|
151
|
+
- `~/.codex/prompts/` (30 prompt files)
|
|
152
|
+
- `~/.agents/skills/` (40 skills)
|
|
153
|
+
- `~/.codex/config.toml` updates:
|
|
154
|
+
- `notify = ["node", "..."]`
|
|
155
|
+
- `model_reasoning_effort = "high"`
|
|
156
|
+
- `developer_instructions = "..."`
|
|
157
|
+
- `[features] collab = true, child_agents_md = true`
|
|
158
|
+
- MCP server entries (`omx_state`, `omx_memory`, `omx_code_intel`, `omx_trace`)
|
|
159
|
+
- `[tui] status_line`
|
|
160
|
+
- Project `AGENTS.md`
|
|
161
|
+
- `.omx/` runtime directories and HUD config
|
|
302
162
|
|
|
303
|
-
|
|
304
|
-
2. Installs 30 agent prompt files to `~/.codex/prompts/`
|
|
305
|
-
3. Installs 39 skill directories to `~/.agents/skills/`
|
|
306
|
-
4. Updates `~/.codex/config.toml` with MCP servers, features, notify hook, `[tui] status_line`, and default `model_reasoning_effort = "high"`
|
|
307
|
-
5. Generates `AGENTS.md` orchestration brain in the current project root
|
|
308
|
-
6. Configures the post-turn notification hook
|
|
309
|
-
7. Creates `.omx/hud-config.json` with default HUD preset
|
|
163
|
+
## Agents and Skills
|
|
310
164
|
|
|
311
|
-
|
|
165
|
+
- Prompts: `prompts/*.md` (installed to `~/.codex/prompts/`)
|
|
166
|
+
- Skills: `skills/*/SKILL.md` (installed to `~/.agents/skills/`)
|
|
312
167
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
168
|
+
Examples:
|
|
169
|
+
- Agents: `architect`, `planner`, `executor`, `debugger`, `verifier`, `security-reviewer`
|
|
170
|
+
- Skills: `autopilot`, `plan`, `team`, `ralph`, `ultrawork`, `ultrapilot`, `research`, `cancel`
|
|
316
171
|
|
|
317
|
-
## Project
|
|
172
|
+
## Project Layout
|
|
318
173
|
|
|
319
|
-
```
|
|
174
|
+
```text
|
|
320
175
|
oh-my-codex/
|
|
321
|
-
bin/omx.js
|
|
176
|
+
bin/omx.js
|
|
322
177
|
src/
|
|
323
|
-
cli/
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
modes/
|
|
330
|
-
|
|
331
|
-
verification/
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
templates/ # AGENTS.md template
|
|
337
|
-
scripts/ # notify-hook.js, tmux-hook-engine.js
|
|
178
|
+
cli/
|
|
179
|
+
team/
|
|
180
|
+
mcp/
|
|
181
|
+
hooks/
|
|
182
|
+
hud/
|
|
183
|
+
config/
|
|
184
|
+
modes/
|
|
185
|
+
notifications/
|
|
186
|
+
verification/
|
|
187
|
+
prompts/
|
|
188
|
+
skills/
|
|
189
|
+
templates/
|
|
190
|
+
scripts/
|
|
338
191
|
```
|
|
339
192
|
|
|
340
193
|
## Development
|
|
@@ -344,13 +197,17 @@ git clone https://github.com/Yeachan-Heo/oh-my-codex.git
|
|
|
344
197
|
cd oh-my-codex
|
|
345
198
|
npm install
|
|
346
199
|
npm run build
|
|
347
|
-
npm
|
|
348
|
-
omx setup && omx doctor
|
|
200
|
+
npm test
|
|
349
201
|
```
|
|
350
202
|
|
|
203
|
+
## Notes
|
|
204
|
+
|
|
205
|
+
- Coverage and parity notes: `COVERAGE.md`
|
|
206
|
+
- Setup and contribution details: `CONTRIBUTING.md`
|
|
207
|
+
|
|
351
208
|
## Acknowledgments
|
|
352
209
|
|
|
353
|
-
|
|
210
|
+
Inspired by [oh-my-claudecode](https://github.com/Yeachan-Heo/oh-my-claudecode), adapted for Codex CLI.
|
|
354
211
|
|
|
355
212
|
## License
|
|
356
213
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it } from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import { normalizeCodexLaunchArgs, buildTmuxShellCommand, buildTmuxSessionName, readTopLevelTomlString, upsertTopLevelTomlString, collectInheritableTeamWorkerArgs, resolveTeamWorkerLaunchArgsEnv, } from '../index.js';
|
|
3
|
+
import { normalizeCodexLaunchArgs, buildTmuxShellCommand, buildTmuxSessionName, readTopLevelTomlString, upsertTopLevelTomlString, collectInheritableTeamWorkerArgs, resolveTeamWorkerLaunchArgsEnv, injectModelInstructionsBypassArgs, } from '../index.js';
|
|
4
4
|
describe('normalizeCodexLaunchArgs', () => {
|
|
5
5
|
it('maps --madmax to codex bypass flag', () => {
|
|
6
6
|
assert.deepEqual(normalizeCodexLaunchArgs(['--madmax']), ['--dangerously-bypass-approvals-and-sandbox']);
|
|
@@ -76,6 +76,24 @@ describe('readTopLevelTomlString', () => {
|
|
|
76
76
|
assert.equal(value, null);
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
+
describe('injectModelInstructionsBypassArgs', () => {
|
|
80
|
+
it('appends model_instructions_file override by default', () => {
|
|
81
|
+
const args = injectModelInstructionsBypassArgs('/tmp/my-project', ['--model', 'gpt-5'], {});
|
|
82
|
+
assert.deepEqual(args, ['--model', 'gpt-5', '-c', 'model_instructions_file="/tmp/my-project/AGENTS.md"']);
|
|
83
|
+
});
|
|
84
|
+
it('does not append when bypass is disabled via env', () => {
|
|
85
|
+
const args = injectModelInstructionsBypassArgs('/tmp/my-project', ['--model', 'gpt-5'], { OMX_BYPASS_DEFAULT_SYSTEM_PROMPT: '0' });
|
|
86
|
+
assert.deepEqual(args, ['--model', 'gpt-5']);
|
|
87
|
+
});
|
|
88
|
+
it('does not append when model_instructions_file is already set', () => {
|
|
89
|
+
const args = injectModelInstructionsBypassArgs('/tmp/my-project', ['-c', 'model_instructions_file="/tmp/custom.md"'], {});
|
|
90
|
+
assert.deepEqual(args, ['-c', 'model_instructions_file="/tmp/custom.md"']);
|
|
91
|
+
});
|
|
92
|
+
it('respects OMX_MODEL_INSTRUCTIONS_FILE env override', () => {
|
|
93
|
+
const args = injectModelInstructionsBypassArgs('/tmp/my-project', [], { OMX_MODEL_INSTRUCTIONS_FILE: '/tmp/alt instructions.md' });
|
|
94
|
+
assert.deepEqual(args, ['-c', 'model_instructions_file="/tmp/alt instructions.md"']);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
79
97
|
describe('upsertTopLevelTomlString', () => {
|
|
80
98
|
it('replaces an existing top-level key', () => {
|
|
81
99
|
const updated = upsertTopLevelTomlString('model_reasoning_effort = "low"\n[tui]\nstatus_line = []\n', 'model_reasoning_effort', 'high');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,E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EAAE;QAC5D,MAAM,OAAO,GAAG,wBAAwB,CACtC,2BAA2B,EAC3B,wBAAwB,EACxB,OAAO,CACR,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,6DAA6D,CAAC,CAAC;IACvF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function main(args: string[]): Promise<void>;
|
|
6
6
|
export declare function normalizeCodexLaunchArgs(args: string[]): string[];
|
|
7
|
+
export declare function injectModelInstructionsBypassArgs(cwd: string, args: string[], env?: NodeJS.ProcessEnv): string[];
|
|
7
8
|
export declare function collectInheritableTeamWorkerArgs(codexArgs: string[]): string[];
|
|
8
9
|
export declare function resolveTeamWorkerLaunchArgsEnv(existingRaw: string | undefined, codexArgs: string[], inheritLeaderFlags?: boolean): string | null;
|
|
9
10
|
export declare function readTopLevelTomlString(content: string, key: string): string | null;
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmEH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmExD;AAgGD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CA2CjE;AAsCD,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,EAAE,CAI7H;AAUD,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAwB9E;AA+BD,wBAAgB,8BAA8B,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,kBAAkB,UAAO,GAAG,MAAM,GAAG,IAAI,CAM7I;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgBlF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAyC5F;AAsBD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAgB3E;AAwGD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7E"}
|
package/dist/cli/index.js
CHANGED
|
@@ -51,9 +51,13 @@ const CODEX_BYPASS_FLAG = '--dangerously-bypass-approvals-and-sandbox';
|
|
|
51
51
|
const HIGH_REASONING_FLAG = '--high';
|
|
52
52
|
const XHIGH_REASONING_FLAG = '--xhigh';
|
|
53
53
|
const CONFIG_FLAG = '-c';
|
|
54
|
+
const LONG_CONFIG_FLAG = '--config';
|
|
54
55
|
const REASONING_KEY = 'model_reasoning_effort';
|
|
56
|
+
const MODEL_INSTRUCTIONS_FILE_KEY = 'model_instructions_file';
|
|
55
57
|
const TEAM_WORKER_LAUNCH_ARGS_ENV = 'OMX_TEAM_WORKER_LAUNCH_ARGS';
|
|
56
58
|
const TEAM_INHERIT_LEADER_FLAGS_ENV = 'OMX_TEAM_INHERIT_LEADER_FLAGS';
|
|
59
|
+
const OMX_BYPASS_DEFAULT_SYSTEM_PROMPT_ENV = 'OMX_BYPASS_DEFAULT_SYSTEM_PROMPT';
|
|
60
|
+
const OMX_MODEL_INSTRUCTIONS_FILE_ENV = 'OMX_MODEL_INSTRUCTIONS_FILE';
|
|
57
61
|
const REASONING_MODES = ['low', 'medium', 'high', 'xhigh'];
|
|
58
62
|
const REASONING_MODE_SET = new Set(REASONING_MODES);
|
|
59
63
|
const REASONING_USAGE = 'Usage: omx reasoning <low|medium|high|xhigh>';
|
|
@@ -251,6 +255,41 @@ export function normalizeCodexLaunchArgs(args) {
|
|
|
251
255
|
function isReasoningOverride(value) {
|
|
252
256
|
return new RegExp(`^${REASONING_KEY}\\s*=`).test(value.trim());
|
|
253
257
|
}
|
|
258
|
+
function isModelInstructionsOverride(value) {
|
|
259
|
+
return new RegExp(`^${MODEL_INSTRUCTIONS_FILE_KEY}\\s*=`).test(value.trim());
|
|
260
|
+
}
|
|
261
|
+
function hasModelInstructionsOverride(args) {
|
|
262
|
+
for (let i = 0; i < args.length; i++) {
|
|
263
|
+
const arg = args[i];
|
|
264
|
+
if (arg === CONFIG_FLAG || arg === LONG_CONFIG_FLAG) {
|
|
265
|
+
const maybeValue = args[i + 1];
|
|
266
|
+
if (typeof maybeValue === 'string' && isModelInstructionsOverride(maybeValue)) {
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (arg.startsWith(`${LONG_CONFIG_FLAG}=`)) {
|
|
272
|
+
const inlineValue = arg.slice(`${LONG_CONFIG_FLAG}=`.length);
|
|
273
|
+
if (isModelInstructionsOverride(inlineValue))
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
function shouldBypassDefaultSystemPrompt(env) {
|
|
280
|
+
return env[OMX_BYPASS_DEFAULT_SYSTEM_PROMPT_ENV] !== '0';
|
|
281
|
+
}
|
|
282
|
+
function buildModelInstructionsOverride(cwd, env) {
|
|
283
|
+
const filePath = env[OMX_MODEL_INSTRUCTIONS_FILE_ENV] || join(cwd, 'AGENTS.md');
|
|
284
|
+
return `${MODEL_INSTRUCTIONS_FILE_KEY}="${escapeTomlString(filePath)}"`;
|
|
285
|
+
}
|
|
286
|
+
export function injectModelInstructionsBypassArgs(cwd, args, env = process.env) {
|
|
287
|
+
if (!shouldBypassDefaultSystemPrompt(env))
|
|
288
|
+
return [...args];
|
|
289
|
+
if (hasModelInstructionsOverride(args))
|
|
290
|
+
return [...args];
|
|
291
|
+
return [...args, CONFIG_FLAG, buildModelInstructionsOverride(cwd, env)];
|
|
292
|
+
}
|
|
254
293
|
function splitWorkerLaunchArgs(raw) {
|
|
255
294
|
if (!raw || raw.trim() === '')
|
|
256
295
|
return [];
|
|
@@ -456,11 +495,12 @@ async function preLaunch(cwd, sessionId) {
|
|
|
456
495
|
* All 3 paths (new tmux, existing tmux, no tmux) block via execSync/execFileSync.
|
|
457
496
|
*/
|
|
458
497
|
function runCodex(cwd, args) {
|
|
498
|
+
const launchArgs = injectModelInstructionsBypassArgs(cwd, args);
|
|
459
499
|
const omxBin = process.argv[1];
|
|
460
|
-
const codexCmd = buildTmuxShellCommand('codex',
|
|
500
|
+
const codexCmd = buildTmuxShellCommand('codex', launchArgs);
|
|
461
501
|
const hudCmd = buildTmuxShellCommand('node', [omxBin, 'hud', '--watch']);
|
|
462
502
|
const inheritLeaderFlags = process.env[TEAM_INHERIT_LEADER_FLAGS_ENV] !== '0';
|
|
463
|
-
const workerLaunchArgs = resolveTeamWorkerLaunchArgsEnv(process.env[TEAM_WORKER_LAUNCH_ARGS_ENV],
|
|
503
|
+
const workerLaunchArgs = resolveTeamWorkerLaunchArgsEnv(process.env[TEAM_WORKER_LAUNCH_ARGS_ENV], launchArgs, inheritLeaderFlags);
|
|
464
504
|
const codexEnv = workerLaunchArgs
|
|
465
505
|
? { ...process.env, [TEAM_WORKER_LAUNCH_ARGS_ENV]: workerLaunchArgs }
|
|
466
506
|
: process.env;
|
|
@@ -474,7 +514,7 @@ function runCodex(cwd, args) {
|
|
|
474
514
|
}
|
|
475
515
|
// execFileSync imported at top level
|
|
476
516
|
try {
|
|
477
|
-
execFileSync('codex',
|
|
517
|
+
execFileSync('codex', launchArgs, { cwd, stdio: 'inherit', env: codexEnv });
|
|
478
518
|
}
|
|
479
519
|
catch {
|
|
480
520
|
// Codex exited
|
|
@@ -502,7 +542,7 @@ function runCodex(cwd, args) {
|
|
|
502
542
|
console.log('tmux not available, launching codex without HUD...');
|
|
503
543
|
// execFileSync imported at top level
|
|
504
544
|
try {
|
|
505
|
-
execFileSync('codex',
|
|
545
|
+
execFileSync('codex', launchArgs, { cwd, stdio: 'inherit', env: codexEnv });
|
|
506
546
|
}
|
|
507
547
|
catch {
|
|
508
548
|
// Codex exited
|