Documentation

How reforms-hub works, written for the owner and for the developer. Start with the overview, then read the part you need. Every page is the core's own design doc.

Start

How it works

Connectors for the mail agentManual-first: the owner starts a session (hub agent or Claude Desktop) and gives ONE instruction (skills/README.md). Nothing runs in the background.Local admin app (the agent's own interface)Agents reach Mail and Notion through their own connectors (mail-mcp for Apple Mail, the session's Notion connector); the hub gives them local tools (draft_write's record and client_record (hub mcp), hub sequences, the knStack of the local admin appEvery location comes from one function, hubPaths() in @hub/config/paths. Nothing else joins a repo root onto projects, state, config, .claude/skills or data (a gate test fails on new direct joins).Bulk drafts and the review queueStatus: built. How the local admin app (06) lets one person review many prepared replies quickly and safely: the agent prepares one draft per client with the reason for it (a phrase in a session, bulk-drafts), the personSkill and knowledge base: deploy a ready project into NotionThe pack follows the live CRM (decision 0019). Each inventory run saves the live data-source schema and runs notion-dump diff <slug> --live <file>; differences are fixed in schema/*.json (aliases, optional, contract), neProjects and knowledge: one workflow, many projectsHand-written: project.md, mail-filters.md, knowledge/files/, knowledge/taxonomy.md, sequences/, workflows/, @dev/ (the project's development kanban, hub dev init <slug> --apply; table by hub dev index <slug>; doctor stepMail filters: classify all incoming mail by where it comes fromGmail does the sorting, we only write the instructions. The agent proposes rules from a headers-only sample, the owner confirms, the files land in the project folder, and the owner imports mail-filters.xml into Gmail himThe knowledge loop: answer, gap, report, KB fix, importThe knowledge base is the folder projects/<slug>/knowledge/files/: Markdown entries edited by hand, indexed locally and searched with knowledge_search. The agent answers only from it. It never reads Notion or any other sCalendar: the agent keeps the owner's calendar, smartly and safelyA project attaches a Google Calendar connector in project.md (calendar.connector, a gcal-<label> server of the instance: Google's calendarmcp.googleapis.com, any Google account); its Claude Code sessions get it, and the Workflows (playbooks)A workflow is a written playbook an agent follows for one kind of job: "triage an incoming email", "follow up a quiet client". It lives in the project folder, projects/<slug>/workflows/<name>.md, one file per workflow, vLeads in the coreA lead is a request that is not yet a client: a website form, a message from an unknown email sender, a referral. Every project that sells has a Leads database, at the top level of its teamspace. The core does not care wLead forms: the check that a lead still arrivesA site's tests run in process. They cannot see a DNS record, a CSP header, a proxy, a CDN rule or a Turnstile key that stops every form in production, and nobody is told. The Leads doctor group looks at each public form Follow-up sequences (admin label "Sequence steps")A sequence is a short, written plan of follow-ups for one kind of silence: "we answered an enquiry and they did not write back", "we sent a proposal and heard nothing". A client is enrolled when the owner says so: in a sThe embedded terminal, the agent modes and Agent toolsA right-hand column in the admin where Claude Code, Codex or a plain shell run in the instance, beside the drafts they make (track P49, decision 0027). Always on: there is no switch (P66, decision 0032, which reverses 00The agent session logEvery question the owner asks a hub agent session (Claude Code or Codex), every answer, every tool call and every wait on the owner, kept per project so the sessions can be analysed later (track P54). It records; it neveCapabilities: what a project's session can reach (mail, Notion, knowledge, Calendar, Drive, the browser)Every session of hub agent <slug> is told, in one generated line after the project's identity, what it can reach: the capabilities line (sessionCapabilities() in app/packages/agent/src/connectors.ts). It is built by the The typed LLM package (@hub/llm)The Hub's one door to a model API (tracks P78 and P144, decisions @dev/decisions/0039 and 0051). A caller declares a task (what it wants, once, at module level) and runs it; the package turns the task's zod 4 schema intoThe ops logOne structured log for the server and every package: what failed or happened, one redacted JSON line each. The agent session log (25) is what the agent did in a session; the ops log is what broke or moved underneath: a mThe client mapOne Mermaid diagram per client: the top-level picture of what the client wants, what is still open and what we did. The agent redraws it after each draft (Mail or a messenger), after an owner-sent reply it sees and afterThe daily follow-up sweepThe server's selector (packages/db/src/repos/follow-up-due.ts, pure over fact rows) lists a Hub client of the project (decision 0009: never the Notion pages) when all hold: - our message is the newest across their Mail (Public group watchThe server looks at watch.md and lens.json every 5 seconds. A valid change is taken without a restart: new groups are added (a removed one is no longer read, its rows stay), the switch starts or stops reading, and the ne

Notion

Setup