oh-my-codex 0.8.6 → 0.8.7

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 (146) hide show
  1. package/README.md +16 -1
  2. package/dist/agents/definitions.js +7 -7
  3. package/dist/agents/definitions.js.map +1 -1
  4. package/dist/agents/native-config.d.ts.map +1 -1
  5. package/dist/agents/native-config.js +18 -6
  6. package/dist/agents/native-config.js.map +1 -1
  7. package/dist/cli/__tests__/index.test.js +9 -6
  8. package/dist/cli/__tests__/index.test.js.map +1 -1
  9. package/dist/cli/__tests__/package-bin-contract.test.d.ts +2 -0
  10. package/dist/cli/__tests__/package-bin-contract.test.d.ts.map +1 -0
  11. package/dist/cli/__tests__/package-bin-contract.test.js +29 -0
  12. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -0
  13. package/dist/cli/index.d.ts.map +1 -1
  14. package/dist/cli/index.js +9 -8
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/config/__tests__/generator-notify.test.js +3 -4
  17. package/dist/config/__tests__/generator-notify.test.js.map +1 -1
  18. package/dist/config/generator.js +1 -1
  19. package/dist/config/generator.js.map +1 -1
  20. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js +5 -38
  21. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js.map +1 -1
  22. package/dist/hooks/__tests__/prompt-guidance-contract.test.js +6 -51
  23. package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -1
  24. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts +2 -0
  25. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts.map +1 -0
  26. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +45 -0
  27. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -0
  28. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js +7 -26
  29. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js.map +1 -1
  30. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts +4 -0
  31. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +1 -0
  32. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +16 -0
  33. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +1 -0
  34. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +19 -47
  35. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
  36. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts +2 -0
  37. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts.map +1 -0
  38. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js +37 -0
  39. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js.map +1 -0
  40. package/dist/hooks/__tests__/skill-guidance-contract.test.js +5 -25
  41. package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -1
  42. package/dist/hooks/prompt-guidance-contract.d.ts +14 -0
  43. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -0
  44. package/dist/hooks/prompt-guidance-contract.js +160 -0
  45. package/dist/hooks/prompt-guidance-contract.js.map +1 -0
  46. package/dist/mcp/__tests__/bootstrap.test.js +51 -13
  47. package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
  48. package/dist/mcp/__tests__/code-intel-server.test.js +4 -3
  49. package/dist/mcp/__tests__/code-intel-server.test.js.map +1 -1
  50. package/dist/mcp/__tests__/memory-server.test.js +4 -2
  51. package/dist/mcp/__tests__/memory-server.test.js.map +1 -1
  52. package/dist/mcp/__tests__/server-lifecycle.test.d.ts +2 -0
  53. package/dist/mcp/__tests__/server-lifecycle.test.d.ts.map +1 -0
  54. package/dist/mcp/__tests__/server-lifecycle.test.js +159 -0
  55. package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -0
  56. package/dist/mcp/bootstrap.d.ts +7 -0
  57. package/dist/mcp/bootstrap.d.ts.map +1 -1
  58. package/dist/mcp/bootstrap.js +51 -0
  59. package/dist/mcp/bootstrap.js.map +1 -1
  60. package/dist/mcp/code-intel-server.js +4 -7
  61. package/dist/mcp/code-intel-server.js.map +1 -1
  62. package/dist/mcp/memory-server.js +2 -6
  63. package/dist/mcp/memory-server.js.map +1 -1
  64. package/dist/mcp/state-server.d.ts.map +1 -1
  65. package/dist/mcp/state-server.js +2 -6
  66. package/dist/mcp/state-server.js.map +1 -1
  67. package/dist/mcp/team-server.d.ts.map +1 -1
  68. package/dist/mcp/team-server.js +2 -6
  69. package/dist/mcp/team-server.js.map +1 -1
  70. package/dist/mcp/trace-server.d.ts.map +1 -1
  71. package/dist/mcp/trace-server.js +2 -6
  72. package/dist/mcp/trace-server.js.map +1 -1
  73. package/dist/team/__tests__/hardening-e2e.test.d.ts +2 -0
  74. package/dist/team/__tests__/hardening-e2e.test.d.ts.map +1 -0
  75. package/dist/team/__tests__/hardening-e2e.test.js +71 -0
  76. package/dist/team/__tests__/hardening-e2e.test.js.map +1 -0
  77. package/dist/team/__tests__/model-contract.test.js +9 -6
  78. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  79. package/dist/team/__tests__/runtime.test.js +34 -6
  80. package/dist/team/__tests__/runtime.test.js.map +1 -1
  81. package/dist/team/__tests__/state.test.js +28 -1
  82. package/dist/team/__tests__/state.test.js.map +1 -1
  83. package/dist/team/__tests__/team-ops-contract.test.js +1 -0
  84. package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
  85. package/dist/team/__tests__/worktree.test.js +22 -0
  86. package/dist/team/__tests__/worktree.test.js.map +1 -1
  87. package/dist/team/runtime.d.ts.map +1 -1
  88. package/dist/team/runtime.js +27 -13
  89. package/dist/team/runtime.js.map +1 -1
  90. package/dist/team/state/tasks.d.ts +2 -1
  91. package/dist/team/state/tasks.d.ts.map +1 -1
  92. package/dist/team/state/tasks.js +46 -5
  93. package/dist/team/state/tasks.js.map +1 -1
  94. package/dist/team/state/types.d.ts +8 -0
  95. package/dist/team/state/types.d.ts.map +1 -1
  96. package/dist/team/state/types.js.map +1 -1
  97. package/dist/team/state.d.ts +9 -0
  98. package/dist/team/state.d.ts.map +1 -1
  99. package/dist/team/state.js +14 -1
  100. package/dist/team/state.js.map +1 -1
  101. package/dist/team/team-ops.d.ts +2 -1
  102. package/dist/team/team-ops.d.ts.map +1 -1
  103. package/dist/team/team-ops.js +1 -0
  104. package/dist/team/team-ops.js.map +1 -1
  105. package/dist/team/tmux-session.d.ts.map +1 -1
  106. package/dist/team/tmux-session.js +3 -2
  107. package/dist/team/tmux-session.js.map +1 -1
  108. package/dist/team/worktree.d.ts.map +1 -1
  109. package/dist/team/worktree.js +14 -0
  110. package/dist/team/worktree.js.map +1 -1
  111. package/package.json +2 -2
  112. package/prompts/analyst.md +56 -42
  113. package/prompts/api-reviewer.md +42 -38
  114. package/prompts/architect.md +53 -47
  115. package/prompts/build-fixer.md +45 -32
  116. package/prompts/code-reviewer.md +53 -46
  117. package/prompts/code-simplifier.md +128 -97
  118. package/prompts/critic.md +49 -34
  119. package/prompts/debugger.md +50 -38
  120. package/prompts/dependency-expert.md +50 -34
  121. package/prompts/designer.md +52 -41
  122. package/prompts/executor.md +96 -71
  123. package/prompts/explore.md +57 -47
  124. package/prompts/git-master.md +43 -32
  125. package/prompts/information-architect.md +101 -67
  126. package/prompts/performance-reviewer.md +41 -37
  127. package/prompts/planner.md +68 -53
  128. package/prompts/product-analyst.md +69 -76
  129. package/prompts/product-manager.md +85 -107
  130. package/prompts/qa-tester.md +43 -32
  131. package/prompts/quality-reviewer.md +51 -45
  132. package/prompts/quality-strategist.md +116 -81
  133. package/prompts/researcher.md +47 -36
  134. package/prompts/security-reviewer.md +54 -48
  135. package/prompts/sisyphus-lite.md +145 -0
  136. package/prompts/style-reviewer.md +40 -36
  137. package/prompts/test-engineer.md +53 -40
  138. package/prompts/ux-researcher.md +98 -65
  139. package/prompts/verifier.md +48 -33
  140. package/prompts/vision.md +44 -32
  141. package/prompts/writer.md +44 -32
  142. package/scripts/dev-refresh-prompts.sh +83 -0
  143. package/scripts/dev-watch-prompts.sh +139 -0
  144. package/scripts/sync-prompt-guidance-fragments.js +51 -0
  145. package/scripts/team-hardening-benchmark.mjs +90 -0
  146. package/templates/AGENTS.md +14 -2
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env node
2
+ import { mkdtemp, rm, readFile, writeFile } from 'node:fs/promises';
3
+ import { execFileSync } from 'node:child_process';
4
+ import { join } from 'node:path';
5
+ import { tmpdir } from 'node:os';
6
+ import { performance } from 'node:perf_hooks';
7
+
8
+ import { initTeamState, createTask, claimTask, readTask, writeAtomic } from '../dist/team/state.js';
9
+ import { monitorTeam } from '../dist/team/runtime.js';
10
+ import { planWorktreeTarget, ensureWorktree } from '../dist/team/worktree.js';
11
+
12
+ async function initRepo() {
13
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-team-bench-repo-'));
14
+ execFileSync('git', ['init'], { cwd, stdio: 'ignore' });
15
+ execFileSync('git', ['config', 'user.email', 'test@example.com'], { cwd, stdio: 'ignore' });
16
+ execFileSync('git', ['config', 'user.name', 'Test User'], { cwd, stdio: 'ignore' });
17
+ await writeFile(join(cwd, 'README.md'), 'hello\n', 'utf-8');
18
+ execFileSync('git', ['add', 'README.md'], { cwd, stdio: 'ignore' });
19
+ execFileSync('git', ['commit', '-m', 'init'], { cwd, stdio: 'ignore' });
20
+ return cwd;
21
+ }
22
+
23
+ async function benchReclaim(iterations = 10) {
24
+ const samples = [];
25
+ for (let i = 0; i < iterations; i += 1) {
26
+ const cwd = await mkdtemp(join(tmpdir(), 'omx-team-bench-reclaim-'));
27
+ try {
28
+ await initTeamState('team-bench', 'bench reclaim', 'executor', 2, cwd);
29
+ const task = await createTask('team-bench', { subject: 'recover', description: 'd', status: 'pending' }, cwd);
30
+ const claim = await claimTask('team-bench', task.id, 'worker-1', task.version ?? 1, cwd);
31
+ if (!claim.ok) throw new Error('claim failed');
32
+
33
+ const taskPath = join(cwd, '.omx', 'state', 'team', 'team-bench', 'tasks', `task-${task.id}.json`);
34
+ const current = JSON.parse(await readFile(taskPath, 'utf-8'));
35
+ current.claim.leased_until = new Date(Date.now() - 1000).toISOString();
36
+ await writeAtomic(taskPath, JSON.stringify(current, null, 2));
37
+
38
+ const start = performance.now();
39
+ await monitorTeam('team-bench', cwd);
40
+ const elapsed = performance.now() - start;
41
+ const reopened = await readTask('team-bench', task.id, cwd);
42
+ if (reopened?.status !== 'pending') throw new Error('task not reclaimed');
43
+ samples.push(elapsed);
44
+ } finally {
45
+ await rm(cwd, { recursive: true, force: true });
46
+ }
47
+ }
48
+ return samples;
49
+ }
50
+
51
+ async function benchDirtyWorktree(iterations = 10) {
52
+ const samples = [];
53
+ for (let i = 0; i < iterations; i += 1) {
54
+ const repo = await initRepo();
55
+ try {
56
+ const plan = planWorktreeTarget({ cwd: repo, scope: 'launch', mode: { enabled: true, detached: true, name: null } });
57
+ if (!plan.enabled) throw new Error('plan disabled');
58
+ const first = ensureWorktree(plan);
59
+ if (!first.enabled) throw new Error('ensure disabled');
60
+ await writeFile(join(first.worktreePath, 'DIRTY.txt'), 'dirty\n', 'utf-8');
61
+ const start = performance.now();
62
+ let blocked = false;
63
+ try {
64
+ ensureWorktree(plan);
65
+ } catch (error) {
66
+ blocked = /worktree_dirty/.test(String(error));
67
+ }
68
+ const elapsed = performance.now() - start;
69
+ if (!blocked) throw new Error('dirty reuse was not blocked');
70
+ samples.push(elapsed);
71
+ } finally {
72
+ await rm(repo, { recursive: true, force: true });
73
+ }
74
+ }
75
+ return samples;
76
+ }
77
+
78
+ function summarize(name, values) {
79
+ const sorted = [...values].sort((a, b) => a - b);
80
+ const avg = sorted.reduce((a, b) => a + b, 0) / sorted.length;
81
+ const median = sorted[Math.floor(sorted.length / 2)];
82
+ const p95 = sorted[Math.min(sorted.length - 1, Math.floor(sorted.length * 0.95))];
83
+ console.log(`${name}: n=${sorted.length} avg_ms=${avg.toFixed(2)} median_ms=${median.toFixed(2)} p95_ms=${p95.toFixed(2)}`);
84
+ }
85
+
86
+ const reclaim = await benchReclaim(10);
87
+ const dirty = await benchDirtyWorktree(10);
88
+ console.log('team-hardening benchmark');
89
+ summarize('expired-claim-reclaim', reclaim);
90
+ summarize('dirty-worktree-detection', dirty);
@@ -2,6 +2,8 @@
2
2
 
3
3
  You are running with oh-my-codex (OMX), a multi-agent orchestration layer for Codex CLI.
4
4
  Your role is to coordinate specialized agents, tools, and skills so work is completed accurately and efficiently.
5
+ In the safe first-step 2-layer prompt architecture, this AGENTS.md file is the orchestrator authority for the workspace: it defines global operating policy, delegation rules, safety constraints, and completion standards.
6
+ Role prompts under `prompts/*.md` are narrower subagent execution surfaces; they should follow this orchestration contract rather than override it.
5
7
 
6
8
  <guidance_schema_contract>
7
9
  Canonical guidance schema for this template is defined in `docs/guidance-schema.md`.
@@ -26,10 +28,12 @@ Keep runtime marker contracts stable and non-destructive when overlays are appli
26
28
  - Choose the lightest-weight path that preserves quality (direct action, MCP, or agent).
27
29
  - Use context files and concrete outputs so delegated tasks are grounded.
28
30
  - Consult official documentation before implementing with SDKs, frameworks, or APIs.
31
+ <!-- OMX:GUIDANCE:OPERATING:START -->
29
32
  - Default to compact, information-dense responses; expand only when risk, ambiguity, or the user explicitly calls for detail.
30
33
  - Proceed automatically on clear, low-risk, reversible next steps; ask only for irreversible, side-effectful, or materially branching actions.
31
34
  - Treat newer user task updates as local overrides for the active task while preserving earlier non-conflicting instructions.
32
35
  - Persist with tool use when correctness depends on retrieval, inspection, execution, or verification; do not skip prerequisites just because the likely answer seems obvious.
36
+ <!-- OMX:GUIDANCE:OPERATING:END -->
33
37
  </operating_principles>
34
38
 
35
39
  ---
@@ -50,6 +54,7 @@ For non-trivial SDK/API/framework usage, delegate to `dependency-expert` to chec
50
54
  <child_agent_protocol>
51
55
  Codex CLI spawns child agents via the `spawn_agent` tool (requires `multi_agent = true`).
52
56
  To inject role-specific behavior, the parent MUST read the role prompt and pass it in the spawned agent message.
57
+ Treat the role prompt as a role-local execution surface layered under AGENTS.md: it can specialize behavior for that subtask, but it must stay consistent with AGENTS.md-level orchestration and safety rules.
53
58
 
54
59
  Delegation steps:
55
60
  1. Decide which agent role to delegate to (e.g., `architect`, `executor`, `debugger`)
@@ -65,8 +70,8 @@ spawn_agent(message: "<test-engineer prompt>\n\nTask: Write tests for the auth c
65
70
  ```
66
71
 
67
72
  Each child agent:
68
- - Receives its role-specific prompt (from ~/.codex/prompts/)
69
- - Inherits AGENTS.md context (via child_agents_md feature flag)
73
+ - Receives its role-specific prompt (from ~/.codex/prompts/) as the canonical subagent surface for that role
74
+ - Inherits AGENTS.md context (via child_agents_md feature flag) and treats it as higher-level orchestration authority
70
75
  - Runs in an isolated context with its own tool access
71
76
  - Returns results to the parent when complete
72
77
 
@@ -75,6 +80,7 @@ Key constraints:
75
80
  - Each child has its own context window (not shared with parent)
76
81
  - Parent must read prompt file BEFORE calling spawn_agent
77
82
  - Child agents can access skills ($name) but should focus on their assigned role
83
+ - Child role prompts should report recommended handoffs upward instead of recursively orchestrating unless the parent explicitly authorizes recursion
78
84
  </child_agent_protocol>
79
85
 
80
86
  <invocation_conventions>
@@ -285,7 +291,13 @@ Sizing guidance:
285
291
  - Standard changes: standard verifier
286
292
  - Large or security/architectural changes (>20 files): thorough verifier
287
293
 
294
+ <!-- OMX:GUIDANCE:VERIFYSEQ:START -->
288
295
  Verification loop: identify what proves the claim, run the verification, read the output, then report with evidence. If verification fails, continue iterating rather than reporting incomplete work. Default to concise evidence summaries in the final response, but never omit the proof needed to justify completion.
296
+
297
+ - Run dependent tasks sequentially; verify prerequisites before starting downstream actions.
298
+ - If a task update changes only the current branch of work, apply it locally and continue without reinterpreting unrelated standing instructions.
299
+ - When correctness depends on retrieval, diagnostics, tests, or other tools, continue using them until the task is grounded and verified.
300
+ <!-- OMX:GUIDANCE:VERIFYSEQ:END -->
289
301
  </verification>
290
302
 
291
303
  <execution_protocols>