burhan-mop 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 (382) hide show
  1. package/.agents/AGENTS.md +54 -0
  2. package/.agents/skills/auto-deploy/SKILL.md +48 -0
  3. package/.agents/skills/autosycn/SKILL.md +75 -0
  4. package/.agents/skills/mop-help/SKILL.md +35 -0
  5. package/.agents/skills/ruflo-core/SKILL.md +35 -0
  6. package/.claude/agents/analysis/analyze-code-quality.md +179 -0
  7. package/.claude/agents/analysis/code-analyzer.md +210 -0
  8. package/.claude/agents/analysis/code-review/analyze-code-quality.md +179 -0
  9. package/.claude/agents/architecture/arch-system-design.md +157 -0
  10. package/.claude/agents/architecture/system-design/arch-system-design.md +155 -0
  11. package/.claude/agents/browser/browser-agent.yaml +182 -0
  12. package/.claude/agents/consensus/byzantine-coordinator.md +63 -0
  13. package/.claude/agents/consensus/crdt-synchronizer.md +997 -0
  14. package/.claude/agents/consensus/gossip-coordinator.md +63 -0
  15. package/.claude/agents/consensus/performance-benchmarker.md +851 -0
  16. package/.claude/agents/consensus/quorum-manager.md +823 -0
  17. package/.claude/agents/consensus/raft-manager.md +63 -0
  18. package/.claude/agents/consensus/security-manager.md +622 -0
  19. package/.claude/agents/core/planner.md +375 -0
  20. package/.claude/agents/custom/test-long-runner.md +44 -0
  21. package/.claude/agents/data/data-ml-model.md +445 -0
  22. package/.claude/agents/data/ml/data-ml-model.md +193 -0
  23. package/.claude/agents/development/backend/dev-backend-api.md +142 -0
  24. package/.claude/agents/development/dev-backend-api.md +345 -0
  25. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
  26. package/.claude/agents/devops/ops-cicd-github.md +165 -0
  27. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
  28. package/.claude/agents/documentation/docs-api-openapi.md +355 -0
  29. package/.claude/agents/flow-nexus/app-store.md +88 -0
  30. package/.claude/agents/flow-nexus/authentication.md +69 -0
  31. package/.claude/agents/flow-nexus/challenges.md +81 -0
  32. package/.claude/agents/flow-nexus/neural-network.md +88 -0
  33. package/.claude/agents/flow-nexus/payments.md +83 -0
  34. package/.claude/agents/flow-nexus/sandbox.md +76 -0
  35. package/.claude/agents/flow-nexus/swarm.md +76 -0
  36. package/.claude/agents/flow-nexus/user-tools.md +96 -0
  37. package/.claude/agents/flow-nexus/workflow.md +84 -0
  38. package/.claude/agents/github/code-review-swarm.md +377 -0
  39. package/.claude/agents/github/github-modes.md +173 -0
  40. package/.claude/agents/github/issue-tracker.md +576 -0
  41. package/.claude/agents/github/multi-repo-swarm.md +553 -0
  42. package/.claude/agents/github/pr-manager.md +438 -0
  43. package/.claude/agents/github/project-board-sync.md +509 -0
  44. package/.claude/agents/github/release-manager.md +605 -0
  45. package/.claude/agents/github/release-swarm.md +583 -0
  46. package/.claude/agents/github/repo-architect.md +398 -0
  47. package/.claude/agents/github/swarm-issue.md +573 -0
  48. package/.claude/agents/github/swarm-pr.md +428 -0
  49. package/.claude/agents/github/sync-coordinator.md +452 -0
  50. package/.claude/agents/github/workflow-automation.md +903 -0
  51. package/.claude/agents/goal/agent.md +816 -0
  52. package/.claude/agents/optimization/benchmark-suite.md +665 -0
  53. package/.claude/agents/optimization/load-balancer.md +431 -0
  54. package/.claude/agents/optimization/performance-monitor.md +672 -0
  55. package/.claude/agents/optimization/resource-allocator.md +674 -0
  56. package/.claude/agents/optimization/topology-optimizer.md +808 -0
  57. package/.claude/agents/payments/agentic-payments.md +126 -0
  58. package/.claude/agents/sona/sona-learning-optimizer.md +74 -0
  59. package/.claude/agents/sparc/architecture.md +699 -0
  60. package/.claude/agents/sparc/pseudocode.md +520 -0
  61. package/.claude/agents/sparc/refinement.md +802 -0
  62. package/.claude/agents/sparc/specification.md +478 -0
  63. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +225 -0
  64. package/.claude/agents/specialized/spec-mobile-react-native.md +227 -0
  65. package/.claude/agents/sublinear/consensus-coordinator.md +338 -0
  66. package/.claude/agents/sublinear/matrix-optimizer.md +185 -0
  67. package/.claude/agents/sublinear/pagerank-analyzer.md +299 -0
  68. package/.claude/agents/sublinear/performance-optimizer.md +368 -0
  69. package/.claude/agents/sublinear/trading-predictor.md +246 -0
  70. package/.claude/agents/swarm/adaptive-coordinator.md +1127 -0
  71. package/.claude/agents/swarm/hierarchical-coordinator.md +710 -0
  72. package/.claude/agents/swarm/mesh-coordinator.md +963 -0
  73. package/.claude/agents/templates/automation-smart-agent.md +205 -0
  74. package/.claude/agents/templates/base-template-generator.md +289 -0
  75. package/.claude/agents/templates/coordinator-swarm-init.md +90 -0
  76. package/.claude/agents/templates/github-pr-manager.md +177 -0
  77. package/.claude/agents/templates/implementer-sparc-coder.md +259 -0
  78. package/.claude/agents/templates/memory-coordinator.md +187 -0
  79. package/.claude/agents/templates/orchestrator-task.md +139 -0
  80. package/.claude/agents/templates/performance-analyzer.md +199 -0
  81. package/.claude/agents/templates/sparc-coordinator.md +514 -0
  82. package/.claude/agents/testing/production-validator.md +395 -0
  83. package/.claude/agents/testing/tdd-london-swarm.md +244 -0
  84. package/.claude/agents/v3/aidefence-guardian.md +282 -0
  85. package/.claude/agents/v3/claims-authorizer.md +208 -0
  86. package/.claude/agents/v3/collective-intelligence-coordinator.md +993 -0
  87. package/.claude/agents/v3/ddd-domain-expert.md +220 -0
  88. package/.claude/agents/v3/injection-analyst.md +236 -0
  89. package/.claude/agents/v3/performance-engineer.md +1233 -0
  90. package/.claude/agents/v3/pii-detector.md +151 -0
  91. package/.claude/agents/v3/reasoningbank-learner.md +213 -0
  92. package/.claude/agents/v3/security-architect-aidefence.md +410 -0
  93. package/.claude/agents/v3/security-architect.md +867 -0
  94. package/.claude/agents/v3/swarm-memory-manager.md +157 -0
  95. package/.claude/agents/v3/v3-integration-architect.md +205 -0
  96. package/.claude/commands/agents/README.md +50 -0
  97. package/.claude/commands/agents/agent-capabilities.md +140 -0
  98. package/.claude/commands/agents/agent-coordination.md +28 -0
  99. package/.claude/commands/agents/agent-spawning.md +28 -0
  100. package/.claude/commands/agents/agent-types.md +216 -0
  101. package/.claude/commands/agents/health.md +139 -0
  102. package/.claude/commands/agents/list.md +100 -0
  103. package/.claude/commands/agents/logs.md +130 -0
  104. package/.claude/commands/agents/metrics.md +122 -0
  105. package/.claude/commands/agents/pool.md +127 -0
  106. package/.claude/commands/agents/spawn.md +140 -0
  107. package/.claude/commands/agents/status.md +115 -0
  108. package/.claude/commands/agents/stop.md +102 -0
  109. package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
  110. package/.claude/commands/analysis/README.md +9 -0
  111. package/.claude/commands/analysis/bottleneck-detect.md +162 -0
  112. package/.claude/commands/analysis/performance-bottlenecks.md +59 -0
  113. package/.claude/commands/analysis/performance-report.md +25 -0
  114. package/.claude/commands/analysis/token-efficiency.md +45 -0
  115. package/.claude/commands/analysis/token-usage.md +25 -0
  116. package/.claude/commands/automation/README.md +9 -0
  117. package/.claude/commands/automation/auto-agent.md +122 -0
  118. package/.claude/commands/automation/self-healing.md +106 -0
  119. package/.claude/commands/automation/session-memory.md +90 -0
  120. package/.claude/commands/automation/smart-agents.md +73 -0
  121. package/.claude/commands/automation/smart-spawn.md +25 -0
  122. package/.claude/commands/automation/workflow-select.md +25 -0
  123. package/.claude/commands/claude-flow-help.md +103 -0
  124. package/.claude/commands/claude-flow-memory.md +107 -0
  125. package/.claude/commands/claude-flow-swarm.md +205 -0
  126. package/.claude/commands/coordination/README.md +9 -0
  127. package/.claude/commands/coordination/agent-spawn.md +25 -0
  128. package/.claude/commands/coordination/init.md +44 -0
  129. package/.claude/commands/coordination/orchestrate.md +43 -0
  130. package/.claude/commands/coordination/spawn.md +45 -0
  131. package/.claude/commands/coordination/swarm-init.md +85 -0
  132. package/.claude/commands/coordination/task-orchestrate.md +25 -0
  133. package/.claude/commands/github/README.md +11 -0
  134. package/.claude/commands/github/code-review-swarm.md +514 -0
  135. package/.claude/commands/github/code-review.md +25 -0
  136. package/.claude/commands/github/github-modes.md +147 -0
  137. package/.claude/commands/github/github-swarm.md +121 -0
  138. package/.claude/commands/github/issue-tracker.md +292 -0
  139. package/.claude/commands/github/issue-triage.md +25 -0
  140. package/.claude/commands/github/multi-repo-swarm.md +519 -0
  141. package/.claude/commands/github/pr-enhance.md +26 -0
  142. package/.claude/commands/github/pr-manager.md +170 -0
  143. package/.claude/commands/github/project-board-sync.md +471 -0
  144. package/.claude/commands/github/release-manager.md +340 -0
  145. package/.claude/commands/github/release-swarm.md +544 -0
  146. package/.claude/commands/github/repo-analyze.md +25 -0
  147. package/.claude/commands/github/repo-architect.md +367 -0
  148. package/.claude/commands/github/swarm-issue.md +485 -0
  149. package/.claude/commands/github/swarm-pr.md +288 -0
  150. package/.claude/commands/github/sync-coordinator.md +303 -0
  151. package/.claude/commands/github/workflow-automation.md +442 -0
  152. package/.claude/commands/hive-mind/README.md +17 -0
  153. package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
  154. package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
  155. package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
  156. package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
  157. package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
  158. package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
  159. package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
  160. package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
  161. package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
  162. package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
  163. package/.claude/commands/hive-mind/hive-mind.md +27 -0
  164. package/.claude/commands/hooks/README.md +11 -0
  165. package/.claude/commands/hooks/overview.md +58 -0
  166. package/.claude/commands/hooks/post-edit.md +117 -0
  167. package/.claude/commands/hooks/post-task.md +112 -0
  168. package/.claude/commands/hooks/pre-edit.md +113 -0
  169. package/.claude/commands/hooks/pre-task.md +111 -0
  170. package/.claude/commands/hooks/session-end.md +118 -0
  171. package/.claude/commands/hooks/setup.md +103 -0
  172. package/.claude/commands/memory/README.md +9 -0
  173. package/.claude/commands/memory/memory-persist.md +25 -0
  174. package/.claude/commands/memory/memory-search.md +25 -0
  175. package/.claude/commands/memory/memory-usage.md +25 -0
  176. package/.claude/commands/memory/neural.md +47 -0
  177. package/.claude/commands/monitoring/README.md +9 -0
  178. package/.claude/commands/monitoring/agent-metrics.md +25 -0
  179. package/.claude/commands/monitoring/agents.md +44 -0
  180. package/.claude/commands/monitoring/real-time-view.md +25 -0
  181. package/.claude/commands/monitoring/status.md +46 -0
  182. package/.claude/commands/monitoring/swarm-monitor.md +25 -0
  183. package/.claude/commands/optimization/README.md +9 -0
  184. package/.claude/commands/optimization/auto-topology.md +62 -0
  185. package/.claude/commands/optimization/cache-manage.md +25 -0
  186. package/.claude/commands/optimization/parallel-execute.md +25 -0
  187. package/.claude/commands/optimization/parallel-execution.md +50 -0
  188. package/.claude/commands/optimization/topology-optimize.md +25 -0
  189. package/.claude/commands/pair/README.md +261 -0
  190. package/.claude/commands/pair/commands.md +546 -0
  191. package/.claude/commands/pair/config.md +510 -0
  192. package/.claude/commands/pair/examples.md +512 -0
  193. package/.claude/commands/pair/modes.md +348 -0
  194. package/.claude/commands/pair/session.md +407 -0
  195. package/.claude/commands/pair/start.md +209 -0
  196. package/.claude/commands/sparc/analyzer.md +52 -0
  197. package/.claude/commands/sparc/architect.md +53 -0
  198. package/.claude/commands/sparc/ask.md +97 -0
  199. package/.claude/commands/sparc/batch-executor.md +54 -0
  200. package/.claude/commands/sparc/code.md +89 -0
  201. package/.claude/commands/sparc/coder.md +54 -0
  202. package/.claude/commands/sparc/debug.md +83 -0
  203. package/.claude/commands/sparc/debugger.md +54 -0
  204. package/.claude/commands/sparc/designer.md +53 -0
  205. package/.claude/commands/sparc/devops.md +109 -0
  206. package/.claude/commands/sparc/docs-writer.md +80 -0
  207. package/.claude/commands/sparc/documenter.md +54 -0
  208. package/.claude/commands/sparc/innovator.md +54 -0
  209. package/.claude/commands/sparc/integration.md +83 -0
  210. package/.claude/commands/sparc/mcp.md +117 -0
  211. package/.claude/commands/sparc/memory-manager.md +54 -0
  212. package/.claude/commands/sparc/optimizer.md +54 -0
  213. package/.claude/commands/sparc/orchestrator.md +132 -0
  214. package/.claude/commands/sparc/post-deployment-monitoring-mode.md +83 -0
  215. package/.claude/commands/sparc/refinement-optimization-mode.md +83 -0
  216. package/.claude/commands/sparc/researcher.md +54 -0
  217. package/.claude/commands/sparc/reviewer.md +54 -0
  218. package/.claude/commands/sparc/security-review.md +80 -0
  219. package/.claude/commands/sparc/sparc-modes.md +174 -0
  220. package/.claude/commands/sparc/sparc.md +111 -0
  221. package/.claude/commands/sparc/spec-pseudocode.md +80 -0
  222. package/.claude/commands/sparc/supabase-admin.md +348 -0
  223. package/.claude/commands/sparc/swarm-coordinator.md +54 -0
  224. package/.claude/commands/sparc/tdd.md +54 -0
  225. package/.claude/commands/sparc/tester.md +54 -0
  226. package/.claude/commands/sparc/tutorial.md +79 -0
  227. package/.claude/commands/sparc/workflow-manager.md +54 -0
  228. package/.claude/commands/stream-chain/pipeline.md +121 -0
  229. package/.claude/commands/stream-chain/run.md +70 -0
  230. package/.claude/commands/swarm/README.md +15 -0
  231. package/.claude/commands/swarm/analysis.md +95 -0
  232. package/.claude/commands/swarm/development.md +96 -0
  233. package/.claude/commands/swarm/examples.md +168 -0
  234. package/.claude/commands/swarm/maintenance.md +102 -0
  235. package/.claude/commands/swarm/optimization.md +117 -0
  236. package/.claude/commands/swarm/research.md +136 -0
  237. package/.claude/commands/swarm/swarm-analysis.md +8 -0
  238. package/.claude/commands/swarm/swarm-background.md +8 -0
  239. package/.claude/commands/swarm/swarm-init.md +19 -0
  240. package/.claude/commands/swarm/swarm-modes.md +8 -0
  241. package/.claude/commands/swarm/swarm-monitor.md +8 -0
  242. package/.claude/commands/swarm/swarm-spawn.md +19 -0
  243. package/.claude/commands/swarm/swarm-status.md +8 -0
  244. package/.claude/commands/swarm/swarm-strategies.md +8 -0
  245. package/.claude/commands/swarm/swarm.md +87 -0
  246. package/.claude/commands/swarm/testing.md +131 -0
  247. package/.claude/commands/training/README.md +9 -0
  248. package/.claude/commands/training/model-update.md +25 -0
  249. package/.claude/commands/training/neural-patterns.md +108 -0
  250. package/.claude/commands/training/neural-train.md +75 -0
  251. package/.claude/commands/training/pattern-learn.md +25 -0
  252. package/.claude/commands/training/specialization.md +63 -0
  253. package/.claude/commands/truth/start.md +143 -0
  254. package/.claude/commands/verify/check.md +50 -0
  255. package/.claude/commands/verify/start.md +128 -0
  256. package/.claude/commands/workflows/README.md +9 -0
  257. package/.claude/commands/workflows/development.md +78 -0
  258. package/.claude/commands/workflows/research.md +63 -0
  259. package/.claude/commands/workflows/workflow-create.md +25 -0
  260. package/.claude/commands/workflows/workflow-execute.md +25 -0
  261. package/.claude/commands/workflows/workflow-export.md +25 -0
  262. package/.claude/helpers/README.md +97 -0
  263. package/.claude/helpers/adr-compliance.sh +186 -0
  264. package/.claude/helpers/auto-commit.sh +178 -0
  265. package/.claude/helpers/auto-memory-hook.mjs +368 -0
  266. package/.claude/helpers/checkpoint-manager.sh +251 -0
  267. package/.claude/helpers/daemon-manager.sh +252 -0
  268. package/.claude/helpers/ddd-tracker.sh +144 -0
  269. package/.claude/helpers/github-safe.js +156 -0
  270. package/.claude/helpers/github-setup.sh +45 -0
  271. package/.claude/helpers/guidance-hook.sh +13 -0
  272. package/.claude/helpers/guidance-hooks.sh +102 -0
  273. package/.claude/helpers/health-monitor.sh +108 -0
  274. package/.claude/helpers/hook-handler.cjs +286 -0
  275. package/.claude/helpers/intelligence.cjs +1031 -0
  276. package/.claude/helpers/learning-hooks.sh +329 -0
  277. package/.claude/helpers/learning-optimizer.sh +127 -0
  278. package/.claude/helpers/learning-service.mjs +1144 -0
  279. package/.claude/helpers/memory.js +83 -0
  280. package/.claude/helpers/metrics-db.mjs +488 -0
  281. package/.claude/helpers/pattern-consolidator.sh +86 -0
  282. package/.claude/helpers/perf-worker.sh +160 -0
  283. package/.claude/helpers/post-commit +16 -0
  284. package/.claude/helpers/pre-commit +26 -0
  285. package/.claude/helpers/quick-start.sh +19 -0
  286. package/.claude/helpers/router.js +105 -0
  287. package/.claude/helpers/ruflo-hook.cjs +59 -0
  288. package/.claude/helpers/security-scanner.sh +127 -0
  289. package/.claude/helpers/session.js +157 -0
  290. package/.claude/helpers/setup-mcp.sh +18 -0
  291. package/.claude/helpers/standard-checkpoint-hooks.sh +189 -0
  292. package/.claude/helpers/statusline-hook.sh +21 -0
  293. package/.claude/helpers/statusline.cjs +693 -0
  294. package/.claude/helpers/statusline.js +352 -0
  295. package/.claude/helpers/swarm-comms.sh +353 -0
  296. package/.claude/helpers/swarm-hooks.sh +761 -0
  297. package/.claude/helpers/swarm-monitor.sh +211 -0
  298. package/.claude/helpers/sync-v3-metrics.sh +245 -0
  299. package/.claude/helpers/update-v3-progress.sh +166 -0
  300. package/.claude/helpers/v3-quick-status.sh +58 -0
  301. package/.claude/helpers/v3.sh +111 -0
  302. package/.claude/helpers/validate-v3-config.sh +216 -0
  303. package/.claude/helpers/worker-manager.sh +170 -0
  304. package/.claude/settings.json +285 -0
  305. package/.claude/skills/agentdb-advanced/SKILL.md +550 -0
  306. package/.claude/skills/agentdb-learning/SKILL.md +545 -0
  307. package/.claude/skills/agentdb-memory-patterns/SKILL.md +339 -0
  308. package/.claude/skills/agentdb-optimization/SKILL.md +509 -0
  309. package/.claude/skills/agentdb-vector-search/SKILL.md +339 -0
  310. package/.claude/skills/auto-deploy/SKILL.md +31 -0
  311. package/.claude/skills/autosycn/SKILL.md +30 -0
  312. package/.claude/skills/browser/SKILL.md +204 -0
  313. package/.claude/skills/dual-mode/README.md +71 -0
  314. package/.claude/skills/dual-mode/dual-collect.md +103 -0
  315. package/.claude/skills/dual-mode/dual-coordinate.md +85 -0
  316. package/.claude/skills/dual-mode/dual-spawn.md +81 -0
  317. package/.claude/skills/flow-nexus-neural/SKILL.md +727 -0
  318. package/.claude/skills/flow-nexus-platform/SKILL.md +1154 -0
  319. package/.claude/skills/flow-nexus-swarm/SKILL.md +604 -0
  320. package/.claude/skills/github-code-review/SKILL.md +1125 -0
  321. package/.claude/skills/github-multi-repo/SKILL.md +862 -0
  322. package/.claude/skills/github-project-management/SKILL.md +1262 -0
  323. package/.claude/skills/github-release-management/SKILL.md +1064 -0
  324. package/.claude/skills/github-workflow-automation/SKILL.md +1047 -0
  325. package/.claude/skills/hooks-automation/SKILL.md +1201 -0
  326. package/.claude/skills/mop-help/SKILL.md +35 -0
  327. package/.claude/skills/pair-programming/SKILL.md +1202 -0
  328. package/.claude/skills/reasoningbank-agentdb/SKILL.md +446 -0
  329. package/.claude/skills/reasoningbank-intelligence/SKILL.md +201 -0
  330. package/.claude/skills/skill-builder/SKILL.md +910 -0
  331. package/.claude/skills/sparc-methodology/SKILL.md +1106 -0
  332. package/.claude/skills/stream-chain/SKILL.md +560 -0
  333. package/.claude/skills/swarm-advanced/SKILL.md +970 -0
  334. package/.claude/skills/swarm-orchestration/SKILL.md +179 -0
  335. package/.claude/skills/v3-cli-modernization/SKILL.md +872 -0
  336. package/.claude/skills/v3-core-implementation/SKILL.md +797 -0
  337. package/.claude/skills/v3-ddd-architecture/SKILL.md +442 -0
  338. package/.claude/skills/v3-integration-deep/SKILL.md +241 -0
  339. package/.claude/skills/v3-mcp-optimization/SKILL.md +777 -0
  340. package/.claude/skills/v3-memory-unification/SKILL.md +174 -0
  341. package/.claude/skills/v3-performance-optimization/SKILL.md +390 -0
  342. package/.claude/skills/v3-security-overhaul/SKILL.md +82 -0
  343. package/.claude/skills/v3-swarm-coordination/SKILL.md +340 -0
  344. package/.claude/skills/verification-quality/SKILL.md +691 -0
  345. package/.claude-flow/CAPABILITIES.md +403 -0
  346. package/.claude-flow/config.yaml +43 -0
  347. package/.claude-flow/metrics/learning.json +17 -0
  348. package/.claude-flow/metrics/swarm-activity.json +18 -0
  349. package/.claude-flow/metrics/v3-progress.json +26 -0
  350. package/.claude-flow/security/audit-status.json +8 -0
  351. package/.codex/config.toml +39 -0
  352. package/.gemini/settings.json +49 -0
  353. package/.mcp.json +55 -0
  354. package/.memoryofplanet/PROTOCOL.md +436 -0
  355. package/.memoryofplanet/STATE.json +561 -0
  356. package/.memoryofplanet/config/defaults.json +46 -0
  357. package/.memoryofplanet/config/team.json +7 -0
  358. package/.memoryofplanet/scripts/burhan-mop.mjs +124 -0
  359. package/.memoryofplanet/scripts/mop-auto-deploy.mjs +153 -0
  360. package/.memoryofplanet/scripts/mop-autosycn.mjs +617 -0
  361. package/.memoryofplanet/scripts/mop-core.mjs +774 -0
  362. package/.memoryofplanet/scripts/mop-workflow.mjs +348 -0
  363. package/.memoryofplanet/templates/artifacts/adversarial-review.md +33 -0
  364. package/.memoryofplanet/templates/artifacts/architecture.md +28 -0
  365. package/.memoryofplanet/templates/artifacts/decision-log.md +21 -0
  366. package/.memoryofplanet/templates/artifacts/handoff.md +21 -0
  367. package/.memoryofplanet/templates/artifacts/implementation-notes.md +21 -0
  368. package/.memoryofplanet/templates/artifacts/prd.md +29 -0
  369. package/.memoryofplanet/templates/artifacts/product-brief.md +30 -0
  370. package/.memoryofplanet/templates/artifacts/readiness-report.md +25 -0
  371. package/.memoryofplanet/templates/artifacts/release-notes.md +21 -0
  372. package/.memoryofplanet/templates/artifacts/review.md +21 -0
  373. package/.memoryofplanet/templates/artifacts/story.md +25 -0
  374. package/.memoryofplanet/templates/artifacts/ux-spec.md +32 -0
  375. package/AGENTS.md +126 -0
  376. package/CLAUDE.md +235 -0
  377. package/GEMINI.md +19 -0
  378. package/README.md +1096 -0
  379. package/bin/burhan-mop.mjs +2 -0
  380. package/bin/mop-core.mjs +2 -0
  381. package/bin/mop-workflow.mjs +2 -0
  382. package/package.json +66 -0
@@ -0,0 +1,368 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Auto Memory Bridge Hook (ADR-048/049)
4
+ *
5
+ * Wires AutoMemoryBridge + LearningBridge + MemoryGraph into Claude Code
6
+ * session lifecycle. Called by settings.json SessionStart/SessionEnd hooks.
7
+ *
8
+ * Usage:
9
+ * node auto-memory-hook.mjs import # SessionStart: import auto memory files into backend
10
+ * node auto-memory-hook.mjs sync # SessionEnd: sync insights back to MEMORY.md
11
+ * node auto-memory-hook.mjs status # Show bridge status
12
+ */
13
+
14
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
15
+ import { join, dirname } from 'path';
16
+ import { fileURLToPath } from 'url';
17
+
18
+ const __filename = fileURLToPath(import.meta.url);
19
+ const __dirname = dirname(__filename);
20
+ const PROJECT_ROOT = join(__dirname, '../..');
21
+ const DATA_DIR = join(PROJECT_ROOT, '.claude-flow', 'data');
22
+ const STORE_PATH = join(DATA_DIR, 'auto-memory-store.json');
23
+
24
+ // Colors
25
+ const GREEN = '\x1b[0;32m';
26
+ const CYAN = '\x1b[0;36m';
27
+ const DIM = '\x1b[2m';
28
+ const RESET = '\x1b[0m';
29
+
30
+ const log = (msg) => console.log(`${CYAN}[AutoMemory] ${msg}${RESET}`);
31
+ const success = (msg) => console.log(`${GREEN}[AutoMemory] โœ“ ${msg}${RESET}`);
32
+ const dim = (msg) => console.log(` ${DIM}${msg}${RESET}`);
33
+
34
+ // Ensure data dir
35
+ if (!existsSync(DATA_DIR)) mkdirSync(DATA_DIR, { recursive: true });
36
+
37
+ // ============================================================================
38
+ // Simple JSON File Backend (implements IMemoryBackend interface)
39
+ // ============================================================================
40
+
41
+ class JsonFileBackend {
42
+ constructor(filePath) {
43
+ this.filePath = filePath;
44
+ this.entries = new Map();
45
+ }
46
+
47
+ async initialize() {
48
+ if (existsSync(this.filePath)) {
49
+ try {
50
+ const data = JSON.parse(readFileSync(this.filePath, 'utf-8'));
51
+ if (Array.isArray(data)) {
52
+ for (const entry of data) this.entries.set(entry.id, entry);
53
+ }
54
+ } catch { /* start fresh */ }
55
+ }
56
+ }
57
+
58
+ async shutdown() { this._persist(); }
59
+ async store(entry) { this.entries.set(entry.id, entry); this._persist(); }
60
+ async get(id) { return this.entries.get(id) ?? null; }
61
+ async getByKey(key, ns) {
62
+ for (const e of this.entries.values()) {
63
+ if (e.key === key && (!ns || e.namespace === ns)) return e;
64
+ }
65
+ return null;
66
+ }
67
+ async update(id, updates) {
68
+ const e = this.entries.get(id);
69
+ if (!e) return null;
70
+ if (updates.metadata) Object.assign(e.metadata, updates.metadata);
71
+ if (updates.content !== undefined) e.content = updates.content;
72
+ if (updates.tags) e.tags = updates.tags;
73
+ e.updatedAt = Date.now();
74
+ this._persist();
75
+ return e;
76
+ }
77
+ async delete(id) { return this.entries.delete(id); }
78
+ async query(opts) {
79
+ let results = [...this.entries.values()];
80
+ if (opts?.namespace) results = results.filter(e => e.namespace === opts.namespace);
81
+ if (opts?.type) results = results.filter(e => e.type === opts.type);
82
+ if (opts?.limit) results = results.slice(0, opts.limit);
83
+ return results;
84
+ }
85
+ async search() { return []; } // No vector search in JSON backend
86
+ async bulkInsert(entries) { for (const e of entries) this.entries.set(e.id, e); this._persist(); }
87
+ async bulkDelete(ids) { let n = 0; for (const id of ids) { if (this.entries.delete(id)) n++; } this._persist(); return n; }
88
+ async count() { return this.entries.size; }
89
+ async listNamespaces() {
90
+ const ns = new Set();
91
+ for (const e of this.entries.values()) ns.add(e.namespace || 'default');
92
+ return [...ns];
93
+ }
94
+ async clearNamespace(ns) {
95
+ let n = 0;
96
+ for (const [id, e] of this.entries) {
97
+ if (e.namespace === ns) { this.entries.delete(id); n++; }
98
+ }
99
+ this._persist();
100
+ return n;
101
+ }
102
+ async getStats() {
103
+ return {
104
+ totalEntries: this.entries.size,
105
+ entriesByNamespace: {},
106
+ entriesByType: { semantic: 0, episodic: 0, procedural: 0, working: 0, cache: 0 },
107
+ memoryUsage: 0, avgQueryTime: 0, avgSearchTime: 0,
108
+ };
109
+ }
110
+ async healthCheck() {
111
+ return {
112
+ status: 'healthy',
113
+ components: {
114
+ storage: { status: 'healthy', latency: 0 },
115
+ index: { status: 'healthy', latency: 0 },
116
+ cache: { status: 'healthy', latency: 0 },
117
+ },
118
+ timestamp: Date.now(), issues: [], recommendations: [],
119
+ };
120
+ }
121
+
122
+ _persist() {
123
+ try {
124
+ writeFileSync(this.filePath, JSON.stringify([...this.entries.values()], null, 2), 'utf-8');
125
+ } catch { /* best effort */ }
126
+ }
127
+ }
128
+
129
+ // ============================================================================
130
+ // Resolve memory package path (local dev or npm installed)
131
+ // ============================================================================
132
+
133
+ async function loadMemoryPackage() {
134
+ // Strategy 1: Local dev (built dist)
135
+ const localDist = join(PROJECT_ROOT, 'v3/@claude-flow/memory/dist/index.js');
136
+ if (existsSync(localDist)) {
137
+ try {
138
+ return await import(`file://${localDist}`);
139
+ } catch { /* fall through */ }
140
+ }
141
+
142
+ // Strategy 2: Use createRequire for CJS-style resolution (handles nested node_modules
143
+ // when installed as a transitive dependency via npx ruflo / npx claude-flow)
144
+ try {
145
+ const { createRequire } = await import('module');
146
+ const require = createRequire(join(PROJECT_ROOT, 'package.json'));
147
+ return require('@claude-flow/memory');
148
+ } catch { /* fall through */ }
149
+
150
+ // Strategy 3: ESM import (works when @claude-flow/memory is a direct dependency)
151
+ try {
152
+ return await import('@claude-flow/memory');
153
+ } catch { /* fall through */ }
154
+
155
+ // Strategy 4: Walk up from PROJECT_ROOT looking for @claude-flow/memory in any node_modules
156
+ let searchDir = PROJECT_ROOT;
157
+ const { parse } = await import('path');
158
+ while (searchDir !== parse(searchDir).root) {
159
+ const candidate = join(searchDir, 'node_modules', '@claude-flow', 'memory', 'dist', 'index.js');
160
+ if (existsSync(candidate)) {
161
+ try {
162
+ return await import(`file://${candidate}`);
163
+ } catch { /* fall through */ }
164
+ }
165
+ searchDir = dirname(searchDir);
166
+ }
167
+
168
+ return null;
169
+ }
170
+
171
+ // ============================================================================
172
+ // Read config from .claude-flow/config.yaml
173
+ // ============================================================================
174
+
175
+ function readConfig() {
176
+ const configPath = join(PROJECT_ROOT, '.claude-flow', 'config.yaml');
177
+ const defaults = {
178
+ learningBridge: { enabled: true, sonaMode: 'balanced', confidenceDecayRate: 0.005, accessBoostAmount: 0.03, consolidationThreshold: 10 },
179
+ memoryGraph: { enabled: true, pageRankDamping: 0.85, maxNodes: 5000, similarityThreshold: 0.8 },
180
+ agentScopes: { enabled: true, defaultScope: 'project' },
181
+ };
182
+
183
+ if (!existsSync(configPath)) return defaults;
184
+
185
+ try {
186
+ const yaml = readFileSync(configPath, 'utf-8');
187
+ // Simple YAML parser for the memory section
188
+ const getBool = (key) => {
189
+ const match = yaml.match(new RegExp(`${key}:\\s*(true|false)`, 'i'));
190
+ return match ? match[1] === 'true' : undefined;
191
+ };
192
+
193
+ const lbEnabled = getBool('learningBridge[\\s\\S]*?enabled');
194
+ if (lbEnabled !== undefined) defaults.learningBridge.enabled = lbEnabled;
195
+
196
+ const mgEnabled = getBool('memoryGraph[\\s\\S]*?enabled');
197
+ if (mgEnabled !== undefined) defaults.memoryGraph.enabled = mgEnabled;
198
+
199
+ const asEnabled = getBool('agentScopes[\\s\\S]*?enabled');
200
+ if (asEnabled !== undefined) defaults.agentScopes.enabled = asEnabled;
201
+
202
+ return defaults;
203
+ } catch {
204
+ return defaults;
205
+ }
206
+ }
207
+
208
+ // ============================================================================
209
+ // Commands
210
+ // ============================================================================
211
+
212
+ async function doImport() {
213
+ log('Importing auto memory files into bridge...');
214
+
215
+ const memPkg = await loadMemoryPackage();
216
+ if (!memPkg || !memPkg.AutoMemoryBridge) {
217
+ dim('Memory package not available โ€” skipping auto memory import');
218
+ return;
219
+ }
220
+
221
+ const config = readConfig();
222
+ const backend = new JsonFileBackend(STORE_PATH);
223
+ await backend.initialize();
224
+
225
+ const bridgeConfig = {
226
+ workingDir: PROJECT_ROOT,
227
+ syncMode: 'on-session-end',
228
+ };
229
+
230
+ // Wire learning if enabled and available
231
+ if (config.learningBridge.enabled && memPkg.LearningBridge) {
232
+ bridgeConfig.learning = {
233
+ sonaMode: config.learningBridge.sonaMode,
234
+ confidenceDecayRate: config.learningBridge.confidenceDecayRate,
235
+ accessBoostAmount: config.learningBridge.accessBoostAmount,
236
+ consolidationThreshold: config.learningBridge.consolidationThreshold,
237
+ };
238
+ }
239
+
240
+ // Wire graph if enabled and available
241
+ if (config.memoryGraph.enabled && memPkg.MemoryGraph) {
242
+ bridgeConfig.graph = {
243
+ pageRankDamping: config.memoryGraph.pageRankDamping,
244
+ maxNodes: config.memoryGraph.maxNodes,
245
+ similarityThreshold: config.memoryGraph.similarityThreshold,
246
+ };
247
+ }
248
+
249
+ const bridge = new memPkg.AutoMemoryBridge(backend, bridgeConfig);
250
+
251
+ try {
252
+ const result = await bridge.importFromAutoMemory();
253
+ success(`Imported ${result.imported} entries (${result.skipped} skipped)`);
254
+ dim(`โ”œโ”€ Backend entries: ${await backend.count()}`);
255
+ dim(`โ”œโ”€ Learning: ${config.learningBridge.enabled ? 'active' : 'disabled'}`);
256
+ dim(`โ”œโ”€ Graph: ${config.memoryGraph.enabled ? 'active' : 'disabled'}`);
257
+ dim(`โ””โ”€ Agent scopes: ${config.agentScopes.enabled ? 'active' : 'disabled'}`);
258
+ } catch (err) {
259
+ dim(`Import failed (non-critical): ${err.message}`);
260
+ }
261
+
262
+ await backend.shutdown();
263
+ }
264
+
265
+ async function doSync() {
266
+ log('Syncing insights to auto memory files...');
267
+
268
+ const memPkg = await loadMemoryPackage();
269
+ if (!memPkg || !memPkg.AutoMemoryBridge) {
270
+ dim('Memory package not available โ€” skipping sync');
271
+ return;
272
+ }
273
+
274
+ const config = readConfig();
275
+ const backend = new JsonFileBackend(STORE_PATH);
276
+ await backend.initialize();
277
+
278
+ const entryCount = await backend.count();
279
+ if (entryCount === 0) {
280
+ dim('No entries to sync');
281
+ await backend.shutdown();
282
+ return;
283
+ }
284
+
285
+ const bridgeConfig = {
286
+ workingDir: PROJECT_ROOT,
287
+ syncMode: 'on-session-end',
288
+ };
289
+
290
+ if (config.learningBridge.enabled && memPkg.LearningBridge) {
291
+ bridgeConfig.learning = {
292
+ sonaMode: config.learningBridge.sonaMode,
293
+ confidenceDecayRate: config.learningBridge.confidenceDecayRate,
294
+ consolidationThreshold: config.learningBridge.consolidationThreshold,
295
+ };
296
+ }
297
+
298
+ if (config.memoryGraph.enabled && memPkg.MemoryGraph) {
299
+ bridgeConfig.graph = {
300
+ pageRankDamping: config.memoryGraph.pageRankDamping,
301
+ maxNodes: config.memoryGraph.maxNodes,
302
+ };
303
+ }
304
+
305
+ const bridge = new memPkg.AutoMemoryBridge(backend, bridgeConfig);
306
+
307
+ try {
308
+ const syncResult = await bridge.syncToAutoMemory();
309
+ success(`Synced ${syncResult.synced} entries to auto memory`);
310
+ dim(`โ”œโ”€ Categories updated: ${syncResult.categories?.join(', ') || 'none'}`);
311
+ dim(`โ””โ”€ Backend entries: ${entryCount}`);
312
+
313
+ // Curate MEMORY.md index with graph-aware ordering
314
+ await bridge.curateIndex();
315
+ success('Curated MEMORY.md index');
316
+ } catch (err) {
317
+ dim(`Sync failed (non-critical): ${err.message}`);
318
+ }
319
+
320
+ if (bridge.destroy) bridge.destroy();
321
+ await backend.shutdown();
322
+ }
323
+
324
+ async function doStatus() {
325
+ const memPkg = await loadMemoryPackage();
326
+ const config = readConfig();
327
+
328
+ console.log('\n=== Auto Memory Bridge Status ===\n');
329
+ console.log(` Package: ${memPkg ? 'โœ… Available' : 'โŒ Not found'}`);
330
+ console.log(` Store: ${existsSync(STORE_PATH) ? 'โœ… ' + STORE_PATH : 'โธ Not initialized'}`);
331
+ console.log(` LearningBridge: ${config.learningBridge.enabled ? 'โœ… Enabled' : 'โธ Disabled'}`);
332
+ console.log(` MemoryGraph: ${config.memoryGraph.enabled ? 'โœ… Enabled' : 'โธ Disabled'}`);
333
+ console.log(` AgentScopes: ${config.agentScopes.enabled ? 'โœ… Enabled' : 'โธ Disabled'}`);
334
+
335
+ if (existsSync(STORE_PATH)) {
336
+ try {
337
+ const data = JSON.parse(readFileSync(STORE_PATH, 'utf-8'));
338
+ console.log(` Entries: ${Array.isArray(data) ? data.length : 0}`);
339
+ } catch { /* ignore */ }
340
+ }
341
+
342
+ console.log('');
343
+ }
344
+
345
+ // ============================================================================
346
+ // Main
347
+ // ============================================================================
348
+
349
+ const command = process.argv[2] || 'status';
350
+
351
+ // Suppress unhandled rejection warnings from dynamic import() failures
352
+ process.on('unhandledRejection', () => {});
353
+
354
+ try {
355
+ switch (command) {
356
+ case 'import': await doImport(); break;
357
+ case 'sync': await doSync(); break;
358
+ case 'status': await doStatus(); break;
359
+ default:
360
+ console.log('Usage: auto-memory-hook.mjs <import|sync|status>');
361
+ break;
362
+ }
363
+ } catch (err) {
364
+ // Hooks must never crash Claude Code - fail silently
365
+ try { dim(`Error (non-critical): ${err.message}`); } catch (_) {}
366
+ }
367
+ // Force clean exit โ€” process.exitCode alone isn't enough if async errors override it
368
+ process.exit(0);
@@ -0,0 +1,251 @@
1
+ #!/bin/bash
2
+ # Claude Checkpoint Manager
3
+ # Provides easy rollback and management of Claude Code checkpoints
4
+
5
+ set -e
6
+
7
+ # Colors
8
+ RED='\033[0;31m'
9
+ GREEN='\033[0;32m'
10
+ YELLOW='\033[1;33m'
11
+ BLUE='\033[0;34m'
12
+ NC='\033[0m' # No Color
13
+
14
+ # Configuration
15
+ CHECKPOINT_DIR=".claude/checkpoints"
16
+ BACKUP_DIR=".claude/backups"
17
+
18
+ # Help function
19
+ show_help() {
20
+ cat << EOF
21
+ Claude Checkpoint Manager
22
+ ========================
23
+
24
+ Usage: $0 <command> [options]
25
+
26
+ Commands:
27
+ list List all checkpoints
28
+ show <id> Show details of a specific checkpoint
29
+ rollback <id> Rollback to a specific checkpoint
30
+ diff <id> Show diff since checkpoint
31
+ clean Clean old checkpoints (older than 7 days)
32
+ summary Show session summary
33
+
34
+ Options:
35
+ --hard For rollback: use git reset --hard (destructive)
36
+ --soft For rollback: use git reset --soft (default)
37
+ --branch For rollback: create new branch from checkpoint
38
+
39
+ Examples:
40
+ $0 list
41
+ $0 show checkpoint-20240130-143022
42
+ $0 rollback checkpoint-20240130-143022 --branch
43
+ $0 diff session-end-session-20240130-150000
44
+ EOF
45
+ }
46
+
47
+ # List all checkpoints
48
+ function list_checkpoints() {
49
+ echo -e "${BLUE}๐Ÿ“‹ Available Checkpoints:${NC}"
50
+ echo ""
51
+
52
+ # List checkpoint tags
53
+ echo -e "${YELLOW}Git Tags:${NC}"
54
+ local tags=$(git tag -l 'checkpoint-*' -l 'session-end-*' -l 'task-*' --sort=-creatordate | head -20)
55
+ if [ -n "$tags" ]; then
56
+ echo "$tags"
57
+ else
58
+ echo "No checkpoint tags found"
59
+ fi
60
+
61
+ echo ""
62
+
63
+ # List checkpoint branches
64
+ echo -e "${YELLOW}Checkpoint Branches:${NC}"
65
+ local branches=$(git branch -a | grep "checkpoint/" | sed 's/^[ *]*//')
66
+ if [ -n "$branches" ]; then
67
+ echo "$branches"
68
+ else
69
+ echo "No checkpoint branches found"
70
+ fi
71
+
72
+ echo ""
73
+
74
+ # List checkpoint files
75
+ if [ -d "$CHECKPOINT_DIR" ]; then
76
+ echo -e "${YELLOW}Recent Checkpoint Files:${NC}"
77
+ find "$CHECKPOINT_DIR" -name "*.json" -type f -printf "%T@ %p\n" | \
78
+ sort -rn | head -10 | cut -d' ' -f2- | xargs -I {} basename {}
79
+ fi
80
+ }
81
+
82
+ # Show checkpoint details
83
+ function show_checkpoint() {
84
+ local checkpoint_id="$1"
85
+
86
+ echo -e "${BLUE}๐Ÿ“ Checkpoint Details: $checkpoint_id${NC}"
87
+ echo ""
88
+
89
+ # Check if it's a tag
90
+ if git tag -l "$checkpoint_id" | grep -q "$checkpoint_id"; then
91
+ echo -e "${YELLOW}Type:${NC} Git Tag"
92
+ echo -e "${YELLOW}Commit:${NC} $(git rev-list -n 1 "$checkpoint_id")"
93
+ echo -e "${YELLOW}Date:${NC} $(git log -1 --format=%ai "$checkpoint_id")"
94
+ echo -e "${YELLOW}Message:${NC}"
95
+ git log -1 --format=%B "$checkpoint_id" | sed 's/^/ /'
96
+ echo ""
97
+ echo -e "${YELLOW}Files changed:${NC}"
98
+ git diff-tree --no-commit-id --name-status -r "$checkpoint_id" | sed 's/^/ /'
99
+ # Check if it's a branch
100
+ elif git branch -a | grep -q "$checkpoint_id"; then
101
+ echo -e "${YELLOW}Type:${NC} Git Branch"
102
+ echo -e "${YELLOW}Latest commit:${NC}"
103
+ git log -1 --oneline "$checkpoint_id"
104
+ else
105
+ echo -e "${RED}โŒ Checkpoint not found: $checkpoint_id${NC}"
106
+ exit 1
107
+ fi
108
+ }
109
+
110
+ # Rollback to checkpoint
111
+ function rollback_checkpoint() {
112
+ local checkpoint_id="$1"
113
+ local mode="$2"
114
+
115
+ echo -e "${YELLOW}๐Ÿ”„ Rolling back to checkpoint: $checkpoint_id${NC}"
116
+ echo ""
117
+
118
+ # Verify checkpoint exists
119
+ if ! git tag -l "$checkpoint_id" | grep -q "$checkpoint_id" && \
120
+ ! git branch -a | grep -q "$checkpoint_id"; then
121
+ echo -e "${RED}โŒ Checkpoint not found: $checkpoint_id${NC}"
122
+ exit 1
123
+ fi
124
+
125
+ # Create backup before rollback
126
+ local backup_name="backup-$(date +%Y%m%d-%H%M%S)"
127
+ echo "Creating backup: $backup_name"
128
+ git tag "$backup_name" -m "Backup before rollback to $checkpoint_id"
129
+
130
+ case "$mode" in
131
+ "--hard")
132
+ echo -e "${RED}โš ๏ธ Performing hard reset (destructive)${NC}"
133
+ git reset --hard "$checkpoint_id"
134
+ echo -e "${GREEN}โœ… Rolled back to $checkpoint_id (hard reset)${NC}"
135
+ ;;
136
+ "--branch")
137
+ local branch_name="rollback-$checkpoint_id-$(date +%Y%m%d-%H%M%S)"
138
+ echo "Creating new branch: $branch_name"
139
+ git checkout -b "$branch_name" "$checkpoint_id"
140
+ echo -e "${GREEN}โœ… Created branch $branch_name from $checkpoint_id${NC}"
141
+ ;;
142
+ "--stash"|*)
143
+ echo "Stashing current changes..."
144
+ git stash push -m "Stash before rollback to $checkpoint_id"
145
+ git reset --soft "$checkpoint_id"
146
+ echo -e "${GREEN}โœ… Rolled back to $checkpoint_id (soft reset)${NC}"
147
+ echo "Your changes are stashed. Use 'git stash pop' to restore them."
148
+ ;;
149
+ esac
150
+ }
151
+
152
+ # Show diff since checkpoint
153
+ function diff_checkpoint() {
154
+ local checkpoint_id="$1"
155
+
156
+ echo -e "${BLUE}๐Ÿ“Š Changes since checkpoint: $checkpoint_id${NC}"
157
+ echo ""
158
+
159
+ if git tag -l "$checkpoint_id" | grep -q "$checkpoint_id"; then
160
+ git diff "$checkpoint_id"
161
+ elif git branch -a | grep -q "$checkpoint_id"; then
162
+ git diff "$checkpoint_id"
163
+ else
164
+ echo -e "${RED}โŒ Checkpoint not found: $checkpoint_id${NC}"
165
+ exit 1
166
+ fi
167
+ }
168
+
169
+ # Clean old checkpoints
170
+ function clean_checkpoints() {
171
+ local days=${1:-7}
172
+
173
+ echo -e "${YELLOW}๐Ÿงน Cleaning checkpoints older than $days days...${NC}"
174
+ echo ""
175
+
176
+ # Clean old checkpoint files
177
+ if [ -d "$CHECKPOINT_DIR" ]; then
178
+ find "$CHECKPOINT_DIR" -name "*.json" -type f -mtime +$days -delete
179
+ echo "โœ… Cleaned old checkpoint files"
180
+ fi
181
+
182
+ # List old tags (but don't delete automatically)
183
+ echo ""
184
+ echo "Old checkpoint tags (manual deletion required):"
185
+ git tag -l 'checkpoint-*' --sort=-creatordate | tail -n +50 || echo "No old tags found"
186
+ }
187
+
188
+ # Show session summary
189
+ function show_summary() {
190
+ echo -e "${BLUE}๐Ÿ“Š Session Summary${NC}"
191
+ echo ""
192
+
193
+ # Find most recent session summary
194
+ if [ -d "$CHECKPOINT_DIR" ]; then
195
+ local latest_summary=$(find "$CHECKPOINT_DIR" -name "summary-*.md" -type f -printf "%T@ %p\n" | \
196
+ sort -rn | head -1 | cut -d' ' -f2-)
197
+
198
+ if [ -n "$latest_summary" ]; then
199
+ echo -e "${YELLOW}Latest session summary:${NC}"
200
+ cat "$latest_summary"
201
+ else
202
+ echo "No session summaries found"
203
+ fi
204
+ fi
205
+ }
206
+
207
+ # Main command handling
208
+ case "$1" in
209
+ list)
210
+ list_checkpoints
211
+ ;;
212
+ show)
213
+ if [ -z "$2" ]; then
214
+ echo -e "${RED}Error: Please specify a checkpoint ID${NC}"
215
+ show_help
216
+ exit 1
217
+ fi
218
+ show_checkpoint "$2"
219
+ ;;
220
+ rollback)
221
+ if [ -z "$2" ]; then
222
+ echo -e "${RED}Error: Please specify a checkpoint ID${NC}"
223
+ show_help
224
+ exit 1
225
+ fi
226
+ rollback_checkpoint "$2" "$3"
227
+ ;;
228
+ diff)
229
+ if [ -z "$2" ]; then
230
+ echo -e "${RED}Error: Please specify a checkpoint ID${NC}"
231
+ show_help
232
+ exit 1
233
+ fi
234
+ diff_checkpoint "$2"
235
+ ;;
236
+ clean)
237
+ clean_checkpoints "$2"
238
+ ;;
239
+ summary)
240
+ show_summary
241
+ ;;
242
+ help|--help|-h)
243
+ show_help
244
+ ;;
245
+ *)
246
+ echo -e "${RED}Error: Unknown command: $1${NC}"
247
+ echo ""
248
+ show_help
249
+ exit 1
250
+ ;;
251
+ esac