v0.21 · Best practices for people and agents building in Cohub
Your own space to create, play, and build with people and agents.
This manifesto is not a feature catalog. It is a practice map: how to think, choose surfaces, and ship work without fighting the product.
Companion: Scenario matrix · Playbooks · 中文
Official: Product docs · Changelog
0. The claim
You do not need a separate “chat app + drive + CI + staging + CMS + bot host” to collaborate with agents.
You need:
- a live place to work (Space)
- a time machine for good moments (Checkpoint / Save)
- a shareable surface for others (App, formerly Work)
- agents and skills that operate in the same place
- optional doors (CLI, Discord, Feishu, WeChat, …)
That bundle is Cohub. Everything else is a specialization on top.
1. Mental model (learn these seven nouns)
| UI noun | Also called | Practice |
|---|---|---|
| Space | space | One Space ≈ one project / experiment / product line |
| Chat | session | One mission per Chat; fork to explore alternatives |
| Save | checkpoint | Save milestones & pre-risk states; read diffs |
| Agent | agent | Skills + files + smoke tests, not essay-only prompts |
| App | work | Publish file / directory / port for others to open; older product docs call it Work |
| Channel | channel | Same Space, different doors (Discord / Feishu / …) |
| Sandbox | sandbox | Where commands, ports, and skills execute |
| Mod | mod | Read-only mount under /mods/<slug> for shared tooling |
| Skill | skill | /skill:name reusable capability |
| Task | task run | Async jobs, generations, hook runs |
| Space Hook | .cohub/hooks/* | Event automation (fs / turn / save / workspace ready) |
| User config Space | name=config | Publishes personal rules/skills to /configs/user on Save |
The core loop
open / fork Space
→ talk + edit files with agents
→ Save (Checkpoint) when it matters
→ publish an App when others should open it
→ fork again / propose back / iterateIf you only remember one diagram, remember that.
2. Principles
P1 — Space is the unit of work
Don’t scatter truth across private DMs, random local folders, and three dashboards. Put code, prompts, outputs, and agent state in the Space files.
P2 — Save is the unit of time
A Save is not “git, but worse”. It is a product moment: playable, forkable, restorable. Save when a human would say “keep this version”.
P3 — App is the unit of sharing
Sandbox links and local previews are for authors. Apps are for viewers; older user-facing docs may call them Works. Prefer published Apps for demos and products.
P4 — Least privilege by default
Grant appScopes for safe reads the App always needs. Request viewer grants only on user gesture for prompt / generation / account-level actions.
P5 — Agents need skills and filesystem, not essays
Long system prompts without skills/files are fragile. Install skills, write small state files, run commands, verify outputs.
P6 — Mutable truth stays out of dist/
Published static assets are snapshots. Live data belongs in Space files, sessions, billing, or APIs the App is allowed to call.
P7 — Same product surface, many doors
Web UI, CLI (@neta-art/cohub-cli), and channels should drive the same Space. Don’t invent a second ops path that bypasses Saves/Apps.
3. Capability map (what to use when)
3.1 Spaces & Files
Use for: project home, assets, agent-readable state, configs. Practice: keep a clear tree (src/, data/, docs/, .agents/skills/). Avoid: only chatting; files are the durable memory.
3.2 Sessions & Agents
Use for: exploration, implementation, review, ops. Practice: one Session per mission; link skills; smoke-test after installs. Avoid: infinite mega-threads with no Saves.
3.3 Checkpoints
Use for: milestones, handoff, fork bases, recovery. Practice: Save before big refactors / publish / untrusted agent autonomy. Avoid: zero Saves until disaster.
3.4 Apps (formerly Works)
Targets:
| Target | Good for | Notes |
|---|---|---|
file | Single HTML artifact | .html only, size limits apply |
directory | Sites / built apps | needs index.html; prefer base: "./" + hash routes |
port | Live dev servers | great for preview; not the default production shape |
Runtime truth: cohub.context() / auth / commerce work inside the published App shell, not on raw static asset URLs.
Since v2.37, App is the canonical SDK/API term (client.apps, appScopes); Work and /w/ remain the legacy user-facing vocabulary and compatibility URL. File and directory publishes have immutable manifests and verified downloads; Board and port publishes are runtime surfaces, not restorable file bundles. Query/hash parameters are forwarded to embedded Apps, except the reserved cohub_* namespace.
Official guide: apps-guide.md
3.5 Generations
Use for: image / video / music (and related multimodal tasks) in Space context. Practice: write outputs into Space files; Save good results; track cost/credits. Direct Generation / Create mode makes a primary media request a first-class timeline turn; Task Browser owns asynchronous history and inspection. generation.create and taskrun.view are separate permissions. Use the live model catalog and keep provider cost/retry status visible. Skill: cohub-generate Official: generations.md
3.6 CLI & automation
Use for: scripts, CI-like loops, headless ops. Practice: cohub -s <spaceId> … against the real Space; store ids/slugs in files. Package: @neta-art/cohub-cli (npm scope) · monorepo talesofai/cohub
3.7 Channels
Use for: meeting people where they already chat. Practice: channel → same Space → same files/Saves/Apps. Avoid: channel-only workflows with no Space filesystem.
3.8 Mods & Skills
Use for: reusable agent capabilities.
| Skill package | Role |
|---|---|
| markbang/wgetx-skill | Social fetch (ESM, no npm for defaults) |
| markbang/warp-proxy-skill | WARP egress proxy in sandbox |
| markbang/cohub-work-skill | Work kit template + publish flow |
| talesofai/okp | okp — structured knowledge search, navigation, and ingestion |
| markbang/temp-mail-skill | temp-mail — disposable email for onboarding flow tests |
| markbang/cohub-pr-skill | pr-workflow — parallel PR development with git worktrees + one session per PR |
| kjx-talesofai/claude-skill-rtb-advisor | rtb-advisor — brand strategist for "Reason to Believe" |
| Platform skills in monorepo | cohub, cohub-generate, cohub-apps, public-files |
Install pattern:
npx skills add <repo-url> --skill <name> --agent codex --yes --copySkills must ship assets inside skills/<name>/ so install copies them.
3.9 In-Space knowledge base (wiki compound interest)
Cohub does not require an external knowledge product to start compounding context. A Space is a knowledge base when files are structured for reuse.
Recommended layout (pattern used by long-running context Spaces):
raw/ # immutable evidence (exports, dumps, mirrored sources)
wiki/ # compounding understanding (edit in place)
index.md # living catalog — update when content changes
log.md # append-only timeline of ingests / decisions
overview.md # what this knowledge Space is for
topics/ entities/ analyses/ queries/ ...
runtime/ # optional agent routes, source registry, protocols
.agents/skills/ # optional ops skills for this knowledge SpacePractice:
- raw is evidence — don’t rewrite history; add sources
- wiki is current understanding — a new input should update 5–10 existing pages, not only create
+1file - log is append-only — what changed, when, with links back to pages
- index is the query surface — humans and agents start here
- Path: semantic page first → confirm with evidence in raw → then act
This is how teams and agents share memory without pasting essays into every prompt.
3.10 Space Hooks & scheduled prompts
Scheduled prompts — time-based recurrence (“every Monday review”). Space Hooks (v1.103+) — domain events declared as files:
.cohub/hooks/*.ymlEvents: space.fs.changed · space.workspace.ready · session.turn.finalized · checkpoint.created · app.version.published · task.updated · webhook Actions: run (sandbox shell), prompt (Chat/session), or uses (a published App Action)
Webhook hooks (v2.46) are addressed by file name (POST /api/spaces/:id/webhooks/<name>) with an optional on.secret.
Practice: one file per hook; FS matching ignores .cohub/** to prevent loops; filter turns with sessionIds / sources. Playbook: space-hooks-automation · Doc: space-hooks.md
3.11 App commerce
One-time products on a published App: feature unlocks and consumable credits.
- Runtime only inside the published shell (
context()/app.commerce.*) - Host owns checkout redirect state; App displays gates/balances and triggers purchase/consume
- Version product keys; never mutate price in place;
operationIdmakes credit consumes idempotent - Reuse
purchaseAttemptIdon purchase retries; optional Cohub Balance is a global USD component
Playbook: app-commerce · Promotion: app-promotions · Guide: app-commerce-guide.md
3.12 Home, Sessions inbox, Mods, /skill:
- Home Space — default landing Space (
home); optional bootstrap checkpoint; still a full Space. - Sessions inbox (
/sessions) — cross-space Chat radar; new chat can target a Space without losing inbox chrome. - Mods — mount shared Spaces at
/mods/<slug>; source owns writes; consumers read. /skill:name— composer slash discovery across platform / mod / user / project skills (expand on send).
Playbooks: home-and-sessions-inbox · mod-mount · skill-slash-discovery
3.13 Personal config: Home or a config Space
Cohub publishes personal config from the Home Space (v2.66+) or from a dedicated owner config Space recognized when space.name === "config".
On Save, the worker publishes a whitelist (AGENTS.md, CLAUDE.md, .agents/, .cohub/) to owner storage and every sandbox mounts it read-only at /configs/user.
Effects:
- User Rules (
AGENTS.md) enter chat system context automatically - User skills appear under
/configs/user/.agents/skillsand in/skill:discovery - Skill precedence:
platform → mods → user → workspace(same name: later wins)
Pick one source. A Home Save publishes AGENTS.md, .agents/, .cohub/models.json, and .cohub/theme.css; an existing name=config Space keeps working but does not merge with Home. Mods are not user config. Mods share team/base tooling; personal config is for owner defaults.
Playbook: user-config-and-rules · Concept: user-config-space · Cheat: config-layers
3.14 Platform config Space
Pinned by PLATFORM_SPACE_ID. Saving it publishes whitelist → /configs/platform and refreshes platform skill/prompt/model caches. Mounted read-only as /configs/platform/.agents in every sandbox.
Playbook: platform-config
3.15 Skill catalog & /skill: cache
GET /api/skills merges platform → mod → user → project. Redis catalogs TTL 24h; user/platform Save SETs cache immediately; project/mod keys hash revisions. /skill:name expands server-side before the agent runs.
Playbook: skill-catalog-cache · Concept: skill-discovery
3.16 Execution token identity
Agent tools inject COHUB_EXECUTION_TOKEN (signed execution grant, 24h TTL, space/turn scoped). CLI env overrides Logto. API verifies execution grants before user sessions. User skills enter the system prompt only if actor === space owner.
Playbook: execution-token-identity · Concept: execution-token
3.17 Search layers (and hyper-search)
Cohub includes product search for Spaces/Chats/turns/labels (/api/search). It does not ship a first-class web SERP or hosted RAG over your wiki.
For web search, install hyper-search into your config Space, Save to publish, then use /skill:hyper-search or:
node /configs/user/.agents/skills/hyper-search/scripts/cli.js search "query"Playbook: search-layers
3.18 Recent runtime surfaces (v2.22-v2.46)
- Semantic Board authoring: Items, connections, effects, and Compositions share atomic, versioned mutations with dry-run diagnostics and durable receipts.
- Task Browser: dedicated multimodal Task Run history with identity-scoped stale-while-revalidate caching and scope-aware Space/Mine views.
- Direct Generation: Create-mode turns, idempotent client message submission, timeline barriers, and explicit generation cost states.
- App operations: immutable promotion links, aggregate funnel analytics, live preview refresh, UI callable surfaces, and verified artifact downloads.
- Runtime safety: per-path optimistic concurrency with
fs.edit, recoverable edits, explicit command-output truncation, additive execution-token permissions, and prompt context variables ({{cohub.session.id}},{{cohub.space.id}},{{cohub.user.uuid}}). - App ecosystem: App Center and Marketplace installation through validated
.cohub/apps.json, with enable/disable/uninstall state separate from published App records. - Space navigation and insight: personal-relevance command palette, Recent/All/Mine/Pinned filters, quick-action Prompt buttons, Space-root new Chat, and Space Activity summaries.
- App surfaces (v2.39, v2.44-v2.46): overlays with configurable hit regions, iframe embedding, preview keep-alive tabs, unified surface resolution, and shell context for what is actually open.
- App Actions and webhooks (v2.41, v2.46): server-side entrypoints under
.cohub/actions/(owner-funded, viewer-metered) and HTTP-triggered hooks that can run them withuses. - Board replay and live Apps (v2.40, v2.45): rewindable transaction logs with
createBoardReplayPlayer(), interactive App frames placed by drag-and-drop, and optional entrance motion.
3.19 Local-first runtime and Board v3 (v2.47-v2.70)
- Local Runtime (v2.51-v2.58, v2.60, v2.68):
cohub runtime upreplacescohub sandbox up; a Space can run on a folder via native Pi or Codex Harnesses, with event-driven sync, Windows/macOS support, display sharing, and attach/import flows. - Board v3 (v2.61-v2.69): one consolidated document model (
settings/items/animations), layered SDK packages (board/editor,board/replica,board/stage,board/export/node, SDK 10), and a v3 CLI (boards get,apply,history,preset,export --paper). Board scripts replace Sketch; task cards are server-synced; 3D models preview in place. - App platform (v2.47, v2.50-v2.53, v2.59, v2.63-v2.67):
client.auth.authorize()replaces legacy viewer auth; immutable version history with provenance (?cohub_v=,listPublicVersions());app.manage; trusted Apps and host consent; file handlers; an app window protocol (client.app.window,onBeforeClose,onDrop,onLaunch); App rooms with RTC, history, invites, and device grants; resource Apps. - Decision models (v2.66):
space.decision()andcohub decisionanswernoul/choice/scorequestions with calibrated probabilities, configured in.cohub/decisions.jsonand deliberately excluded from LLM pickers. - Home as personal config (v2.66): saving the Home Space publishes User Rules, skills, prompts, models, and a personal theme; an existing
name=configSpace stays ordinary. - Media and generation (v2.47-v2.70): 3D model inputs, media as URLs end to end, WebP variants, 2 GiB uploads with structured error codes, unified upload quota, and model pricing in the CLI.
- Chat and navigation: four-level fork trees, session source filters, a unified
@mention, a roomier workspace, and compact side-panel tabs.
4. Builder playbook (human)
Start
- Create or fork a Space
- Write a 10-line goal in
README.mdorGOAL.md - Install only the skills this mission needs
Build
- Keep source and outputs in Space files
- Use Sessions for missions; Save when green
- Prefer small agent loops with verification commands
Ship
- For static demos: build → publish directory App
- For Cohub-interactive products: App runtime + minimal scopes
- Put the public URL in the Space README
Operate
- Prefer scheduled prompts + on-disk state for recurrence
- Rotate secrets; don’t commit cookies/tokens
- Fork Saves to explore; don’t mutate the only good timeline blindly
5. Agent playbook (operator model)
Before coding
- Resolve Space id / paths; don’t invent mount points
- Read AGENTS.md / skill SKILL.md if present
- Prefer existing skills over re-implementing scrapers/tools
While coding
- Smallest correct change
- Write artifacts under agreed directories (
data/,apps/, …) - Smoke-test with low limits before large crawls/generations
When publishing
- Confirm
base: "./"and hash routing for static Apps - List scopes explicitly; refuse “full access just in case”
- Return public App URL + how to verify
ready
When stuck
- Save progress
- Record failure (HTTP status, path, command) in a file
- Ask for the missing permission or product decision, not a blank rewrite
6. Anti-patterns
See also expanded cards in anti-patterns/.
| Anti-pattern | Why it hurts | Do this instead |
|---|---|---|
| Chat-only project | No durable truth | Files + Saves |
| Raw sandbox URL as “launch” | Unstable, wrong audience | Publish an App |
| BrowserRouter on static App | Asset/route 404s | HashRouter + base: "./" |
Baking live data into dist | Stale + insecure | Read Space files/API at runtime |
| Auth on page load | Bad UX + over-permission | Gesture + viewer scopes |
| Mega skill dump unused | Noise, risk, cost | Install per mission |
| No Saves before agent autonomy | Hard to recover | Checkpoint first |
| Rebuilding Cohub auth in the App | Duplicate identity | SDK auth.request |
7. Cheatsheet
Public App URL
/:username/:spaceSlug/w/:workSlugMinimal static publish intent
pnpm build # or your builder
cohub -s "$COHUB_SPACE_ID" apps publish <slug> \
--dir <space-relative-dist> \
--app-scope file.viewWork permissions (current mental split)
- appScopes (publisher grants to the App's own Space): e.g.
space.view,session.view,file.view,taskrun.view - viewer grants (viewer consents per Space): e.g.
session.prompt.*,generation.create,user.*;allowedViewerScopesis deprecated
Always start smaller than you think.
8. How this doc will grow
| Layer | Now | Later |
|---|---|---|
| Manifesto | this file (v0.21) | revise with product changes |
| Matrix | scenario index | keep IDs stable |
| Playbooks | 36 playbooks | add new scenarios as product grows |
| Concepts | 36 core nouns | add sparingly |
| Knowledge-base pattern | §3.9 + playbook | evolve with real Spaces |
9. One-page summary
Cohub is all you need when your loop is:
Space (work) → Agent+Skills (do) → Checkpoint (keep) → App (share) → Fork (again)Use the scenario matrix and playbooks to pick the next concrete path.
Part of awesome-cohub · monorepo talesofai/cohub