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
OverviewAn agent-first mail and CRM workflow on the owner's Mac. The agent does the work, the admin shows it, the owner decides. He starts an agent session (Claude Code or Codex: hub agent <project>, or a tab of the admin's termTwo layers: core and instanceThis repository is the core of a local, manual-first mail and CRM workflow. It is built to be handed to any owner, who sets up his own projects with it. Everything in a working setup belongs to exactly one of two layers.
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
Notion setupOne place for everything about the Notion side of an instance: what the CRM in Notion consists of, which fields each database has, how to connect it, how to build it in a fresh teamspace.Notion fields, per databaseEvery property of every database the Notion CRM deploys, with its type, who writes it and the select options. Names are exactly as Notion shows them: Hub and the CRM sync look fields up by name, so never rename one. The
Setup
Setup checklistWork top to bottom. hub doctor runs every box below that is not an optional extra and prints PASS, WARN or FAIL per step id; hub doctor --automation adds the extras. A FAIL names its own fix. hub guide prints the by-handAccess: which credential goes to whatThe single owner page for access. Every other page links here instead of repeating it. A check for each row is a hub doctor step; the full ordered list of steps is the generated checklist.md.Instances and teams: start one, join oneHow a Hub instance is made, shared with a team and installed on each person's Mac. Any instance, any team size: two, three, four or more people on one instance work the same way. Decision: the plan repo's decision 0043 (