Awesome Cohub
中文
Reference11 min

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:

  1. a live place to work (Space)
  2. a time machine for good moments (Checkpoint / Save)
  3. a shareable surface for others (App, formerly Work)
  4. agents and skills that operate in the same place
  5. 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 nounAlso calledPractice
SpacespaceOne Space ≈ one project / experiment / product line
ChatsessionOne mission per Chat; fork to explore alternatives
SavecheckpointSave milestones & pre-risk states; read diffs
AgentagentSkills + files + smoke tests, not essay-only prompts
AppworkPublish file / directory / port for others to open; older product docs call it Work
ChannelchannelSame Space, different doors (Discord / Feishu / …)
SandboxsandboxWhere commands, ports, and skills execute
ModmodRead-only mount under /mods/<slug> for shared tooling
Skillskill/skill:name reusable capability
Tasktask runAsync jobs, generations, hook runs
Space Hook.cohub/hooks/*Event automation (fs / turn / save / workspace ready)
User config Spacename=configPublishes 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 / iterate

If 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:

TargetGood forNotes
fileSingle HTML artifact.html only, size limits apply
directorySites / built appsneeds index.html; prefer base: "./" + hash routes
portLive dev serversgreat 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 packageRole
markbang/wgetx-skillSocial fetch (ESM, no npm for defaults)
markbang/warp-proxy-skillWARP egress proxy in sandbox
markbang/cohub-work-skillWork kit template + publish flow
talesofai/okpokp — structured knowledge search, navigation, and ingestion
markbang/temp-mail-skilltemp-mail — disposable email for onboarding flow tests
markbang/cohub-pr-skillpr-workflow — parallel PR development with git worktrees + one session per PR
kjx-talesofai/claude-skill-rtb-advisorrtb-advisor — brand strategist for "Reason to Believe"
Platform skills in monorepocohub, cohub-generate, cohub-apps, public-files

Install pattern:

npx skills add <repo-url> --skill <name> --agent codex --yes --copy

Skills 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 Space

Practice:

  1. raw is evidence — don’t rewrite history; add sources
  2. wiki is current understanding — a new input should update 5–10 existing pages, not only create +1 file
  3. log is append-only — what changed, when, with links back to pages
  4. index is the query surface — humans and agents start here
  5. 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/*.yml

Events: 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; operationId makes credit consumes idempotent
  • Reuse purchaseAttemptId on 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/skills and 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

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 with uses.
  • 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 up replaces cohub 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() and cohub decision answer noul / choice / score questions with calibrated probabilities, configured in .cohub/decisions.json and 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=config Space 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

  1. Create or fork a Space
  2. Write a 10-line goal in README.md or GOAL.md
  3. Install only the skills this mission needs

Build

  1. Keep source and outputs in Space files
  2. Use Sessions for missions; Save when green
  3. Prefer small agent loops with verification commands

Ship

  1. For static demos: build → publish directory App
  2. For Cohub-interactive products: App runtime + minimal scopes
  3. Put the public URL in the Space README

Operate

  1. Prefer scheduled prompts + on-disk state for recurrence
  2. Rotate secrets; don’t commit cookies/tokens
  3. 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-patternWhy it hurtsDo this instead
Chat-only projectNo durable truthFiles + Saves
Raw sandbox URL as “launch”Unstable, wrong audiencePublish an App
BrowserRouter on static AppAsset/route 404sHashRouter + base: "./"
Baking live data into distStale + insecureRead Space files/API at runtime
Auth on page loadBad UX + over-permissionGesture + viewer scopes
Mega skill dump unusedNoise, risk, costInstall per mission
No Saves before agent autonomyHard to recoverCheckpoint first
Rebuilding Cohub auth in the AppDuplicate identitySDK auth.request

7. Cheatsheet

Public App URL

/:username/:spaceSlug/w/:workSlug

Minimal static publish intent

pnpm build   # or your builder
cohub -s "$COHUB_SPACE_ID" apps publish <slug> \
  --dir <space-relative-dist> \
  --app-scope file.view

Work 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.*; allowedViewerScopes is deprecated

Always start smaller than you think.


8. How this doc will grow

LayerNowLater
Manifestothis file (v0.21)revise with product changes
Matrixscenario indexkeep IDs stable
Playbooks36 playbooksadd new scenarios as product grows
Concepts36 core nounsadd sparingly
Knowledge-base pattern§3.9 + playbookevolve 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