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
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ opening an issue at https://github.com/octo-ai/open-octo/issues.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,92 @@
1
+ # Contributing to Octo
2
+
3
+ Thanks for taking the time to contribute. Every PR will be reviewed. We evaluate
4
+ each contribution along three dimensions:
5
+
6
+ 1. **Value of the need** — is this useful, and to whom?
7
+ 2. **Architectural impact** — does it fit the existing design?
8
+ 3. **Code standards** — does it meet our quality bar?
9
+
10
+ Read the sections below before opening a PR. If your contribution clearly
11
+ delivers outsized value, the rules here can bend — see [Exceptions](#exceptions).
12
+
13
+ ---
14
+
15
+ ## 1. Architecture First
16
+
17
+ Improvements built on top of the existing, stable architecture are accepted
18
+ quickly. By "stable architecture" we mean a change that:
19
+
20
+ - Solves the need with the **smallest possible diff**.
21
+ - **Adds no new configuration knobs** unless strictly required.
22
+ - **Adds no new dependencies** unless strictly required (see also §3).
23
+ - **Respects the existing design intent** — same layering, same abstractions,
24
+ same naming conventions.
25
+ - Ideally **simplifies** the architecture rather than expanding it.
26
+
27
+ PRs that introduce parallel mechanisms, speculative abstractions, or "just in
28
+ case" flexibility will be sent back for trimming.
29
+
30
+ ## 2. Needs Should Be Shared and Side-Effect-Free
31
+
32
+ We prefer changes that benefit **most users** and have **no side effects** on
33
+ others.
34
+
35
+ - **Common needs** (broadly applicable, opt-in by nature, isolated blast
36
+ radius) → fast track.
37
+ - **Niche needs** (valuable to a few, but with potential to affect others'
38
+ workflows, performance, or defaults) → reviewed more cautiously. Expect
39
+ questions about scope, defaults, and rollout.
40
+
41
+ If your change alters existing default behavior, call it out explicitly in the
42
+ PR description.
43
+
44
+ ## 3. Code Standards
45
+
46
+ ### Tests
47
+
48
+ - All tests **must pass** before a PR can be merged.
49
+ - **Coverage must not drop.** New code needs new tests.
50
+
51
+ ### Commits & PRs
52
+
53
+ - **Write commit messages and PR titles/descriptions in English.** This applies
54
+ to everyone, regardless of working language.
55
+ - Keep commits focused; squash noise before requesting review.
56
+ - PR descriptions should briefly state: what, why, and any user-visible impact.
57
+
58
+ ### Built with Octo
59
+
60
+ - PRs **authored using Octo itself** are prioritized for review and
61
+ merge. Mention it in the PR description if applicable. We dogfood our own
62
+ tool.
63
+
64
+ ### Dependencies
65
+
66
+ - **Avoid adding new libraries.** Prefer the standard library, existing
67
+ dependencies, or a few lines of code over pulling in another gem/package.
68
+ - If a new dependency is genuinely necessary, justify it in the PR description:
69
+ why this library, why not write it ourselves, license, maintenance status.
70
+
71
+ ### Style
72
+
73
+ - Follow the conventions already present in the file you're editing.
74
+ - See each sub-project's `.octorules` for project-specific rules
75
+ (`octo/`, `platform/`, `installer/`).
76
+
77
+ ---
78
+
79
+ ## Exceptions
80
+
81
+ Rules exist to keep the project healthy, not to block valuable work. For
82
+ contributions that deliver **substantial, clear value**, the standards above
83
+ can be relaxed at the maintainers' discretion. When in doubt, open an issue or
84
+ draft PR first to discuss the trade-offs.
85
+
86
+ ---
87
+
88
+ ## Code of Conduct
89
+
90
+ Participation in this project is governed by the
91
+ [Code of Conduct](./CODE_OF_CONDUCT.md). By contributing, you agree to uphold
92
+ it.
data/Dockerfile ADDED
@@ -0,0 +1,28 @@
1
+ FROM ruby:3.4.4-slim AS builder
2
+
3
+ RUN apt-get update && apt-get install -y \
4
+ build-essential \
5
+ curl \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ RUN gem install openclacky --no-document
9
+
10
+ FROM ruby:3.4.4-slim
11
+
12
+ RUN apt-get update && apt-get install -y \
13
+ git \
14
+ curl \
15
+ python3 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ COPY --from=builder /usr/local/bundle /usr/local/bundle
19
+
20
+ RUN curl https://mise.run | sh
21
+ ENV PATH="/root/.local/bin:$PATH"
22
+
23
+ VOLUME ["/root/.clacky"]
24
+
25
+ EXPOSE 7070
26
+
27
+ ENTRYPOINT ["openclacky"]
28
+ CMD ["server", "--host", "0.0.0.0"]
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 windy
4
+ Copyright (c) 2026 Leihb (roy)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
data/POSITIONING.md ADDED
@@ -0,0 +1,46 @@
1
+ # Octo Positioning
2
+
3
+ ## What Octo Is
4
+
5
+ An AI agent that puts **functionality first** — with three equal interfaces.
6
+
7
+ - **Three faces, one agent**: CLI, Web, and IM are all first-class citizens with identical capabilities. No interface is secondary, no interface is an afterthought
8
+ - **Standard skills**: Compatible with Claude Code skill format — install any community skill without friction
9
+ - **Token-pragmatic**: Uses tokens wisely, but never at the expense of getting the job done right
10
+
11
+ ## What Octo Is Not
12
+
13
+ - **Not a token-minimization obsession**: We don't sacrifice functionality to save cents
14
+ - **Not web-first**: No master-worker architecture imposed on local usage
15
+ - **Not a marketplace**: No encrypted skills, no creator center, no commercial skill ecosystem
16
+ - **Not a billing dashboard**: Cost tracking is minimal; we assume you're on a coding plan
17
+
18
+ ## Core Principles
19
+
20
+ 1. **Function over frugality** — A working solution that costs 2x tokens is better than a broken one that saves tokens
21
+ 2. **Interface equality** — CLI, Web, and IM are all first-class citizens with equal capabilities
22
+ 3. **Open ecosystem** — Skills follow standard formats; no vendor lock-in
23
+ 4. **Developer ergonomics** — Configuration is simple, defaults are sensible, documentation is honest
24
+
25
+ ## Relationship to Upstream
26
+
27
+ Octo started from octo but diverges on product philosophy:
28
+
29
+ | Aspect | octo | Octo |
30
+ |--------|-----------|------|
31
+ | Primary goal | Minimize token usage | Maximize task completion quality |
32
+ | Architecture | Web master-worker | Local-first, distributed-capable |
33
+ | Skill format | Custom encrypted | Standard Claude Code compatible |
34
+ | Commercial features | Billing, creator center | None |
35
+ | CLI status | Secondary | First-class |
36
+ | Web status | Primary | First-class |
37
+ | IM status | Feature-limited | First-class |
38
+
39
+ ## Target User
40
+
41
+ Developers who want an AI agent that:
42
+ - Works reliably in the terminal
43
+ - Serves a clean web UI when they want one
44
+ - Answers messages in Slack/Discord/Feishu with the same capabilities
45
+ - Doesn't nag about token costs
46
+ - Can install any skill from the community
data/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # Octo
2
+
3
+ [![Build](https://img.shields.io/github/actions/workflow/status/Leihb/octo/main.yml?label=build&style=flat-square)](https://github.com/Leihb/octo/actions)
4
+ [![Release](https://img.shields.io/gem/v/octo?label=release&style=flat-square&color=blue)](https://rubygems.org/gems/octo)
5
+ [![Ruby](https://img.shields.io/badge/ruby-%3E%3D%203.1.0-red?style=flat-square)](https://www.ruby-lang.org)
6
+ [![License](https://img.shields.io/badge/license-MIT-lightgrey?style=flat-square)](LICENSE.txt)
7
+
8
+ <p align="center">
9
+ <a href="README.md">English</a> · <a href="README_CN.md">简体中文</a>
10
+ </p>
11
+
12
+ > This project is a hard fork of [clacky-ai/openclacky](https://github.com/clacky-ai/openclacky). The original MIT copyright is preserved in [LICENSE.txt](LICENSE.txt); modifications are © 2026 Leihb (roy).
13
+
14
+ A **functionality-first** AI agent with three equal interfaces.
15
+
16
+ Octo is a Ruby tool for interacting with AI models. It speaks **Anthropic Messages**, **OpenAI** (Chat Completions + Responses), and **AWS Bedrock** natively, and works with any other provider that exposes one of those API shapes. It provides chat functionality and autonomous AI agent capabilities with tool use. Use it in the **terminal**, in a **web browser**, or through **instant messaging** — all three interfaces are first-class citizens with identical capabilities.
17
+
18
+ ## Philosophy
19
+
20
+ - **Three faces, one agent** — CLI, Web, and IM are all first-class. No interface is secondary
21
+ - **Open skills** — Compatible with Claude Code skill format. Install any community skill without friction
22
+ - **Token-pragmatic** — Uses tokens wisely, but never at the expense of getting the job done right
23
+
24
+ ## What Octo Is Not
25
+
26
+ - Not a token-minimization obsession — functionality comes first
27
+ - Not web-first — no master-worker architecture imposed on local CLI usage
28
+ - Not a marketplace — no encrypted skills, no commercial skill ecosystem
29
+
30
+ ## Features
31
+
32
+ | Feature | Description |
33
+ |---|---|
34
+ | **Interactive CLI** | Start an agent session directly in your terminal |
35
+ | **Web UI** | Full chat interface with multi-session support at `localhost:7070` |
36
+ | **IM Integration** | Feishu, WeCom, WeChat, Discord, Telegram — all with full parity |
37
+ | **Skills** | Install, create, and evolve skills in standard Markdown format |
38
+ | **BYOK** | Bring your own API key — any Anthropic / OpenAI / Bedrock-compatible model |
39
+ | **Autonomous agent** | ReAct pattern with tool execution for complex tasks |
40
+
41
+ ## Installation
42
+
43
+ ### RubyGem
44
+
45
+ Requires Ruby >= 3.1.0
46
+
47
+ ```bash
48
+ gem install octo
49
+ ```
50
+
51
+ ### One-line installer (macOS / Ubuntu)
52
+
53
+ ```bash
54
+ /bin/bash -c "$(curl -sSL https://raw.githubusercontent.com/Leihb/octo/main/scripts/install.sh)"
55
+ ```
56
+
57
+ ### Windows
58
+
59
+ ```powershell
60
+ powershell -c "& ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/Leihb/octo/main/scripts/install.ps1')))"
61
+ ```
62
+
63
+ ## Quick Start
64
+
65
+ ### Terminal
66
+
67
+ ```bash
68
+ octo # start interactive agent in current directory
69
+ ```
70
+
71
+ ### Web UI
72
+
73
+ ```bash
74
+ octo server # default: http://localhost:7070
75
+ ```
76
+
77
+ Options:
78
+
79
+ ```bash
80
+ octo server --port 8080 # custom port
81
+ octo server --host 0.0.0.0 # listen on all interfaces
82
+ ```
83
+
84
+ ### Configuration
85
+
86
+ ```bash
87
+ $ octo
88
+ > /config
89
+ ```
90
+
91
+ Set your **API Key**, **Model**, and **Base URL**. Octo routes each model to its native protocol — Anthropic Messages, OpenAI (Chat Completions / Responses), or AWS Bedrock — so you keep features like Claude's `cache_control` byte-for-byte instead of going through a lossy OpenAI shim.
92
+
93
+ Supported out of the box: **Claude (Anthropic) · GPT (OpenAI) · DeepSeek · Kimi (Moonshot) · MiniMax · OpenRouter · AWS Bedrock · Qwen** — or any custom endpoint that speaks one of the three protocols.
94
+
95
+ ## Skills
96
+
97
+ Skills are the primary way to extend Octo's capabilities. A skill is a Markdown instruction file that guides the agent to accomplish a specific task using existing tools.
98
+
99
+ - **Invoke with `/`** — fuzzy search and call any installed skill
100
+ - **Create in natural language** — describe what you want; the agent drafts `SKILL.md`
101
+ - **Self-evolving** — skills improve based on execution context and results
102
+ - **Open format** — compatible with Claude Code / Markdown Pack / custom formats
103
+
104
+ Skill directories:
105
+
106
+ - Built-in: `lib/octo/default_skills/`
107
+ - Project-level: `.octo/skills/`
108
+ - User-level: `~/.octo/skills/`
109
+
110
+ ## Example Usage
111
+
112
+ ```bash
113
+ $ octo
114
+ > /new my-app # scaffold a new project
115
+ > Add user auth with email and password
116
+ > How does the payment module work?
117
+ ```
118
+
119
+ ## Install from Source
120
+
121
+ ```bash
122
+ git clone https://github.com/Leihb/octo.git
123
+ cd octo
124
+ bundle install
125
+ bin/octo
126
+ ```
127
+
128
+ ## Contributing
129
+
130
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Leihb/octo. Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening a PR.
131
+
132
+ ## License
133
+
134
+ Available as open source under the [MIT License](https://opensource.org/licenses/MIT).
data/README_CN.md ADDED
@@ -0,0 +1,134 @@
1
+ # Octo
2
+
3
+ [![Build](https://img.shields.io/github/actions/workflow/status/Leihb/octo/main.yml?label=build&style=flat-square)](https://github.com/Leihb/octo/actions)
4
+ [![Release](https://img.shields.io/gem/v/octo?label=release&style=flat-square&color=blue)](https://rubygems.org/gems/octo)
5
+ [![Ruby](https://img.shields.io/badge/ruby-%3E%3D%203.1.0-red?style=flat-square)](https://www.ruby-lang.org)
6
+ [![License](https://img.shields.io/badge/license-MIT-lightgrey?style=flat-square)](LICENSE.txt)
7
+
8
+ <p align="center">
9
+ <a href="README.md">English</a> · <a href="README_CN.md">简体中文</a>
10
+ </p>
11
+
12
+ > 本项目硬分叉自 [clacky-ai/openclacky](https://github.com/clacky-ai/openclacky)。上游 MIT 协议及原作者版权完整保留于 [LICENSE.txt](LICENSE.txt);后续修改 © 2026 Leihb (roy)。
13
+
14
+ 一个**功能优先**的 AI Agent,三种界面一视同仁。
15
+
16
+ Octo 是一个 Ruby 工具,用于与 AI 模型交互。原生支持 **Anthropic Messages**、**OpenAI**(Chat Completions + Responses)和 **AWS Bedrock** 三套 API 协议,也兼容任何复用这些协议的第三方端点。提供聊天功能和具备工具执行能力的自主 AI Agent。你可以在**终端**、**浏览器**或**即时通讯**中使用它 —— 三种界面都是一等公民,能力完全相同。
17
+
18
+ ## 理念
19
+
20
+ - **三面一体** — CLI、Web、IM 都是一等公民,没有次要界面
21
+ - **开放技能** — 兼容 Claude Code 技能格式,无缝安装社区技能
22
+ - **Token 务实** — 合理使用 token,但绝不为了省钱而牺牲功能正确性
23
+
24
+ ## Octo 不是什么
25
+
26
+ - 不是 token 最小化执念 — 功能优先
27
+ - 不是 web 优先 — 本地 CLI 使用不受主从架构约束
28
+ - 不是应用市场 — 没有加密技能,没有商业化技能生态
29
+
30
+ ## 特性
31
+
32
+ | 特性 | 说明 |
33
+ |---|---|
34
+ | **交互式 CLI** | 直接在终端启动 Agent 会话 |
35
+ | **Web UI** | 完整的聊天界面,支持多 Session,`localhost:7070` |
36
+ | **IM 集成** | 飞书、企微、微信、Discord、Telegram —— 全部能力对等 |
37
+ | **Skills** | 以标准 Markdown 格式安装、创建和进化技能 |
38
+ | **BYOK** | 自带 API Key —— 任意 Anthropic / OpenAI / Bedrock 协议模型 |
39
+ | **自主 Agent** | ReAct 模式配合工具执行,处理复杂任务 |
40
+
41
+ ## 安装
42
+
43
+ ### RubyGem
44
+
45
+ 需要 Ruby >= 3.1.0
46
+
47
+ ```bash
48
+ gem install octo
49
+ ```
50
+
51
+ ### 一键安装(macOS / Ubuntu)
52
+
53
+ ```bash
54
+ /bin/bash -c "$(curl -sSL https://raw.githubusercontent.com/Leihb/octo/main/scripts/install.sh)"
55
+ ```
56
+
57
+ ### Windows
58
+
59
+ ```powershell
60
+ powershell -c "& ([scriptblock]::Create((irm 'https://raw.githubusercontent.com/Leihb/octo/main/scripts/install.ps1')))"
61
+ ```
62
+
63
+ ## 快速开始
64
+
65
+ ### 终端
66
+
67
+ ```bash
68
+ octo # 在当前目录启动交互式 Agent
69
+ ```
70
+
71
+ ### Web UI
72
+
73
+ ```bash
74
+ octo server # 默认地址:http://localhost:7070
75
+ ```
76
+
77
+ 选项:
78
+
79
+ ```bash
80
+ octo server --port 8080 # 自定义端口
81
+ octo server --host 0.0.0.0 # 监听所有接口
82
+ ```
83
+
84
+ ### 配置
85
+
86
+ ```bash
87
+ $ octo
88
+ > /config
89
+ ```
90
+
91
+ 设置你的 **API Key**、**模型**和 **Base URL**。Octo 会按模型分发到对应的原生协议 —— Anthropic Messages、OpenAI(Chat Completions / Responses)或 AWS Bedrock,避免走 OpenAI 兼容 shim 时丢失 Claude `cache_control` 等特性。
92
+
93
+ 开箱即支持:**Claude (Anthropic) · GPT (OpenAI) · DeepSeek · Kimi (Moonshot) · MiniMax · OpenRouter · AWS Bedrock · Qwen**,或任意走上述三种协议之一的自定义端点。
94
+
95
+ ## Skills
96
+
97
+ Skills 是扩展 Octo 能力的主要方式。一个 skill 是一份 Markdown 指令文件,指导 Agent 使用现有工具完成特定任务。
98
+
99
+ - **`/` 唤起** — 模糊搜索并调用已安装 skill
100
+ - **自然语言创建** — 描述你想要什么,Agent 自动起草 `SKILL.md`
101
+ - **自我进化** — 根据执行上下文和结果持续改进
102
+ - **开放格式** — 兼容 Claude Code / Markdown Pack / 自定义格式
103
+
104
+ Skill 目录:
105
+
106
+ - 内置:`lib/octo/default_skills/`
107
+ - 项目级:`.octo/skills/`
108
+ - 用户级:`~/.octo/skills/`
109
+
110
+ ## 使用示例
111
+
112
+ ```bash
113
+ $ octo
114
+ > /new my-app # 创建新项目脚手架
115
+ > 添加邮箱密码登录功能
116
+ > 支付模块是怎么实现的?
117
+ ```
118
+
119
+ ## 从源码安装
120
+
121
+ ```bash
122
+ git clone https://github.com/Leihb/octo.git
123
+ cd octo
124
+ bundle install
125
+ bin/octo
126
+ ```
127
+
128
+ ## 参与贡献
129
+
130
+ 欢迎在 GitHub 提交 Bug 报告和 Pull Request:https://github.com/Leihb/octo 。提 PR 前请先阅读 [CONTRIBUTING.md](./CONTRIBUTING.md)。
131
+
132
+ ## 许可证
133
+
134
+ 基于 [MIT 协议](https://opensource.org/licenses/MIT) 开源发布。
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ namespace :build do
9
+ desc "Build both openclacky and clacky gems"
10
+ task :all do
11
+ puts "Building openclacky gem..."
12
+ sh "gem build openclacky.gemspec"
13
+
14
+ puts "Building clacky gem..."
15
+ sh "cd clacky-legacy && gem build clacky.gemspec"
16
+ sh "cd clacky-legacy && gem build clarky.gemspec"
17
+
18
+ puts "Moving gems to pkg directory..."
19
+ sh "mkdir -p pkg"
20
+ sh "mv openclacky-*.gem pkg/"
21
+ sh "mv clacky-legacy/*.gem pkg/"
22
+
23
+ puts "✅ Build complete! Gems are in pkg/ directory:"
24
+ sh "ls -lh pkg/*.gem"
25
+ end
26
+
27
+ desc "Clean built gems from pkg directory"
28
+ task :clean do
29
+ sh "rm -rf pkg/*.gem"
30
+ puts "✅ Cleaned pkg directory"
31
+ end
32
+ end
33
+
34
+ task default: %i[spec]
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rspec"
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SampleProject
4
+ class ApiHandler
5
+ def initialize(store)
6
+ @store = store
7
+ end
8
+
9
+ def handle_request(path, params)
10
+ case path
11
+ when "/users"
12
+ list_users(params)
13
+ when "/orders"
14
+ list_orders(params)
15
+ else
16
+ { error: "Not found", status: 404 }
17
+ end
18
+ end
19
+
20
+ private
21
+
22
+ def list_users(params)
23
+ users = @store.query("SELECT * FROM users LIMIT #{params[:limit] || 10}")
24
+ { data: users, status: 200 }
25
+ end
26
+
27
+ def list_orders(params)
28
+ orders = @store.all(:orders)
29
+ { data: orders, status: 200 }
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SampleProject
4
+ class OrderCalculator
5
+ def initialize(items)
6
+ @items = items
7
+ end
8
+
9
+ def calculateTotal
10
+ @items.sum { |item| item[:price] * item[:quantity] }
11
+ end
12
+
13
+ def calculateTotalWithTax(tax_rate)
14
+ subtotal = calculateTotal
15
+ subtotal * (1 + tax_rate)
16
+ end
17
+
18
+ def applyDiscount(discount_percent)
19
+ total = calculateTotal
20
+ total * (1 - discount_percent / 100.0)
21
+ end
22
+ end
23
+ end