MiniClaw

MiniClaw 是一个 local-first automation runtime,把 Discord 消息、可选 Weixin direct 文字/语音/图片入口、cron 调度、只读 providers 和 Claude/Codex agents 组织成一条可观测的个人自动化工作流。website 是面向人的门户;实现契约仍维护在 repo docs 中。

系统设计

flowchart LR
  Discord[Discord] --> Intake[IM Intake]
  Weixin[Weixin Direct] --> Intake
  Intake --> Router[Smart Router]
  Router --> Chat[Chat Runtime]
  Router --> Task[Task Runtime]
  Cron[Cron Scheduler] --> ActiveWindow[Active Window Guard]
  ActiveWindow --> Providers[Pre Providers]
  Providers --> Task
  Task --> Agents[Claude / Codex]
  Chat --> Store[(SQLite)]
  Task --> Store
  Agents --> Delivery[Discord / IM Delivery]
  Store --> Quality[Trace / Docs / Quality Gates]

设计边界

  • Discord-native control plane:chat、task intake、slash commands、cron reports 和 failure recovery 默认通过 Discord 交互和留痕;Weixin direct 是 opt-in 的个人文字/语音/图片入口,可独立进入 chat 或经 y/n 确认进入 task。
  • Runtime boundary:MiniClaw 负责 routing、context、progress、trace events 和 delivery;Claude/Codex 负责 agent execution。
  • Operator visibility:task traces、cron run history、只读 doctor reports 和 incident workflows 都是 first-class slash-command surfaces。
  • Provider-first reports:content、email、stock、watchlist、pulse 和 market-intel providers 先生成结构化上下文,再交给 LLM 汇总;scheduled cron 会先经过全局 active-window guard。
  • Local-first state:用户配置、secrets、provider sessions、Weixin account state、cron state 和 SQLite 数据都留在公开 repo 之外。
  • Docs-driven governance:英文 repo docs 是 canonical implementation record;中文 docs 通过 source-hash parity 跟随英文。
  • Quality as architecture:docs drift、website drift、bilingual parity、changelog drift、coverage、secrets 和 cron E2E 都是可执行 gate。

Runtime Loop

sequenceDiagram
  participant U as User / Cron
  participant D as Discord
  participant R as Router
  participant T as Runtime
  participant P as Provider
  participant A as Agent
  participant S as SQLite

  U->>D: message, slash command, or schedule
  D->>R: normalized intake event
  R->>T: chat, task, or cron route
  T->>P: collect trusted context when active window allows
  T->>A: execute with bounded runtime config
  A->>S: persist trace, usage, and state
  T->>D: progress, result, or recovery action

阅读路径

  • Architecture 展示系统边界和数据流动。
  • Runtime 解释 intake、routing、task execution、memory、cron 和 recovery。
  • Providers 描述只读数据采集层以及 provider families。
  • Getting Started 保持首次本地运行足够短,深入配置继续回到 repo docs。
  • Quality Gates 展示 MiniClaw 如何防止 docs、website、tests 和 release checks 漂移。

来源文档

本页是 curated website summary;实现 source of truth 仍然维护在 repo docs 中。