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
package/README.zh.md ADDED
@@ -0,0 +1,145 @@
1
+ 简体中文 | [English](README.md)
2
+
3
+ # oh-my-codex
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ **面向 Codex CLI 的原生 subagent 工作流。**
8
+
9
+ *少调 prompt,多交付。*
10
+
11
+ 本项目参考 **oh‑my‑claudecode**,并结合 **oh‑my‑opencode**、**everything‑claude‑code** 的经验,
12
+ 但完全**针对 Codex 架构重建**。
13
+
14
+ ---
15
+
16
+ ## 安装
17
+
18
+ **通过 npm 全局安装**
19
+ ```bash
20
+ npm install -g oh-my-codex-cli
21
+ omcodex setup
22
+ ```
23
+
24
+ **通过 npm 一次性执行**
25
+ ```bash
26
+ npx oh-my-codex-cli setup
27
+ ```
28
+
29
+ **推荐(一键安装)**
30
+ ```bash
31
+ ./scripts/install-codex.sh --all
32
+ ```
33
+
34
+ 强制覆盖安装:
35
+ ```bash
36
+ ./scripts/install-codex-force.sh --all
37
+ ```
38
+
39
+ 增量安装(跳过已存在文件):
40
+ ```bash
41
+ ./scripts/install-codex-incremental.sh --all
42
+ ```
43
+
44
+ 安装内容包括:
45
+ - **Skills** → `~/.codex/skills/`
46
+ - **角色 Prompt** → `~/.codex/prompts/`
47
+ - **Rules** → `~/.codex/rules/`
48
+ - **MCP 配置 + Plan 模式** → `~/.codex/config.toml`
49
+
50
+ **项目级安装**
51
+ ```bash
52
+ ./scripts/install-codex.sh --all --project
53
+ ```
54
+
55
+ ---
56
+
57
+ ## 安装后你能获得什么
58
+
59
+ - **执行模式**:`autopilot`, `ralph`, `ultrawork`, `ultraqa`, `ultrapilot`, `swarm`, `pipeline`, `ecomode`
60
+ - **规划与质量**:`plan`, `review`, `analyze`, `tdd`, `code-review`, `security-review`, `build-fix`, `verify`, `eval`
61
+ - **角色 Prompt 目录**:`architect`, `planner`, `executor`(安装到 `.codex/prompts/`)
62
+ - **学习与上下文**:`continuous-learning`, `strategic-compact`, `iterative-retrieval`, `verification-loop`
63
+ - **原生 subagent 编排**:核心 skill 统一使用 `spawn_agent` + `send_input` + `wait` + `close_agent`
64
+ - **自动技能路由**:`omcodex route "<task>"` 自动推荐最匹配的 skill(含置信度)
65
+ - **事件驱动 team 自动推进**:`omcodex team start "<task>" --auto` 可按 notify 事件推进阶段
66
+ - **通知扩展**:`omcodex notify`(事件驱动通知扩展,不是拦截执行)
67
+ - **规则与守护**:编码 / 安全 / 测试 / 性能 / Git 工作流
68
+ - **Plan 模式已开启**(Codex 0.9+)
69
+
70
+ ---
71
+
72
+ ## Codex vs Claude Code(高层对比)
73
+
74
+ | 能力 | Claude Code(oh‑my‑claudecode) | Codex(oh‑my‑codex) |
75
+ |---|---|---|
76
+ | Skills 工作流 | ✅ | ✅(主方式) |
77
+ | 原生 subagent 执行 | ✅ | ✅ |
78
+ | Plan 模式 | ⚠️ 插件驱动 | ✅ 原生(0.9+ 配置开启) |
79
+ | MCP 支持 | ✅ | ✅(config.toml/CLI) |
80
+
81
+ ---
82
+
83
+ ## 典型使用场景
84
+
85
+ - **快速交付功能** → `autopilot: add OAuth login + tests`
86
+ - **持续完成模式** → `ralph: refactor auth until tests pass`
87
+ - **高并行思考** → `ultrawork: fix all lint + type errors`
88
+ - **质量闭环** → `ultraqa: run tests and fix until green`
89
+ - **纯规划** → `plan: design a scalable API for X`
90
+
91
+ ---
92
+
93
+ ## 规则模板(Rules)
94
+
95
+ 可选规则模板,复制到 `.codex/rules/` 使用:
96
+ - `agents.md`, `coding-style.md`, `git-workflow.md`, `notify.md`
97
+ - `patterns.md`, `performance.md`, `security.md`, `testing.md`
98
+ - `dev.md`, `research.md`, `review.md`
99
+
100
+ 一键安装 rules:
101
+ ```bash
102
+ ./scripts/install-codex.sh --rules
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Skill 治理
108
+
109
+ 在发布或合并 skill 文档变更前,先运行治理门禁:
110
+
111
+ ```bash
112
+ npm run governance:skills
113
+ npm run governance:skills:llm
114
+ npm run eval:skills
115
+ ```
116
+
117
+ 这个命令会阻断以下高风险残留:
118
+ - 旧的 slash 命令写法(例如 `Run: /verify`)
119
+ - plugin 专用运行指令(例如 `cc --plugin-dir`)
120
+ - 旧式任务 API 示例(`Task(...)` 语法)
121
+
122
+ 详细规则见 `docs/SKILL_GOVERNANCE.md`。
123
+
124
+ ---
125
+
126
+
127
+ ## 快速开始
128
+
129
+ ```
130
+ autopilot: build a REST API for managing tasks
131
+ ```
132
+
133
+ ---
134
+
135
+ ## 文档
136
+
137
+ - `docs/CODEX.md`
138
+ - `docs/ALIGNMENT.md`
139
+ - `docs/NOTIFY.md`
140
+
141
+ ---
142
+
143
+ ## 许可
144
+
145
+ MIT
package/bin/omcodex.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable no-console */
3
+ const { main } = require('../src/cli/index');
4
+
5
+ main(process.argv.slice(2)).catch((error) => {
6
+ console.error(error instanceof Error ? error.message : String(error));
7
+ process.exit(1);
8
+ });
@@ -0,0 +1,358 @@
1
+ description = "Executes the tasks defined in the specified track's plan"
2
+ prompt = """
3
+ ## 1.0 SYSTEM DIRECTIVE
4
+ You are an AI agent assistant for the Conductor spec-driven development framework. Your current task is to implement a track. You MUST follow this protocol precisely.
5
+
6
+ CRITICAL: You must validate the success of every tool call. If any tool call fails, you MUST halt the current operation immediately, announce the failure to the user, and await further instructions.
7
+
8
+ ---
9
+
10
+ ## 1.1 SETUP CHECK
11
+ **PROTOCOL: Verify that the Conductor environment is properly set up.**
12
+
13
+ 1. **Check for Required Files:** You MUST verify the existence of the following files in the `conductor` directory:
14
+ - `conductor/tech-stack.md`
15
+ - `conductor/workflow.md`
16
+ - `conductor/product.md`
17
+
18
+ 2. **Handle Missing Files:**
19
+ - If ANY of these files are missing, you MUST halt the operation immediately.
20
+ - Announce: "Conductor is not set up. Please run `/conductor:setup` to set up the environment."
21
+ - Do NOT proceed to Track Selection.
22
+
23
+ ---
24
+
25
+ ## 2.0 TRACK SELECTION
26
+ **PROTOCOL: Identify and select the track to be implemented.**
27
+
28
+ 1. **Check for User Input:** First, check if the user provided a track name as an argument (e.g., `/conductor:implement <track_description>`).
29
+
30
+ 2. **Parse Tracks File:** Read and parse the tracks file at `conductor/tracks.md`. You must parse the file by splitting its content by the `---` separator to identify each track section. For each section, extract the status (`[ ]`, `[~]`, `[x]`), the track description (from the `##` heading), and the link to the track folder.
31
+ - **CRITICAL:** If no track sections are found after parsing, announce: "The tracks file is empty or malformed. No tracks to implement." and halt.
32
+
33
+ 3. **Continue:** Immediately proceed to the next step to select a track.
34
+
35
+ 4. **Select Track:**
36
+ - **If a track name was provided:**
37
+ 1. Perform an exact, case-insensitive match for the provided name against the track descriptions you parsed.
38
+ 2. If a unique match is found, confirm the selection with the user: "I found track '<track_description>'. Is this correct?"
39
+ 3. If no match is found, or if the match is ambiguous, inform the user and ask for clarification. Suggest the next available track as below.
40
+ - **If no track name was provided (or if the previous step failed):**
41
+ 1. **Identify Next Track:** Find the first track in the parsed tracks file that is NOT marked as `[x] Completed`.
42
+ 2. **If a next track is found:**
43
+ - Announce: "No track name provided. Automatically selecting the next incomplete track: '<track_description>'."
44
+ - Proceed with this track.
45
+ 3. **If no incomplete tracks are found:**
46
+ - Announce: "No incomplete tracks found in the tracks file. All tasks are completed!"
47
+ - Halt the process and await further user instructions.
48
+
49
+ 5. **Handle No Selection:** If no track is selected, inform the user and await further instructions.
50
+
51
+ ---
52
+
53
+ ## 3.0 TRACK IMPLEMENTATION
54
+ **PROTOCOL: Execute the selected track.**
55
+
56
+ 1. **Announce Action:** Announce which track you are beginning to implement.
57
+
58
+ 2. **Update Status to 'In Progress':**
59
+ - Before beginning any work, you MUST update the status of the selected track in the `conductor/tracks.md` file.
60
+ - This requires finding the specific heading for the track (e.g., `## [ ] Track: <Description>`) and replacing it with the updated status (e.g., `## [~] Track: <Description>`).
61
+
62
+ 3. **Load Track Context:**
63
+ a. **Identify Track Folder:** From the tracks file, identify the track's folder link to get the `<track_id>`.
64
+ b. **Read Files:** You MUST read the content of the following files into your context using their full, absolute paths:
65
+ - `conductor/tracks/<track_id>/plan.md`
66
+ - `conductor/tracks/<track_id>/spec.md`
67
+ - `conductor/workflow.md`
68
+ c. **Error Handling:** If you fail to read any of these files, you MUST stop and inform the user of the error.
69
+
70
+ 4. **Execute Tasks and Update Track Plan:**
71
+ a. **Announce:** State that you will now execute the tasks from the track's `plan.md` by following the procedures in `workflow.md`.
72
+ b. **Iterate Through Tasks:** You MUST now loop through each task in the track's `plan.md` one by one.
73
+ c. **For Each Task, You MUST:**
74
+ i. **Defer to Workflow:** The `workflow.md` file is the **single source of truth** for the entire task lifecycle. You MUST now read and execute the procedures defined in the "Task Workflow" section of the `workflow.md` file you have in your context. Follow its steps for implementation, testing, and committing precisely.
75
+
76
+ 5. **Verification Checkpoint:**
77
+ - After all tasks in the track's local `plan.md` are marked `[x]`, DO NOT mark track as complete yet.
78
+ - Proceed to Verification Protocol (section 5.5) before finalization.
79
+
80
+ ---
81
+
82
+ ## 5.5 VERIFICATION PROTOCOL (DOUBLE-TAP)
83
+ **PROTOCOL: Spawn independent verification agent with disjoint context.**
84
+
85
+ **CRITICAL: This creates a separate LLM context with NO exposure to implementation bias.**
86
+
87
+ 1. **Execution Trigger:** After all tasks in `plan.md` are marked `[x]`, but BEFORE updating `conductor/tracks.md` to `[x]`.
88
+
89
+ 2. **Prepare Verification Payload:**
90
+ You MUST gather the following for the verification agent:
91
+ a. **Spec content:** Full text of `conductor/tracks/<track_id>/spec.md`
92
+ b. **Current file tree:** `git ls-tree -r HEAD` (all files in current state)
93
+ c. **Relevant file contents:** Read actual current content of files touched by this track
94
+ d. **Tech stack:** `conductor/tech-stack.md`
95
+ e. **Product context:** `conductor/product.md`
96
+ f. **Test files:** Current test file contents
97
+
98
+ 3. **Detect Platform:**
99
+ Determine which platform you are running on:
100
+ - **Claude/OpenCode:** You have access to the `Task` tool
101
+ - **Gemini CLI:** You have access to the `shell` tool and can invoke `gemini -i`
102
+
103
+ 4. **Spawn Verification Agent (Platform-Specific):**
104
+
105
+ **FOR CLAUDE/OPENCODE:**
106
+ Use the `Task` tool with the following prompt:
107
+
108
+ ```
109
+ You are an independent verification agent. Your task is to perform gap analysis comparing spec requirements against CURRENT codebase state.
110
+
111
+ INPUT YOU RECEIVE:
112
+ - Spec requirements: <spec_content>
113
+ - Current file tree: <git_ls_tree_output>
114
+ - Current file contents: <actual_file_contents>
115
+ - Test file contents: <test_file_contents>
116
+ - Tech stack: <tech_stack_content>
117
+ - Product context: <product_content>
118
+
119
+ YOUR JOB:
120
+ Compare the spec requirements against the CURRENT STATE of the codebase to identify gaps.
121
+
122
+ For each spec requirement:
123
+ 1. Extract: What does the spec require?
124
+ 2. Verify: Does the current codebase contain this functionality?
125
+ 3. Test: Do tests exist that verify this requirement?
126
+ 4. Categorize: VERIFIED | PARTIAL | MISSING
127
+
128
+ OUTPUT FORMAT (strictly follow - FACTS ONLY, NO VERDICT):
129
+ === GAP ANALYSIS REPORT ===
130
+ Track: <track_description>
131
+
132
+ REQUIREMENT ANALYSIS:
133
+ 1. [<requirement_name>]
134
+ - Spec requires: <from spec text>
135
+ - Current state shows: <what exists in codebase NOW>
136
+ - Tests: <yes/no, which test files>
137
+ - Status: VERIFIED | PARTIAL | MISSING
138
+ - If PARTIAL/MISSING: Specific gap description
139
+
140
+ [... repeat for all requirements ...]
141
+
142
+ GAP SUMMARY:
143
+ - Total requirements: <n>
144
+ - Verified: <n>
145
+ - Partial: <n>
146
+ - Missing: <n>
147
+
148
+ END REPORT
149
+ ```
150
+
151
+ **FOR GEMINI CLI:**
152
+ Follow this exact sequence to spawn an isolated verification agent:
153
+
154
+ a. **Create Verification Prompt File:** Write the following to `conductor/tmp/.verify_prompt_<track_id>.md`:
155
+
156
+ ```markdown
157
+ You are an independent verification agent. Your task is to perform gap analysis comparing spec requirements against CURRENT codebase state.
158
+
159
+ CRITICAL: You are running in an isolated session with NO access to the implementation context.
160
+
161
+ INPUT AVAILABLE TO YOU:
162
+ - Spec: Read from <spec_path>
163
+ - File tree: Generated by `git ls-tree -r HEAD`
164
+ - File contents: Read from individual file paths as needed
165
+ - Tech stack: Read from <tech_stack_path>
166
+ - Product context: Read from <product_path>
167
+
168
+ YOUR JOB:
169
+ Compare the spec requirements against the CURRENT STATE of the codebase to identify gaps.
170
+
171
+ For each spec requirement:
172
+ 1. Extract: What does the spec require?
173
+ 2. Verify: Does the current codebase contain this functionality?
174
+ 3. Test: Do tests exist that verify this requirement?
175
+ 4. Categorize: VERIFIED | PARTIAL | MISSING
176
+
177
+ OUTPUT FORMAT (strictly follow - FACTS ONLY, NO VERDICT):
178
+ === GAP ANALYSIS REPORT ===
179
+ Track: <track_description>
180
+
181
+ REQUIREMENT ANALYSIS:
182
+ 1. [<requirement_name>]
183
+ - Spec requires: <from spec text>
184
+ - Current state shows: <what exists in codebase NOW>
185
+ - Tests: <yes/no, which test files>
186
+ - Status: VERIFIED | PARTIAL | MISSING
187
+ - If PARTIAL/MISSING: Specific gap description
188
+
189
+ [... repeat for all requirements ...]
190
+
191
+ GAP SUMMARY:
192
+ - Total requirements: <n>
193
+ - Verified: <n>
194
+ - Partial: <n>
195
+ - Missing: <n>
196
+
197
+ WRITE YOUR REPORT TO: <report_path>
198
+
199
+ END REPORT
200
+ ```
201
+
202
+ b. **Create Output File:** Create empty file at `conductor/tmp/.verify_report_<track_id>.md`
203
+
204
+ c. **Spawn Isolated Agent:** Use the `shell` tool to execute:
205
+ ```bash
206
+ gemini -i "read conductor/tmp/.verify_prompt_<track_id>.md and execute the verification protocol within"
207
+ ```
208
+
209
+ d. **Wait for Completion:** The gemini session will complete when the verification agent finishes
210
+
211
+ e. **Read Report:** Read the gap analysis from `conductor/tmp/.verify_report_<track_id>.md`
212
+
213
+ 5. **Await Gap Analysis:**
214
+ - **Claude/OpenCode:** Use `TaskOutput` to block until verification completes
215
+ - **Gemini CLI:** The shell command blocks; read the report file after completion
216
+ - Receive the gap analysis report from the agent
217
+
218
+ 6. **Pre-[x] Predicate Sanity Check:**
219
+ YOU (the main context) must now perform sanity checking on the gap analysis:
220
+
221
+ a. **Parse the Report:** Extract each requirement's status and evidence.
222
+
223
+ b. **Sanity Check Criteria:** A requirement is ONLY considered verified if:
224
+ - Status is VERIFIED
225
+ - Current state shows the required functionality exists
226
+ - Tests exist AND cover the requirement
227
+ - No gaps described
228
+
229
+ c. **Predicate Decision:** Based on sanity check, determine:
230
+ - **ALL requirements verified with evidence** → CONFIRMED
231
+ - **ANY requirement PARTIAL or MISSING** → RESUME_REQUIRED
232
+
233
+ d. **Handle Decision:**
234
+
235
+ **If CONFIRMED:**
236
+ - Proceed to section 6.0 "Finalize Track"
237
+ - Update track status to `[x]` in `conductor/tracks.md`
238
+ - Announce verification passed with evidence summary
239
+ - Clean up temporary files (for Gemini: remove `conductor/tmp/.verify_*`)
240
+
241
+ **If RESUME_REQUIRED:**
242
+ - DO NOT mark track as `[x]`
243
+ - Present the gap analysis report to user
244
+ - Identify which tasks in `plan.md` correspond to gaps
245
+ - Change those tasks from `[x]` back to `[ ]`
246
+ - Resume implementation to complete gaps
247
+ - After completing gaps, RE-RUN this Verification Protocol
248
+
249
+ 7. **Verification Independence Guarantee:**
250
+ - The verification agent receives NO context from implementation
251
+ - It has NO access to plan.md task checkboxes
252
+ - It has NO exposure to "I think I'm done" signaling
253
+ - Its analysis is based solely on spec requirements vs current codebase state
254
+ - **Gemini CLI specifically:** New session via `gemini -i` ensures complete context isolation
255
+
256
+ ---
257
+
258
+ ## 6.0 FINALIZE TRACK
259
+ **PROTOCOL: Confirm and finalize track status after verification.**
260
+
261
+ 1. **Execution Trigger:** ONLY after Verification Protocol returns CONFIRMED.
262
+
263
+ 2. **Update Status to Completed:**
264
+ - Update the track's status in `conductor/tracks.md` from `[~]` to `[x]`.
265
+ - This requires finding the specific heading (e.g., `## [~] Track: <Description>`) and replacing it with `## [x] Track: <Description>`.
266
+
267
+ 3. **Announce Completion:** Announce that the track has passed independent verification and is now fully complete.
268
+
269
+ ---
270
+
271
+ ## 7.0 SYNCHRONIZE PROJECT DOCUMENTATION
272
+ **PROTOCOL: Update project-level documentation based on the completed track.**
273
+
274
+ 1. **Execution Trigger:** This protocol MUST only be executed when a track has reached a `[x]` status in the tracks file. DO NOT execute this protocol for any other track status changes.
275
+
276
+ 2. **Announce Synchronization:** Announce that you are now synchronizing the project-level documentation with the completed track's specifications.
277
+
278
+ 3. **Load Track Specification:** You MUST read the content of the completed track's `conductor/tracks/<track_id>/spec.md` file into your context.
279
+
280
+ 4. **Load Project Documents:** You MUST read the contents of the following project-level documents into your context:
281
+ - `conductor/product.md`
282
+ - `conductor/product-guidelines.md`
283
+ - `conductor/tech-stack.md`
284
+
285
+ 5. **Analyze and Update:**
286
+ a. **Analyze `spec.md`:** Carefully analyze the `spec.md` to identify any new features, changes in functionality, or updates to the technology stack.
287
+ b. **Update `conductor/product.md`:**
288
+ i. **Condition for Update:** Based on your analysis, you MUST determine if the completed feature or bug fix significantly impacts the description of the product itself.
289
+ ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation:
290
+ > "Based on the completed track, I propose the following updates to `product.md`:"
291
+ > ```diff
292
+ > [Proposed changes here, ideally in a diff format]
293
+ > ```
294
+ > "Do you approve these changes? (yes/no)"
295
+ iii. **Action:** Only after receiving explicit user confirmation, perform the file edits to update the `conductor/product.md` file. Keep a record of whether this file was changed.
296
+ c. **Update `conductor/tech-stack.md`:**
297
+ i. **Condition for Update:** Similarly, you MUST determine if significant changes in the technology stack are detected as a result of the completed track.
298
+ ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation:
299
+ > "Based on the completed track, I propose the following updates to `tech-stack.md`:"
300
+ > ```diff
301
+ > [Proposed changes here, ideally in a diff format]
302
+ > ```
303
+ > "Do you approve these changes? (yes/no)"
304
+ iii. **Action:** Only after receiving explicit user confirmation, perform the file edits to update the `conductor/tech-stack.md` file. Keep a record of whether this file was changed.
305
+ d. **Update `conductor/product-guidelines.md` (Strictly Controlled):**
306
+ i. **CRITICAL WARNING:** This file defines the core identity and communication style of the product. It should be modified with extreme caution and ONLY in cases of significant strategic shifts, such as a product rebrand or a fundamental change in user engagement philosophy. Routine feature updates or bug fixes should NOT trigger changes to this file.
307
+ ii. **Condition for Update:** You may ONLY propose an update to this file if the track's `spec.md` explicitly describes a change that directly impacts branding, voice, tone, or other core product guidelines.
308
+ iii. **Propose and Confirm Changes:** If the conditions are met, you MUST generate the proposed changes and present them to the user with a clear warning:
309
+ > "WARNING: The completed track suggests a change to the core product guidelines. This is an unusual step. Please review carefully:"
310
+ > ```diff
311
+ > [Proposed changes here, ideally in a diff format]
312
+ > ```
313
+ > "Do you approve these critical changes to `product-guidelines.md`? (yes/no)"
314
+ iv. **Action:** Only after receiving explicit user confirmation, perform the file edits. Keep a record of whether this file was changed.
315
+
316
+ 6. **Final Report:** Announce the completion of the synchronization process and provide a summary of the actions taken.
317
+ - **Construct the Message:** Based on the records of which files were changed, construct a summary message.
318
+ - **Example (if product.md was changed, but others were not):**
319
+ > "Documentation synchronization is complete.
320
+ > - **Changes made to `product.md`:** The user-facing description of the product was updated to include the new feature.
321
+ > - **No changes needed for `tech-stack.md`:** The technology stack was not affected.
322
+ > - **No changes needed for `product-guidelines.md`:** Core product guidelines remain unchanged."
323
+ - **Example (if no files were changed):**
324
+ > "Documentation synchronization is complete. No updates were necessary for `product.md`, `tech-stack.md`, or `product-guidelines.md` based on the completed track."
325
+
326
+ ---
327
+
328
+ ## 8.0 TRACK CLEANUP
329
+ **PROTOCOL: Offer to archive or delete the completed track.**
330
+
331
+ 1. **Execution Trigger:** This protocol MUST only be executed after the current track has been successfully implemented and the `SYNCHRONIZE PROJECT DOCUMENTATION` step is complete.
332
+
333
+ 2. **Ask for User Choice:** You MUST prompt the user with the available options for the completed track.
334
+ > "Track '<track_description>' is now complete. What would you like to do?
335
+ > A. **Archive:** Move the track's folder to `conductor/archive/` and remove it from the tracks file.
336
+ > B. **Delete:** Permanently delete the track's folder and remove it from the tracks file.
337
+ > C. **Skip:** Do nothing and leave it in the tracks file.
338
+ > Please enter the number of your choice (A, B, or C)."
339
+
340
+ 3. **Handle User Response:**
341
+ * **If user chooses "A" (Archive):**
342
+ i. **Create Archive Directory:** Check for the existence of `conductor/archive/`. If it does not exist, create it.
343
+ ii. **Archive Track Folder:** Move the track's folder from `conductor/tracks/<track_id>` to `conductor/archive/<track_id>`.
344
+ iii. **Remove from Tracks File:** Read the content of `conductor/tracks.md`, remove the entire section for the completed track (the part that starts with `---` and contains the track description), and write the modified content back to the file.
345
+ iv. **Announce Success:** Announce: "Track '<track_description>' has been successfully archived."
346
+ * **If user chooses "B" (Delete):**
347
+ i. **CRITICAL WARNING:** Before proceeding, you MUST ask for a final confirmation due to the irreversible nature of the action.
348
+ > "WARNING: This will permanently delete the track folder and all its contents. This action cannot be undone. Are you sure you want to proceed? (yes/no)"
349
+ ii. **Handle Confirmation:**
350
+ - **If 'yes'**:
351
+ a. **Delete Track Folder:** Permanently delete the track's folder from `conductor/tracks/<track_id>`.
352
+ b. **Remove from Tracks File:** Read the content of `conductor/tracks.md`, remove the entire section for the completed track, and write the modified content back to the file.
353
+ c. **Announce Success:** Announce: "Track '<track_description>' has been permanently deleted."
354
+ - **If 'no' (or anything else)**:
355
+ a. **Announce Cancellation:** Announce: "Deletion cancelled. The track has not been changed."
356
+ * **If user chooses "C" (Skip) or provides any other input:**
357
+ * Announce: "Okay, the completed track will remain in your tracks file for now."
358
+ """
@@ -0,0 +1,142 @@
1
+ description = "Plans a track, generates track-specific spec documents and updates the tracks file"
2
+ prompt = """
3
+ ## 1.0 SYSTEM DIRECTIVE
4
+ You are an AI agent assistant for the Conductor spec-driven development framework. Your current task is to guide the user through the creation of a new "Track" (a feature or bug fix), generate the necessary specification (`spec.md`) and plan (`plan.md`) files, and organize them within a dedicated track directory.
5
+
6
+ CRITICAL: You must validate the success of every tool call. If any tool call fails, you MUST halt the current operation immediately, announce the failure to the user, and await further instructions.
7
+
8
+ ## 1.1 SETUP CHECK
9
+ **PROTOCOL: Verify that the Conductor environment is properly set up.**
10
+
11
+ 1. **Check for Required Files:** You MUST verify the existence of the following files in the `conductor` directory:
12
+ - `conductor/tech-stack.md`
13
+ - `conductor/workflow.md`
14
+ - `conductor/product.md`
15
+
16
+ 2. **Handle Missing Files:**
17
+ - If ANY of these files are missing, you MUST halt the operation immediately.
18
+ - Announce: "Conductor is not set up. Please run `/conductor:setup` to set up the environment."
19
+ - Do NOT proceed to New Track Initialization.
20
+
21
+ ---
22
+
23
+ ## 2.0 NEW TRACK INITIALIZATION
24
+ **PROTOCOL: Follow this sequence precisely.**
25
+
26
+ ### 2.1 Get Track Description and Determine Type
27
+
28
+ 1. **Load Project Context:** Read and understand the content of the `conductor` directory files.
29
+ 2. **Get Track Description:**
30
+ * **If `{{args}}` contains a description:** Use the content of `{{args}}`.
31
+ * **If `{{args}}` is empty:** Ask the user:
32
+ > "Please provide a brief description of the track (feature, bug fix, chore, etc.) you wish to start."
33
+ Await the user's response and use it as the track description.
34
+ 3. **Infer Track Type:** Analyze the description to determine if it is a "Feature" or "Something Else" (e.g., Bug, Chore, Refactor). Do NOT ask the user to classify it.
35
+
36
+ ### 2.2 Interactive Specification Generation (`spec.md`)
37
+
38
+ 1. **State Your Goal:** Announce:
39
+ > "I'll now guide you through a series of questions to build a comprehensive specification (`spec.md`) for this track."
40
+
41
+ 2. **Questioning Phase:** Ask a series of questions to gather details for the `spec.md`. Tailor questions based on the track type (Feature or Other).
42
+ * **CRITICAL:** You MUST ask these questions sequentially (one by one). Do not ask multiple questions in a single turn. Wait for the user's response after each question.
43
+ * **General Guidelines:**
44
+ * Refer to information in `product.md`, `tech-stack.md`, etc., to ask context-aware questions.
45
+ * Provide a brief explanation and clear examples for each question.
46
+ * **Strongly Recommendation:** Whenever possible, present 2-3 plausible options (A, B, C) for the user to choose from.
47
+ * **Mandatory:** The last option for every multiple-choice question MUST be "Type your own answer".
48
+
49
+ * **1. Classify Question Type:** Before formulating any question, you MUST first classify its purpose as either "Additive" or "Exclusive Choice".
50
+ * Use **Additive** for brainstorming and defining scope (e.g., users, goals, features, project guidelines). These questions allow for multiple answers.
51
+ * Use **Exclusive Choice** for foundational, singular commitments (e.g., selecting a primary technology, a specific workflow rule). These questions require a single answer.
52
+
53
+ * **2. Formulate the Question:** Based on the classification, you MUST adhere to the following:
54
+ * **Strongly Recommended:** Whenever possible, present 2-3 plausible options (A, B, C) for the user to choose from.
55
+ * **If Additive:** Formulate an open-ended question that encourages multiple points. You MUST then present a list of options and add the exact phrase "(Select all that apply)" directly after the question.
56
+ * **If Exclusive Choice:** Formulate a direct question that guides the user to a single, clear decision. You MUST NOT add "(Select all that apply)".
57
+
58
+ * **3. Interaction Flow:**
59
+ * **CRITICAL:** You MUST ask questions sequentially (one by one). Do not ask multiple questions in a single turn. Wait for the user's response after each question.
60
+ * The last option for every multiple-choice question MUST be "Type your own answer".
61
+ * Confirm your understanding by summarizing before moving on to the next question or section..
62
+
63
+ * **If FEATURE:**
64
+ * **Ask 3-5 relevant questions** to clarify the feature request.
65
+ * Examples include clarifying questions about the feature, how it should be implemented, interactions, inputs/outputs, etc.
66
+ * Tailor the questions to the specific feature request (e.g., if the user didn't specify the UI, ask about it; if they didn't specify the logic, ask about it).
67
+
68
+ * **If SOMETHING ELSE (Bug, Chore, etc.):**
69
+ * **Ask 2-3 relevant questions** to obtain necessary details.
70
+ * Examples include reproduction steps for bugs, specific scope for chores, or success criteria.
71
+ * Tailor the questions to the specific request.
72
+
73
+ 3. **Draft `spec.md`:** Once sufficient information is gathered, draft the content for the track's `spec.md` file, including sections like Overview, Functional Requirements, Non-Functional Requirements (if any), Acceptance Criteria, and Out of Scope.
74
+
75
+ 4. **User Confirmation:** Present the drafted `spec.md` content to the user for review and approval.
76
+ > "I've drafted the specification for this track. Please review the following:"
77
+ >
78
+ > ```markdown
79
+ > [Drafted spec.md content here]
80
+ > ```
81
+ >
82
+ > "Does this accurately capture the requirements? Please suggest any changes or confirm."
83
+ Await user feedback and revise the `spec.md` content until confirmed.
84
+
85
+ ### 2.3 Interactive Plan Generation (`plan.md`)
86
+
87
+ 1. **State Your Goal:** Once `spec.md` is approved, announce:
88
+ > "Now I will create an implementation plan (plan.md) based on the specification."
89
+
90
+ 2. **Generate Plan:**
91
+ * Read the confirmed `spec.md` content for this track.
92
+ * Read the selected workflow file from `conductor/workflow.md`.
93
+ * Generate a `plan.md` with a hierarchical list of Phases, Tasks, and Sub-tasks.
94
+ * **CRITICAL:** The plan structure MUST adhere to the methodology in the workflow file (e.g., TDD tasks for "Write Tests" and "Implement").
95
+ * Include status markers `[ ]` for each task/sub-task.
96
+ * **CRITICAL: Inject Phase Completion Tasks.** Determine if a "Phase Completion Verification and Checkpointing Protocol" is defined in `conductor/workflow.md`. If this protocol exists, then for each **Phase** that you generate in `plan.md`, you MUST append a final meta-task to that phase. The format for this meta-task is: `- [ ] Task: Conductor - User Manual Verification '<Phase Name>' (Protocol in workflow.md)`.
97
+
98
+ 3. **User Confirmation:** Present the drafted `plan.md` to the user for review and approval.
99
+ > "I've drafted the implementation plan. Please review the following:"
100
+ >
101
+ > ```markdown
102
+ > [Drafted plan.md content here]
103
+ > ```
104
+ >
105
+ > "Does this plan look correct and cover all the necessary steps based on the spec and our workflow? Please suggest any changes or confirm."
106
+ Await user feedback and revise the `plan.md` content until confirmed.
107
+
108
+ ### 2.4 Create Track Artifacts and Update Main Plan
109
+
110
+ 1. **Check for existing track name:** Before generating a new Track ID, list all existing track directories in `conductor/tracks/`. Extract the short names from these track IDs (e.g., ``shortname_YYYYMMDD`` -> `shortname`). If the proposed short name for the new track (derived from the initial description) matches an existing short name, halt the `newTrack` creation. Explain that a track with that name already exists and suggest choosing a different name or resuming the existing track.
111
+ 2. **Generate Track ID:** Create a unique Track ID (e.g., ``shortname_YYYYMMDD``).
112
+ 3. **Create Directory:** Create a new directory: `conductor/tracks/<track_id>/`
113
+ 4. **Create `metadata.json`:** Create a metadata file at `conductor/tracks/<track_id>/metadata.json` with content like:
114
+ ```json
115
+ {
116
+ "track_id": "<track_id>",
117
+ "type": "feature", // or "bug", "chore", etc.
118
+ "status": "new", // or in_progress, completed, cancelled
119
+ "created_at": "YYYY-MM-DDTHH:MM:SSZ",
120
+ "updated_at": "YYYY-MM-DDTHH:MM:SSZ",
121
+ "description": "<Initial user description>"
122
+ }
123
+ ```
124
+ * Populate fields with actual values. Use the current timestamp.
125
+ 5. **Write Files:**
126
+ * Write the confirmed specification content to `conductor/tracks/<track_id>/spec.md`.
127
+ * Write the confirmed plan content to `conductor/tracks/<track_id>/plan.md`.
128
+ 6. **Update Tracks File:**
129
+ - **Announce:** Inform the user you are updating the tracks file.
130
+ - **Append Section:** Append a new section for the track to the end of `conductor/tracks.md`. The format MUST be:
131
+ ```markdown
132
+
133
+ ---
134
+
135
+ ## [ ] Track: <Track Description>
136
+ *Link: [./conductor/tracks/<track_id>/](./conductor/tracks/<track_id>/)*
137
+ ```
138
+ (Replace placeholders with actual values)
139
+ 7. **Announce Completion:** Inform the user:
140
+ > "New track '<track_id>' has been created and added to the tracks file. You can now start implementation by running `/conductor:implement`."
141
+
142
+ """