@redigg/redigg 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 (322) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +145 -0
  3. package/dist/agent/ResearchAgent.d.ts +35 -0
  4. package/dist/agent/ResearchAgent.js +818 -0
  5. package/dist/agent/ResearchAgent.js.map +1 -0
  6. package/dist/agent/subagent/SubAgent.d.ts +23 -0
  7. package/dist/agent/subagent/SubAgent.js +87 -0
  8. package/dist/agent/subagent/SubAgent.js.map +1 -0
  9. package/dist/agent/subagent/SubAgentManager.d.ts +19 -0
  10. package/dist/agent/subagent/SubAgentManager.js +40 -0
  11. package/dist/agent/subagent/SubAgentManager.js.map +1 -0
  12. package/dist/bin.d.ts +2 -0
  13. package/dist/bin.js +34 -0
  14. package/dist/bin.js.map +1 -0
  15. package/dist/cli.d.ts +1 -0
  16. package/dist/cli.js +179 -0
  17. package/dist/cli.js.map +1 -0
  18. package/dist/events/EventManager.d.ts +39 -0
  19. package/dist/events/EventManager.js +20 -0
  20. package/dist/events/EventManager.js.map +1 -0
  21. package/dist/gateway/index.d.ts +9 -0
  22. package/dist/gateway/index.js +474 -0
  23. package/dist/gateway/index.js.map +1 -0
  24. package/dist/index.d.ts +3 -0
  25. package/dist/index.js +97 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/llm/LLMClient.d.ts +30 -0
  28. package/dist/llm/LLMClient.js +21 -0
  29. package/dist/llm/LLMClient.js.map +1 -0
  30. package/dist/llm/OpenAIClient.d.ts +16 -0
  31. package/dist/llm/OpenAIClient.js +58 -0
  32. package/dist/llm/OpenAIClient.js.map +1 -0
  33. package/dist/memory/MemoryManager.d.ts +41 -0
  34. package/dist/memory/MemoryManager.js +221 -0
  35. package/dist/memory/MemoryManager.js.map +1 -0
  36. package/dist/memory/evolution/MemoryEvolutionSystem.d.ts +17 -0
  37. package/dist/memory/evolution/MemoryEvolutionSystem.js +71 -0
  38. package/dist/memory/evolution/MemoryEvolutionSystem.js.map +1 -0
  39. package/dist/memory/search/BM25Search.d.ts +22 -0
  40. package/dist/memory/search/BM25Search.js +61 -0
  41. package/dist/memory/search/BM25Search.js.map +1 -0
  42. package/dist/memory/structure/PageIndex.d.ts +26 -0
  43. package/dist/memory/structure/PageIndex.js +156 -0
  44. package/dist/memory/structure/PageIndex.js.map +1 -0
  45. package/dist/quality/QualityManager.d.ts +12 -0
  46. package/dist/quality/QualityManager.js +61 -0
  47. package/dist/quality/QualityManager.js.map +1 -0
  48. package/dist/scheduling/CronManager.d.ts +21 -0
  49. package/dist/scheduling/CronManager.js +66 -0
  50. package/dist/scheduling/CronManager.js.map +1 -0
  51. package/dist/session/SessionManager.d.ts +37 -0
  52. package/dist/session/SessionManager.js +238 -0
  53. package/dist/session/SessionManager.js.map +1 -0
  54. package/dist/skills/SkillManager.d.ts +31 -0
  55. package/dist/skills/SkillManager.js +254 -0
  56. package/dist/skills/SkillManager.js.map +1 -0
  57. package/dist/skills/agent/PACK.md +13 -0
  58. package/dist/skills/agent/agent-orchestration/SKILL.md +37 -0
  59. package/dist/skills/agent/agent-orchestration/index.d.ts +9 -0
  60. package/dist/skills/agent/agent-orchestration/index.js +70 -0
  61. package/dist/skills/agent/agent-orchestration/index.js.map +1 -0
  62. package/dist/skills/agent/evolution/SKILL.md +25 -0
  63. package/dist/skills/agent/evolution/index.d.ts +9 -0
  64. package/dist/skills/agent/evolution/index.js +57 -0
  65. package/dist/skills/agent/evolution/index.js.map +1 -0
  66. package/dist/skills/agent/heartbeat/index.d.ts +8 -0
  67. package/dist/skills/agent/heartbeat/index.js +44 -0
  68. package/dist/skills/agent/heartbeat/index.js.map +1 -0
  69. package/dist/skills/agent/memory-management/SKILL.md +40 -0
  70. package/dist/skills/agent/memory-management/index.d.ts +8 -0
  71. package/dist/skills/agent/memory-management/index.js +44 -0
  72. package/dist/skills/agent/memory-management/index.js.map +1 -0
  73. package/dist/skills/agent/scheduling/SKILL.md +33 -0
  74. package/dist/skills/agent/scheduling/index.d.ts +13 -0
  75. package/dist/skills/agent/scheduling/index.js +80 -0
  76. package/dist/skills/agent/scheduling/index.js.map +1 -0
  77. package/dist/skills/agent/session-management/SKILL.md +35 -0
  78. package/dist/skills/agent/session-management/index.d.ts +11 -0
  79. package/dist/skills/agent/session-management/index.js +54 -0
  80. package/dist/skills/agent/session-management/index.js.map +1 -0
  81. package/dist/skills/agent/skill-management/SKILL.md +31 -0
  82. package/dist/skills/agent/skill-management/index.d.ts +8 -0
  83. package/dist/skills/agent/skill-management/index.js +25 -0
  84. package/dist/skills/agent/skill-management/index.js.map +1 -0
  85. package/dist/skills/evolution/SkillEvolutionSystem.d.ts +12 -0
  86. package/dist/skills/evolution/SkillEvolutionSystem.js +157 -0
  87. package/dist/skills/evolution/SkillEvolutionSystem.js.map +1 -0
  88. package/dist/skills/lib/ScholarTool.d.ts +14 -0
  89. package/dist/skills/lib/ScholarTool.js +71 -0
  90. package/dist/skills/lib/ScholarTool.js.map +1 -0
  91. package/dist/skills/research/PACK.md +7 -0
  92. package/dist/skills/research/academic-survey-self-improve/SKILL.md +17 -0
  93. package/dist/skills/research/academic-survey-self-improve/index.d.ts +10 -0
  94. package/dist/skills/research/academic-survey-self-improve/index.js +75 -0
  95. package/dist/skills/research/academic-survey-self-improve/index.js.map +1 -0
  96. package/dist/skills/research/concept-explainer/SKILL.md +3 -0
  97. package/dist/skills/research/concept-explainer/index.d.ts +8 -0
  98. package/dist/skills/research/concept-explainer/index.js +37 -0
  99. package/dist/skills/research/concept-explainer/index.js.map +1 -0
  100. package/dist/skills/research/literature-review/SKILL.md +25 -0
  101. package/dist/skills/research/literature-review/index.d.ts +9 -0
  102. package/dist/skills/research/literature-review/index.js +132 -0
  103. package/dist/skills/research/literature-review/index.js.map +1 -0
  104. package/dist/skills/research/paper-analysis/SKILL.md +3 -0
  105. package/dist/skills/research/paper-analysis/index.d.ts +9 -0
  106. package/dist/skills/research/paper-analysis/index.js +64 -0
  107. package/dist/skills/research/paper-analysis/index.js.map +1 -0
  108. package/dist/skills/research/pdf-generator/SKILL.md +16 -0
  109. package/dist/skills/research/pdf-generator/index.d.ts +10 -0
  110. package/dist/skills/research/pdf-generator/index.js +88 -0
  111. package/dist/skills/research/pdf-generator/index.js.map +1 -0
  112. package/dist/skills/system/PACK.md +8 -0
  113. package/dist/skills/system/code-analysis/SKILL.md +43 -0
  114. package/dist/skills/system/code-analysis/index.d.ts +12 -0
  115. package/dist/skills/system/code-analysis/index.js +172 -0
  116. package/dist/skills/system/code-analysis/index.js.map +1 -0
  117. package/dist/skills/system/local-file-ops/SKILL.md +55 -0
  118. package/dist/skills/system/local-file-ops/index.d.ts +9 -0
  119. package/dist/skills/system/local-file-ops/index.js +111 -0
  120. package/dist/skills/system/local-file-ops/index.js.map +1 -0
  121. package/dist/skills/types.d.ts +41 -0
  122. package/dist/skills/types.js +2 -0
  123. package/dist/skills/types.js.map +1 -0
  124. package/dist/skills/vendor/PACK.md +11 -0
  125. package/dist/skills/vendor/agent-browser/CONTRIBUTING.md +63 -0
  126. package/dist/skills/vendor/agent-browser/SKILL.md +328 -0
  127. package/dist/skills/vendor/find-skills/SKILL.md +133 -0
  128. package/dist/skills/vendor/proactive-agent/SKILL-v2.3-backup.md +554 -0
  129. package/dist/skills/vendor/proactive-agent/SKILL-v3-draft.md +499 -0
  130. package/dist/skills/vendor/proactive-agent/SKILL.md +632 -0
  131. package/dist/skills/vendor/proactive-agent/assets/AGENTS.md +155 -0
  132. package/dist/skills/vendor/proactive-agent/assets/HEARTBEAT.md +128 -0
  133. package/dist/skills/vendor/proactive-agent/assets/MEMORY.md +47 -0
  134. package/dist/skills/vendor/proactive-agent/assets/ONBOARDING.md +103 -0
  135. package/dist/skills/vendor/proactive-agent/assets/SOUL.md +40 -0
  136. package/dist/skills/vendor/proactive-agent/assets/TOOLS.md +55 -0
  137. package/dist/skills/vendor/proactive-agent/assets/USER.md +36 -0
  138. package/dist/skills/vendor/proactive-agent/references/onboarding-flow.md +158 -0
  139. package/dist/skills/vendor/proactive-agent/references/security-patterns.md +109 -0
  140. package/dist/skills/vendor/searxng/CHANGELOG.md +38 -0
  141. package/dist/skills/vendor/searxng/PUBLISH.md +147 -0
  142. package/dist/skills/vendor/searxng/PUBLISHING_CHECKLIST.md +111 -0
  143. package/dist/skills/vendor/searxng/README.md +168 -0
  144. package/dist/skills/vendor/searxng/SKILL.md +69 -0
  145. package/dist/skills/vendor/self-improving-agent/.learnings/ERRORS.md +5 -0
  146. package/dist/skills/vendor/self-improving-agent/.learnings/FEATURE_REQUESTS.md +5 -0
  147. package/dist/skills/vendor/self-improving-agent/.learnings/LEARNINGS.md +5 -0
  148. package/dist/skills/vendor/self-improving-agent/SKILL.md +647 -0
  149. package/dist/skills/vendor/self-improving-agent/assets/LEARNINGS.md +45 -0
  150. package/dist/skills/vendor/self-improving-agent/assets/SKILL-TEMPLATE.md +177 -0
  151. package/dist/skills/vendor/self-improving-agent/hooks/openclaw/HOOK.md +23 -0
  152. package/dist/skills/vendor/self-improving-agent/hooks/openclaw/handler.d.ts +9 -0
  153. package/dist/skills/vendor/self-improving-agent/hooks/openclaw/handler.js +54 -0
  154. package/dist/skills/vendor/self-improving-agent/hooks/openclaw/handler.js.map +1 -0
  155. package/dist/skills/vendor/self-improving-agent/references/examples.md +374 -0
  156. package/dist/skills/vendor/self-improving-agent/references/hooks-setup.md +223 -0
  157. package/dist/skills/vendor/self-improving-agent/references/openclaw-integration.md +248 -0
  158. package/dist/skills/vendor/skill-vetter/SKILL.md +138 -0
  159. package/dist/src/agent/ResearchAgent.d.ts +35 -0
  160. package/dist/src/agent/ResearchAgent.js +818 -0
  161. package/dist/src/agent/ResearchAgent.js.map +1 -0
  162. package/dist/src/agent/subagent/SubAgent.d.ts +23 -0
  163. package/dist/src/agent/subagent/SubAgent.js +87 -0
  164. package/dist/src/agent/subagent/SubAgent.js.map +1 -0
  165. package/dist/src/agent/subagent/SubAgentManager.d.ts +19 -0
  166. package/dist/src/agent/subagent/SubAgentManager.js +40 -0
  167. package/dist/src/agent/subagent/SubAgentManager.js.map +1 -0
  168. package/dist/src/bin.d.ts +2 -0
  169. package/dist/src/bin.js +34 -0
  170. package/dist/src/bin.js.map +1 -0
  171. package/dist/src/cli.d.ts +1 -0
  172. package/dist/src/cli.js +179 -0
  173. package/dist/src/cli.js.map +1 -0
  174. package/dist/src/events/EventManager.d.ts +39 -0
  175. package/dist/src/events/EventManager.js +20 -0
  176. package/dist/src/events/EventManager.js.map +1 -0
  177. package/dist/src/gateway/index.d.ts +9 -0
  178. package/dist/src/gateway/index.js +474 -0
  179. package/dist/src/gateway/index.js.map +1 -0
  180. package/dist/src/index.d.ts +3 -0
  181. package/dist/src/index.js +105 -0
  182. package/dist/src/index.js.map +1 -0
  183. package/dist/src/llm/LLMClient.d.ts +30 -0
  184. package/dist/src/llm/LLMClient.js +21 -0
  185. package/dist/src/llm/LLMClient.js.map +1 -0
  186. package/dist/src/llm/OpenAIClient.d.ts +16 -0
  187. package/dist/src/llm/OpenAIClient.js +58 -0
  188. package/dist/src/llm/OpenAIClient.js.map +1 -0
  189. package/dist/src/memory/MemoryManager.d.ts +41 -0
  190. package/dist/src/memory/MemoryManager.js +221 -0
  191. package/dist/src/memory/MemoryManager.js.map +1 -0
  192. package/dist/src/memory/evolution/MemoryEvolutionSystem.d.ts +17 -0
  193. package/dist/src/memory/evolution/MemoryEvolutionSystem.js +71 -0
  194. package/dist/src/memory/evolution/MemoryEvolutionSystem.js.map +1 -0
  195. package/dist/src/memory/search/BM25Search.d.ts +22 -0
  196. package/dist/src/memory/search/BM25Search.js +61 -0
  197. package/dist/src/memory/search/BM25Search.js.map +1 -0
  198. package/dist/src/memory/structure/PageIndex.d.ts +26 -0
  199. package/dist/src/memory/structure/PageIndex.js +156 -0
  200. package/dist/src/memory/structure/PageIndex.js.map +1 -0
  201. package/dist/src/quality/QualityManager.d.ts +12 -0
  202. package/dist/src/quality/QualityManager.js +61 -0
  203. package/dist/src/quality/QualityManager.js.map +1 -0
  204. package/dist/src/scheduling/CronManager.d.ts +21 -0
  205. package/dist/src/scheduling/CronManager.js +66 -0
  206. package/dist/src/scheduling/CronManager.js.map +1 -0
  207. package/dist/src/session/SessionManager.d.ts +37 -0
  208. package/dist/src/session/SessionManager.js +238 -0
  209. package/dist/src/session/SessionManager.js.map +1 -0
  210. package/dist/src/skills/SkillManager.d.ts +33 -0
  211. package/dist/src/skills/SkillManager.js +260 -0
  212. package/dist/src/skills/SkillManager.js.map +1 -0
  213. package/dist/src/skills/evolution/SkillEvolutionSystem.d.ts +12 -0
  214. package/dist/src/skills/evolution/SkillEvolutionSystem.js +157 -0
  215. package/dist/src/skills/evolution/SkillEvolutionSystem.js.map +1 -0
  216. package/dist/src/skills/lib/ScholarTool.d.ts +14 -0
  217. package/dist/src/skills/lib/ScholarTool.js +71 -0
  218. package/dist/src/skills/lib/ScholarTool.js.map +1 -0
  219. package/dist/src/skills/types.d.ts +41 -0
  220. package/dist/src/skills/types.js +2 -0
  221. package/dist/src/skills/types.js.map +1 -0
  222. package/dist/src/storage/sqlite.d.ts +8 -0
  223. package/dist/src/storage/sqlite.js +73 -0
  224. package/dist/src/storage/sqlite.js.map +1 -0
  225. package/dist/src/utils/logger.d.ts +12 -0
  226. package/dist/src/utils/logger.js +53 -0
  227. package/dist/src/utils/logger.js.map +1 -0
  228. package/dist/storage/sqlite.d.ts +8 -0
  229. package/dist/storage/sqlite.js +73 -0
  230. package/dist/storage/sqlite.js.map +1 -0
  231. package/dist/utils/logger.d.ts +12 -0
  232. package/dist/utils/logger.js +53 -0
  233. package/dist/utils/logger.js.map +1 -0
  234. package/package.json +71 -0
  235. package/skills/agent/PACK.md +13 -0
  236. package/skills/agent/agent-orchestration/SKILL.md +37 -0
  237. package/skills/agent/agent-orchestration/index.ts +84 -0
  238. package/skills/agent/evolution/SKILL.md +25 -0
  239. package/skills/agent/evolution/index.ts +67 -0
  240. package/skills/agent/heartbeat/index.ts +48 -0
  241. package/skills/agent/memory-management/SKILL.md +40 -0
  242. package/skills/agent/memory-management/index.ts +48 -0
  243. package/skills/agent/scheduling/SKILL.md +33 -0
  244. package/skills/agent/scheduling/index.ts +97 -0
  245. package/skills/agent/session-management/SKILL.md +35 -0
  246. package/skills/agent/session-management/index.ts +65 -0
  247. package/skills/agent/skill-management/SKILL.md +31 -0
  248. package/skills/agent/skill-management/index.ts +32 -0
  249. package/skills/research/PACK.md +7 -0
  250. package/skills/research/academic-survey-self-improve/SKILL.md +17 -0
  251. package/skills/research/academic-survey-self-improve/index.ts +87 -0
  252. package/skills/research/concept-explainer/SKILL.md +3 -0
  253. package/skills/research/concept-explainer/index.ts +42 -0
  254. package/skills/research/literature-review/SKILL.md +25 -0
  255. package/skills/research/literature-review/index.ts +168 -0
  256. package/skills/research/paper-analysis/SKILL.md +3 -0
  257. package/skills/research/paper-analysis/index.ts +73 -0
  258. package/skills/research/pdf-generator/SKILL.md +16 -0
  259. package/skills/research/pdf-generator/index.d.ts +10 -0
  260. package/skills/research/pdf-generator/index.js +114 -0
  261. package/skills/research/pdf-generator/index.js.map +1 -0
  262. package/skills/research/pdf-generator/index.ts +97 -0
  263. package/skills/system/PACK.md +8 -0
  264. package/skills/system/code-analysis/SKILL.md +43 -0
  265. package/skills/system/code-analysis/index.ts +180 -0
  266. package/skills/system/local-file-ops/SKILL.md +55 -0
  267. package/skills/system/local-file-ops/index.ts +123 -0
  268. package/skills/vendor/PACK.md +11 -0
  269. package/skills/vendor/agent-browser/.clawhub/origin.json +7 -0
  270. package/skills/vendor/agent-browser/CONTRIBUTING.md +63 -0
  271. package/skills/vendor/agent-browser/SKILL.md +328 -0
  272. package/skills/vendor/agent-browser/_meta.json +6 -0
  273. package/skills/vendor/find-skills/.clawhub/origin.json +7 -0
  274. package/skills/vendor/find-skills/SKILL.md +133 -0
  275. package/skills/vendor/find-skills/_meta.json +6 -0
  276. package/skills/vendor/proactive-agent/.clawhub/origin.json +7 -0
  277. package/skills/vendor/proactive-agent/SKILL-v2.3-backup.md +554 -0
  278. package/skills/vendor/proactive-agent/SKILL-v3-draft.md +499 -0
  279. package/skills/vendor/proactive-agent/SKILL.md +632 -0
  280. package/skills/vendor/proactive-agent/_meta.json +6 -0
  281. package/skills/vendor/proactive-agent/assets/AGENTS.md +155 -0
  282. package/skills/vendor/proactive-agent/assets/HEARTBEAT.md +128 -0
  283. package/skills/vendor/proactive-agent/assets/MEMORY.md +47 -0
  284. package/skills/vendor/proactive-agent/assets/ONBOARDING.md +103 -0
  285. package/skills/vendor/proactive-agent/assets/SOUL.md +40 -0
  286. package/skills/vendor/proactive-agent/assets/TOOLS.md +55 -0
  287. package/skills/vendor/proactive-agent/assets/USER.md +36 -0
  288. package/skills/vendor/proactive-agent/references/onboarding-flow.md +158 -0
  289. package/skills/vendor/proactive-agent/references/security-patterns.md +109 -0
  290. package/skills/vendor/proactive-agent/scripts/security-audit.sh +149 -0
  291. package/skills/vendor/searxng/.clawdhub/origin.json +7 -0
  292. package/skills/vendor/searxng/CHANGELOG.md +38 -0
  293. package/skills/vendor/searxng/PUBLISH.md +147 -0
  294. package/skills/vendor/searxng/PUBLISHING_CHECKLIST.md +111 -0
  295. package/skills/vendor/searxng/README.md +168 -0
  296. package/skills/vendor/searxng/SKILL.md +69 -0
  297. package/skills/vendor/searxng/_meta.json +6 -0
  298. package/skills/vendor/searxng/config/settings.yml +36 -0
  299. package/skills/vendor/searxng/run-searxng.sh +48 -0
  300. package/skills/vendor/searxng/scripts/searxng.py +211 -0
  301. package/skills/vendor/self-improving-agent/.clawhub/origin.json +7 -0
  302. package/skills/vendor/self-improving-agent/.learnings/ERRORS.md +5 -0
  303. package/skills/vendor/self-improving-agent/.learnings/FEATURE_REQUESTS.md +5 -0
  304. package/skills/vendor/self-improving-agent/.learnings/LEARNINGS.md +5 -0
  305. package/skills/vendor/self-improving-agent/SKILL.md +647 -0
  306. package/skills/vendor/self-improving-agent/_meta.json +6 -0
  307. package/skills/vendor/self-improving-agent/assets/LEARNINGS.md +45 -0
  308. package/skills/vendor/self-improving-agent/assets/SKILL-TEMPLATE.md +177 -0
  309. package/skills/vendor/self-improving-agent/hooks/openclaw/HOOK.md +23 -0
  310. package/skills/vendor/self-improving-agent/hooks/openclaw/handler.js +56 -0
  311. package/skills/vendor/self-improving-agent/hooks/openclaw/handler.ts +62 -0
  312. package/skills/vendor/self-improving-agent/references/examples.md +374 -0
  313. package/skills/vendor/self-improving-agent/references/hooks-setup.md +223 -0
  314. package/skills/vendor/self-improving-agent/references/openclaw-integration.md +248 -0
  315. package/skills/vendor/self-improving-agent/scripts/activator.sh +20 -0
  316. package/skills/vendor/self-improving-agent/scripts/error-detector.sh +55 -0
  317. package/skills/vendor/self-improving-agent/scripts/extract-skill.sh +221 -0
  318. package/skills/vendor/skill-vetter/.clawhub/origin.json +7 -0
  319. package/skills/vendor/skill-vetter/SKILL.md +138 -0
  320. package/skills/vendor/skill-vetter/_meta.json +6 -0
  321. package/web/README.md +73 -0
  322. package/web/package.json +65 -0
@@ -0,0 +1,223 @@
1
+ # Hook Setup Guide
2
+
3
+ Configure automatic self-improvement triggers for AI coding agents.
4
+
5
+ ## Overview
6
+
7
+ Hooks enable proactive learning capture by injecting reminders at key moments:
8
+ - **UserPromptSubmit**: Reminder after each prompt to evaluate learnings
9
+ - **PostToolUse (Bash)**: Error detection when commands fail
10
+
11
+ ## Claude Code Setup
12
+
13
+ ### Option 1: Project-Level Configuration
14
+
15
+ Create `.claude/settings.json` in your project root:
16
+
17
+ ```json
18
+ {
19
+ "hooks": {
20
+ "UserPromptSubmit": [
21
+ {
22
+ "matcher": "",
23
+ "hooks": [
24
+ {
25
+ "type": "command",
26
+ "command": "./skills/self-improvement/scripts/activator.sh"
27
+ }
28
+ ]
29
+ }
30
+ ],
31
+ "PostToolUse": [
32
+ {
33
+ "matcher": "Bash",
34
+ "hooks": [
35
+ {
36
+ "type": "command",
37
+ "command": "./skills/self-improvement/scripts/error-detector.sh"
38
+ }
39
+ ]
40
+ }
41
+ ]
42
+ }
43
+ }
44
+ ```
45
+
46
+ ### Option 2: User-Level Configuration
47
+
48
+ Add to `~/.claude/settings.json` for global activation:
49
+
50
+ ```json
51
+ {
52
+ "hooks": {
53
+ "UserPromptSubmit": [
54
+ {
55
+ "matcher": "",
56
+ "hooks": [
57
+ {
58
+ "type": "command",
59
+ "command": "~/.claude/skills/self-improvement/scripts/activator.sh"
60
+ }
61
+ ]
62
+ }
63
+ ]
64
+ }
65
+ }
66
+ ```
67
+
68
+ ### Minimal Setup (Activator Only)
69
+
70
+ For lower overhead, use only the UserPromptSubmit hook:
71
+
72
+ ```json
73
+ {
74
+ "hooks": {
75
+ "UserPromptSubmit": [
76
+ {
77
+ "matcher": "",
78
+ "hooks": [
79
+ {
80
+ "type": "command",
81
+ "command": "./skills/self-improvement/scripts/activator.sh"
82
+ }
83
+ ]
84
+ }
85
+ ]
86
+ }
87
+ }
88
+ ```
89
+
90
+ ## Codex CLI Setup
91
+
92
+ Codex uses the same hook system as Claude Code. Create `.codex/settings.json`:
93
+
94
+ ```json
95
+ {
96
+ "hooks": {
97
+ "UserPromptSubmit": [
98
+ {
99
+ "matcher": "",
100
+ "hooks": [
101
+ {
102
+ "type": "command",
103
+ "command": "./skills/self-improvement/scripts/activator.sh"
104
+ }
105
+ ]
106
+ }
107
+ ]
108
+ }
109
+ }
110
+ ```
111
+
112
+ ## GitHub Copilot Setup
113
+
114
+ Copilot doesn't support hooks directly. Instead, add guidance to `.github/copilot-instructions.md`:
115
+
116
+ ```markdown
117
+ ## Self-Improvement
118
+
119
+ After completing tasks that involved:
120
+ - Debugging non-obvious issues
121
+ - Discovering workarounds
122
+ - Learning project-specific patterns
123
+ - Resolving unexpected errors
124
+
125
+ Consider logging the learning to `.learnings/` using the format from the self-improvement skill.
126
+
127
+ For high-value learnings that would benefit other sessions, consider skill extraction.
128
+ ```
129
+
130
+ ## Verification
131
+
132
+ ### Test Activator Hook
133
+
134
+ 1. Enable the hook configuration
135
+ 2. Start a new Claude Code session
136
+ 3. Send any prompt
137
+ 4. Verify you see `<self-improvement-reminder>` in the context
138
+
139
+ ### Test Error Detector Hook
140
+
141
+ 1. Enable PostToolUse hook for Bash
142
+ 2. Run a command that fails: `ls /nonexistent/path`
143
+ 3. Verify you see `<error-detected>` reminder
144
+
145
+ ### Dry Run Extract Script
146
+
147
+ ```bash
148
+ ./skills/self-improvement/scripts/extract-skill.sh test-skill --dry-run
149
+ ```
150
+
151
+ Expected output shows the skill scaffold that would be created.
152
+
153
+ ## Troubleshooting
154
+
155
+ ### Hook Not Triggering
156
+
157
+ 1. **Check script permissions**: `chmod +x scripts/*.sh`
158
+ 2. **Verify path**: Use absolute paths or paths relative to project root
159
+ 3. **Check settings location**: Project vs user-level settings
160
+ 4. **Restart session**: Hooks are loaded at session start
161
+
162
+ ### Permission Denied
163
+
164
+ ```bash
165
+ chmod +x ./skills/self-improvement/scripts/activator.sh
166
+ chmod +x ./skills/self-improvement/scripts/error-detector.sh
167
+ chmod +x ./skills/self-improvement/scripts/extract-skill.sh
168
+ ```
169
+
170
+ ### Script Not Found
171
+
172
+ If using relative paths, ensure you're in the correct directory or use absolute paths:
173
+
174
+ ```json
175
+ {
176
+ "command": "/absolute/path/to/skills/self-improvement/scripts/activator.sh"
177
+ }
178
+ ```
179
+
180
+ ### Too Much Overhead
181
+
182
+ If the activator feels intrusive:
183
+
184
+ 1. **Use minimal setup**: Only UserPromptSubmit, skip PostToolUse
185
+ 2. **Add matcher filter**: Only trigger for certain prompts:
186
+
187
+ ```json
188
+ {
189
+ "matcher": "fix|debug|error|issue",
190
+ "hooks": [...]
191
+ }
192
+ ```
193
+
194
+ ## Hook Output Budget
195
+
196
+ The activator is designed to be lightweight:
197
+ - **Target**: ~50-100 tokens per activation
198
+ - **Content**: Structured reminder, not verbose instructions
199
+ - **Format**: XML tags for easy parsing
200
+
201
+ If you need to reduce overhead further, you can edit `activator.sh` to output less text.
202
+
203
+ ## Security Considerations
204
+
205
+ - Hook scripts run with the same permissions as Claude Code
206
+ - Scripts only output text; they don't modify files or run commands
207
+ - Error detector reads `CLAUDE_TOOL_OUTPUT` environment variable
208
+ - All scripts are opt-in (you must configure them explicitly)
209
+
210
+ ## Disabling Hooks
211
+
212
+ To temporarily disable without removing configuration:
213
+
214
+ 1. **Comment out in settings**:
215
+ ```json
216
+ {
217
+ "hooks": {
218
+ // "UserPromptSubmit": [...]
219
+ }
220
+ }
221
+ ```
222
+
223
+ 2. **Or delete the settings file**: Hooks won't run without configuration
@@ -0,0 +1,248 @@
1
+ # OpenClaw Integration
2
+
3
+ Complete setup and usage guide for integrating the self-improvement skill with OpenClaw.
4
+
5
+ ## Overview
6
+
7
+ OpenClaw uses workspace-based prompt injection combined with event-driven hooks. Context is injected from workspace files at session start, and hooks can trigger on lifecycle events.
8
+
9
+ ## Workspace Structure
10
+
11
+ ```
12
+ ~/.openclaw/
13
+ ├── workspace/ # Working directory
14
+ │ ├── AGENTS.md # Multi-agent coordination patterns
15
+ │ ├── SOUL.md # Behavioral guidelines and personality
16
+ │ ├── TOOLS.md # Tool capabilities and gotchas
17
+ │ ├── MEMORY.md # Long-term memory (main session only)
18
+ │ └── memory/ # Daily memory files
19
+ │ └── YYYY-MM-DD.md
20
+ ├── skills/ # Installed skills
21
+ │ └── <skill-name>/
22
+ │ └── SKILL.md
23
+ └── hooks/ # Custom hooks
24
+ └── <hook-name>/
25
+ ├── HOOK.md
26
+ └── handler.ts
27
+ ```
28
+
29
+ ## Quick Setup
30
+
31
+ ### 1. Install the Skill
32
+
33
+ ```bash
34
+ clawdhub install self-improving-agent
35
+ ```
36
+
37
+ Or copy manually:
38
+
39
+ ```bash
40
+ cp -r self-improving-agent ~/.openclaw/skills/
41
+ ```
42
+
43
+ ### 2. Install the Hook (Optional)
44
+
45
+ Copy the hook to OpenClaw's hooks directory:
46
+
47
+ ```bash
48
+ cp -r hooks/openclaw ~/.openclaw/hooks/self-improvement
49
+ ```
50
+
51
+ Enable the hook:
52
+
53
+ ```bash
54
+ openclaw hooks enable self-improvement
55
+ ```
56
+
57
+ ### 3. Create Learning Files
58
+
59
+ Create the `.learnings/` directory in your workspace:
60
+
61
+ ```bash
62
+ mkdir -p ~/.openclaw/workspace/.learnings
63
+ ```
64
+
65
+ Or in the skill directory:
66
+
67
+ ```bash
68
+ mkdir -p ~/.openclaw/skills/self-improving-agent/.learnings
69
+ ```
70
+
71
+ ## Injected Prompt Files
72
+
73
+ ### AGENTS.md
74
+
75
+ Purpose: Multi-agent workflows and delegation patterns.
76
+
77
+ ```markdown
78
+ # Agent Coordination
79
+
80
+ ## Delegation Rules
81
+ - Use explore agent for open-ended codebase questions
82
+ - Spawn sub-agents for long-running tasks
83
+ - Use sessions_send for cross-session communication
84
+
85
+ ## Session Handoff
86
+ When delegating to another session:
87
+ 1. Provide full context in the handoff message
88
+ 2. Include relevant file paths
89
+ 3. Specify expected output format
90
+ ```
91
+
92
+ ### SOUL.md
93
+
94
+ Purpose: Behavioral guidelines and communication style.
95
+
96
+ ```markdown
97
+ # Behavioral Guidelines
98
+
99
+ ## Communication Style
100
+ - Be direct and concise
101
+ - Avoid unnecessary caveats and disclaimers
102
+ - Use technical language appropriate to context
103
+
104
+ ## Error Handling
105
+ - Admit mistakes promptly
106
+ - Provide corrected information immediately
107
+ - Log significant errors to learnings
108
+ ```
109
+
110
+ ### TOOLS.md
111
+
112
+ Purpose: Tool capabilities, integration gotchas, local configuration.
113
+
114
+ ```markdown
115
+ # Tool Knowledge
116
+
117
+ ## Self-Improvement Skill
118
+ Log learnings to `.learnings/` for continuous improvement.
119
+
120
+ ## Local Tools
121
+ - Document tool-specific gotchas here
122
+ - Note authentication requirements
123
+ - Track integration quirks
124
+ ```
125
+
126
+ ## Learning Workflow
127
+
128
+ ### Capturing Learnings
129
+
130
+ 1. **In-session**: Log to `.learnings/` as usual
131
+ 2. **Cross-session**: Promote to workspace files
132
+
133
+ ### Promotion Decision Tree
134
+
135
+ ```
136
+ Is the learning project-specific?
137
+ ├── Yes → Keep in .learnings/
138
+ └── No → Is it behavioral/style-related?
139
+ ├── Yes → Promote to SOUL.md
140
+ └── No → Is it tool-related?
141
+ ├── Yes → Promote to TOOLS.md
142
+ └── No → Promote to AGENTS.md (workflow)
143
+ ```
144
+
145
+ ### Promotion Format Examples
146
+
147
+ **From learning:**
148
+ > Git push to GitHub fails without auth configured - triggers desktop prompt
149
+
150
+ **To TOOLS.md:**
151
+ ```markdown
152
+ ## Git
153
+ - Don't push without confirming auth is configured
154
+ - Use `gh auth status` to check GitHub CLI auth
155
+ ```
156
+
157
+ ## Inter-Agent Communication
158
+
159
+ OpenClaw provides tools for cross-session communication:
160
+
161
+ ### sessions_list
162
+
163
+ View active and recent sessions:
164
+ ```
165
+ sessions_list(activeMinutes=30, messageLimit=3)
166
+ ```
167
+
168
+ ### sessions_history
169
+
170
+ Read transcript from another session:
171
+ ```
172
+ sessions_history(sessionKey="session-id", limit=50)
173
+ ```
174
+
175
+ ### sessions_send
176
+
177
+ Send message to another session:
178
+ ```
179
+ sessions_send(sessionKey="session-id", message="Learning: API requires X-Custom-Header")
180
+ ```
181
+
182
+ ### sessions_spawn
183
+
184
+ Spawn a background sub-agent:
185
+ ```
186
+ sessions_spawn(task="Research X and report back", label="research")
187
+ ```
188
+
189
+ ## Available Hook Events
190
+
191
+ | Event | When It Fires |
192
+ |-------|---------------|
193
+ | `agent:bootstrap` | Before workspace files inject |
194
+ | `command:new` | When `/new` command issued |
195
+ | `command:reset` | When `/reset` command issued |
196
+ | `command:stop` | When `/stop` command issued |
197
+ | `gateway:startup` | When gateway starts |
198
+
199
+ ## Detection Triggers
200
+
201
+ ### Standard Triggers
202
+ - User corrections ("No, that's wrong...")
203
+ - Command failures (non-zero exit codes)
204
+ - API errors
205
+ - Knowledge gaps
206
+
207
+ ### OpenClaw-Specific Triggers
208
+
209
+ | Trigger | Action |
210
+ |---------|--------|
211
+ | Tool call error | Log to TOOLS.md with tool name |
212
+ | Session handoff confusion | Log to AGENTS.md with delegation pattern |
213
+ | Model behavior surprise | Log to SOUL.md with expected vs actual |
214
+ | Skill issue | Log to .learnings/ or report upstream |
215
+
216
+ ## Verification
217
+
218
+ Check hook is registered:
219
+
220
+ ```bash
221
+ openclaw hooks list
222
+ ```
223
+
224
+ Check skill is loaded:
225
+
226
+ ```bash
227
+ openclaw status
228
+ ```
229
+
230
+ ## Troubleshooting
231
+
232
+ ### Hook not firing
233
+
234
+ 1. Ensure hooks enabled in config
235
+ 2. Restart gateway after config changes
236
+ 3. Check gateway logs for errors
237
+
238
+ ### Learnings not persisting
239
+
240
+ 1. Verify `.learnings/` directory exists
241
+ 2. Check file permissions
242
+ 3. Ensure workspace path is configured correctly
243
+
244
+ ### Skill not loading
245
+
246
+ 1. Check skill is in skills directory
247
+ 2. Verify SKILL.md has correct frontmatter
248
+ 3. Run `openclaw status` to see loaded skills
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: skill-vetter
3
+ version: 1.0.0
4
+ description: Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
5
+ ---
6
+
7
+ # Skill Vetter 🔒
8
+
9
+ Security-first vetting protocol for AI agent skills. **Never install a skill without vetting it first.**
10
+
11
+ ## When to Use
12
+
13
+ - Before installing any skill from ClawdHub
14
+ - Before running skills from GitHub repos
15
+ - When evaluating skills shared by other agents
16
+ - Anytime you're asked to install unknown code
17
+
18
+ ## Vetting Protocol
19
+
20
+ ### Step 1: Source Check
21
+
22
+ ```
23
+ Questions to answer:
24
+ - [ ] Where did this skill come from?
25
+ - [ ] Is the author known/reputable?
26
+ - [ ] How many downloads/stars does it have?
27
+ - [ ] When was it last updated?
28
+ - [ ] Are there reviews from other agents?
29
+ ```
30
+
31
+ ### Step 2: Code Review (MANDATORY)
32
+
33
+ Read ALL files in the skill. Check for these **RED FLAGS**:
34
+
35
+ ```
36
+ 🚨 REJECT IMMEDIATELY IF YOU SEE:
37
+ ─────────────────────────────────────────
38
+ • curl/wget to unknown URLs
39
+ • Sends data to external servers
40
+ • Requests credentials/tokens/API keys
41
+ • Reads ~/.ssh, ~/.aws, ~/.config without clear reason
42
+ • Accesses MEMORY.md, USER.md, SOUL.md, IDENTITY.md
43
+ • Uses base64 decode on anything
44
+ • Uses eval() or exec() with external input
45
+ • Modifies system files outside workspace
46
+ • Installs packages without listing them
47
+ • Network calls to IPs instead of domains
48
+ • Obfuscated code (compressed, encoded, minified)
49
+ • Requests elevated/sudo permissions
50
+ • Accesses browser cookies/sessions
51
+ • Touches credential files
52
+ ─────────────────────────────────────────
53
+ ```
54
+
55
+ ### Step 3: Permission Scope
56
+
57
+ ```
58
+ Evaluate:
59
+ - [ ] What files does it need to read?
60
+ - [ ] What files does it need to write?
61
+ - [ ] What commands does it run?
62
+ - [ ] Does it need network access? To where?
63
+ - [ ] Is the scope minimal for its stated purpose?
64
+ ```
65
+
66
+ ### Step 4: Risk Classification
67
+
68
+ | Risk Level | Examples | Action |
69
+ |------------|----------|--------|
70
+ | 🟢 LOW | Notes, weather, formatting | Basic review, install OK |
71
+ | 🟡 MEDIUM | File ops, browser, APIs | Full code review required |
72
+ | 🔴 HIGH | Credentials, trading, system | Human approval required |
73
+ | ⛔ EXTREME | Security configs, root access | Do NOT install |
74
+
75
+ ## Output Format
76
+
77
+ After vetting, produce this report:
78
+
79
+ ```
80
+ SKILL VETTING REPORT
81
+ ═══════════════════════════════════════
82
+ Skill: [name]
83
+ Source: [ClawdHub / GitHub / other]
84
+ Author: [username]
85
+ Version: [version]
86
+ ───────────────────────────────────────
87
+ METRICS:
88
+ • Downloads/Stars: [count]
89
+ • Last Updated: [date]
90
+ • Files Reviewed: [count]
91
+ ───────────────────────────────────────
92
+ RED FLAGS: [None / List them]
93
+
94
+ PERMISSIONS NEEDED:
95
+ • Files: [list or "None"]
96
+ • Network: [list or "None"]
97
+ • Commands: [list or "None"]
98
+ ───────────────────────────────────────
99
+ RISK LEVEL: [🟢 LOW / 🟡 MEDIUM / 🔴 HIGH / ⛔ EXTREME]
100
+
101
+ VERDICT: [✅ SAFE TO INSTALL / ⚠️ INSTALL WITH CAUTION / ❌ DO NOT INSTALL]
102
+
103
+ NOTES: [Any observations]
104
+ ═══════════════════════════════════════
105
+ ```
106
+
107
+ ## Quick Vet Commands
108
+
109
+ For GitHub-hosted skills:
110
+ ```bash
111
+ # Check repo stats
112
+ curl -s "https://api.github.com/repos/OWNER/REPO" | jq '{stars: .stargazers_count, forks: .forks_count, updated: .updated_at}'
113
+
114
+ # List skill files
115
+ curl -s "https://api.github.com/repos/OWNER/REPO/contents/skills/SKILL_NAME" | jq '.[].name'
116
+
117
+ # Fetch and review SKILL.md
118
+ curl -s "https://raw.githubusercontent.com/OWNER/REPO/main/skills/SKILL_NAME/SKILL.md"
119
+ ```
120
+
121
+ ## Trust Hierarchy
122
+
123
+ 1. **Official OpenClaw skills** → Lower scrutiny (still review)
124
+ 2. **High-star repos (1000+)** → Moderate scrutiny
125
+ 3. **Known authors** → Moderate scrutiny
126
+ 4. **New/unknown sources** → Maximum scrutiny
127
+ 5. **Skills requesting credentials** → Human approval always
128
+
129
+ ## Remember
130
+
131
+ - No skill is worth compromising security
132
+ - When in doubt, don't install
133
+ - Ask your human for high-risk decisions
134
+ - Document what you vet for future reference
135
+
136
+ ---
137
+
138
+ *Paranoia is a feature.* 🔒🦀
@@ -0,0 +1,35 @@
1
+ import { MemoryManager } from '../memory/MemoryManager.js';
2
+ import { MemoryEvolutionSystem } from '../memory/evolution/MemoryEvolutionSystem.js';
3
+ import { LLMClient } from '../llm/LLMClient.js';
4
+ import { SkillManager } from '../skills/SkillManager.js';
5
+ import { SessionManager, Session } from '../session/SessionManager.js';
6
+ import { CronManager } from '../scheduling/CronManager.js';
7
+ import { EventManager } from '../events/EventManager.js';
8
+ import { QualityManager } from '../quality/QualityManager.js';
9
+ export declare class ResearchAgent {
10
+ memoryManager: MemoryManager;
11
+ private memoryEvo;
12
+ private skillEvo;
13
+ private llm;
14
+ skillManager: SkillManager;
15
+ sessionManager: SessionManager;
16
+ cronManager: CronManager;
17
+ eventManager: EventManager;
18
+ qualityManager: QualityManager;
19
+ private heartbeatInterval;
20
+ constructor(memoryManager: MemoryManager, memoryEvo: MemoryEvolutionSystem, llm: LLMClient, skillManager?: SkillManager);
21
+ private setupEventListeners;
22
+ start(): Promise<void>;
23
+ stop(): void;
24
+ private heartbeat;
25
+ chat(userId: string, message: string, onProgress?: (type: 'token' | 'log' | 'plan' | 'todo', content: any) => void, sessionId?: string, options?: {
26
+ autoMode?: boolean;
27
+ }): Promise<string>;
28
+ private createPlan;
29
+ private executeStep;
30
+ private handlePostProcessing;
31
+ executeLegacyLogic(session: Session, userId: string, message: string, log: (content: string, stats?: any) => void, onProgress?: (type: 'token' | 'log' | 'plan' | 'todo', content: any) => void): Promise<string>;
32
+ private generateSessionTitle;
33
+ private executeLiteratureReview;
34
+ private shouldSearch;
35
+ }