Docs / Setup

Instances and teams: start one, join one

How 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 (P89).

The layout

What is shared and what is personal

Shared by the team Personal, on each Mac
Notion: clients, leads, tasks, documents (the project's teamspace) data/app.db: drafts, records, Activity
The private instance repo: project.md, knowledge, workflows, sequences, filters, config Agent sessions and their sign-ins (Claude Code, Codex, the Notion connector)
Google Drive: client documents only, linked from the client's Drive folder field Apple Mail accounts (a shared mailbox is fine: each person's drafts are their own)
A Telegram or WhatsApp login of the person's OWN account
state/ (secrets, sessions, logs, person.json with the person's name), autostart

Never put the instance folder, state/, data/app.db, .env, a messenger session, node_modules or .next in git or on Google Drive, iCloud Drive, Dropbox or OneDrive: SQLite over a synced folder corrupts, a copied messenger session is a second device on one key (440, ban risk), and dependencies churn the sync. ./run.sh setup fails files.unsynced when the folder is in one of those.

When a reply is sent (the admin's Send, hub send, or a send Sent detection sees), the Hub writes Last sent at and Last sent by (your setup name) on the client's Clients page, so the team sees who wrote last. Setting notion.stamp_sends (on by default) in project.md switches it; it needs the hub integration with "Update content" and the two fields in Notion (../notion/fields.md, access.md).

Start a new instance

From any core checkout (./hub.sh in it) or an existing instance (./run.sh). Run inside a git checkout, the new folder goes next to it (../hub-acme), never inside it; elsewhere it goes in the current folder; a path is used as given. Until the next core tag, add --pin main to get a core with this setup:

git clone https://github.com/markolofsen/reforms-hub.git && cd reforms-hub
./hub.sh new-instance acme                                 # makes ../hub-acme, core pinned at the newest tag; asks the kind of its first project
cd ../hub-acme && ./run.sh setup                           # your Mac: tools, folders, skills, checks, your name, the personal list
gh repo create <you>/hub-acme --private --source . --remote origin --push   # printed by new-instance; you run it
./run.sh agent acme                                     # then say «настрой проект acme»

On a terminal new-instance asks one question: the kinds of ./hub.sh project kinds, numbered; answer a number or a name, or Enter for no project yet (then ./run.sh agent new and «настрой проект »). In a script, --kind <kind> says it and nothing is asked; without it there is no project. --no-install leaves the dependencies for ./run.sh setup; under 5 GB free the install is skipped and said so. The Hub never creates a remote. ./run.sh setup in the new folder sees a project nobody set up yet and calls it a new instance.

Join an instance as a teammate

The instance owner adds you to the private repo on GitHub and to the project's Notion teamspace. Then, on your Mac, in a local folder:

git clone --recurse-submodules https://github.com/<owner>/hub-<name>.git ~/workspace/hub-<name>
cd ~/workspace/hub-<name>
./run.sh setup --person "Your Name"

./run.sh setup says what it sees ("You are joining an instance the team already set up"), checks out the pinned core if the clone has none, installs Node's packages when they are missing (core/install.sh), makes the folders, config and skill links, runs the checks, and ends with Personal on this Mac: one line each, ok, TODO, opt or ?, with the exact fix. It types nothing for you:

Run it again any time: on a Mac that already runs the instance it is the doctor plus what is new (a newer core, a missing sign-in).

Working together

Update this page when the architecture changes.

Source: @docs/setup/team.md