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,331 @@
1
+ ---
2
+ name: debug-analysis
3
+ description: 深度调试分析 - 直接调用 Gemini/Codex CLI 进行系统性问题诊断,支持会话延续。
4
+ auto_invoke: true
5
+ tags: [debug, analysis, troubleshooting, direct-cli]
6
+ ---
7
+
8
+ # Debug Analysis - 深度调试分析 Skill
9
+
10
+ ## 🎯 核心功能
11
+
12
+ 通过直接调用 Gemini 和 Codex CLI,进行系统性问题诊断和根因分析。
13
+
14
+ **替代**: PAL MCP debug 工具
15
+
16
+ ## 📋 触发场景
17
+
18
+ **自动触发**:
19
+ - "调试问题"
20
+ - "系统性错误分析"
21
+ - "debug 这个问题"
22
+ - "根因分析"
23
+ - "为什么出现这个错误"
24
+
25
+ **手动触发**:
26
+ ```
27
+ 使用 debug-analysis 分析:<问题描述>
28
+ ```
29
+
30
+ ## 🔄 Workflow
31
+
32
+ ### Step 1: 问题收集
33
+
34
+ 收集问题的完整信息:
35
+ - 错误信息
36
+ - 日志片段
37
+ - 相关代码
38
+ - 复现步骤
39
+ - 环境信息
40
+
41
+ ### Step 2: Gemini 深度分析 (1M 上下文)
42
+
43
+ **⚠️ 重要: 优先使用 `gemp` (长任务优化版),`gemini` CLI 作为备用**
44
+
45
+ ```bash
46
+ # Step 1: 写入 prompt 到临时文件
47
+ cat > /tmp/gemini_debug_prompt.txt << 'PROMPT_EOF'
48
+ 作为资深调试专家,分析以下问题:
49
+
50
+ 【问题描述】
51
+ <用户问题>
52
+
53
+ 【错误日志】
54
+ <错误日志>
55
+
56
+ 【相关代码】
57
+ <代码片段>
58
+
59
+ 请进行系统性分析:
60
+ 1. 问题表象分析
61
+ 2. 可能的根本原因 (列出3-5个假设)
62
+ 3. 验证方法
63
+ 4. 修复建议
64
+
65
+ 使用结构化思维,逐步推理。
66
+ PROMPT_EOF
67
+
68
+ # Step 2: 优先使用 gemp (20分钟超时,输出纯净)
69
+ cat /tmp/gemini_debug_prompt.txt | node ~/.gemini/long_task_runner.js 2>&1
70
+ ```
71
+
72
+ **备用方案** (如果 gemp 失败):
73
+ ```bash
74
+ cat /tmp/gemini_debug_prompt.txt | gemini --yolo 2>&1 | grep -v "STARTUP\|YOLO\|Load"
75
+ ```
76
+
77
+ ### Step 3: Codex 代码层面诊断
78
+
79
+ ```bash
80
+ codex exec --json --dangerously-bypass-approvals-and-sandbox \
81
+ --enable web_search_request \
82
+ -c 'mcp_servers={}' \
83
+ "作为代码诊断专家,分析以下问题:
84
+
85
+ 【问题描述】
86
+ <用户问题>
87
+
88
+ 【代码片段】
89
+ <代码>
90
+
91
+ 请从代码层面诊断:
92
+ 1. 代码逻辑问题
93
+ 2. 边界条件检查
94
+ 3. 异常处理缺陷
95
+ 4. 并发/竞态问题
96
+ 5. 具体修复代码
97
+
98
+ 给出可直接使用的修复方案。
99
+ " 2>&1 | grep '"type":"item.completed"' | tail -1 | python3 -c "
100
+ import sys, json
101
+ data = json.loads(sys.stdin.read())
102
+ print(data['item']['text'])
103
+ "
104
+ ```
105
+
106
+ ### Step 4: Claude 综合诊断
107
+
108
+ 基于两个模型的分析,Claude 提供:
109
+
110
+ 1. **根因确认**
111
+ - 最可能的根本原因
112
+ - 证据支持
113
+ - 确信度评估
114
+
115
+ 2. **修复方案**
116
+ - 立即修复 (临时方案)
117
+ - 彻底修复 (根本方案)
118
+ - 预防措施
119
+
120
+ 3. **验证步骤**
121
+ - 如何验证修复有效
122
+ - 测试用例建议
123
+
124
+ ## 📊 输出格式
125
+
126
+ ```markdown
127
+ ## 🔍 深度调试分析报告
128
+
129
+ **问题**: [问题描述]
130
+
131
+ ---
132
+
133
+ ### 🤖 Gemini 系统分析 (深度推理)
134
+
135
+ **问题表象**:
136
+ [问题的外在表现]
137
+
138
+ **根因假设** (优先级排序):
139
+ 1. **假设1**: [描述] (可能性: 80%)
140
+ - 证据: [...]
141
+ - 验证: [...]
142
+
143
+ 2. **假设2**: [描述] (可能性: 15%)
144
+ - 证据: [...]
145
+ - 验证: [...]
146
+
147
+ **详细分析**:
148
+ [Gemini 的完整推理过程]
149
+
150
+ ---
151
+
152
+ ### 💻 Codex 代码诊断
153
+
154
+ **代码层面问题**:
155
+ - [问题1]
156
+ - [问题2]
157
+
158
+ **具体修复方案**:
159
+
160
+ ```typescript
161
+ // 修复前
162
+ <原代码>
163
+
164
+ // 修复后
165
+ <修复后的代码>
166
+ ```
167
+
168
+ **修复说明**:
169
+ [Codex 的详细解释]
170
+
171
+ ---
172
+
173
+ ### 🎯 Claude 综合诊断
174
+
175
+ #### 根本原因
176
+
177
+ **确定的根因**: [最可能的原因]
178
+
179
+ **确信度**: [高/中/低]
180
+
181
+ **证据**:
182
+ - 证据1: [...]
183
+ - 证据2: [...]
184
+
185
+ #### 修复方案
186
+
187
+ **方案1: 立即修复** (临时)
188
+ ```typescript
189
+ <临时修复代码>
190
+ ```
191
+ - 优点: [...]
192
+ - 缺点: [...]
193
+ - 适用场景: 紧急上线
194
+
195
+ **方案2: 彻底修复** (推荐)
196
+ ```typescript
197
+ <彻底修复代码>
198
+ ```
199
+ - 优点: [...]
200
+ - 实施步骤:
201
+ 1. [步骤1]
202
+ 2. [步骤2]
203
+
204
+ #### 验证步骤
205
+
206
+ **1. 单元测试**:
207
+ ```typescript
208
+ test('修复后不应出现错误', () => {
209
+ // 测试用例
210
+ });
211
+ ```
212
+
213
+ **2. 集成测试**:
214
+ - [测试场景1]
215
+ - [测试场景2]
216
+
217
+ **3. 监控指标**:
218
+ - 错误率应降至 <0.1%
219
+ - 响应时间应 <100ms
220
+
221
+ #### 预防措施
222
+
223
+ - [措施1]: 防止类似问题再次发生
224
+ - [措施2]: 代码规范改进
225
+ - [措施3]: 监控告警设置
226
+
227
+ ---
228
+
229
+ **📅 诊断时间**: [时间戳]
230
+ **🤖 模型**: Gemini (系统分析) + Codex (代码诊断) + Claude (综合)
231
+ **⏱️ 总耗时**: [X 分钟]
232
+ ```
233
+
234
+ ## 🎓 使用示例
235
+
236
+ ### 示例 1: 并发错误
237
+
238
+ **输入**:
239
+ ```
240
+ debug-analysis:我们的订单系统偶尔出现重复扣款,错误日志:
241
+ Error: Duplicate charge detected for order #12345
242
+ 复现概率约 1/1000 次下单
243
+ ```
244
+
245
+ **流程**:
246
+ 1. Gemini: 分析并发场景,推测竞态条件
247
+ 2. Codex: 检查事务处理代码,找到未加锁的关键路径
248
+ 3. Claude: 给出分布式锁方案 + Redis 实现代码
249
+
250
+ ### 示例 2: 内存泄漏
251
+
252
+ **输入**:
253
+ ```
254
+ debug-analysis:Node.js 应用内存持续增长,12小时后崩溃。
255
+ 内存从 200MB 增长到 2GB。
256
+ ```
257
+
258
+ **流程**:
259
+ 1. Gemini: 分析内存泄漏常见模式 (闭包、事件监听器)
260
+ 2. Codex: 检查代码中的事件监听、定时器、缓存
261
+ 3. Claude: 定位具体泄漏点 + 修复建议 + 监控方案
262
+
263
+ ### 示例 3: 性能问题
264
+
265
+ **输入**:
266
+ ```
267
+ debug-analysis:API 响应时间从 50ms 突然增加到 2000ms。
268
+ 数据库查询正常,CPU/内存正常。
269
+ ```
270
+
271
+ **流程**:
272
+ 1. Gemini: 分析网络、第三方服务、缓存失效等可能性
273
+ 2. Codex: 检查异步处理、Promise 链、并发控制
274
+ 3. Claude: 定位到未处理的 Promise rejection 导致请求堆积
275
+
276
+ ## 🔄 上下文延续
277
+
278
+ ### 多轮诊断
279
+
280
+ **使用 gemp 进行多轮诊断**:
281
+
282
+ ```bash
283
+ # 第一轮:初步诊断
284
+ cat > /tmp/gemini_debug1.txt << 'PROMPT_EOF'
285
+ 分析这个错误...
286
+ PROMPT_EOF
287
+ cat /tmp/gemini_debug1.txt | node ~/.gemini/long_task_runner.js 2>&1
288
+
289
+ # 第二轮:深入某个假设
290
+ cat > /tmp/gemini_debug2.txt << 'PROMPT_EOF'
291
+ 深入分析假设1:竞态条件
292
+ PROMPT_EOF
293
+ cat /tmp/gemini_debug2.txt | node ~/.gemini/long_task_runner.js 2>&1
294
+
295
+ # 第三轮:验证方案
296
+ cat > /tmp/gemini_debug3.txt << 'PROMPT_EOF'
297
+ 这个修复方案是否会引入新问题?
298
+ PROMPT_EOF
299
+ cat /tmp/gemini_debug3.txt | node ~/.gemini/long_task_runner.js 2>&1
300
+ ```
301
+
302
+ **备用方案** (gemini CLI 多轮):
303
+ ```bash
304
+ gemini -p "分析这个错误..." --yolo
305
+ gemini -p "深入分析假设1..." --resume latest --yolo
306
+ ```
307
+
308
+ ## ⚠️ 错误处理
309
+
310
+ ### CLI 调用失败
311
+
312
+ **降级策略**:
313
+ - Gemini 失败 → Codex + Claude
314
+ - Codex 失败 → Gemini + Claude
315
+ - 都失败 → Claude 单模型分析
316
+
317
+ ## 🆚 vs PAL MCP Debug
318
+
319
+ | 特性 | PAL MCP | Direct CLI Skill |
320
+ |------|---------|-----------------|
321
+ | 超时问题 | ❌ 容易超时 | ✅ 不会超时 |
322
+ | 深度推理 | ✅ 支持 | ✅ Gemini 原生支持 |
323
+ | 代码诊断 | ✅ 支持 | ✅ Codex GPT-5 |
324
+ | 上下文延续 | ✅ continuation_id | ✅ --resume |
325
+ | 调试难度 | ❌ 黑盒 | ✅ 透明 |
326
+
327
+ ---
328
+
329
+ **创建时间**: 2025-12-19
330
+ **版本**: v1.0
331
+ **替代**: PAL MCP debug 工具
@@ -0,0 +1,347 @@
1
+ ---
2
+ name: deepinit
3
+ description: Deep codebase initialization with hierarchical AGENTS.md documentation
4
+ ---
5
+
6
+ # Deep Init Skill
7
+
8
+
9
+ ## Native Subagent Protocol (Codex)
10
+
11
+ Codex supports native subagents. Delegate with `spawn_agent`, coordinate with `send_input`, collect via `wait`, and clean up with `close_agent`.
12
+
13
+ Execution preference:
14
+ 1. Use native subagents first for independent workstreams (parallel when possible).
15
+ 2. Merge results in main thread and run final verification.
16
+ 3. Fallback only when delegation is blocked: use the `[ANALYST]`/`[ARCHITECT]`/`[EXECUTOR]`/`[REVIEWER]` structure in a single response.
17
+
18
+ Minimal orchestration pattern:
19
+ ```text
20
+ spawn_agent -> send_input (optional) -> wait -> close_agent
21
+ ```
22
+
23
+ > Codex invocation: use `$deepinit ...` or `deepinit: ...`
24
+
25
+
26
+ Creates comprehensive, hierarchical AGENTS.md documentation across the entire codebase.
27
+
28
+ ## Core Concept
29
+
30
+ AGENTS.md files serve as **AI-readable documentation** that helps agents understand:
31
+ - What each directory contains
32
+ - How components relate to each other
33
+ - Special instructions for working in that area
34
+ - Dependencies and relationships
35
+
36
+ ## Hierarchical Tagging System
37
+
38
+ Every AGENTS.md (except root) includes a parent reference tag:
39
+
40
+ ```markdown
41
+ <!-- Parent: ../AGENTS.md -->
42
+ ```
43
+
44
+ This creates a navigable hierarchy:
45
+ ```
46
+ /AGENTS.md ← Root (no parent tag)
47
+ ├── src/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
48
+ │ ├── src/components/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
49
+ │ └── src/utils/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
50
+ └── docs/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
51
+ ```
52
+
53
+ ## AGENTS.md Template
54
+
55
+ ```markdown
56
+ <!-- Parent: {relative_path_to_parent}/AGENTS.md -->
57
+ <!-- Generated: {timestamp} | Updated: {timestamp} -->
58
+
59
+ # {Directory Name}
60
+
61
+ ## Purpose
62
+ {One-paragraph description of what this directory contains and its role}
63
+
64
+ ## Key Files
65
+ {List each significant file with a one-line description}
66
+
67
+ | File | Description |
68
+ |------|-------------|
69
+ | `file.ts` | Brief description of purpose |
70
+
71
+ ## Subdirectories
72
+ {List each subdirectory with brief purpose}
73
+
74
+ | Directory | Purpose |
75
+ |-----------|---------|
76
+ | `subdir/` | What it contains (see `subdir/AGENTS.md`) |
77
+
78
+ ## For AI Agents
79
+
80
+ ### Working In This Directory
81
+ {Special instructions for AI agents modifying files here}
82
+
83
+ ### Testing Requirements
84
+ {How to test changes in this directory}
85
+
86
+ ### Common Patterns
87
+ {Code patterns or conventions used here}
88
+
89
+ ## Dependencies
90
+
91
+ ### Internal
92
+ {References to other parts of the codebase this depends on}
93
+
94
+ ### External
95
+ {Key external packages/libraries used}
96
+
97
+ <!-- MANUAL: Any manually added notes below this line are preserved on regeneration -->
98
+ ```
99
+
100
+ ## Execution Workflow
101
+
102
+ ### Step 1: Map Directory Structure
103
+
104
+ ```
105
+ # Use fast local search commands (can be run in parallel when useful)
106
+ find . -type d \
107
+ -not -path "*/node_modules/*" \
108
+ -not -path "*/.git/*" \
109
+ -not -path "*/dist/*" \
110
+ -not -path "*/build/*" \
111
+ -not -path "*/__pycache__/*" \
112
+ -not -path "*/.venv/*" \
113
+ -not -path "*/coverage/*" \
114
+ -not -path "*/.next/*" \
115
+ -not -path "*/.nuxt/*"
116
+ ```
117
+
118
+ ### Step 2: Create Work Plan
119
+
120
+ Generate todo items for each directory, organized by depth level:
121
+
122
+ ```
123
+ Level 0: / (root)
124
+ Level 1: /src, /docs, /tests
125
+ Level 2: /src/components, /src/utils, /docs/api
126
+ ...
127
+ ```
128
+
129
+ ### Step 3: Generate Level by Level
130
+
131
+ **IMPORTANT**: Generate parent levels before child levels to ensure parent references are valid.
132
+
133
+ For each directory:
134
+ 1. Read all files in the directory
135
+ 2. Analyze purpose and relationships
136
+ 3. Generate AGENTS.md content
137
+ 4. Write file with proper parent reference
138
+
139
+ ### Step 4: Compare and Update (if exists)
140
+
141
+ When AGENTS.md already exists:
142
+
143
+ 1. **Read existing content**
144
+ 2. **Identify sections**:
145
+ - Auto-generated sections (can be updated)
146
+ - Manual sections (`<!-- MANUAL -->` preserved)
147
+ 3. **Compare**:
148
+ - New files added?
149
+ - Files removed?
150
+ - Structure changed?
151
+ 4. **Merge**:
152
+ - Update auto-generated content
153
+ - Preserve manual annotations
154
+ - Update timestamp
155
+
156
+ ### Step 5: Validate Hierarchy
157
+
158
+ After generation, run validation checks:
159
+
160
+ | Check | How to Verify | Corrective Action |
161
+ |-------|--------------|-------------------|
162
+ | Parent references resolve | Read each AGENTS.md, check `<!-- Parent: -->` path exists | Fix path or remove orphan |
163
+ | No orphaned AGENTS.md | Compare AGENTS.md locations to directory structure | Delete orphaned files |
164
+ | Completeness | List all directories, check for AGENTS.md | Generate missing files |
165
+ | Timestamps current | Check `<!-- Generated: -->` dates | Regenerate outdated files |
166
+
167
+ Validation script pattern:
168
+ ```bash
169
+ # Find all AGENTS.md files
170
+ find . -name "AGENTS.md" -type f
171
+
172
+ # Check parent references
173
+ grep -r "<!-- Parent:" --include="AGENTS.md" .
174
+ ```
175
+
176
+ ## Smart Delegation
177
+
178
+ | Task | Agent |
179
+ |------|-------|
180
+ | Directory mapping | `explore` |
181
+ | File analysis | `architect-low` |
182
+ | Content generation | `writer` |
183
+ | AGENTS.md writes | `writer` |
184
+
185
+ ## Empty Directory Handling
186
+
187
+ When encountering empty or near-empty directories:
188
+
189
+ | Condition | Action |
190
+ |-----------|--------|
191
+ | No files, no subdirectories | **Skip** - do not create AGENTS.md |
192
+ | No files, has subdirectories | Create minimal AGENTS.md with subdirectory listing only |
193
+ | Has only generated files (*.min.js, *.map) | Skip or minimal AGENTS.md |
194
+ | Has only config files | Create AGENTS.md describing configuration purpose |
195
+
196
+ Example minimal AGENTS.md for directory-only containers:
197
+ ```markdown
198
+ <!-- Parent: ../AGENTS.md -->
199
+ # {Directory Name}
200
+
201
+ ## Purpose
202
+ Container directory for organizing related modules.
203
+
204
+ ## Subdirectories
205
+ | Directory | Purpose |
206
+ |-----------|---------|
207
+ | `subdir/` | Description (see `subdir/AGENTS.md`) |
208
+ ```
209
+
210
+ ## Parallelization Rules
211
+
212
+ 1. **Same-level directories**: Process in parallel
213
+ 2. **Different levels**: Sequential (parent first)
214
+ 3. **Large directories**: Spawn dedicated agent per directory
215
+ 4. **Small directories**: Batch multiple into one agent
216
+
217
+ ## Quality Standards
218
+
219
+ ### Must Include
220
+ - [ ] Accurate file descriptions
221
+ - [ ] Correct parent references
222
+ - [ ] Subdirectory links
223
+ - [ ] AI agent instructions
224
+
225
+ ### Must Avoid
226
+ - [ ] Generic boilerplate
227
+ - [ ] Incorrect file names
228
+ - [ ] Broken parent references
229
+ - [ ] Missing important files
230
+
231
+ ## Example Output
232
+
233
+ ### Root AGENTS.md
234
+ ```markdown
235
+ <!-- Generated: 2024-01-15 | Updated: 2024-01-15 -->
236
+
237
+ # my-project
238
+
239
+ ## Purpose
240
+ A web application for managing user tasks with real-time collaboration features.
241
+
242
+ ## Key Files
243
+ | File | Description |
244
+ |------|-------------|
245
+ | `package.json` | Project dependencies and scripts |
246
+ | `tsconfig.json` | TypeScript configuration |
247
+ | `.env.example` | Environment variable template |
248
+
249
+ ## Subdirectories
250
+ | Directory | Purpose |
251
+ |-----------|---------|
252
+ | `src/` | Application source code (see `src/AGENTS.md`) |
253
+ | `docs/` | Documentation (see `docs/AGENTS.md`) |
254
+ | `tests/` | Test suites (see `tests/AGENTS.md`) |
255
+
256
+ ## For AI Agents
257
+
258
+ ### Working In This Directory
259
+ - Always run `npm install` after modifying package.json
260
+ - Use TypeScript strict mode
261
+ - Follow ESLint rules
262
+
263
+ ### Testing Requirements
264
+ - Run `npm test` before committing
265
+ - Ensure >80% coverage
266
+
267
+ ### Common Patterns
268
+ - Use barrel exports (index.ts)
269
+ - Prefer functional components
270
+
271
+ ## Dependencies
272
+
273
+ ### External
274
+ - React 18.x - UI framework
275
+ - TypeScript 5.x - Type safety
276
+ - Vite - Build tool
277
+
278
+ <!-- MANUAL: Custom project notes can be added below -->
279
+ ```
280
+
281
+ ### Nested AGENTS.md
282
+ ```markdown
283
+ <!-- Parent: ../AGENTS.md -->
284
+ <!-- Generated: 2024-01-15 | Updated: 2024-01-15 -->
285
+
286
+ # components
287
+
288
+ ## Purpose
289
+ Reusable React components organized by feature and complexity.
290
+
291
+ ## Key Files
292
+ | File | Description |
293
+ |------|-------------|
294
+ | `index.ts` | Barrel export for all components |
295
+ | `Button.tsx` | Primary button component |
296
+ | `Modal.tsx` | Modal dialog component |
297
+
298
+ ## Subdirectories
299
+ | Directory | Purpose |
300
+ |-----------|---------|
301
+ | `forms/` | Form-related components (see `forms/AGENTS.md`) |
302
+ | `layout/` | Layout components (see `layout/AGENTS.md`) |
303
+
304
+ ## For AI Agents
305
+
306
+ ### Working In This Directory
307
+ - Each component has its own file
308
+ - Use CSS modules for styling
309
+ - Export via index.ts
310
+
311
+ ### Testing Requirements
312
+ - Unit tests in `__tests__/` subdirectory
313
+ - Use React Testing Library
314
+
315
+ ### Common Patterns
316
+ - Props interfaces defined above component
317
+ - Use forwardRef for DOM-exposing components
318
+
319
+ ## Dependencies
320
+
321
+ ### Internal
322
+ - `src/hooks/` - Custom hooks used by components
323
+ - `src/utils/` - Utility functions
324
+
325
+ ### External
326
+ - `clsx` - Conditional class names
327
+ - `lucide-react` - Icons
328
+
329
+ <!-- MANUAL: -->
330
+ ```
331
+
332
+ ## Triggering Update Mode
333
+
334
+ When running on an existing codebase with AGENTS.md files:
335
+
336
+ 1. Detect existing files first
337
+ 2. Read and parse existing content
338
+ 3. Analyze current directory state
339
+ 4. Generate diff between existing and current
340
+ 5. Apply updates while preserving manual sections
341
+
342
+ ## Performance Considerations
343
+
344
+ - **Cache directory listings** - Don't re-scan same directories
345
+ - **Batch small directories** - Process multiple at once
346
+ - **Skip unchanged** - If directory hasn't changed, skip regeneration
347
+ - **Parallel writes** - Multiple agents writing different files simultaneously