ultracode-for-codex 0.3.0 → 0.3.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.
package/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Ultracode for Codex
2
2
 
3
- Ultracode for Codex runs local workflows as CLI commands backed by an
4
- already-authenticated Codex CLI session. Progress streams to stderr as JSONL by
5
- default, the final result prints to stdout as JSON, and cancellation/retry stay
6
- inside the same command process.
7
- The packaged `settings.json` defaults workflow runs to OS background execution
8
- with result and progress files under `.ultracode-for-codex/background/{jobId}`.
3
+ Ultracode for Codex ships two Codex skill commands plus a local npm CLI runtime.
4
+ `$ultracode-for-codex` is the default high-visibility mode: the Codex main
5
+ context plans adaptive phases, spawns focused parallel subagents, synthesizes
6
+ their results, and reports progress directly in the chat.
7
+ `$ultracode-for-codex-cli` is the explicit runtime path for package validation,
8
+ background jobs, attached CLI runs, release checks, and reproducible local
9
+ workflow artifacts.
9
10
 
10
11
  ## Quick Start
11
12
 
@@ -16,6 +17,35 @@ npm install --save-dev ultracode-for-codex
16
17
  npm exec -- ultracode-for-codex --llm-guide
17
18
  ```
18
19
 
20
+ Or install the CLI globally:
21
+
22
+ ```bash
23
+ npm install -g ultracode-for-codex
24
+ ultracode-for-codex --version
25
+ ultracode-for-codex --llm-guide
26
+ ```
27
+
28
+ Install the Codex skill commands from a project install:
29
+
30
+ ```bash
31
+ mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
32
+ cp -R ./node_modules/ultracode-for-codex/skills/ultracode-for-codex \
33
+ "${CODEX_HOME:-$HOME/.codex}/skills/"
34
+ cp -R ./node_modules/ultracode-for-codex/skills/ultracode-for-codex-cli \
35
+ "${CODEX_HOME:-$HOME/.codex}/skills/"
36
+ ```
37
+
38
+ Or install the skill commands from a global npm install:
39
+
40
+ ```bash
41
+ mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
42
+ GLOBAL_NODE_MODULES="$(npm root -g)"
43
+ cp -R "$GLOBAL_NODE_MODULES/ultracode-for-codex/skills/ultracode-for-codex" \
44
+ "${CODEX_HOME:-$HOME/.codex}/skills/"
45
+ cp -R "$GLOBAL_NODE_MODULES/ultracode-for-codex/skills/ultracode-for-codex-cli" \
46
+ "${CODEX_HOME:-$HOME/.codex}/skills/"
47
+ ```
48
+
19
49
  Build and verify a local installable tarball from a source checkout:
20
50
 
21
51
  ```bash
@@ -29,7 +59,7 @@ Install the tarball from a target project:
29
59
  npm install --save-dev /path/to/ultracode-for-codex-<version>.tgz
30
60
  ```
31
61
 
32
- Run a workflow:
62
+ Run through the CLI runtime when that path is explicitly wanted:
33
63
 
34
64
  ```bash
35
65
  npm exec -- ultracode-for-codex run \
@@ -75,14 +105,14 @@ npm exec -- ultracode-for-codex run \
75
105
  --args '{"prompt":"review correctness risks and propose fixes"}'
76
106
  ```
77
107
 
78
- The built-in `task` and `code-review` workflows use an LLM planner first, then
79
- run work phase by phase. Within each phase, multiple focused Codex subagents run
80
- in parallel by default, followed by phase and final synthesis. The planner may
81
- choose a single-agent path only when parallel execution would add risk or waste.
82
- Planner guidance includes dynamic workflow patterns such as classify-and-act,
83
- fan-out-and-synthesize, adversarial verification, generate-and-filter,
84
- tournament, and loop-until-done, so different work types can use different
85
- phase shapes.
108
+ The CLI built-in `task` and `code-review` workflows use an LLM planner first,
109
+ then run work phase by phase. Within each phase, multiple focused Codex
110
+ subagents run in parallel by default, followed by phase and final synthesis. The
111
+ planner may choose a single-agent path only when parallel execution would add
112
+ risk or waste. Planner guidance includes dynamic workflow patterns such as
113
+ classify-and-act, fan-out-and-synthesize, adversarial verification,
114
+ generate-and-filter, tournament, and loop-until-done, so different work types
115
+ can use different phase shapes.
86
116
 
87
117
  ## Settings
88
118
 
@@ -155,14 +185,18 @@ continue other tasks and inspect the job later with `status`, `logs`, or
155
185
  - Use `--execution background` for OS background runs and `--execution attached`
156
186
  only when the caller should stay connected until completion.
157
187
 
158
- ## Codex Companion Skill
188
+ ## Codex Skill Commands
159
189
 
160
- The npm package is the runtime artifact. The companion Codex skill in
161
- `skills/ultracode-for-codex` is a lightweight operating guide for agents using
162
- the package; it contains no runtime code.
190
+ The npm package includes two Codex skill command folders:
163
191
 
164
- Install or copy that folder into `${CODEX_HOME:-$HOME/.codex}/skills` when you
165
- want Codex to auto-load the package boundaries and verification routine.
192
+ - `skills/ultracode-for-codex`: default Codex-native orchestration. The main
193
+ context plans adaptive phases, spawns parallel subagents, synthesizes each
194
+ phase, reports completion progress, and recommends a final critical re-check.
195
+ Live progress uses test-runner-style visual snapshots; completion reporting
196
+ uses a diffstat-style impact summary plus a plan-style result summary.
197
+ - `skills/ultracode-for-codex-cli`: explicit CLI runtime operations, including
198
+ background jobs, attached runs, packaging, release checks, runtime-boundary
199
+ validation, and installed E2E tests.
166
200
 
167
201
  ## Runtime Boundaries
168
202
 
@@ -171,7 +205,7 @@ want Codex to auto-load the package boundaries and verification routine.
171
205
  environment.
172
206
  - Codex subagents run against the requested workflow cwd and receive bounded
173
207
  read-only workspace tools for text file reads and directory listings.
174
- - Built-in `task` and `code-review` inject deterministic workspace context into
208
+ - CLI built-in `task` and `code-review` inject deterministic workspace context into
175
209
  planner-selected phase-wise parallel subagents, then synthesize each phase and
176
210
  the final result.
177
211
  - Workflow execution is local and command-owned; settings default to OS
@@ -235,8 +269,11 @@ node dist/cli.js run --accept-llm-guide=v1 --script-file ./workflow.js
235
269
 
236
270
  ## Docs
237
271
 
238
- - `skills/ultracode-for-codex/SKILL.md`: Codex companion skill for operating
239
- the npm runtime safely.
272
+ - `skills/ultracode-for-codex/SKILL.md`: default Codex-native orchestrator
273
+ skill command.
274
+ - `skills/ultracode-for-codex/references/progress-visuals.md`: golden visual
275
+ progress and completion summary examples for native orchestration.
276
+ - `skills/ultracode-for-codex-cli/SKILL.md`: explicit CLI runtime skill command.
240
277
  - `ULTRACODE_INSTALL.md`: install and operating guide for LLM agents.
241
278
  - `docs/ultracode-p3a-journal-design.md`: journal contract.
242
279
  - `docs/ultracode-p3b-resume-cache.md`: runtime-internal resume/cache contract.
@@ -1,13 +1,27 @@
1
1
  # Ultracode install and usage guide
2
2
 
3
3
  This file is for LLM agents installing or operating `ultracode-for-codex`.
4
- Read it before running workflows or generating integration code.
4
+ Read it before running CLI workflows, installing the Codex skill commands, or
5
+ generating integration code.
5
6
 
6
7
  ## What This Package Does
7
8
 
8
- `ultracode-for-codex` provides a local command-owned workflow runtime backed by an
9
- already-authenticated Codex CLI session. The packaged `settings.json` defaults
10
- workflow runs to OS background execution with result and progress files under
9
+ `ultracode-for-codex` provides two Codex skill command surfaces and a local
10
+ command-owned workflow runtime backed by an already-authenticated Codex CLI
11
+ session.
12
+
13
+ Skill commands:
14
+
15
+ - `$ultracode-for-codex`: default Codex-native orchestration. The main Codex
16
+ context plans phases, spawns focused parallel subagents, synthesizes results,
17
+ and shows progress directly in the chat with test-runner-style live snapshots
18
+ and diffstat-plus-plan completion summaries.
19
+ - `$ultracode-for-codex-cli`: explicit CLI runtime operation for background
20
+ jobs, attached runs, package validation, release checks, and reproducible
21
+ local runtime artifacts.
22
+
23
+ The packaged `settings.json` defaults CLI workflow runs to OS background
24
+ execution with result and progress files under
11
25
  `.ultracode-for-codex/background/{jobId}`.
12
26
 
13
27
  Production surface:
@@ -43,18 +57,21 @@ For source-checkout validation, install the generated tarball instead:
43
57
  npm install --save-dev ./ultracode-for-codex-<version>.tgz
44
58
  ```
45
59
 
46
- Optional Codex companion skill:
60
+ Optional Codex skill commands:
47
61
 
48
62
  ```bash
49
63
  mkdir -p "${CODEX_HOME:-$HOME/.codex}/skills"
50
64
  cp -R ./node_modules/ultracode-for-codex/skills/ultracode-for-codex \
51
65
  "${CODEX_HOME:-$HOME/.codex}/skills/"
66
+ cp -R ./node_modules/ultracode-for-codex/skills/ultracode-for-codex-cli \
67
+ "${CODEX_HOME:-$HOME/.codex}/skills/"
52
68
  ```
53
69
 
54
- The skill is only an operating guide. The npm package remains the runtime
55
- artifact.
70
+ `$ultracode-for-codex` keeps orchestration in the main Codex context.
71
+ `$ultracode-for-codex-cli` uses the npm CLI runtime. The npm package remains the
72
+ runtime artifact for CLI execution.
56
73
 
57
- ## Run
74
+ ## Run The CLI Runtime
58
75
 
59
76
  ```bash
60
77
  npm exec -- ultracode-for-codex run \
@@ -81,11 +98,11 @@ npm exec -- ultracode-for-codex jobs --cwd /path/to/project
81
98
  npm exec -- ultracode-for-codex archive <jobId> --cwd /path/to/project
82
99
  ```
83
100
 
84
- Use built-in `task` for general work and `code-review` for review-specific work.
85
- Both start with an LLM planner, execute phase by phase, run multiple focused
86
- Codex subagents in parallel within each phase by default, and synthesize phase
87
- and final results. The planner chooses a single-agent path only when parallel
88
- execution would add risk or waste.
101
+ Use CLI built-in `task` for general work and `code-review` for review-specific
102
+ work. Both start with an LLM planner, execute phase by phase, run multiple
103
+ focused Codex subagents in parallel within each phase by default, and synthesize
104
+ phase and final results. The planner chooses a single-agent path only when
105
+ parallel execution would add risk or waste.
89
106
  Planner guidance includes classify-and-act, fan-out-and-synthesize,
90
107
  adversarial verification, generate-and-filter, tournament, and loop-until-done
91
108
  patterns so different work types can use different phase shapes.
@@ -153,7 +170,7 @@ Useful controls:
153
170
  ## Runtime Contract
154
171
 
155
172
  - Use Codex app-server over stdio as the production backend.
156
- - Keep workflow execution local and command-owned; settings default to OS
173
+ - Keep CLI workflow execution local and command-owned; settings default to OS
157
174
  background execution so long runs can keep waiting while Codex does other
158
175
  work.
159
176
  - Route progress, cancellation, permission review, retry, and result projection
@@ -192,6 +209,11 @@ workflow.
192
209
  ## Documentation Map
193
210
 
194
211
  - `README.md`: human quickstart and common examples.
212
+ - `skills/ultracode-for-codex/SKILL.md`: default Codex-native orchestrator
213
+ command.
214
+ - `skills/ultracode-for-codex/references/progress-visuals.md`: golden visual
215
+ progress and completion summary examples for native orchestration.
216
+ - `skills/ultracode-for-codex-cli/SKILL.md`: explicit CLI runtime command.
195
217
  - `docs/ultracode-p3a-journal-design.md`: implemented journal contract.
196
218
  - `docs/ultracode-p3b-resume-cache.md`: runtime-internal resume/cache contract.
197
219
  - `docs/ultracode-p3c-worktree-isolation.md`: worktree isolation contract.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultracode-for-codex",
3
- "version": "0.3.0",
4
- "description": "Run local Codex-backed workflows from a command-owned CLI runtime.",
3
+ "version": "0.3.2",
4
+ "description": "Run Codex-native Ultracode orchestration with an optional local CLI runtime.",
5
5
  "keywords": [
6
6
  "codex",
7
7
  "workflow",
@@ -41,6 +41,7 @@
41
41
  "dist/codex/",
42
42
  "dist/runtime/",
43
43
  "skills/ultracode-for-codex/",
44
+ "skills/ultracode-for-codex-cli/",
44
45
  "settings.json",
45
46
  "README.md",
46
47
  "docs/provenance-audit.md",
@@ -1,139 +1,117 @@
1
1
  ---
2
2
  name: ultracode-for-codex
3
- description: Operate, package, validate, or update the Ultracode for Codex npm runtime. Use when installing or running local workflows, checking runtime boundaries, packaging release tarballs, updating docs, or maintaining the companion Codex skill.
3
+ description: Run Ultracode for Codex in Codex-native mode, with the main Codex context planning phases, spawning parallel subagents, synthesizing results, and showing progress directly in the chat.
4
4
  ---
5
5
 
6
6
  # Ultracode for Codex
7
7
 
8
8
  ## Core Rule
9
9
 
10
- Treat the npm package as the runtime artifact. This skill is only a companion
11
- guide for Codex agents. Runtime authority remains in the `ultracode-for-codex`
12
- binary, tests, package exports, journal layer, and workflow runtime code.
13
-
14
- Workflow execution runs through the local CLI command. Progress,
15
- cancellation, permission review, retry, and result projection stay in that
16
- command process. `settings.json` defaults runs to OS background execution; use
17
- that path for long Codex-launched work so Codex can keep doing other tasks and
18
- inspect the background job later. Attached runs stream stderr JSONL for
19
- Codex-readable status, while stdout remains the final workflow result JSON.
20
-
21
- The default Ultracode work shape is phase-wise parallel execution: built-in
22
- `task` and `code-review` first call a planner agent, then execute each planned
23
- phase with parallel focused subagents by default, followed by phase and final
24
- synthesis. A single-agent path is reserved for cases where the planner judges
25
- parallel execution risky or wasteful.
26
- Planner guidance includes classify-and-act, fan-out-and-synthesize,
27
- adversarial verification, generate-and-filter, tournament, and loop-until-done
28
- patterns so workflow shape can follow the task instead of a fixed template.
29
-
30
- ## Install And Run
31
-
32
- Use the npm package for consumer installs.
33
-
34
- ```bash
35
- npm install --save-dev ultracode-for-codex
36
- npm exec -- ultracode-for-codex --llm-guide
37
- npm exec -- ultracode-for-codex run \
38
- --accept-llm-guide=v1 \
39
- --cwd /path/to/project \
40
- --script-file .codex/workflows/review.js \
41
- --args '{"prompt":"review the current change"}'
42
- ```
10
+ This skill is the primary Codex-native Ultracode command. Treat the current
11
+ Codex main context as the orchestrator. Plan adaptive phases, spawn focused
12
+ subagents directly from Codex, synthesize phase outputs, and keep the user
13
+ informed in the chat.
43
14
 
44
- For source-checkout validation before publish:
15
+ Use the CLI runtime only when the user explicitly asks for `$ultracode-for-codex-cli`,
16
+ CLI execution, background jobs, packaging, publish preparation, installed
17
+ runtime validation, or reproducible local runtime artifacts.
45
18
 
46
- ```bash
47
- npm run pack:ultracode-for-codex
48
- npm install --save-dev ./artifacts/ultracode-for-codex-<version>.tgz
49
- ```
19
+ ## Required Capability Surface
50
20
 
51
- CLI behavior:
52
-
53
- - `--version` or `-v` prints the installed package version;
54
- - default execution is `background`; stdout contains a launch record with
55
- `jobId`, `pid`, `resultPath`, `progressPath`, `metadataPath`, and `pidPath`;
56
- - background jobs can be inspected with `status`, waited with `wait`, read with
57
- `logs` and `result`, and cancelled with `cancel`;
58
- - background jobs can be enumerated with `jobs` or `list`, and exported without
59
- deletion with `archive` or `export`;
60
- - `wait --result`, `cancel --wait`, `logs --event <event>`, and `--plain`
61
- provide focused foreground checks;
62
- - attached execution is available with `--execution attached` when the caller
63
- should stay connected until completion;
64
- - attached progress prints to stderr as JSONL by default;
65
- - attached final workflow result prints as JSON to stdout;
66
- - JSONL records include `kind`, `version`, `event`, `status`, and `summary`,
67
- with agent identity and label fields on agent records;
68
- - built-in `task` and `code-review` emit `workflow.plan.ready` as a planning
69
- snapshot, not a promise that every later phase is already known;
70
- - `workflow.phase.planned` is emitted immediately before each phase starts and
71
- carries that phase's current planned agent role labels;
72
- - each `workflow.phase.started` record repeats the same role labels when the
73
- phase begins;
74
- - each `workflow.agent.completed` record includes phase progress, total known
75
- agent progress, and elapsed time;
76
- - after a completed run, `workflow.summary.ready` reports phase-level agent
77
- counts and angles, then `workflow.review.recommended` asks the current
78
- session LLM to critically re-check the final result before acting on it;
79
- - `Ctrl-C` cancels the active attached workflow;
80
- - `--retry-limit <n>` retries failed workflows inside the same process;
81
- - `--timeout-ms 0` waits for completion, cancellation, or app-server exit;
82
- positive values opt into a workflow deadline and per-agent silence budget,
83
- and that budget is not divided by the retry budget.
84
- - `--permission ask|allow|deny` handles project/user/plugin/scriptPath reviews.
85
- - `--progress plain` switches to human-readable progress lines.
86
- - background file locations are controlled by `workflow.background` in
87
- `settings.json`.
88
-
89
- ## Runtime Boundaries
90
-
91
- - Use Codex app-server over stdio as the production backend.
92
- - Keep direct provider credentials out of Codex child process environments.
93
- - Codex subagents run against the requested workflow cwd and have bounded
94
- read-only workspace tools for text file reads and directory listings.
95
- - Built-in `task` and `code-review` inject deterministic workspace context into
96
- planner-selected phase-wise parallel subagents.
97
- - Keep workflow execution local and command-owned; settings default to OS
98
- background execution so long runs can keep waiting while Codex does other
99
- work.
100
- - Keep `journalPath`, `journal.jsonl`, and journal contents out of CLI output.
101
- - Treat `.ultracode-for-codex` workflow state as sensitive local data.
102
- - Keep `resumeFromRunId` runtime-internal unless cross-process resume
103
- gets an explicit durable design.
104
- - Use `isolation: "worktree"` only inside a git repo with at least one commit;
105
- isolated worktrees are intentionally preserved for review, including clean
106
- worktrees.
107
-
108
- ## Packaging And Verification
109
-
110
- For source checkout changes, run the narrowest relevant check first, then a
111
- release-level check before handoff:
112
-
113
- ```bash
114
- npm test
115
- npm run test:e2e:ultracode-for-codex
116
- npm run test:all
117
- ```
21
+ Use Codex subagent tools for delegated work. If subagent tools are not visible,
22
+ search for the multi-agent tools first. If no subagent surface is available,
23
+ state that native parallel orchestration is unavailable in this session and
24
+ continue with the best single-context workflow.
118
25
 
119
- Build an installable artifact with:
26
+ Do not make the CLI process the default orchestrator for this skill. The npm
27
+ runtime remains available through `$ultracode-for-codex-cli`, but this command's
28
+ value is high-visibility orchestration in the main context.
120
29
 
121
- ```bash
122
- npm run pack:ultracode-for-codex
123
- ```
30
+ ## Native Workflow
124
31
 
125
- Check the npm publish payload with:
32
+ 1. Identify the user goal, scope, constraints, likely completion condition, and
33
+ whether the work is review, implementation, planning, verification, or mixed.
34
+ 2. Design only the next useful phase when later phases depend on earlier
35
+ results. A first plan may be partial.
36
+ 3. Before each phase starts, show a compact phase plan in the chat:
126
37
 
127
- ```bash
128
- npm run publish:dry-run
38
+ ```text
39
+ Phase Inspect - 3 agents
40
+ - Runtime contracts: verify the active execution path and failure semantics.
41
+ - UX/progress: check visibility, summaries, and user-facing wording.
42
+ - Tests/package: check coverage, package contents, and install behavior.
129
43
  ```
130
44
 
131
- Publish after npm login with:
132
-
133
- ```bash
134
- npm run publish:npm
45
+ 4. Spawn independent phase agents in parallel by default. Use a single agent
46
+ only when parallel work is risky, wasteful, or blocked by a strictly
47
+ sequential dependency.
48
+ 5. Keep subagent prompts concrete and bounded. Give each agent a distinct angle,
49
+ expected output shape, and file or responsibility boundary when relevant.
50
+ 6. While agents run, do non-overlapping main-context work such as deterministic
51
+ file inspection, test execution, or integration planning.
52
+ 7. As agents complete, report progress with a visual snapshot rather than a
53
+ dense sentence. Use the Default Live Snapshot golden shape from
54
+ `references/progress-visuals.md` by default. Select task-specific additions
55
+ from the Situation Choice Matrix in that reference. Within one user
56
+ request, keep a cumulative ledger: do not remove completed rows from later
57
+ snapshots; update their status and append newly discovered work below them.
58
+
59
+ ```text
60
+ Phase E2E Validate
61
+
62
+ + Native routing review done 34s
63
+ + CLI package review done 48s
64
+
65
+ > npm-exec-run-shim running 1/2 checks
66
+ > skill-copy-detection running 3/6 files
67
+
68
+ Agents 2 completed | 2 running
69
+ Checks 5 passed | 0 failed | 2 running
70
+ Elapsed 1m 12s
135
71
  ```
136
72
 
137
- When architecture, runtime boundaries, package exports, or release scope
138
- changes, update active docs such as `README.md`, `ULTRACODE_INSTALL.md`, and
139
- `IMPLEMENTATION_MAP.html`.
73
+ 8. Synthesize each phase before deciding the next phase. Preserve disagreement,
74
+ uncertainty, material risks, and exact evidence.
75
+ 9. After the final synthesis, include the Completion Impact Summary and
76
+ Plan-Style Result Summary golden shapes from `references/progress-visuals.md`,
77
+ followed by a short phase/agent summary.
78
+ 10. Recommend that the current session LLM critically re-check the final result
79
+ before the user relies on it, especially for code, security, release, or
80
+ architecture decisions.
81
+
82
+ ## Planning Heuristics
83
+
84
+ Default to phase-wise parallel execution. Useful patterns include:
85
+
86
+ - classify-and-act: classify request type, risk, or repo area before choosing
87
+ the phase shape;
88
+ - fan-out-and-synthesize: split independent lenses across parallel agents, then
89
+ merge evidence;
90
+ - adversarial verification: assign at least one agent to challenge correctness,
91
+ security, assumptions, or test adequacy;
92
+ - generate-and-filter: create candidate approaches or fixes, then select by
93
+ evidence and constraints;
94
+ - tournament: compare competing alternatives when the best path is unclear;
95
+ - loop-until-done: iterate repair and verification only when there is a clear
96
+ stop condition.
97
+
98
+ For code review, common parallel angles are runtime correctness,
99
+ security/capability boundaries, API/CLI contracts, persistence/retry/cancel
100
+ behavior, user-visible progress, package contents, and test coverage.
101
+
102
+ For implementation, split by disjoint write ownership where possible. Tell
103
+ subagents they are not alone in the codebase and must not revert unrelated or
104
+ parallel edits.
105
+
106
+ ## Output Contract
107
+
108
+ Keep progress visible but concise. Prefer stable visual summaries over prose-only
109
+ status sentences. Use `references/progress-visuals.md` for the golden examples.
110
+ The final answer should include:
111
+
112
+ - the completed result or findings;
113
+ - evidence and verification performed;
114
+ - a phase/agent summary;
115
+ - residual risk or unverified items;
116
+ - a critical re-check recommendation for the current session LLM when the result
117
+ will drive action.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Ultracode for Codex"
3
- short_description: "Operate the Ultracode for Codex npm runtime safely."
4
- default_prompt: "Use the Ultracode for Codex npm package as the runtime and follow its local CLI boundaries."
3
+ short_description: "Run Codex-native phase-wise parallel orchestration."
4
+ default_prompt: "Use the Codex main context as the Ultracode orchestrator, plan adaptive phases, spawn focused parallel subagents, synthesize results, and keep progress visible."
@@ -0,0 +1,418 @@
1
+ # Progress Visuals
2
+
3
+ Use these golden examples for Codex-native Ultracode progress updates. The goal
4
+ is fast visual parsing in chat while staying portable across terminals and
5
+ renderers. Prefer ASCII symbols and short labels.
6
+
7
+ ## Research Pattern Map
8
+
9
+ These patterns are adapted from established CLI/TUI conventions:
10
+
11
+ - multi-task progress: Rich-style multiple task rows with progress metadata;
12
+ - test progress: pytest-style progress/count/timing summaries;
13
+ - async build logs: Docker BuildKit-style numbered steps and plain progress;
14
+ - folded details: GitHub Actions-style grouped log sections;
15
+ - change plans: Terraform-style add/update/keep/destroy action symbols;
16
+ - rollout watches: Kubernetes rollout-style "N out of M" convergence messages;
17
+ - audit tables: npm audit-style severity/package/path/remediation columns.
18
+
19
+ Map those patterns to Ultracode situations instead of using one universal
20
+ status format.
21
+
22
+ ## Situation Choice Matrix
23
+
24
+ Choose one row per task situation. Each row has at most three user-facing
25
+ shapes: primary, support, and finish. Do not present profile names to the user.
26
+ If a task mixes situations, choose the dominant row for live progress and borrow
27
+ at most one support shape from another row.
28
+
29
+ | Situation | Primary | Support | Finish |
30
+ | --- | --- | --- | --- |
31
+ | Ordinary or mixed work | Default Live Snapshot | Verification Gate Matrix | Plan-Style Result Summary |
32
+ | Design or planning | Decision Tournament | Context Coverage Matrix | User Decision Gate |
33
+ | Implementation | Implementation Work Ledger | Verification Gate Matrix | Completion Impact Summary |
34
+ | Review or audit | Agent Lens Matrix | Context Coverage Matrix | Evidence To Finding Trace |
35
+ | Release or install | Artifact Inventory | Rollout Or Convergence Watch | Risk Or Audit Table |
36
+ | Retry, cancellation, or long-running work | Recovery Ledger | Resource Budget Snapshot | Rollout Or Convergence Watch |
37
+
38
+ Phase Plan Preview is baseline behavior before a phase starts, not an extra
39
+ choice. Long Async Timeline is only a temporary diagnostic appendix when the
40
+ user explicitly asks to debug detailed event order.
41
+
42
+ ## Cumulative Ledger Rule
43
+
44
+ Within one user request, progress snapshots are cumulative. Do not let completed
45
+ work scroll out of the next snapshot just because new work starts. Keep completed
46
+ rows, update their status, and append newly discovered work below them. This
47
+ makes the current answer self-contained even if the user only sees the latest
48
+ snapshot.
49
+
50
+ ```text
51
+ Phase Commit Prep
52
+
53
+ + README install flow done local + global skill install
54
+ + Registry/install check done <version> published and installed
55
+ + Verification done npm run test:all
56
+
57
+ > Commit running staging release changes
58
+ - Push queued origin/main
59
+
60
+ Checks 3 passed | 0 failed | 2 running/queued
61
+ Next: commit release changes
62
+ ```
63
+
64
+ Use `+` for completed work, `>` for running work, `-` for queued work, and `!`
65
+ for blocked or failed work. Keep earlier completed rows visible in every later
66
+ snapshot for the same request.
67
+
68
+ ## Default Live Snapshot
69
+
70
+ Use this for ordinary phase progress. It is inspired by test-runner summaries:
71
+ completed work is listed first, active work is visually distinct, and totals are
72
+ grouped at the bottom.
73
+
74
+ ```text
75
+ Phase E2E Validate
76
+
77
+ + Native routing review done 34s
78
+ + CLI package review done 48s
79
+
80
+ > npm-exec-run-shim running 1/2 checks
81
+ > skill-copy-detection running 3/6 files
82
+
83
+ Agents 2 completed | 2 running
84
+ Checks 5 passed | 0 failed | 2 running
85
+ Elapsed 1m 12s
86
+ ```
87
+
88
+ Keep each row to one line when possible.
89
+
90
+ ## Dense Meter Snapshot
91
+
92
+ Use this when the work is count-heavy and the user needs ratios.
93
+
94
+ ```text
95
+ Progress Snapshot main c3734d8
96
+
97
+ Native routing ####################---- 5 / 6 checks
98
+ CLI package E2E ######################## passed
99
+ Skill install check ################-------- 4 / 6 files
100
+ Docs contract ############------------ 2 / 4 sections
101
+
102
+ Elapsed 1m 42s Next: npm exec run shim check
103
+ ```
104
+
105
+ Use fixed-width bars only when the denominator is meaningful. Do not invent a
106
+ percentage for semantic work that cannot be counted.
107
+
108
+ ## Long Async Timeline
109
+
110
+ Use this for long-running parallel work where event order matters.
111
+
112
+ ```text
113
+ #1 [plan] classify task shape
114
+ #1 DONE 0.8s
115
+
116
+ #2 [phase:inspect] spawn 2 review agents
117
+ #2 running 2 agents
118
+
119
+ #3 [agent:native-routing] verify skill split
120
+ #3 DONE 34.1s
121
+
122
+ #4 [agent:cli-package] verify installed E2E
123
+ #4 DONE 48.7s
124
+
125
+ #5 [synthesis] merge findings
126
+ #5 running
127
+ ```
128
+
129
+ Use this sparingly in chat. It is best when the user asks for detailed live
130
+ process visibility.
131
+
132
+ ## Completion Impact Summary
133
+
134
+ Use this in final or phase-completion reporting when files changed.
135
+
136
+ ```text
137
+ Change Impact
138
+
139
+ skills/ultracode-for-codex/SKILL.md | 200 +++++++++++---------
140
+ skills/ultracode-for-codex-cli/SKILL.md | 136 +++++++++++++
141
+ scripts/e2e-installed-ultracode-for-codex.mjs | 78 +++++++-
142
+ README.md | 62 ++++--
143
+
144
+ 8 files changed, 295 insertions(+), 201 deletions(-)
145
+ ```
146
+
147
+ Prefer real `git diff --stat` output when available.
148
+
149
+ ## Plan-Style Result Summary
150
+
151
+ Use this with the impact summary to explain what changed conceptually.
152
+
153
+ ```text
154
+ Execution Result
155
+
156
+ + add ultracode-for-codex-cli skill command
157
+ ~ update ultracode-for-codex native orchestration contract
158
+ ~ update installed E2E to cover npm exec run
159
+ = keep CLI runtime command surface
160
+
161
+ Result: 1 added, 2 updated, 1 kept
162
+ Risk: Codex skill reload cannot be forced inside the current session
163
+ ```
164
+
165
+ Use `+ add`, `~ update`, `= keep`, and `! risk` consistently.
166
+
167
+ ## Folded Detail Summary
168
+
169
+ Use this when the top-level result is enough and details should remain compact.
170
+
171
+ ```text
172
+ E2E Validation Summary
173
+
174
+ [passed] Native skill routing
175
+ [passed] CLI package runtime
176
+ [passed] npm exec run shim
177
+ [passed] CODEX_HOME skill copy
178
+
179
+ Details
180
+ native-routing-review 5 findings, 0 failures
181
+ cli-package-review 7 findings, 0 failures
182
+ npm test:all 35 tests passed
183
+ ```
184
+
185
+ This is best for final handoff or after multiple agents have returned.
186
+
187
+ ## Building Block Examples
188
+
189
+ Use these shapes as building blocks selected by the Situation Choice Matrix
190
+ above. Do not present this full list as user-facing choices.
191
+
192
+ ### Phase Plan Preview
193
+
194
+ Use this immediately before spawning agents for a phase.
195
+
196
+ ```text
197
+ Phase Inspect - planned fan-out
198
+
199
+ - Runtime contracts check execution authority and failure semantics
200
+ - UX/progress inspect visible status and completion summaries
201
+ - Tests/package verify E2E, tarball, and installed skill contents
202
+
203
+ Parallelism: 3 agents
204
+ Synthesis: merge material findings and decide next phase
205
+ ```
206
+
207
+ ### Agent Lens Matrix
208
+
209
+ Use this when several agents are reviewing the same artifact from different
210
+ angles.
211
+
212
+ ```text
213
+ Review Lenses
214
+
215
+ + Runtime correctness no material issue workflow-runtime.ts
216
+ + Capability boundary no material issue subagent-backend.ts
217
+ ! User visibility needs fix progress visuals
218
+ > Package contract running tarball contents
219
+
220
+ Findings 1 open | 2 clear | 1 running
221
+ Next: fix user visibility contract
222
+ ```
223
+
224
+ ### Implementation Work Ledger
225
+
226
+ Use this when work is split into edit scopes.
227
+
228
+ ```text
229
+ Implementation Ledger
230
+
231
+ + Skill routing docs updated skills/ultracode-for-codex
232
+ + CLI skill command added skills/ultracode-for-codex-cli
233
+ > E2E package checks editing scripts/e2e-installed-...
234
+ - README install flow queued local/global install examples
235
+
236
+ Files touched 6 | Tests queued 2 | Risk low
237
+ ```
238
+
239
+ ### Verification Gate Matrix
240
+
241
+ Use this after tests, package checks, reviews, or publish dry-runs.
242
+
243
+ ```text
244
+ Verification Gates
245
+
246
+ + unit/integration passed 35 tests
247
+ + installed E2E passed fake Codex boundary
248
+ + package validation passed 35 files in tarball
249
+ + publish dry-run passed would publish <version>
250
+
251
+ Gates 4 passed | 0 failed | 0 skipped
252
+ Residual: live Codex smoke remains opt-in
253
+ ```
254
+
255
+ ### Decision Tournament
256
+
257
+ Use this when comparing approaches before implementation.
258
+
259
+ ```text
260
+ Decision Tournament
261
+
262
+ A CLI orchestration rejected low visibility
263
+ B Native main orchestration selected highest chat visibility
264
+ C Hybrid auto-router deferred more moving parts
265
+
266
+ Winner: B
267
+ Reason: best fit for Codex-native progress and direct subagent control
268
+ ```
269
+
270
+ ### Blocked Or Risk Snapshot
271
+
272
+ Use this when a dependency, permission, failing gate, or missing capability
273
+ blocks progress.
274
+
275
+ ```text
276
+ Blocked Snapshot
277
+
278
+ + Package contents verified
279
+ ! Native subagent surface blocked multi-agent tools unavailable
280
+ - Parallel review paused needs subagent surface
281
+
282
+ Blocker: native parallel orchestration unavailable in this session
283
+ Fallback: continue single-context review and record residual risk
284
+ ```
285
+
286
+ ### Retry Or Recovery Ledger
287
+
288
+ Use this for transient failures, retry loops, cancellation, or recovery.
289
+
290
+ ```text
291
+ Recovery Ledger
292
+
293
+ + attempt 1 failed workflow_agent_stalled
294
+ + retry policy applied retry 1 / 2
295
+ > attempt 2 running narrowed review prompt
296
+ - synthesis queued after terminal result
297
+
298
+ Retries 1 used | 1 remaining
299
+ Next: wait for attempt 2 terminal state
300
+ ```
301
+
302
+ ### Artifact Inventory
303
+
304
+ Use this when the output is files, package artifacts, generated docs, or local
305
+ state.
306
+
307
+ ```text
308
+ Artifact Inventory
309
+
310
+ + npm tarball artifacts/ultracode-for-codex-<version>.tgz
311
+ + native skill skills/ultracode-for-codex/SKILL.md
312
+ + CLI skill skills/ultracode-for-codex-cli/SKILL.md
313
+ + progress examples skills/ultracode-for-codex/references/progress-visuals.md
314
+
315
+ Artifacts 4 ready | Sensitive local state not included
316
+ ```
317
+
318
+ ### Rollout Or Convergence Watch
319
+
320
+ Use this when waiting for a target state: publish propagation, installed package
321
+ availability, test shards, deployment checks, or background jobs.
322
+
323
+ ```text
324
+ Convergence Watch
325
+
326
+ + npm registry visible <version> latest
327
+ + global CLI updated /opt/homebrew/bin/ultracode-for-codex
328
+ > Codex skill reload pending next session boundary
329
+ - downstream smoke queued user project install
330
+
331
+ Converged 2 / 4
332
+ Next: verify downstream smoke after reload
333
+ ```
334
+
335
+ ### Risk Or Audit Table
336
+
337
+ Use this for security, capability boundaries, provenance, dependency audit,
338
+ license review, or data exposure checks.
339
+
340
+ ```text
341
+ Risk Audit
342
+
343
+ severity area status evidence
344
+ high provider credentials clear env stripping test
345
+ medium local state paths clear .ultracode-for-codex ignored
346
+ low docs ambiguity open install wording
347
+
348
+ Open risk 1 low | Material risk 0
349
+ Next: clarify install wording
350
+ ```
351
+
352
+ ### Context Coverage Matrix
353
+
354
+ Use this when the quality of a result depends on which evidence was actually
355
+ read, searched, tested, or left unverified.
356
+
357
+ ```text
358
+ Context Coverage
359
+
360
+ + runtime source read src/runtime/workflow-runtime.ts
361
+ + package scripts read scripts/package-...
362
+ + installed E2E executed npm run test:e2e:...
363
+ ! live Codex smoke skipped opt-in local environment
364
+
365
+ Coverage 3 verified | 1 residual
366
+ Residual: live smoke remains user-triggered
367
+ ```
368
+
369
+ ### User Decision Gate
370
+
371
+ Use this when the next step needs a product or risk choice rather than more
372
+ execution.
373
+
374
+ ```text
375
+ Decision Gate
376
+
377
+ A Publish now ready all gates green
378
+ B Add live smoke first safer needs local Codex run
379
+ C Defer release safest no user impact yet
380
+
381
+ Recommended: A
382
+ Why: package and dry-run gates are green; live smoke is optional
383
+ ```
384
+
385
+ ### Resource Budget Snapshot
386
+
387
+ Use this for long work where elapsed time, agent count, retry budget, or token
388
+ budget matters.
389
+
390
+ ```text
391
+ Resource Budget
392
+
393
+ agents active 3 / 6
394
+ retries used 1 / 2
395
+ elapsed 7m 20s
396
+ timeout none
397
+ token budget not capped
398
+
399
+ Pressure: low
400
+ Next: wait for active agents before synthesis
401
+ ```
402
+
403
+ ### Evidence To Finding Trace
404
+
405
+ Use this when translating many observations into a smaller set of findings or
406
+ fixes.
407
+
408
+ ```text
409
+ Evidence Trace
410
+
411
+ evidence finding action
412
+ package files include skill refs packaging contract ok keep
413
+ npm exec run path untested E2E gap add test
414
+ progress rows disappear visibility gap add ledger rule
415
+
416
+ Findings 2 actionable | 1 keep
417
+ Next: implement E2E gap and ledger rule
418
+ ```
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: ultracode-for-codex-cli
3
+ description: Operate, package, validate, or update the Ultracode for Codex npm CLI runtime, including background jobs, attached runs, runtime boundaries, release tarballs, and Codex skill command files.
4
+ ---
5
+
6
+ # Ultracode for Codex CLI
7
+
8
+ ## Core Rule
9
+
10
+ Use this skill for the npm package and CLI runtime surface. Runtime authority for
11
+ this path lives in the `ultracode-for-codex` binary, tests, package exports,
12
+ journal layer, and workflow runtime code.
13
+
14
+ The default `$ultracode-for-codex` skill is Codex-native and keeps orchestration
15
+ in the main context. This `$ultracode-for-codex-cli` skill is for explicit CLI
16
+ runtime work: background execution, attached runs, package validation, release
17
+ preparation, installed E2E checks, runtime-boundary checks, and local workflow
18
+ artifacts.
19
+
20
+ Workflow execution through this path runs through the local CLI command.
21
+ Progress, cancellation, permission review, retry, and result projection stay in
22
+ that command process. `settings.json` defaults runs to OS background execution;
23
+ use that path for long Codex-launched CLI work so Codex can keep doing other
24
+ tasks and inspect the background job later. Attached runs stream stderr JSONL for
25
+ Codex-readable status, while stdout remains the final workflow result JSON.
26
+
27
+ ## Install And Run
28
+
29
+ Use the npm package for consumer installs.
30
+
31
+ ```bash
32
+ npm install --save-dev ultracode-for-codex
33
+ npm exec -- ultracode-for-codex --llm-guide
34
+ npm exec -- ultracode-for-codex run \
35
+ --accept-llm-guide=v1 \
36
+ --cwd /path/to/project \
37
+ --script-file .codex/workflows/review.js \
38
+ --args '{"prompt":"review the current change"}'
39
+ ```
40
+
41
+ For source-checkout validation before publish:
42
+
43
+ ```bash
44
+ npm run pack:ultracode-for-codex
45
+ npm install --save-dev ./artifacts/ultracode-for-codex-<version>.tgz
46
+ ```
47
+
48
+ CLI behavior:
49
+
50
+ - `--version` or `-v` prints the installed package version;
51
+ - default execution is `background`; stdout contains a launch record with
52
+ `jobId`, `pid`, `resultPath`, `progressPath`, `metadataPath`, and `pidPath`;
53
+ - background jobs can be inspected with `status`, waited with `wait`, read with
54
+ `logs` and `result`, and cancelled with `cancel`;
55
+ - background jobs can be enumerated with `jobs` or `list`, and exported without
56
+ deletion with `archive` or `export`;
57
+ - `wait --result`, `cancel --wait`, `logs --event <event>`, and `--plain`
58
+ provide focused foreground checks;
59
+ - attached execution is available with `--execution attached` when the caller
60
+ should stay connected until completion;
61
+ - attached progress prints to stderr as JSONL by default;
62
+ - attached final workflow result prints as JSON to stdout;
63
+ - JSONL records include `kind`, `version`, `event`, `status`, and `summary`,
64
+ with agent identity and label fields on agent records;
65
+ - built-in `task` and `code-review` emit `workflow.plan.ready` as a planning
66
+ snapshot, not a promise that every later phase is already known;
67
+ - `workflow.phase.planned` is emitted immediately before each phase starts and
68
+ carries that phase's current planned agent role labels;
69
+ - each `workflow.phase.started` record repeats the same role labels when the
70
+ phase begins;
71
+ - each `workflow.agent.completed` record includes phase progress, total known
72
+ agent progress, and elapsed time;
73
+ - after a completed run, `workflow.summary.ready` reports phase-level agent
74
+ counts and angles, then `workflow.review.recommended` asks the current
75
+ session LLM to critically re-check the final result before acting on it;
76
+ - `Ctrl-C` cancels the active attached workflow;
77
+ - `--retry-limit <n>` retries failed workflows inside the same process;
78
+ - `--timeout-ms 0` waits for completion, cancellation, or app-server exit;
79
+ positive values opt into a workflow deadline and per-agent silence budget,
80
+ and that budget is not divided by the retry budget.
81
+ - `--permission ask|allow|deny` handles project/user/plugin/scriptPath reviews.
82
+ - `--progress plain` switches to human-readable progress lines.
83
+ - background file locations are controlled by `workflow.background` in
84
+ `settings.json`.
85
+
86
+ ## Runtime Boundaries
87
+
88
+ - Use Codex app-server over stdio as the production backend.
89
+ - Keep direct provider credentials out of Codex child process environments.
90
+ - Codex subagents run against the requested workflow cwd and have bounded
91
+ read-only workspace tools for text file reads and directory listings.
92
+ - Built-in `task` and `code-review` inject deterministic workspace context into
93
+ planner-selected phase-wise parallel subagents.
94
+ - Keep workflow execution local and command-owned; settings default to OS
95
+ background execution so long runs can keep waiting while Codex does other
96
+ work.
97
+ - Keep `journalPath`, `journal.jsonl`, and journal contents out of CLI output.
98
+ - Treat `.ultracode-for-codex` workflow state as sensitive local data.
99
+ - Keep `resumeFromRunId` runtime-internal unless cross-process resume gets an
100
+ explicit durable design.
101
+ - Use `isolation: "worktree"` only inside a git repo with at least one commit;
102
+ isolated worktrees are intentionally preserved for review, including clean
103
+ worktrees.
104
+
105
+ ## Packaging And Verification
106
+
107
+ For source checkout changes, run the narrowest relevant check first, then a
108
+ release-level check before handoff:
109
+
110
+ ```bash
111
+ npm test
112
+ npm run test:e2e:ultracode-for-codex
113
+ npm run test:all
114
+ ```
115
+
116
+ Build an installable artifact with:
117
+
118
+ ```bash
119
+ npm run pack:ultracode-for-codex
120
+ ```
121
+
122
+ Check the npm publish payload with:
123
+
124
+ ```bash
125
+ npm run publish:dry-run
126
+ ```
127
+
128
+ Publish after npm login with:
129
+
130
+ ```bash
131
+ npm run publish:npm
132
+ ```
133
+
134
+ When architecture, runtime boundaries, package exports, or release scope
135
+ changes, update active docs such as `README.md`, `ULTRACODE_INSTALL.md`, and
136
+ `IMPLEMENTATION_MAP.html`.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Ultracode for Codex CLI"
3
+ short_description: "Operate the Ultracode for Codex npm CLI runtime."
4
+ default_prompt: "Use the Ultracode for Codex CLI runtime for explicit package, background job, validation, and release work."