octo-agent 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. checksums.yaml +7 -0
  2. data/.clacky/skills/commit/SKILL.md +423 -0
  3. data/.clacky/skills/gem-release/SKILL.md +199 -0
  4. data/.clacky/skills/gem-release/scripts/release.sh +304 -0
  5. data/.clacky/skills/oss-upload/SKILL.md +47 -0
  6. data/.octorules +106 -0
  7. data/.rspec +3 -0
  8. data/.rubocop.yml +8 -0
  9. data/CHANGELOG.md +76 -0
  10. data/CODE_OF_CONDUCT.md +132 -0
  11. data/CONTRIBUTING.md +92 -0
  12. data/Dockerfile +28 -0
  13. data/LICENSE.txt +22 -0
  14. data/POSITIONING.md +46 -0
  15. data/README.md +134 -0
  16. data/README_CN.md +134 -0
  17. data/Rakefile +34 -0
  18. data/benchmark/fixtures/sample_project/Gemfile +3 -0
  19. data/benchmark/fixtures/sample_project/lib/api_handler.rb +32 -0
  20. data/benchmark/fixtures/sample_project/lib/order_calculator.rb +23 -0
  21. data/benchmark/fixtures/sample_project/lib/user_renderer.rb +20 -0
  22. data/benchmark/fixtures/sample_project/spec/order_calculator_spec.rb +20 -0
  23. data/benchmark/results/EVALUATION_REPORT.md +165 -0
  24. data/benchmark/results/baseline_20260511_174424.json +128 -0
  25. data/benchmark/results/report_20260511_175256.json +271 -0
  26. data/benchmark/results/report_20260511_175444.json +271 -0
  27. data/benchmark/results/treatment_20260511_175103.json +130 -0
  28. data/benchmark/runner.rb +441 -0
  29. data/bin/octo +7 -0
  30. data/docs/agent-first-ui-design.md +77 -0
  31. data/docs/billing-system.md +318 -0
  32. data/docs/channel-architecture.md +235 -0
  33. data/docs/engineering-article.md +343 -0
  34. data/docs/session-skill-invocation.md +69 -0
  35. data/docs/time_machine_design.md +247 -0
  36. data/docs/ui2-architecture.md +124 -0
  37. data/homebrew/README.md +96 -0
  38. data/homebrew/openocto.rb +24 -0
  39. data/lib/octo/agent/hook_manager.rb +61 -0
  40. data/lib/octo/agent/llm_caller.rb +800 -0
  41. data/lib/octo/agent/memory_updater.rb +246 -0
  42. data/lib/octo/agent/message_compressor.rb +225 -0
  43. data/lib/octo/agent/message_compressor_helper.rb +869 -0
  44. data/lib/octo/agent/next_message_suggester.rb +215 -0
  45. data/lib/octo/agent/session_serializer.rb +685 -0
  46. data/lib/octo/agent/skill_auto_creator.rb +114 -0
  47. data/lib/octo/agent/skill_evolution.rb +61 -0
  48. data/lib/octo/agent/skill_manager.rb +466 -0
  49. data/lib/octo/agent/skill_reflector.rb +89 -0
  50. data/lib/octo/agent/system_prompt_builder.rb +101 -0
  51. data/lib/octo/agent/time_machine.rb +214 -0
  52. data/lib/octo/agent/tool_executor.rb +454 -0
  53. data/lib/octo/agent/tool_registry.rb +150 -0
  54. data/lib/octo/agent.rb +2180 -0
  55. data/lib/octo/agent_config.rb +989 -0
  56. data/lib/octo/agent_profile.rb +112 -0
  57. data/lib/octo/anthropic_stream_aggregator.rb +137 -0
  58. data/lib/octo/background_task_registry.rb +324 -0
  59. data/lib/octo/banner.rb +34 -0
  60. data/lib/octo/bedrock_stream_aggregator.rb +137 -0
  61. data/lib/octo/block_font.rb +331 -0
  62. data/lib/octo/cli.rb +968 -0
  63. data/lib/octo/client.rb +623 -0
  64. data/lib/octo/default_agents/SOUL.md +3 -0
  65. data/lib/octo/default_agents/USER.md +1 -0
  66. data/lib/octo/default_agents/base_prompt.md +66 -0
  67. data/lib/octo/default_agents/coding/profile.yml +2 -0
  68. data/lib/octo/default_agents/coding/system_prompt.md +67 -0
  69. data/lib/octo/default_agents/general/profile.yml +2 -0
  70. data/lib/octo/default_agents/general/system_prompt.md +16 -0
  71. data/lib/octo/default_parsers/doc_parser.rb +69 -0
  72. data/lib/octo/default_parsers/docx_parser.rb +188 -0
  73. data/lib/octo/default_parsers/pdf_parser.rb +120 -0
  74. data/lib/octo/default_parsers/pdf_parser_ocr.py +103 -0
  75. data/lib/octo/default_parsers/pdf_parser_plumber.py +62 -0
  76. data/lib/octo/default_parsers/pptx_parser.rb +140 -0
  77. data/lib/octo/default_parsers/xlsx_parser.rb +121 -0
  78. data/lib/octo/default_skills/browser-setup/SKILL.md +426 -0
  79. data/lib/octo/default_skills/channel-manager/SKILL.md +623 -0
  80. data/lib/octo/default_skills/channel-manager/dingtalk_setup.rb +191 -0
  81. data/lib/octo/default_skills/channel-manager/discord_setup.rb +199 -0
  82. data/lib/octo/default_skills/channel-manager/feishu_setup.rb +574 -0
  83. data/lib/octo/default_skills/channel-manager/import_lark_skills.rb +97 -0
  84. data/lib/octo/default_skills/channel-manager/install_feishu_skills.rb +105 -0
  85. data/lib/octo/default_skills/channel-manager/weixin_setup.rb +274 -0
  86. data/lib/octo/default_skills/code-explorer/SKILL.md +36 -0
  87. data/lib/octo/default_skills/cron-task-creator/SKILL.md +257 -0
  88. data/lib/octo/default_skills/cron-task-creator/evals/evals.json +38 -0
  89. data/lib/octo/default_skills/onboard/SKILL.md +578 -0
  90. data/lib/octo/default_skills/onboard/scripts/import_external_skills.rb +413 -0
  91. data/lib/octo/default_skills/onboard/scripts/install_builtin_skills.rb +97 -0
  92. data/lib/octo/default_skills/persist-memory/SKILL.md +59 -0
  93. data/lib/octo/default_skills/personal-website/SKILL.md +113 -0
  94. data/lib/octo/default_skills/personal-website/publish.rb +235 -0
  95. data/lib/octo/default_skills/product-help/SKILL.md +123 -0
  96. data/lib/octo/default_skills/product-help/docs/agent-config.md +74 -0
  97. data/lib/octo/default_skills/product-help/docs/best-practices.md +49 -0
  98. data/lib/octo/default_skills/product-help/docs/browser-tool.md +53 -0
  99. data/lib/octo/default_skills/product-help/docs/built-in-skills.md +43 -0
  100. data/lib/octo/default_skills/product-help/docs/cli-reference.md +82 -0
  101. data/lib/octo/default_skills/product-help/docs/create-your-first-skill.md +47 -0
  102. data/lib/octo/default_skills/product-help/docs/faq.md +98 -0
  103. data/lib/octo/default_skills/product-help/docs/how-to-use-a-skill.md +58 -0
  104. data/lib/octo/default_skills/product-help/docs/installation.md +59 -0
  105. data/lib/octo/default_skills/product-help/docs/memory-system.md +61 -0
  106. data/lib/octo/default_skills/product-help/docs/octorules.md +62 -0
  107. data/lib/octo/default_skills/product-help/docs/session-management.md +63 -0
  108. data/lib/octo/default_skills/product-help/docs/skill-basics.md +55 -0
  109. data/lib/octo/default_skills/product-help/docs/skill-frontmatter.md +61 -0
  110. data/lib/octo/default_skills/product-help/docs/web-server.md +49 -0
  111. data/lib/octo/default_skills/product-help/docs/what-is-octo.md +37 -0
  112. data/lib/octo/default_skills/product-help/docs/windows-installation.md +36 -0
  113. data/lib/octo/default_skills/product-help/docs/writing-tips.md +53 -0
  114. data/lib/octo/default_skills/recall-memory/SKILL.md +65 -0
  115. data/lib/octo/default_skills/skill-add/SKILL.md +59 -0
  116. data/lib/octo/default_skills/skill-add/scripts/install_from_zip.rb +295 -0
  117. data/lib/octo/default_skills/skill-creator/SKILL.md +602 -0
  118. data/lib/octo/default_skills/skill-creator/agents/analyzer.md +274 -0
  119. data/lib/octo/default_skills/skill-creator/agents/comparator.md +202 -0
  120. data/lib/octo/default_skills/skill-creator/agents/grader.md +223 -0
  121. data/lib/octo/default_skills/skill-creator/eval-viewer/generate_review.py +471 -0
  122. data/lib/octo/default_skills/skill-creator/eval-viewer/viewer.html +1325 -0
  123. data/lib/octo/default_skills/skill-creator/references/schemas.md +430 -0
  124. data/lib/octo/default_skills/skill-creator/scripts/__init__.py +0 -0
  125. data/lib/octo/default_skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
  126. data/lib/octo/default_skills/skill-creator/scripts/generate_report.py +326 -0
  127. data/lib/octo/default_skills/skill-creator/scripts/improve_description.py +310 -0
  128. data/lib/octo/default_skills/skill-creator/scripts/quick_validate.py +103 -0
  129. data/lib/octo/default_skills/skill-creator/scripts/run_eval.py +317 -0
  130. data/lib/octo/default_skills/skill-creator/scripts/run_loop.py +331 -0
  131. data/lib/octo/default_skills/skill-creator/scripts/utils.py +47 -0
  132. data/lib/octo/default_skills/skill-creator/scripts/validate_skill_frontmatter.rb +143 -0
  133. data/lib/octo/idle_compression_timer.rb +115 -0
  134. data/lib/octo/json_ui_controller.rb +204 -0
  135. data/lib/octo/message_format/anthropic.rb +409 -0
  136. data/lib/octo/message_format/bedrock.rb +361 -0
  137. data/lib/octo/message_format/open_ai.rb +222 -0
  138. data/lib/octo/message_history.rb +373 -0
  139. data/lib/octo/openai_stream_aggregator.rb +130 -0
  140. data/lib/octo/plain_ui_controller.rb +166 -0
  141. data/lib/octo/providers.rb +534 -0
  142. data/lib/octo/server/browser_manager.rb +397 -0
  143. data/lib/octo/server/channel/adapters/base.rb +82 -0
  144. data/lib/octo/server/channel/adapters/dingtalk/adapter.rb +314 -0
  145. data/lib/octo/server/channel/adapters/dingtalk/api_client.rb +391 -0
  146. data/lib/octo/server/channel/adapters/dingtalk/stream_client.rb +203 -0
  147. data/lib/octo/server/channel/adapters/discord/adapter.rb +229 -0
  148. data/lib/octo/server/channel/adapters/discord/api_client.rb +107 -0
  149. data/lib/octo/server/channel/adapters/discord/gateway_client.rb +270 -0
  150. data/lib/octo/server/channel/adapters/feishu/adapter.rb +320 -0
  151. data/lib/octo/server/channel/adapters/feishu/bot.rb +478 -0
  152. data/lib/octo/server/channel/adapters/feishu/file_processor.rb +36 -0
  153. data/lib/octo/server/channel/adapters/feishu/message_parser.rb +129 -0
  154. data/lib/octo/server/channel/adapters/feishu/ws_client.rb +423 -0
  155. data/lib/octo/server/channel/adapters/telegram/adapter.rb +375 -0
  156. data/lib/octo/server/channel/adapters/telegram/api_client.rb +205 -0
  157. data/lib/octo/server/channel/adapters/wecom/adapter.rb +148 -0
  158. data/lib/octo/server/channel/adapters/wecom/media_downloader.rb +115 -0
  159. data/lib/octo/server/channel/adapters/wecom/ws_client.rb +395 -0
  160. data/lib/octo/server/channel/adapters/weixin/adapter.rb +692 -0
  161. data/lib/octo/server/channel/adapters/weixin/api_client.rb +402 -0
  162. data/lib/octo/server/channel/channel_config.rb +178 -0
  163. data/lib/octo/server/channel/channel_manager.rb +468 -0
  164. data/lib/octo/server/channel/channel_ui_controller.rb +224 -0
  165. data/lib/octo/server/channel.rb +33 -0
  166. data/lib/octo/server/discover.rb +77 -0
  167. data/lib/octo/server/epipe_safe_io.rb +105 -0
  168. data/lib/octo/server/http_server.rb +3554 -0
  169. data/lib/octo/server/scheduler.rb +317 -0
  170. data/lib/octo/server/server_master.rb +325 -0
  171. data/lib/octo/server/session_registry.rb +431 -0
  172. data/lib/octo/server/web_ui_controller.rb +487 -0
  173. data/lib/octo/session_manager.rb +385 -0
  174. data/lib/octo/skill.rb +466 -0
  175. data/lib/octo/skill_loader.rb +328 -0
  176. data/lib/octo/tools/base.rb +118 -0
  177. data/lib/octo/tools/browser.rb +625 -0
  178. data/lib/octo/tools/edit.rb +165 -0
  179. data/lib/octo/tools/file_reader.rb +549 -0
  180. data/lib/octo/tools/glob.rb +162 -0
  181. data/lib/octo/tools/grep.rb +356 -0
  182. data/lib/octo/tools/invoke_skill.rb +96 -0
  183. data/lib/octo/tools/list_tasks.rb +54 -0
  184. data/lib/octo/tools/redo_task.rb +41 -0
  185. data/lib/octo/tools/request_user_feedback.rb +84 -0
  186. data/lib/octo/tools/security.rb +333 -0
  187. data/lib/octo/tools/terminal/output_cleaner.rb +63 -0
  188. data/lib/octo/tools/terminal/persistent_session.rb +268 -0
  189. data/lib/octo/tools/terminal/safe_rm.sh +106 -0
  190. data/lib/octo/tools/terminal/session_manager.rb +213 -0
  191. data/lib/octo/tools/terminal.rb +1828 -0
  192. data/lib/octo/tools/todo_manager.rb +374 -0
  193. data/lib/octo/tools/trash_manager.rb +388 -0
  194. data/lib/octo/tools/undo_task.rb +35 -0
  195. data/lib/octo/tools/web_fetch.rb +242 -0
  196. data/lib/octo/tools/web_search.rb +260 -0
  197. data/lib/octo/tools/write.rb +77 -0
  198. data/lib/octo/ui2/block_font.rb +10 -0
  199. data/lib/octo/ui2/components/base_component.rb +163 -0
  200. data/lib/octo/ui2/components/command_suggestions.rb +290 -0
  201. data/lib/octo/ui2/components/common_component.rb +96 -0
  202. data/lib/octo/ui2/components/inline_input.rb +226 -0
  203. data/lib/octo/ui2/components/input_area.rb +1338 -0
  204. data/lib/octo/ui2/components/message_component.rb +99 -0
  205. data/lib/octo/ui2/components/modal_component.rb +419 -0
  206. data/lib/octo/ui2/components/todo_area.rb +149 -0
  207. data/lib/octo/ui2/components/tool_component.rb +107 -0
  208. data/lib/octo/ui2/components/welcome_banner.rb +139 -0
  209. data/lib/octo/ui2/layout_manager.rb +807 -0
  210. data/lib/octo/ui2/line_editor.rb +363 -0
  211. data/lib/octo/ui2/markdown_renderer.rb +100 -0
  212. data/lib/octo/ui2/output_buffer.rb +370 -0
  213. data/lib/octo/ui2/progress_handle.rb +362 -0
  214. data/lib/octo/ui2/progress_indicator.rb +55 -0
  215. data/lib/octo/ui2/screen_buffer.rb +273 -0
  216. data/lib/octo/ui2/terminal_detector.rb +119 -0
  217. data/lib/octo/ui2/theme_manager.rb +85 -0
  218. data/lib/octo/ui2/themes/base_theme.rb +105 -0
  219. data/lib/octo/ui2/themes/hacker_theme.rb +62 -0
  220. data/lib/octo/ui2/themes/minimal_theme.rb +56 -0
  221. data/lib/octo/ui2/thinking_verbs.rb +26 -0
  222. data/lib/octo/ui2/ui_controller.rb +1625 -0
  223. data/lib/octo/ui2/view_renderer.rb +177 -0
  224. data/lib/octo/ui2.rb +40 -0
  225. data/lib/octo/ui_interface.rb +154 -0
  226. data/lib/octo/utils/arguments_parser.rb +191 -0
  227. data/lib/octo/utils/browser_detector.rb +195 -0
  228. data/lib/octo/utils/encoding.rb +92 -0
  229. data/lib/octo/utils/environment_detector.rb +140 -0
  230. data/lib/octo/utils/file_ignore_helper.rb +170 -0
  231. data/lib/octo/utils/file_processor.rb +601 -0
  232. data/lib/octo/utils/gitignore_parser.rb +154 -0
  233. data/lib/octo/utils/limit_stack.rb +152 -0
  234. data/lib/octo/utils/logger.rb +124 -0
  235. data/lib/octo/utils/login_shell.rb +72 -0
  236. data/lib/octo/utils/model_pricing.rb +646 -0
  237. data/lib/octo/utils/parser_manager.rb +165 -0
  238. data/lib/octo/utils/path_helper.rb +15 -0
  239. data/lib/octo/utils/scripts_manager.rb +59 -0
  240. data/lib/octo/utils/string_matcher.rb +158 -0
  241. data/lib/octo/utils/trash_directory.rb +112 -0
  242. data/lib/octo/utils/workspace_rules.rb +46 -0
  243. data/lib/octo/version.rb +5 -0
  244. data/lib/octo/web/app.css +7141 -0
  245. data/lib/octo/web/app.js +543 -0
  246. data/lib/octo/web/apple-touch-icon.png +0 -0
  247. data/lib/octo/web/auth.js +150 -0
  248. data/lib/octo/web/channels.js +276 -0
  249. data/lib/octo/web/datepicker.js +205 -0
  250. data/lib/octo/web/favicon.png +0 -0
  251. data/lib/octo/web/i18n.js +1073 -0
  252. data/lib/octo/web/icon-512.png +0 -0
  253. data/lib/octo/web/icon-dark.svg +25 -0
  254. data/lib/octo/web/icon.svg +29 -0
  255. data/lib/octo/web/index.html +871 -0
  256. data/lib/octo/web/marked.min.js +69 -0
  257. data/lib/octo/web/onboard.js +491 -0
  258. data/lib/octo/web/profile.js +442 -0
  259. data/lib/octo/web/sessions.js +4421 -0
  260. data/lib/octo/web/settings.js +913 -0
  261. data/lib/octo/web/sidebar.js +32 -0
  262. data/lib/octo/web/skills.js +885 -0
  263. data/lib/octo/web/tasks.js +297 -0
  264. data/lib/octo/web/theme.js +105 -0
  265. data/lib/octo/web/trash.js +343 -0
  266. data/lib/octo/web/vendor/hljs/highlight.min.js +1244 -0
  267. data/lib/octo/web/vendor/hljs/hljs-theme.css +95 -0
  268. data/lib/octo/web/vendor/katex/auto-render.min.js +1 -0
  269. data/lib/octo/web/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  270. data/lib/octo/web/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  271. data/lib/octo/web/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  272. data/lib/octo/web/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  273. data/lib/octo/web/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  274. data/lib/octo/web/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  275. data/lib/octo/web/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  276. data/lib/octo/web/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  277. data/lib/octo/web/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  278. data/lib/octo/web/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  279. data/lib/octo/web/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  280. data/lib/octo/web/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  281. data/lib/octo/web/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  282. data/lib/octo/web/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  283. data/lib/octo/web/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  284. data/lib/octo/web/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  285. data/lib/octo/web/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  286. data/lib/octo/web/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  287. data/lib/octo/web/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  288. data/lib/octo/web/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  289. data/lib/octo/web/vendor/katex/katex.min.css +1 -0
  290. data/lib/octo/web/vendor/katex/katex.min.js +1 -0
  291. data/lib/octo/web/version.js +449 -0
  292. data/lib/octo/web/weixin-qr.html +209 -0
  293. data/lib/octo/web/ws-dispatcher.js +357 -0
  294. data/lib/octo/web/ws.js +128 -0
  295. data/lib/octo.rb +145 -0
  296. data/scripts/build/build.sh +329 -0
  297. data/scripts/build/lib/apt.sh +56 -0
  298. data/scripts/build/lib/brew.sh +89 -0
  299. data/scripts/build/lib/colors.sh +17 -0
  300. data/scripts/build/lib/gem.sh +95 -0
  301. data/scripts/build/lib/mise.sh +125 -0
  302. data/scripts/build/lib/network.sh +157 -0
  303. data/scripts/build/lib/os.sh +57 -0
  304. data/scripts/build/lib/shell.sh +37 -0
  305. data/scripts/build/src/install.sh.cc +174 -0
  306. data/scripts/build/src/install_browser.sh.cc +101 -0
  307. data/scripts/build/src/install_full.sh.cc +290 -0
  308. data/scripts/build/src/install_rails_deps.sh.cc +145 -0
  309. data/scripts/build/src/install_system_deps.sh.cc +123 -0
  310. data/scripts/build/src/uninstall.sh.cc +101 -0
  311. data/scripts/install.ps1 +532 -0
  312. data/scripts/install.sh +567 -0
  313. data/scripts/install_browser.sh +479 -0
  314. data/scripts/install_full.sh +838 -0
  315. data/scripts/install_rails_deps.sh +746 -0
  316. data/scripts/install_system_deps.sh +518 -0
  317. data/scripts/uninstall.sh +287 -0
  318. data/sig/octo.rbs +4 -0
  319. metadata +614 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 770adebba9f32b670437aabefb4c8f41241022743245762a993bb5c0da840d09
4
+ data.tar.gz: 843e4cf2cff053026212087c50e06c16799235c5cc803f34ad7e7f20863e75f8
5
+ SHA512:
6
+ metadata.gz: f4633637ee5a0274117f29a5f00ecf97843f104d5e76b58ba00e0a4de5c330f6062e018258e9fc6d8c33ecb2b6672c2adca6f23c9c65c32efe9ab0bbd50d9795
7
+ data.tar.gz: 34bef150d9cda14a477f0a20b974f662a79dbaf9fe25811e3a98d22a27521c2984f8e09b819ade5771322fa19e59bd634183b271bd8ba170012385844c20baf0
@@ -0,0 +1,423 @@
1
+ ---
2
+ ---
3
+ name: commit
4
+ description: Smart Git commit helper that analyzes changes and creates semantic commits
5
+ user-invocable: true
6
+ disable-model-invocation: false
7
+ ---
8
+
9
+ # Smart Commit Skill
10
+
11
+ This skill helps users create well-structured, semantic git commits by analyzing changes and suggesting appropriate commit messages.
12
+
13
+ ## CRITICAL REQUIREMENT: SINGLE-LINE COMMITS ONLY
14
+
15
+ **ALL commit messages created by this skill MUST be single-line only.**
16
+
17
+ - DO: `git commit -m "feat: add user authentication"`
18
+ - DON'T: Multi-line commits with body text
19
+ - DON'T: Multiple `-m` flags
20
+ - DON'T: Commit messages with `\n` or additional paragraphs
21
+
22
+ Keep commits concise and focused. If more detail is needed, suggest adding it separately in PR descriptions or documentation.
23
+
24
+ ## Overview
25
+
26
+ This skill automates the process of reviewing git changes and creating meaningful, conventional commits following the semantic commit format (feat/fix/chore/test).
27
+
28
+ ## Core Philosophy
29
+
30
+ **THINK IN PURPOSES, NOT FILES**
31
+
32
+ This skill prioritizes understanding the OVERALL GOAL of changes before deciding how to commit them. The default approach is to:
33
+ 1. Understand what the developer is trying to achieve
34
+ 2. Group all related changes into meaningful, purpose-driven commits
35
+ 3. Prefer fewer, cohesive commits over many fragmented ones
36
+
37
+ DO NOT commit file-by-file. DO NOT separate tests from implementation. DO NOT fragment features across multiple commits.
38
+
39
+ Instead, ask: "What story do these changes tell?" and commit accordingly.
40
+
41
+ ## Usage
42
+
43
+ To use this skill, simply say:
44
+ - "Help me commit my changes"
45
+ - "Create semantic commits"
46
+ - "Review and commit changes"
47
+ - Use the command: `/commit`
48
+
49
+ ## Process Steps
50
+
51
+ ### 1. Analyze Git Status
52
+
53
+ First, check the current git status to understand:
54
+ - What files have been modified, added, or deleted
55
+ - Which files are staged vs unstaged
56
+ - Overall state of the working directory
57
+
58
+ ```bash
59
+ git status
60
+ git diff --stat
61
+ ```
62
+
63
+ ### 2. HOLISTIC ANALYSIS - Understand the Overall Purpose
64
+
65
+ CRITICAL: Before diving into file-by-file analysis, step back and ask:
66
+
67
+ - What is the developer trying to achieve overall? (e.g., "Add authentication feature", "Fix login bugs", "Refactor database layer")
68
+ - Is there a common theme or goal across these changes?
69
+ - Can multiple changes be explained by a single higher-level purpose?
70
+
71
+ Think strategically, not tactically:
72
+ - BAD: "Changed auth.rb, changed user.rb, changed session.rb" -> 3 separate commits
73
+ - GOOD: "These are all part of implementing user authentication" -> 1 commit
74
+
75
+ Review ALL changes together first:
76
+ ```bash
77
+ # Get overview of all changes
78
+ git diff --stat
79
+ git diff
80
+ ```
81
+
82
+ Look for patterns:
83
+ - Do multiple files serve the same feature?
84
+ - Are there related bug fixes across files?
85
+ - Is there a refactoring that touches multiple files?
86
+ - Are tests accompanying their implementation?
87
+
88
+ ### 3. Review Changes in Detail
89
+
90
+ Now examine each file to understand specifics:
91
+ - The nature of changes (new feature, bug fix, refactoring, tests, documentation)
92
+ - How it connects to the overall purpose identified in step 2
93
+ - Whether it's part of the main change or a separate concern
94
+
95
+ ```bash
96
+ git diff <file>
97
+ ```
98
+
99
+ ### 4. INTELLIGENT GROUPING - Merge Similar Changes
100
+
101
+ CRITICAL PRINCIPLE: Prefer fewer, meaningful commits over many small commits
102
+
103
+ **Grouping Strategy:**
104
+
105
+ 1. **Same Feature/Purpose = One Commit**
106
+ - All files contributing to the same feature should be in ONE commit
107
+ - Tests for a feature belong with the feature implementation
108
+ - Related configuration changes belong with the feature
109
+
110
+ 2. **Ask: "Would I explain these separately in a code review?"**
111
+ - If you'd say "I added X, Y, and Z as part of feature F" -> ONE commit
112
+ - If you'd say "I added X, and separately I fixed Y" -> TWO commits
113
+
114
+ 3. **Look for these grouping opportunities:**
115
+ - Feature + Tests: Always together
116
+ - Implementation across multiple files: One commit if same feature
117
+ - Bug fix + Test: Together if addressing same issue
118
+ - Refactoring across modules: One commit if same refactoring goal
119
+ - Documentation + Code: Together if documenting the same change
120
+ - Configuration + Code: Together if config is required for the code
121
+
122
+ 4. **Only split when:**
123
+ - Changes serve genuinely different purposes
124
+ - Mixing would make the commit unclear or too broad
125
+ - One change is risky and should be isolated
126
+ - Different semantic types that shouldn't mix (feat vs fix vs chore)
127
+
128
+ **Examples of Good Grouping:**
129
+
130
+ GOOD - Merged into ONE commit:
131
+ ```
132
+ Commit: feat: add user authentication
133
+ - lib/auth/authenticator.rb (new authentication logic)
134
+ - lib/user.rb (user model updates)
135
+ - lib/session.rb (session management)
136
+ - spec/auth/authenticator_spec.rb (tests)
137
+ - spec/user_spec.rb (updated tests)
138
+ - config/routes.rb (auth routes)
139
+ ```
140
+
141
+ GOOD - Different purposes, TWO commits:
142
+ ```
143
+ Commit 1: feat: add user authentication
144
+ - lib/auth/authenticator.rb
145
+ - spec/auth/authenticator_spec.rb
146
+
147
+ Commit 2: fix: resolve database timeout issue
148
+ - lib/database/connection.rb
149
+ - spec/database/connection_spec.rb
150
+ ```
151
+
152
+ BAD - Over-splitting, should be ONE commit:
153
+ ```
154
+ Commit 1: feat: add authentication logic
155
+ - lib/auth/authenticator.rb
156
+
157
+ Commit 2: feat: update user model for authentication
158
+ - lib/user.rb
159
+
160
+ Commit 3: test: add authentication tests
161
+ - spec/auth/authenticator_spec.rb
162
+
163
+ Commit 4: chore: add authentication routes
164
+ - config/routes.rb
165
+ ```
166
+
167
+ **Decision Tree:**
168
+ ```
169
+ Are changes related to the same goal/feature/purpose?
170
+ |-- YES -> Combine into ONE commit
171
+ | +-- Even if they touch different files/modules
172
+ +-- NO -> Keep as separate commits
173
+ +-- Ask: Are they different semantic types (feat/fix/chore)?
174
+ |-- YES -> Definitely separate
175
+ +-- NO -> Consider if they could still be combined
176
+ ```
177
+
178
+ ### 5. Generate Commit Messages
179
+
180
+ Based on the holistic analysis, generate commit messages following the conventional commit format:
181
+
182
+ **Format**: `<type>: <description>`
183
+
184
+ **Types**:
185
+ - `feat`: New features or functionality
186
+ - `fix`: Bug fixes
187
+ - `chore`: Routine tasks, maintenance, dependencies
188
+ - `test`: Adding or modifying tests (only if standalone)
189
+ - `docs`: Documentation changes (only if standalone)
190
+ - `refactor`: Code refactoring without changing functionality
191
+ - `style`: Code style changes (formatting, whitespace)
192
+ - `perf`: Performance improvements
193
+
194
+ **CRITICAL GUIDELINES**:
195
+ - **MUST BE SINGLE-LINE**: Commit messages MUST be a single line only. DO NOT create multi-line commit messages.
196
+ - Keep messages concise (ideally under 50 characters)
197
+ - Use imperative mood ("add feature" not "added feature")
198
+ - Don't end with a period
199
+ - Be specific but brief
200
+ - **One logical PURPOSE per commit** (not one file per commit)
201
+ - Describe the overall goal, not implementation details
202
+ - If more detail is needed, suggest adding it in PR description or commit body separately, but the initial commit MUST be single-line
203
+
204
+ **Examples**:
205
+ - `feat: add user authentication` (not "add authenticator.rb, user.rb, session.rb")
206
+ - `fix: resolve login timeout issues` (not "fix auth.rb timeout")
207
+ - `chore: update dependencies` (not separate commits for each gem)
208
+ - `refactor: simplify database connection logic` (not one commit per file)
209
+ - `docs: update API documentation` (only if pure documentation change)
210
+
211
+ ### 6. Execute Commits Immediately
212
+
213
+ No confirmation needed — analyze, group, and commit right away.
214
+
215
+ For each commit group:
216
+ ```bash
217
+ # Stage specific files
218
+ git add <file1> <file2> ...
219
+
220
+ # Create commit with SINGLE-LINE message only
221
+ git commit -m "<type>: <description>"
222
+ ```
223
+
224
+ **IMPORTANT**:
225
+ - Use ONLY `git commit -m "single line message"` format
226
+ - DO NOT use multi-line commits with additional body text
227
+ - DO NOT use `-m` flag multiple times
228
+ - Keep the commit message as a single, concise line
229
+
230
+ ### 7. Final Summary
231
+
232
+ After all commits, show:
233
+ - Total number of commits created
234
+ - Each commit hash + message
235
+ - Suggest next steps (e.g., git push)
236
+
237
+ ## Commands Used
238
+
239
+ ```bash
240
+ # Check status
241
+ git status
242
+ git status --short
243
+
244
+ # View changes
245
+ git diff
246
+ git diff --stat
247
+ git diff <file>
248
+
249
+ # Stage files
250
+ git add <file>
251
+
252
+ # Create commit (SINGLE-LINE only)
253
+ git commit -m "type: single line description"
254
+
255
+ # NEVER use multi-line format like:
256
+ # git commit -m "title" -m "body" -- DON'T DO THIS
257
+ # git commit -m "title\n\nbody" -- DON'T DO THIS
258
+
259
+ # View commit history
260
+ git log --oneline -n 5
261
+ ```
262
+
263
+ ## Workflow Example
264
+
265
+ BAD Example (Over-splitting):
266
+ ```
267
+ User: /commit
268
+
269
+ AI (WRONG APPROACH):
270
+ Found 5 modified files
271
+
272
+ Proposed commits:
273
+ Commit 1: feat: add user model
274
+ - lib/user.rb
275
+ Commit 2: test: add user tests
276
+ - spec/user_spec.rb
277
+ Commit 3: fix: fix auth validation
278
+ - lib/auth.rb
279
+ Commit 4: test: add auth tests
280
+ - spec/auth_spec.rb
281
+ Commit 5: chore: update dependencies
282
+ - Gemfile
283
+
284
+ Problem: Too fragmented! Tests separated from code.
285
+ ```
286
+
287
+ GOOD Example (Holistic grouping):
288
+ ```
289
+ User: /commit
290
+
291
+ AI (CORRECT APPROACH):
292
+ 1. Analyzing all changes...
293
+ Found 5 modified files
294
+
295
+ 2. Identifying overall purpose...
296
+ Main goal: Implementing user registration feature
297
+ Secondary: Fixing existing auth bug
298
+ Maintenance: Dependency updates
299
+
300
+ 3. Holistic analysis:
301
+ - lib/user.rb: New user registration feature
302
+ - spec/user_spec.rb: Tests for user registration (same feature)
303
+ - lib/auth.rb: Fix password validation bug (separate concern)
304
+ - spec/auth_spec.rb: Tests for auth fix (same bug fix)
305
+ - Gemfile: Updated dependencies (separate maintenance)
306
+
307
+ 4. Proposed commits (grouped by purpose):
308
+
309
+ Commit 1: feat: add user registration
310
+ - lib/user.rb (implementation)
311
+ - spec/user_spec.rb (tests)
312
+
313
+ Reason: Feature and its tests belong together
314
+
315
+ Commit 2: fix: correct password validation logic
316
+ - lib/auth.rb (bug fix)
317
+ - spec/auth_spec.rb (tests)
318
+
319
+ Reason: Fix and its tests belong together
320
+
321
+ Commit 3: chore: update gem dependencies
322
+ - Gemfile
323
+
324
+ Reason: Unrelated maintenance task
325
+
326
+ Total: 3 meaningful commits instead of 5 fragmented ones
327
+
328
+ AI (executes immediately, no confirmation):
329
+ Commit 1 created (a1b2c3d): feat: add user registration
330
+ Commit 2 created (e4f5g6h): fix: correct password validation logic
331
+ Commit 3 created (i7j8k9l): chore: update gem dependencies
332
+
333
+ Summary: 3 commits created successfully!
334
+ Next steps: Review with 'git log' or push with 'git push'
335
+ ```
336
+
337
+ ## Best Practices
338
+
339
+ ### Commit Message Rules
340
+ - **MUST be single-line only** - Never use multi-line commit messages
341
+ - Start with lowercase (except proper nouns)
342
+ - Use present tense imperative
343
+ - Be specific but concise
344
+ - Focus on "what" and "why", not "how"
345
+ - Maximum 72 characters for the single line
346
+
347
+ ### Commit Organization - THINK PURPOSE, NOT FILES
348
+
349
+ **GOLDEN RULE: One logical PURPOSE per commit, not one FILE per commit**
350
+
351
+ ### When to COMBINE Changes (Default Approach)
352
+ - **Feature implementation + its tests** (ALWAYS together)
353
+ - **Multiple files serving the same feature** (one commit)
354
+ - **Bug fix + its test** (ALWAYS together)
355
+ - **Code + required configuration** (together if config enables the code)
356
+ - **Refactoring across multiple files** (one commit if same refactoring goal)
357
+ - **Documentation + code it documents** (together if part of same change)
358
+ - **Related files in same module/feature** (one commit)
359
+
360
+ ### When to SPLIT Commits (Exception Cases)
361
+ - **Truly different purposes**: e.g., "add feature X" vs "fix bug Y"
362
+ - **Different semantic types**: feat vs fix vs chore (usually)
363
+ - **Risky changes**: isolate if one change is experimental
364
+ - **Independent concerns**: changes that could be deployed separately
365
+ - **Too broad scope**: if one commit does too many unrelated things
366
+
367
+ ### Anti-Patterns to Avoid
368
+ - NEVER split implementation and tests into separate commits
369
+ - NEVER create one commit per file unless files are truly independent
370
+ - NEVER split configuration from the code that requires it
371
+ - NEVER fragment a feature into multiple commits just because it touches multiple files
372
+
373
+ ### Decision Framework
374
+ ```
375
+ For each set of changes, ask:
376
+ 1. "What was I trying to accomplish?" (identify the purpose)
377
+ 2. "Do these files work together toward that purpose?" (YES -> combine)
378
+ 3. "Would splitting these make the history harder to understand?" (YES -> combine)
379
+ 4. "Could these changes be deployed independently?" (NO -> combine)
380
+ ```
381
+
382
+ ## Error Handling
383
+
384
+ - **No changes detected**: Inform user and exit gracefully
385
+ - **Merge conflicts**: Warn user to resolve conflicts first
386
+ - **Detached HEAD**: Alert user about repository state
387
+ - **Uncommitted changes during conflict**: Suggest stashing or committing
388
+ - **Empty commit message**: Request user input for clarification
389
+
390
+ ## Safety Features
391
+
392
+ - Always review changes before committing (read diffs first)
393
+ - Execute commits immediately after analysis — no confirmation step
394
+ - Preserve git history integrity
395
+
396
+ ## Integration with Workflow
397
+
398
+ This skill works best:
399
+ - After completing a feature or fix
400
+ - Before pushing to remote
401
+ - During code review preparation
402
+ - When cleaning up messy commit history (use with `git reset` first)
403
+
404
+ ## Notes
405
+
406
+ - This skill does NOT push commits (user controls when to push)
407
+ - Follows conventional commits specification
408
+ - Encourages atomic, well-documented commits
409
+ - Helps maintain clean git history
410
+ - Useful for both beginners and experienced developers
411
+
412
+ ## Dependencies
413
+
414
+ - Git installed and configured
415
+ - Working directory is a git repository
416
+ - User has permissions to commit
417
+ - Changes exist to commit
418
+
419
+ ## Version History
420
+
421
+ - Created: 2025-02-01
422
+ - Purpose: Improve commit quality and development workflow
423
+ - Compatible with: Any git repository
@@ -0,0 +1,199 @@
1
+ ---
2
+ name: gem-release
3
+ description: >-
4
+ Automates the complete process of releasing a new version of the octo Ruby
5
+ gem. Supports both stable releases (auto-increment) and pre-release versions
6
+ (user-specified, e.g., 1.0.0.beta.1). Handles version bumping, testing, building,
7
+ RubyGems publishing, GitHub Releases, and OSS CDN mirroring.
8
+ disable-model-invocation: false
9
+ user-invocable: true
10
+ ---
11
+
12
+ # Gem Release Skill
13
+
14
+ Automates the complete octo gem release workflow via `SKILL_DIR/scripts/release.sh`.
15
+
16
+ ## Usage
17
+
18
+ - "Release a new version"
19
+ - "Publish a new gem version"
20
+ - "Release version 1.0.0.beta.1" (pre-release with explicit version)
21
+ - `/gem-release`
22
+
23
+ ## Workflow
24
+
25
+ The release script (`SKILL_DIR/scripts/release.sh`) handles everything end-to-end:
26
+
27
+ 1. Pre-release checks (clean working directory, required tools)
28
+ 2. Run test suite (`bundle exec rspec`)
29
+ 3. Bump version in `lib/octo/version.rb`
30
+ 4. Update `Gemfile.lock` via `bundle install`
31
+ 5. Commit and push to origin, wait for CI
32
+ 6. Build gem (`gem build octo.gemspec`)
33
+ 7. Publish to RubyGems (`gem push`)
34
+ 8. Create git tag and push
35
+ 9. Create GitHub Release with .gem asset (uses CHANGELOG.md for notes)
36
+ 10. Upload .gem to Tencent Cloud OSS CDN
37
+ 11. Update `latest.txt` on OSS (stable only, unless `--update-latest`)
38
+ 12. Rebuild and sync `scripts/` to OSS
39
+ 13. Cleanup build artifacts
40
+
41
+ ## Agent Instructions
42
+
43
+ ### 1. Determine version and release type
44
+
45
+ Read current version:
46
+ ```bash
47
+ grep 'VERSION =' lib/octo/version.rb
48
+ ```
49
+
50
+ **Stable release (default):** Increment patch version (e.g., `1.0.5` → `1.0.6`). Confirm with user if unsure which part to bump (major/minor/patch).
51
+
52
+ **Pre-release:** Use the exact version the user specified (e.g., `2.0.0.beta.1`). Before proceeding, warn about pre-release caveats (see section below).
53
+
54
+ ### 2. Write CHANGELOG
55
+
56
+ This is the one step the agent handles manually — the script does not write changelog entries because it requires reviewing git history and exercising judgment.
57
+
58
+ 1. Find the previous version tag:
59
+ ```bash
60
+ git describe --tags --abbrev=0
61
+ ```
62
+
63
+ 2. Gather commits since last release:
64
+ ```bash
65
+ git log <previous_tag>..HEAD --oneline
66
+ ```
67
+
68
+ 3. Write a new section in `CHANGELOG.md` following this format:
69
+ ```markdown
70
+ ## [X.Y.Z] - YYYY-MM-DD
71
+
72
+ ### Added
73
+ - Feature description
74
+
75
+ ### Improved
76
+ - Enhancement description
77
+
78
+ ### Fixed
79
+ - Bug fix description
80
+
81
+ ### More
82
+ - Minor items
83
+ ```
84
+
85
+ 4. Categorization rules:
86
+ - Each commit with **independent user-facing value** gets its own bullet — don't over-merge commits sharing a theme
87
+ - Use imperative mood ("Add" not "Added")
88
+ - Place user-facing value at the top
89
+ - Skip trivial commits (typos, minor formatting)
90
+ - Sanity check: count `### Added` bullets vs `feat:` commits — if commits > bullets, you likely merged too aggressively
91
+
92
+ 5. Commit the changelog:
93
+ ```bash
94
+ git add CHANGELOG.md
95
+ git commit -m "docs: update CHANGELOG for v<version>"
96
+ ```
97
+
98
+ ### 3. Run the release script
99
+
100
+ **Stable release:**
101
+ ```bash
102
+ bash "SKILL_DIR/scripts/release.sh" <version>
103
+ ```
104
+
105
+ **Pre-release (skip latest.txt):**
106
+ ```bash
107
+ bash "SKILL_DIR/scripts/release.sh" <version> --prerelease
108
+ ```
109
+
110
+ **Pre-release (update latest.txt — only if user explicitly requested):**
111
+ ```bash
112
+ bash "SKILL_DIR/scripts/release.sh" <version> --prerelease --update-latest
113
+ ```
114
+
115
+ **Dry run (preview only):**
116
+ ```bash
117
+ bash "SKILL_DIR/scripts/release.sh" <version> --dry-run
118
+ ```
119
+
120
+ The script runs all steps sequentially and stops on any failure. Monitor the output — if a step fails, diagnose and fix before retrying.
121
+
122
+ ### 4. Present release summary
123
+
124
+ After the script completes successfully, present a concise summary. The output will often be read in WeChat, so keep it compact and avoid template-like formatting that triggers message folding.
125
+
126
+ Rules:
127
+ - No emojis
128
+ - No tables (use a compact list if you need to list items)
129
+ - No multi-line code blocks
130
+ - Write as a natural, flowing message — not a structured report
131
+ - Skip "More" / chore items unless they directly affect users
132
+ - Write from the user's perspective — what they can now do, or what problem is fixed
133
+ - Translate technical terms into plain language
134
+ - Keep each item one sentence, action-oriented
135
+
136
+ Format (flexible — adapt as needed, but roughly):
137
+
138
+ ```
139
+ v{version} released.
140
+
141
+ [One sentence highlight — the biggest user-visible change.]
142
+
143
+ Added:
144
+ - [translate each "Added" item]
145
+ - ...
146
+
147
+ Improved:
148
+ - [translate each "Improved" item]
149
+ - ...
150
+
151
+ Fixed:
152
+ - [translate each "Fixed" item]
153
+ - ...
154
+
155
+ Upgrade: click "Upgrade" in Web UI bottom-left, or `gem update octo`
156
+ Fresh install: curl -sSL https://raw.githubusercontent.com/octo-ai/octo/main/scripts/install.sh | bash
157
+
158
+ RubyGems: https://rubygems.org/gems/octo/versions/{version}
159
+ GitHub: https://github.com/octo-ai/octo/releases/tag/v{version}
160
+ ```
161
+
162
+ ## Pre-Release Caveats
163
+
164
+ When releasing a pre-release version, inform the user of these behaviors:
165
+
166
+ | Concern | Behavior | Impact |
167
+ |---------|----------|--------|
168
+ | **Version check notification** | `Gem::Version("0.9.38") < Gem::Version("1.0.0.beta.1")` is true | The upgrade dot WILL appear in the Web UI for most users |
169
+ | **`gem update` (official source)** | Does NOT install prereleases without `--pre` | Users who click "Upgrade" will see notification but upgrade silently does nothing |
170
+ | **OSS CDN upgrade (mirror users)** | Downloads exact `.gem` from `latest.txt` | If latest.txt points to prerelease, mirror users WILL get the beta |
171
+ | **OSS `latest.txt`** | Fresh installs fetch latest.txt | By default, do NOT update latest.txt for pre-releases |
172
+
173
+ Ask the user whether to use `--update-latest` before running the script.
174
+
175
+ ## Error Handling
176
+
177
+ The script uses `set -euo pipefail` and stops on any failure. Common issues:
178
+
179
+ - **Tests fail** → fix tests before re-running
180
+ - **CI fails** → script pushes then watches CI; fix and re-push if needed
181
+ - **gem push fails** → check RubyGems credentials (`gem signin`)
182
+ - **gh release fails** → check `gh auth status`
183
+ - **coscli fails** → check `~/.cos.yaml` config
184
+
185
+ After fixing an issue, you can re-run the script — it's safe to retry. If a partial release happened (e.g., gem pushed but tag not created), handle remaining steps manually.
186
+
187
+ ## File Locations
188
+
189
+ - Release script: `SKILL_DIR/scripts/release.sh`
190
+ - Version file: `lib/octo/version.rb`
191
+ - Gem specification: `octo.gemspec`
192
+ - Changelog: `CHANGELOG.md`
193
+
194
+ ## Dependencies
195
+
196
+ - Ruby >= 3.1.0, Bundler, RSpec
197
+ - `gh` CLI installed and authenticated
198
+ - `coscli` installed at `/usr/local/bin/coscli` with `~/.cos.yaml`
199
+ - RubyGems push credentials