oh-my-codex-cli 0.1.0

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 (292) hide show
  1. package/.agent/skills/agent-kb/HOW_TO_USE.md +428 -0
  2. package/.agent/skills/agent-kb/README.md +46 -0
  3. package/.agent/skills/agent-kb/SKILL.md +128 -0
  4. package/.agent/skills/agent-kb/references/intelligent-analysis-explained.md +333 -0
  5. package/.agent/skills/agent-kb/references/query-optimization.md +225 -0
  6. package/.agent/skills/aireview/SKILL.md +704 -0
  7. package/.agent/skills/analyze/SKILL.md +81 -0
  8. package/.agent/skills/architect-planner/HOW_TO_USE.md +238 -0
  9. package/.agent/skills/architect-planner/README.md +41 -0
  10. package/.agent/skills/architect-planner/SKILL.md +539 -0
  11. package/.agent/skills/auto-mbti/SKILL.md +291 -0
  12. package/.agent/skills/autopilot/SKILL.md +222 -0
  13. package/.agent/skills/backend-patterns/SKILL.md +602 -0
  14. package/.agent/skills/bdd-generator/README.md +78 -0
  15. package/.agent/skills/bdd-generator/SKILL.md +436 -0
  16. package/.agent/skills/brainstorming/HOW_TO_USE.md +289 -0
  17. package/.agent/skills/brainstorming/README.md +41 -0
  18. package/.agent/skills/brainstorming/SKILL.md +165 -0
  19. package/.agent/skills/build-fix/SKILL.md +190 -0
  20. package/.agent/skills/cancel/SKILL.md +658 -0
  21. package/.agent/skills/checkpoint/SKILL.md +94 -0
  22. package/.agent/skills/code-review/SKILL.md +273 -0
  23. package/.agent/skills/coding-standards/SKILL.md +535 -0
  24. package/.agent/skills/conductor/SKILL.md +128 -0
  25. package/.agent/skills/conductor/commands/conductor/implement.toml +358 -0
  26. package/.agent/skills/conductor/commands/conductor/newTrack.toml +142 -0
  27. package/.agent/skills/conductor/commands/conductor/revert.toml +123 -0
  28. package/.agent/skills/conductor/commands/conductor/setup.toml +429 -0
  29. package/.agent/skills/conductor/commands/conductor/status.toml +57 -0
  30. package/.agent/skills/conductor/scripts/install.sh +89 -0
  31. package/.agent/skills/conductor/templates/code_styleguides/csharp.md +115 -0
  32. package/.agent/skills/conductor/templates/code_styleguides/dart.md +238 -0
  33. package/.agent/skills/conductor/templates/code_styleguides/general.md +23 -0
  34. package/.agent/skills/conductor/templates/code_styleguides/go.md +48 -0
  35. package/.agent/skills/conductor/templates/code_styleguides/html-css.md +49 -0
  36. package/.agent/skills/conductor/templates/code_styleguides/javascript.md +51 -0
  37. package/.agent/skills/conductor/templates/code_styleguides/python.md +37 -0
  38. package/.agent/skills/conductor/templates/code_styleguides/typescript.md +43 -0
  39. package/.agent/skills/conductor/templates/rules/README.md +23 -0
  40. package/.agent/skills/conductor/templates/rules/agents.md +49 -0
  41. package/.agent/skills/conductor/templates/rules/coding-style.md +70 -0
  42. package/.agent/skills/conductor/templates/rules/dev.md +20 -0
  43. package/.agent/skills/conductor/templates/rules/git-workflow.md +45 -0
  44. package/.agent/skills/conductor/templates/rules/hooks.md +6 -0
  45. package/.agent/skills/conductor/templates/rules/patterns.md +55 -0
  46. package/.agent/skills/conductor/templates/rules/performance.md +47 -0
  47. package/.agent/skills/conductor/templates/rules/research.md +26 -0
  48. package/.agent/skills/conductor/templates/rules/review.md +22 -0
  49. package/.agent/skills/conductor/templates/rules/security.md +36 -0
  50. package/.agent/skills/conductor/templates/rules/testing.md +30 -0
  51. package/.agent/skills/conductor/templates/workflow.md +333 -0
  52. package/.agent/skills/consensus/HOW_TO_USE.md +191 -0
  53. package/.agent/skills/consensus/README.md +41 -0
  54. package/.agent/skills/consensus/SKILL.md +317 -0
  55. package/.agent/skills/content-research-writer/SKILL.md +537 -0
  56. package/.agent/skills/debug-analysis/SKILL.md +331 -0
  57. package/.agent/skills/deepinit/SKILL.md +347 -0
  58. package/.agent/skills/deepsearch/SKILL.md +56 -0
  59. package/.agent/skills/doctor/SKILL.md +158 -0
  60. package/.agent/skills/drawio/EXAMPLES.md +382 -0
  61. package/.agent/skills/drawio/QUICK_START.md +237 -0
  62. package/.agent/skills/drawio/README.md +315 -0
  63. package/.agent/skills/drawio/SETUP_GUIDE.md +254 -0
  64. package/.agent/skills/drawio/SKILL.md +1176 -0
  65. package/.agent/skills/e2e/SKILL.md +396 -0
  66. package/.agent/skills/ecomode/SKILL.md +160 -0
  67. package/.agent/skills/electron-driver/SKILL.md +144 -0
  68. package/.agent/skills/electron-driver/scripts/driver-template.js +71 -0
  69. package/.agent/skills/eval/SKILL.md +140 -0
  70. package/.agent/skills/eval-harness/SKILL.md +242 -0
  71. package/.agent/skills/evolve/SKILL.md +213 -0
  72. package/.agent/skills/frontend-design/SKILL.md +42 -0
  73. package/.agent/skills/frontend-patterns/SKILL.md +646 -0
  74. package/.agent/skills/frontend-ui-ux/SKILL.md +70 -0
  75. package/.agent/skills/git-master/SKILL.md +75 -0
  76. package/.agent/skills/help/SKILL.md +89 -0
  77. package/.agent/skills/iterative-retrieval/SKILL.md +217 -0
  78. package/.agent/skills/local-skills-setup/SKILL.md +483 -0
  79. package/.agent/skills/log-analyzer/SKILL.md +187 -0
  80. package/.agent/skills/mcp-setup/SKILL.md +226 -0
  81. package/.agent/skills/multi-model-research/HOW_TO_USE.md +614 -0
  82. package/.agent/skills/multi-model-research/README.md +233 -0
  83. package/.agent/skills/multi-model-research/SKILL.md +541 -0
  84. package/.agent/skills/multi-model-research/references/troubleshooting.md +415 -0
  85. package/.agent/skills/note/SKILL.md +80 -0
  86. package/.agent/skills/omc-setup/SKILL.md +219 -0
  87. package/.agent/skills/orchestrate/SKILL.md +620 -0
  88. package/.agent/skills/patent-workflow/IMPLEMENTATION_SUMMARY.md +500 -0
  89. package/.agent/skills/patent-workflow/README.md +455 -0
  90. package/.agent/skills/patent-workflow/SKILL.md +1036 -0
  91. package/.agent/skills/patent-workflow/tools/irr_checker.py +260 -0
  92. package/.agent/skills/patent-workflow/tools/sample_terminology.json +49 -0
  93. package/.agent/skills/patent-workflow/tools/term_checker.py +355 -0
  94. package/.agent/skills/pattern-recognition/SKILL.md +792 -0
  95. package/.agent/skills/pipeline/SKILL.md +448 -0
  96. package/.agent/skills/plan/SKILL.md +309 -0
  97. package/.agent/skills/planning-methodology/SKILL.md +370 -0
  98. package/.agent/skills/planning-with-files/SKILL.md +210 -0
  99. package/.agent/skills/planning-with-files/examples.md +202 -0
  100. package/.agent/skills/planning-with-files/reference.md +218 -0
  101. package/.agent/skills/planning-with-files/scripts/check-complete.ps1 +42 -0
  102. package/.agent/skills/planning-with-files/scripts/check-complete.sh +44 -0
  103. package/.agent/skills/planning-with-files/scripts/init-session.ps1 +120 -0
  104. package/.agent/skills/planning-with-files/scripts/init-session.sh +120 -0
  105. package/.agent/skills/planning-with-files/scripts/session-catchup.py +208 -0
  106. package/.agent/skills/planning-with-files/templates/findings.md +95 -0
  107. package/.agent/skills/planning-with-files/templates/progress.md +114 -0
  108. package/.agent/skills/planning-with-files/templates/task_plan.md +132 -0
  109. package/.agent/skills/project-analyze/CLAUDE.md +18 -0
  110. package/.agent/skills/project-analyze/HOW_TO_USE.md +145 -0
  111. package/.agent/skills/project-analyze/README.md +42 -0
  112. package/.agent/skills/project-analyze/SKILL.md +289 -0
  113. package/.agent/skills/project-analyze/SKILL.md.backup +287 -0
  114. package/.agent/skills/project-analyze/SKILL.md.backup_20260105_093646 +287 -0
  115. package/.agent/skills/project-analyze/assets/analysis-report-template.md +433 -0
  116. package/.agent/skills/project-analyze/references/analysis-patterns.md +422 -0
  117. package/.agent/skills/project-analyze/references/projectmind-explained.md +535 -0
  118. package/.agent/skills/project-session-manager/SKILL.md +428 -0
  119. package/.agent/skills/project-session-manager/lib/config.sh +86 -0
  120. package/.agent/skills/project-session-manager/lib/parse.sh +121 -0
  121. package/.agent/skills/project-session-manager/lib/session.sh +132 -0
  122. package/.agent/skills/project-session-manager/lib/tmux.sh +103 -0
  123. package/.agent/skills/project-session-manager/lib/worktree.sh +171 -0
  124. package/.agent/skills/project-session-manager/psm.sh +629 -0
  125. package/.agent/skills/project-session-manager/templates/feature.md +56 -0
  126. package/.agent/skills/project-session-manager/templates/issue-fix.md +57 -0
  127. package/.agent/skills/project-session-manager/templates/pr-review.md +65 -0
  128. package/.agent/skills/project-session-manager/templates/projects.json +19 -0
  129. package/.agent/skills/quality-check/HOW_TO_USE.md +171 -0
  130. package/.agent/skills/quality-check/README.md +50 -0
  131. package/.agent/skills/quality-check/SKILL.md +240 -0
  132. package/.agent/skills/quality-check/SKILL.md.backup +238 -0
  133. package/.agent/skills/quality-check/SKILL.md.backup_20260105_093646 +238 -0
  134. package/.agent/skills/quality-check/assets/quality-report-template.md +437 -0
  135. package/.agent/skills/quality-check/references/refactoring-patterns.md +550 -0
  136. package/.agent/skills/quality-check/references/scoring-criteria.md +454 -0
  137. package/.agent/skills/quality-validation/SKILL.md +519 -0
  138. package/.agent/skills/quality-validation/SKILL.md.backup +573 -0
  139. package/.agent/skills/quality-validation/SKILL.md.backup_20260105_093646 +573 -0
  140. package/.agent/skills/ralph/SKILL.md +236 -0
  141. package/.agent/skills/ralph-init/SKILL.md +78 -0
  142. package/.agent/skills/ralplan/SKILL.md +58 -0
  143. package/.agent/skills/refactor-clean/SKILL.md +49 -0
  144. package/.agent/skills/release/SKILL.md +84 -0
  145. package/.agent/skills/research/SKILL.md +526 -0
  146. package/.agent/skills/research-methodology/SKILL.md +268 -0
  147. package/.agent/skills/review/SKILL.md +53 -0
  148. package/.agent/skills/security-review/SKILL.md +509 -0
  149. package/.agent/skills/security-review/cloud-infrastructure-security.md +361 -0
  150. package/.agent/skills/setup-pm/SKILL.md +102 -0
  151. package/.agent/skills/skill/SKILL.md +424 -0
  152. package/.agent/skills/skill-create/SKILL.md +209 -0
  153. package/.agent/skills/skill-debugger/HOW_TO_USE.md +244 -0
  154. package/.agent/skills/skill-debugger/README.md +44 -0
  155. package/.agent/skills/skill-debugger/SKILL.md +326 -0
  156. package/.agent/skills/skill-debugger/diagnostic_checklist.md +115 -0
  157. package/.agent/skills/skill-development/SKILL.md +661 -0
  158. package/.agent/skills/skill-development/references/skill-creator-original.md +209 -0
  159. package/.agent/skills/skill-doc-generator/README.md +37 -0
  160. package/.agent/skills/skill-doc-generator/SKILL.md +331 -0
  161. package/.agent/skills/skill-quality-analyzer/HOW_TO_USE.md +243 -0
  162. package/.agent/skills/skill-quality-analyzer/README.md +61 -0
  163. package/.agent/skills/skill-quality-analyzer/SKILL.md +247 -0
  164. package/.agent/skills/skill-quality-analyzer/analyzer.py +209 -0
  165. package/.agent/skills/skill-quality-analyzer/expected_output.json +81 -0
  166. package/.agent/skills/skill-quality-analyzer/sample_input.json +9 -0
  167. package/.agent/skills/skill-tester/README.md +46 -0
  168. package/.agent/skills/skill-tester/SKILL.md +345 -0
  169. package/.agent/skills/start-dev/SKILL.md +701 -0
  170. package/.agent/skills/swarm/SKILL.md +691 -0
  171. package/.agent/skills/task-kb-lookup/SKILL.md +211 -0
  172. package/.agent/skills/task-kb-record/SKILL.md +417 -0
  173. package/.agent/skills/tdd/SKILL.md +446 -0
  174. package/.agent/skills/tdd-generator/DEMO.md +516 -0
  175. package/.agent/skills/tdd-generator/README.md +89 -0
  176. package/.agent/skills/tdd-generator/SKILL.md +278 -0
  177. package/.agent/skills/tdd-workflow/SKILL.md +424 -0
  178. package/.agent/skills/test-coverage/SKILL.md +48 -0
  179. package/.agent/skills/thinkdeep/HOW_TO_USE.md +183 -0
  180. package/.agent/skills/thinkdeep/README.md +41 -0
  181. package/.agent/skills/thinkdeep/SKILL.md +343 -0
  182. package/.agent/skills/ui-ux-pro-max/SKILL.md +228 -0
  183. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  184. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  185. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  186. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  187. package/.agent/skills/ui-ux-pro-max/data/prompts.csv +24 -0
  188. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  189. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  190. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  191. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  192. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  193. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  194. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  195. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  196. package/.agent/skills/ui-ux-pro-max/data/styles.csv +59 -0
  197. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  198. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  199. package/.agent/skills/ui-ux-pro-max/scripts/core.py +236 -0
  200. package/.agent/skills/ui-ux-pro-max/scripts/search.py +61 -0
  201. package/.agent/skills/ultrapilot/SKILL.md +647 -0
  202. package/.agent/skills/ultraqa/SKILL.md +152 -0
  203. package/.agent/skills/ultrawork/SKILL.md +123 -0
  204. package/.agent/skills/update-codemaps/SKILL.md +38 -0
  205. package/.agent/skills/update-docs/SKILL.md +52 -0
  206. package/.agent/skills/verification-loop/SKILL.md +140 -0
  207. package/.agent/skills/verify/SKILL.md +80 -0
  208. package/.agent/skills/writer-memory/SKILL.md +459 -0
  209. package/.agent/skills/writer-memory/lib/character-tracker.ts +338 -0
  210. package/.agent/skills/writer-memory/lib/memory-manager.ts +804 -0
  211. package/.agent/skills/writer-memory/lib/relationship-graph.ts +400 -0
  212. package/.agent/skills/writer-memory/lib/scene-organizer.ts +544 -0
  213. package/.agent/skills/writer-memory/lib/synopsis-builder.ts +339 -0
  214. package/.agent/skills/writer-memory/templates/synopsis-template.md +46 -0
  215. package/.governance/skill-lint.allowlist +4 -0
  216. package/.governance/skill-llm.allowlist +4 -0
  217. package/AGENTS.md +59 -0
  218. package/LICENSE +21 -0
  219. package/README.md +169 -0
  220. package/README.zh.md +145 -0
  221. package/bin/omcodex.js +8 -0
  222. package/commands/conductor/implement.toml +358 -0
  223. package/commands/conductor/newTrack.toml +142 -0
  224. package/commands/conductor/revert.toml +123 -0
  225. package/commands/conductor/setup.toml +429 -0
  226. package/commands/conductor/status.toml +57 -0
  227. package/docs/ALIGNMENT.md +40 -0
  228. package/docs/CODEX.md +133 -0
  229. package/docs/NOTIFY.md +81 -0
  230. package/docs/SKILL_GOVERNANCE.md +72 -0
  231. package/docs/SKILL_GOVERNANCE_FRAMEWORK.md +182 -0
  232. package/docs/SKILL_GOVERNANCE_FRAMEWORK.zh.md +170 -0
  233. package/package.json +50 -0
  234. package/prompts/architect.md +105 -0
  235. package/prompts/executor.md +134 -0
  236. package/prompts/planner.md +113 -0
  237. package/scripts/check-skill-governance.sh +84 -0
  238. package/scripts/check-skill-llm-governance.js +302 -0
  239. package/scripts/eval-skills.js +217 -0
  240. package/scripts/generate-catalog-docs.js +95 -0
  241. package/scripts/generate-codex-mcp-config.sh +22 -0
  242. package/scripts/install-codex-force.sh +5 -0
  243. package/scripts/install-codex-incremental.sh +5 -0
  244. package/scripts/install-codex.sh +79 -0
  245. package/scripts/notify-dispatch.js +15 -0
  246. package/scripts/setup-package-manager.js +137 -0
  247. package/src/catalog/generated/public-catalog.json +547 -0
  248. package/src/catalog/manifest.json +542 -0
  249. package/src/catalog/reader.js +43 -0
  250. package/src/catalog/schema.js +79 -0
  251. package/src/cli/doctor.js +62 -0
  252. package/src/cli/index.js +85 -0
  253. package/src/cli/notify.js +127 -0
  254. package/src/cli/route.js +43 -0
  255. package/src/cli/setup.js +155 -0
  256. package/src/cli/team.js +125 -0
  257. package/src/config/generator.js +119 -0
  258. package/src/mcp/memory-server.js +241 -0
  259. package/src/mcp/state-server.js +112 -0
  260. package/src/mcp/trace-server.js +168 -0
  261. package/src/notify/dispatch.js +74 -0
  262. package/src/notify/extensibility/dispatcher.js +113 -0
  263. package/src/notify/extensibility/events.js +15 -0
  264. package/src/notify/extensibility/loader.js +54 -0
  265. package/src/router/skill-router.js +90 -0
  266. package/src/team/auto-advance.js +72 -0
  267. package/src/team/orchestrator.js +82 -0
  268. package/src/team/state-store.js +33 -0
  269. package/src/utils/paths.js +33 -0
  270. package/templates/AGENTS.md +15 -0
  271. package/templates/catalog-manifest.json +542 -0
  272. package/templates/code_styleguides/csharp.md +115 -0
  273. package/templates/code_styleguides/dart.md +238 -0
  274. package/templates/code_styleguides/general.md +23 -0
  275. package/templates/code_styleguides/go.md +48 -0
  276. package/templates/code_styleguides/html-css.md +49 -0
  277. package/templates/code_styleguides/javascript.md +51 -0
  278. package/templates/code_styleguides/python.md +37 -0
  279. package/templates/code_styleguides/typescript.md +43 -0
  280. package/templates/rules/README.md +23 -0
  281. package/templates/rules/agents.md +49 -0
  282. package/templates/rules/coding-style.md +70 -0
  283. package/templates/rules/dev.md +20 -0
  284. package/templates/rules/git-workflow.md +45 -0
  285. package/templates/rules/notify.md +6 -0
  286. package/templates/rules/patterns.md +55 -0
  287. package/templates/rules/performance.md +47 -0
  288. package/templates/rules/research.md +26 -0
  289. package/templates/rules/review.md +22 -0
  290. package/templates/rules/security.md +36 -0
  291. package/templates/rules/testing.md +30 -0
  292. package/templates/workflow.md +333 -0
@@ -0,0 +1,526 @@
1
+ ---
2
+ name: research
3
+ description: Orchestrate parallel scientist agents for comprehensive research with AUTO mode
4
+ argument-hint: <research goal>
5
+ ---
6
+
7
+ # Research Skill
8
+
9
+
10
+ ## Native Subagent Protocol (Codex)
11
+
12
+ Codex supports native subagents. Delegate with `spawn_agent`, coordinate with `send_input`, collect via `wait`, and clean up with `close_agent`.
13
+
14
+ Execution preference:
15
+ 1. Use native subagents first for independent workstreams (parallel when possible).
16
+ 2. Merge results in main thread and run final verification.
17
+ 3. Fallback only when delegation is blocked: use the `[ANALYST]`/`[ARCHITECT]`/`[EXECUTOR]`/`[REVIEWER]` structure in a single response.
18
+
19
+ Minimal orchestration pattern:
20
+ ```text
21
+ spawn_agent -> send_input (optional) -> wait -> close_agent
22
+ ```
23
+
24
+ > Codex invocation: use `$research ...` or `research: ...`
25
+
26
+
27
+ Orchestrate parallel scientist agents for comprehensive research workflows with optional AUTO mode for fully autonomous execution.
28
+
29
+ ## Overview
30
+
31
+ Research is a multi-stage workflow that decomposes complex research goals into parallel investigations:
32
+
33
+ 1. **Decomposition** - Break research goal into independent stages/hypotheses
34
+ 2. **Execution** - Run parallel scientist agents on each stage
35
+ 3. **Verification** - Cross-validate findings, check consistency
36
+ 4. **Synthesis** - Aggregate results into comprehensive report
37
+
38
+ ## Usage Examples
39
+
40
+ ```
41
+ $research <goal> # Standard research with user checkpoints
42
+ $research AUTO: <goal> # Fully autonomous until complete
43
+ $research status # Check current research session status
44
+ $research resume # Resume interrupted research session
45
+ $research list # List all research sessions
46
+ $research report <session-id> # Generate report for session
47
+ ```
48
+
49
+ ### Quick Examples
50
+
51
+ ```
52
+ $research What are the performance characteristics of different sorting algorithms?
53
+ $research AUTO: Analyze authentication patterns in this codebase
54
+ $research How does the error handling work across the API layer?
55
+ ```
56
+
57
+ ## Research Protocol
58
+
59
+ ### Stage Decomposition Pattern
60
+
61
+ When given a research goal, decompose into 3-7 independent stages:
62
+
63
+ ```markdown
64
+ ## Research Decomposition
65
+
66
+ **Goal:** <original research goal>
67
+
68
+ ### Stage 1: <stage-name>
69
+ - **Focus:** What this stage investigates
70
+ - **Hypothesis:** Expected finding (if applicable)
71
+ - **Scope:** Files/areas to examine
72
+ - **Tier:** LOW | MEDIUM | HIGH
73
+
74
+ ### Stage 2: <stage-name>
75
+ ...
76
+ ```
77
+
78
+ ### Parallel Scientist Invocation
79
+
80
+ Run independent stages in parallel using role handoffs:
81
+
82
+ ```
83
+ // Stage 1 - Simple data gathering
84
+ [SCIENTIST-LOW | haiku] "[RESEARCH_STAGE:1] Investigate..."
85
+
86
+ // Stage 2 - Standard analysis
87
+ [SCIENTIST | sonnet] "[RESEARCH_STAGE:2] Analyze..."
88
+
89
+ // Stage 3 - Complex reasoning
90
+ [SCIENTIST-HIGH | opus] "[RESEARCH_STAGE:3] Deep analysis of..."
91
+ ```
92
+
93
+ ### Smart Model Routing
94
+
95
+ **CRITICAL: Always pass `model` parameter explicitly!**
96
+
97
+ | Task Complexity | Agent | Model | Use For |
98
+ |-----------------|-------|-------|---------|
99
+ | Data gathering | `scientist-low` | haiku | File enumeration, pattern counting, simple lookups |
100
+ | Standard analysis | `scientist` | sonnet | Code analysis, pattern detection, documentation review |
101
+ | Complex reasoning | `scientist-high` | opus | Architecture analysis, cross-cutting concerns, hypothesis validation |
102
+
103
+ ### Routing Decision Guide
104
+
105
+ | Research Task | Tier | Example Prompt |
106
+ |---------------|------|----------------|
107
+ | "Count occurrences of X" | LOW | "Count all usages of useState hook" |
108
+ | "Find all files matching Y" | LOW | "List all test files in the project" |
109
+ | "Analyze pattern Z" | MEDIUM | "Analyze error handling patterns in API routes" |
110
+ | "Document how W works" | MEDIUM | "Document the authentication flow" |
111
+ | "Explain why X happens" | HIGH | "Explain why race conditions occur in the cache layer" |
112
+ | "Compare approaches A vs B" | HIGH | "Compare Redux vs Context for state management here" |
113
+
114
+ ### Verification Loop
115
+
116
+ After parallel execution completes, verify findings:
117
+
118
+ ```
119
+ // Cross-validation stage
120
+ [SCIENTIST | sonnet]
121
+ [RESEARCH_VERIFICATION]
122
+ Cross-validate these findings for consistency:
123
+
124
+ Stage 1 findings: <summary>
125
+ Stage 2 findings: <summary>
126
+ Stage 3 findings: <summary>
127
+
128
+ Check for:
129
+ 1. Contradictions between stages
130
+ 2. Missing connections
131
+ 3. Gaps in coverage
132
+ 4. Evidence quality
133
+
134
+ Output: [VERIFIED] or [CONFLICTS:<list>]
135
+ ```
136
+
137
+ ## AUTO Mode
138
+
139
+ AUTO mode runs the complete research workflow autonomously with loop control.
140
+
141
+ ### Loop Control Protocol
142
+
143
+ ```
144
+ [RESEARCH + AUTO - ITERATION {{ITERATION}}/{{MAX}}]
145
+
146
+ Your previous attempt did not output the completion promise. Continue working.
147
+
148
+ Current state: {{STATE}}
149
+ Completed stages: {{COMPLETED_STAGES}}
150
+ Pending stages: {{PENDING_STAGES}}
151
+ ```
152
+
153
+ ### Promise Tags
154
+
155
+ | Tag | Meaning | When to Use |
156
+ |-----|---------|-------------|
157
+ | `[PROMISE:RESEARCH_COMPLETE]` | Research finished successfully | All stages done, verified, report generated |
158
+ | `[PROMISE:RESEARCH_BLOCKED]` | Cannot proceed | Missing data, access issues, circular dependency |
159
+
160
+ ### AUTO Mode Rules
161
+
162
+ 1. **Max Iterations:** 10 (configurable)
163
+ 2. **Continue until:** Promise tag emitted OR max iterations
164
+ 3. **State tracking:** Persist after each stage completion
165
+ 4. **Cancellation:** `$cancel` or "stop", "cancel"
166
+
167
+ ### AUTO Mode Example
168
+
169
+ ```
170
+ $research AUTO: Comprehensive security analysis of the authentication system
171
+
172
+ [Decomposition]
173
+ - Stage 1 (LOW): Enumerate auth-related files
174
+ - Stage 2 (MEDIUM): Analyze token handling
175
+ - Stage 3 (MEDIUM): Review session management
176
+ - Stage 4 (HIGH): Identify vulnerability patterns
177
+ - Stage 5 (MEDIUM): Document security controls
178
+
179
+ [Execution - Parallel]
180
+ Firing stages 1-3 in parallel...
181
+ Firing stages 4-5 after dependencies complete...
182
+
183
+ [Verification]
184
+ Cross-validating findings...
185
+
186
+ [Synthesis]
187
+ Generating report...
188
+
189
+ [PROMISE:RESEARCH_COMPLETE]
190
+ ```
191
+
192
+ ## Parallel Execution Patterns
193
+
194
+ ### Independent Dataset Analysis (Parallel)
195
+
196
+ When stages analyze different data sources:
197
+
198
+ ```
199
+ // All fire simultaneously
200
+ [SCIENTIST-LOW | haiku] "[STAGE:1] Analyze src/api/..."
201
+ [SCIENTIST-LOW | haiku] "[STAGE:2] Analyze src/utils/..."
202
+ [SCIENTIST-LOW | haiku] "[STAGE:3] Analyze src/components/..."
203
+ ```
204
+
205
+ ### Hypothesis Battery (Parallel)
206
+
207
+ When testing multiple hypotheses:
208
+
209
+ ```
210
+ // Test hypotheses simultaneously
211
+ [SCIENTIST | sonnet] "[HYPOTHESIS:A] Test if caching improves..."
212
+ [SCIENTIST | sonnet] "[HYPOTHESIS:B] Test if batching reduces..."
213
+ [SCIENTIST | sonnet] "[HYPOTHESIS:C] Test if lazy loading helps..."
214
+ ```
215
+
216
+ ### Cross-Validation (Sequential)
217
+
218
+ When verification depends on all findings:
219
+
220
+ ```
221
+ // Wait for all parallel stages
222
+ [stages complete]
223
+
224
+ // Then sequential verification
225
+ [SCIENTIST-HIGH | opus]
226
+ [CROSS_VALIDATION]
227
+ Validate consistency across all findings:
228
+ - Finding 1: ...
229
+ - Finding 2: ...
230
+ - Finding 3: ...
231
+ ```
232
+
233
+ ### Concurrency Limit
234
+
235
+ **Maximum 5 concurrent scientist agents** to prevent resource exhaustion.
236
+
237
+ If more than 5 stages, batch them:
238
+ ```
239
+ Batch 1: Stages 1-5 (parallel)
240
+ [wait for completion]
241
+ Batch 2: Stages 6-7 (parallel)
242
+ ```
243
+
244
+ ## Session Management
245
+
246
+ ### Directory Structure
247
+
248
+ ```
249
+ .omc/research/{session-id}/
250
+ state.json # Session state and progress
251
+ stages/
252
+ stage-1.md # Stage 1 findings
253
+ stage-2.md # Stage 2 findings
254
+ ...
255
+ findings/
256
+ raw/ # Raw findings from scientists
257
+ verified/ # Post-verification findings
258
+ figures/
259
+ figure-1.png # Generated visualizations
260
+ ...
261
+ report.md # Final synthesized report
262
+ ```
263
+
264
+ ### State File Format
265
+
266
+ ```json
267
+ {
268
+ "id": "research-20240115-abc123",
269
+ "goal": "Original research goal",
270
+ "status": "in_progress | complete | blocked | cancelled",
271
+ "mode": "standard | auto",
272
+ "iteration": 3,
273
+ "maxIterations": 10,
274
+ "stages": [
275
+ {
276
+ "id": 1,
277
+ "name": "Stage name",
278
+ "tier": "LOW | MEDIUM | HIGH",
279
+ "status": "pending | running | complete | failed",
280
+ "startedAt": "ISO timestamp",
281
+ "completedAt": "ISO timestamp",
282
+ "findingsFile": "stages/stage-1.md"
283
+ }
284
+ ],
285
+ "verification": {
286
+ "status": "pending | passed | failed",
287
+ "conflicts": [],
288
+ "completedAt": "ISO timestamp"
289
+ },
290
+ "createdAt": "ISO timestamp",
291
+ "updatedAt": "ISO timestamp"
292
+ }
293
+ ```
294
+
295
+ ### Session Commands
296
+
297
+ | Command | Action |
298
+ |---------|--------|
299
+ | `$research status` | Show current session progress |
300
+ | `$research resume` | Resume most recent interrupted session |
301
+ | `$research resume <session-id>` | Resume specific session |
302
+ | `$research list` | List all sessions with status |
303
+ | `$research report <session-id>` | Generate/regenerate report |
304
+ | `$research cancel` | Cancel current session (preserves state) |
305
+
306
+ ## Tag Extraction
307
+
308
+ Scientists use structured tags for findings. Extract them with these patterns:
309
+
310
+ ### Finding Tags
311
+
312
+ ```
313
+ [FINDING:<id>] <title>
314
+ <evidence and analysis>
315
+ [/FINDING]
316
+
317
+ [EVIDENCE:<finding-id>]
318
+ - File: <path>
319
+ - Lines: <range>
320
+ - Content: <relevant code/text>
321
+ [/EVIDENCE]
322
+
323
+ [CONFIDENCE:<level>] # HIGH | MEDIUM | LOW
324
+ <reasoning for confidence level>
325
+ ```
326
+
327
+ ### Extraction Regex Patterns
328
+
329
+ ```javascript
330
+ // Finding extraction
331
+ const findingPattern = /\[FINDING:(\w+)\]\s*(.*?)\n([\s\S]*?)\[\/FINDING\]/g;
332
+
333
+ // Evidence extraction
334
+ const evidencePattern = /\[EVIDENCE:(\w+)\]([\s\S]*?)\[\/EVIDENCE\]/g;
335
+
336
+ // Confidence extraction
337
+ const confidencePattern = /\[CONFIDENCE:(HIGH|MEDIUM|LOW)\]\s*(.*)/g;
338
+
339
+ // Stage completion
340
+ const stageCompletePattern = /\[STAGE_COMPLETE:(\d+)\]/;
341
+
342
+ // Verification result
343
+ const verificationPattern = /\[(VERIFIED|CONFLICTS):?(.*?)\]/;
344
+ ```
345
+
346
+ ### Evidence Window
347
+
348
+ When extracting evidence, include context window:
349
+
350
+ ```
351
+ [EVIDENCE:F1]
352
+ - File: /src/auth/login.ts
353
+ - Lines: 45-52 (context: 40-57)
354
+ - Content:
355
+ ```typescript
356
+ // Lines 45-52 with 5 lines context above/below
357
+ ```
358
+ [/EVIDENCE]
359
+ ```
360
+
361
+ ### Quality Validation
362
+
363
+ Findings must meet quality threshold:
364
+
365
+ | Quality Check | Requirement |
366
+ |---------------|-------------|
367
+ | Evidence present | At least 1 [EVIDENCE] per [FINDING] |
368
+ | Confidence stated | Each finding has [CONFIDENCE] |
369
+ | Source cited | File paths are absolute and valid |
370
+ | Reproducible | Another agent could verify |
371
+
372
+ ## Report Generation
373
+
374
+ ### Report Template
375
+
376
+ ```markdown
377
+ # Research Report: {{GOAL}}
378
+
379
+ **Session ID:** {{SESSION_ID}}
380
+ **Date:** {{DATE}}
381
+ **Status:** {{STATUS}}
382
+
383
+ ## Executive Summary
384
+
385
+ {{2-3 paragraph summary of key findings}}
386
+
387
+ ## Methodology
388
+
389
+ ### Research Stages
390
+
391
+ | Stage | Focus | Tier | Status |
392
+ |-------|-------|------|--------|
393
+ {{STAGES_TABLE}}
394
+
395
+ ### Approach
396
+
397
+ {{Description of decomposition rationale and execution strategy}}
398
+
399
+ ## Key Findings
400
+
401
+ ### Finding 1: {{TITLE}}
402
+
403
+ **Confidence:** {{HIGH|MEDIUM|LOW}}
404
+
405
+ {{Detailed finding with evidence}}
406
+
407
+ #### Evidence
408
+
409
+ {{Embedded evidence blocks}}
410
+
411
+ ### Finding 2: {{TITLE}}
412
+ ...
413
+
414
+ ## Visualizations
415
+
416
+ {{FIGURES}}
417
+
418
+ ## Cross-Validation Results
419
+
420
+ {{Verification summary, any conflicts resolved}}
421
+
422
+ ## Limitations
423
+
424
+ - {{Limitation 1}}
425
+ - {{Limitation 2}}
426
+ - {{Areas not covered and why}}
427
+
428
+ ## Recommendations
429
+
430
+ 1. {{Actionable recommendation}}
431
+ 2. {{Actionable recommendation}}
432
+
433
+ ## Appendix
434
+
435
+ ### Raw Data
436
+
437
+ {{Links to raw findings files}}
438
+
439
+ ### Session State
440
+
441
+ {{Link to state.json}}
442
+ ```
443
+
444
+ ### Figure Embedding Protocol
445
+
446
+ Scientists generate visualizations using this marker:
447
+
448
+ ```
449
+ [FIGURE:path/to/figure.png]
450
+ Caption: Description of what the figure shows
451
+ Alt: Accessibility description
452
+ [/FIGURE]
453
+ ```
454
+
455
+ Report generator embeds figures:
456
+
457
+ ```markdown
458
+ ## Visualizations
459
+
460
+ ![Figure 1: Description](figures/figure-1.png)
461
+ *Caption: Description of what the figure shows*
462
+
463
+ ![Figure 2: Description](figures/figure-2.png)
464
+ *Caption: Description of what the figure shows*
465
+ ```
466
+
467
+ ### Figure Types
468
+
469
+ | Type | Use For | Generated By |
470
+ |------|---------|--------------|
471
+ | Architecture diagram | System structure | scientist-high |
472
+ | Flow chart | Process flows | scientist |
473
+ | Dependency graph | Module relationships | scientist |
474
+ | Timeline | Sequence of events | scientist |
475
+ | Comparison table | A vs B analysis | scientist |
476
+
477
+ ## Configuration
478
+
479
+ Optional settings in `.codex/settings.json`:
480
+
481
+ ```json
482
+ {
483
+ "omc": {
484
+ "research": {
485
+ "maxIterations": 10,
486
+ "maxConcurrentScientists": 5,
487
+ "defaultTier": "MEDIUM",
488
+ "autoVerify": true,
489
+ "generateFigures": true,
490
+ "evidenceContextLines": 5
491
+ }
492
+ }
493
+ }
494
+ ```
495
+
496
+ ## Cancellation
497
+
498
+ ```
499
+ $cancel
500
+ ```
501
+
502
+ Or say: "stop research", "cancel research", "abort"
503
+
504
+ Progress is preserved in `.omc/research/{session-id}/` for resume.
505
+
506
+ ## Troubleshooting
507
+
508
+ **Stuck in verification loop?**
509
+ - Check for conflicting findings between stages
510
+ - Review state.json for specific conflicts
511
+ - May need to re-run specific stages with different approach
512
+
513
+ **Scientists returning low-quality findings?**
514
+ - Check tier assignment - complex analysis needs HIGH tier
515
+ - Ensure prompts include clear scope and expected output format
516
+ - Review if research goal is too broad
517
+
518
+ **AUTO mode exhausted iterations?**
519
+ - Review state to see where it's stuck
520
+ - Check if goal is achievable with available data
521
+ - Consider breaking into smaller research sessions
522
+
523
+ **Missing figures in report?**
524
+ - Verify figures/ directory exists
525
+ - Check [FIGURE:] tags in findings
526
+ - Ensure paths are relative to session directory