How openclaw/clawhub works
ClawHub is a monorepo with three main product surfaces sharing one backend:
1. the browser web app,
2. the clawdhub CLI,
3. the Convex backend that owns data, auth, search, and file storage.
A fourth important subsystem is the shared schema package, which defines the public contract between the CLI, the web app, and the backend.
Top-level architecture
The repository is organized around a central Convex data platform and several thin clients:
• src/ is the TanStack Start web app.
• packages/clawdhub/ is the end-user CLI package.
• convex/ is the backend application logic, schema, scheduled jobs, HTTP APIs, and auth configuration.
• packages/schema/ contains shared parsers and schema definitions for skill/package/soul file formats and API routes.
• server/ contains server-only helpers, mainly for Open Graph image generation.
• public/ exposes static assets and generated API documentation.
The system serves two closely related sites from the same codebase:
• clawhub.ai for skills and packages.
• onlycrabs.ai for souls.
The host and build mode influence routing and default landing content, but the underlying app and backend are largely shared.
Main runtime boundaries
1) Web frontend: src/
This is the browser-facing application built with TanStack Start, React, Vite, and Nitro-style server rendering.
Its job is to:
• render skill, soul, package, user, and admin pages,
• fetch data from Convex,
• provide publish flows and management screens,
• render rich details such as file listings, version history, security results, comments, stars, and ownership info.
Key characteristics of this layer:
• It is mostly a presentation and orchestration layer.
• It does not own persistent business state.
• It relies on generated Convex client code and shared utility functions.
• It supports both desktop browser interaction and the host-based “souls-first” mode on onlycrabs.ai.
Notable route groups include:
• skills browsing and detail pages,
• soul browsing and detail pages,
• package browsing and publishing,
• publish/upload flows,
• search,
• user profile and org pages,
• admin/management tooling,
• CLI-auth landing pages.
There is a lot of client-side UI composition under src/components/, including specialized panels for:
• skill versions,
• comments,
• diffing,
• files,
• security scan results,
• ownership,
• installation guidance,
• stats and badges.
The frontend talks to the backend through src/convex/client.ts and uses helper functions in src/lib/ for domain logic like uploads, labels, diffing, auth state, deployment drift, and rendering helpers.
2) CLI client: packages/clawdhub/
This package is the command-line interface users run locally.
Its responsibilities are different from the web app:
• authenticate the user,
• discover local skills or packages,
• publish skills and plugins,
• inspect registry entries,
• manage local installs,
• sync telemetry and metadata,
• perform local scanning and configuration handling.
It is not just a thin API wrapper. It also contains local filesystem and runtime logic for:
• homedir and config discovery,
• browser-based auth bootstrap,
• local package/skill scanning,
• command registry and subcommand implementations,
• CLI-specific UI formatting.
The CLI depends on the shared schema package so that its understanding of skill/package manifests and routes stays aligned with the backend and web app.
3) Backend: convex/
Convex is the core system of record.
This layer owns:
• database schema,
• queries and mutations,
• file storage,
• scheduled jobs and maintenance,
• auth integration,
• HTTP endpoints,
• search indexing,
• moderation and approval workflows,
• GitHub import/backup/restore flows,
• telemetry and global stats,
• rate limiting and publish restrictions.
The Convex side is where the domain model lives. It is split into many feature modules rather than a single monolith, with file names reflecting bounded areas such as:
• skills,
• souls,
• packages,
• users,
• stars,
• comments,
• downloads,
• search,
• moderation,
• publishers,
• uploads,
• tokens,
• webhooks,
• GitHub backup/import/restore,
• leaderboards,
• maintenance and cron-driven tasks.
The convex/lib/ subtree holds most reusable domain logic and policy checks. This includes things like:
• access control,
• reserved names and slugs,
• publish limits,
• search text generation,
• embedding visibility,
• moderation rules and reason codes,
• public/private visibility logic,
• package registry and package security rules,
• skill publishing and safety analysis,
• changelog handling,
• GitHub identity/account helpers,
• token and webhook helpers,
• rate limiting and HTTP utilities.
This structure matters architecturally: the backend is not just CRUD, it is a policy engine that validates, transforms, and indexes published content before it becomes visible.
4) Shared contract package: packages/schema/
This package is the explicit protocol layer for the repo.
It contains:
• manifest and frontmatter schemas,
• route definitions,
• license/text file helpers,
• package and contract definitions for OpenClaw,
• structured schema parsing used by both CLI and backend.
This is the package you would place at the center of a diagram showing cross-cutting compatibility. It ensures the CLI, app, and backend all agree on how a skill, soul, or package is described on disk and over the API.
5) Server-only helpers: server/
This subsystem is mostly about Open Graph metadata rendering.
It fetches metadata for skills and souls and renders SVG assets used for social cards and previews.
This is separate from the main frontend because image generation and OG asset creation are server concerns, not normal app UI concerns.
Primary data flows
Browse and read flows
1. User visits the web app or runs a CLI command.
2. The frontend or CLI reads from Convex queries or HTTP endpoints.
3. Convex fetches structured records from its database.
4. The app renders:
- catalog pages,
- detail pages,
- versions,
- stats,
- stars/comments,
- ownership and moderation state.
For public browsing, the data path is read-heavy and typically involves precomputed fields such as search digests, summaries, and stats.
Publish flows
Publishing is one of the most important end-to-end paths.
A publish action can originate from:
• the web UI,
• the CLI,
• or an import/sync flow.
The flow is roughly:
1. A local skill/package/soul manifest and supporting files are prepared.
2. The client uploads the bundle or metadata to Convex.
3. Convex validates the content using shared schemas and domain rules.
4. Backend policy checks run:
- access control,
- slug reservation,
- publish limits,
- security and safety checks,
- moderation gates,
- visibility rules.
5. Files are stored in Convex file storage.
6. The backend writes versioned records and changelog data.
7. Search and derived indexes are updated.
8. The listing becomes visible according to moderation and publication state.
For skills, this includes full skill bundles and supporting files. For souls, the model is narrower and currently centers on SOUL.md. For packages, the flow handles native OpenClaw package metadata and plugin-specific publishing.
Search and discovery flows
Search is a first-class subsystem.
The important architecture detail is that search is not purely keyword-based:
• content is embedded using OpenAI embeddings,
• Convex vector search is used for retrieval,
• backend code generates search text digests and visibility-aware search payloads.
So the path is:
1. content is published or updated,
2. backend generates embeddings and normalized search text,
3. the vector index is updated,
4. frontend and CLI search against the indexed data.
This is shared across skills, souls, and package discovery, but with different ranking and visibility constraints.
Authentication and identity flows
Authentication is centered on Convex Auth with GitHub OAuth.
That means:
• the backend controls session/auth state,
• GitHub is the external identity provider,
• the CLI includes browser-auth support for logging in from the terminal,
• the web app uses authenticated Convex state for privileged actions.
Identity is also enriched with GitHub account data for import, sync, and restore workflows.
GitHub integration flows
There is a dedicated set of backend modules for:
• GitHub identity,
• GitHub import,
• GitHub backup,
• GitHub restore,
• soul backups,
• skill backups.
These flows connect the registry to external GitHub data and are used for migration, backup, or synchronization scenarios. They are separate from the core publish path because they represent external-system integration and longer-running data movement.
Moderation, reporting, and safety flows
The repo has strong moderation support, so the architecture should treat safety as a backend concern rather than a UI feature.
Important parts include:
• comment moderation,
• skill moderation,
• security scan results,
• report dialogs in the UI,
• admin/moderator flows,
• reserve/ban/hidden-state logic,
• safety and scam-prompt analysis,
• publish-time policy checks.
A submission can be accepted, flagged, hidden, approved, or soft-deleted depending on these backend policies. The frontend reflects that state, but does not decide it.
Telemetry and analytics flows
The repo tracks minimal install telemetry to support install counts.
That path is intentionally narrow:
• the CLI emits telemetry during sync when logged in,
• the backend stores or aggregates it,
• global stats and leaderboards consume the derived data.
This is a lightweight data flow but important for understanding why the system has stats, install counts, and leaderboards separate from the core content records.
Important functional subsystems
Skills
Skills are the flagship content type.
They have:
• versions,
• tags like latest,
• changelogs,
• ownership and transfers,
• public/private visibility,
• comments and stars,
• security scans,
• search digests,
• slug/alias management,
• moderation and reclaim flows.
Skills have the richest UI and backend policy surface in the repo.
Souls
Souls are a parallel content type for lore/system notes.
They reuse much of the same platform machinery:
• versions,
• publish flows,
• search,
• detail pages,
• stars/comments.
But they are conceptually distinct, have their own host-first presentation on onlycrabs.ai, and currently accept a narrower bundle format.
Packages / OpenClaw plugins
Packages are a newer catalog surface.
They support:
• code plugins and bundle plugins,
• family/trust/capability metadata,
• inspection and exploration,
• publish flows through both web and CLI.
This is a distinct product boundary from skills, even though they share the same registry and some common browsing patterns.
Local installs and sync
The CLI manages the user’s local environment:
• install and uninstall,
• update all,
• inspect without installing,
• sync registry state to local runtime,
• scan local folders for publishable skills.
This is outside the Convex backend’s authority. The backend knows about registry state; the local machine owns actual installation.
External dependencies that matter architecturally
These are the external systems that materially shape the design:
• Convex: database, file storage, query/mutation runtime, HTTP actions, auth integration, and cron jobs.
• GitHub OAuth and GitHub APIs: authentication, identity, import/backup/restore.
• OpenAI embeddings: search indexing and vector retrieval.
• Bun: local dev/runtime for the repo and CLI tooling.
• TanStack Start / Vite / Nitro: frontend runtime and SSR build pipeline.
How to think about the boundaries in a diagram
A good architecture diagram for this repo should show:
• users interacting through either the browser app or the CLI,
• both clients depending on the shared schema package,
• both clients reaching into Convex as the backend system of record,
• Convex integrating outward to GitHub and OpenAI,
• server-side OG/image generation as a separate rendering utility,
• the web app and CLI as presentation/client layers,
• onlycrabs.ai as a host-mode variant of the same platform.
The key idea is that ClawHub is not a simple CRUD app. It is a content registry with strong domain policy, multiple content families, a shared contract layer, and a backend that performs validation, moderation, indexing, and identity-aware publication.
Main entry points: convex Convex app · src Web app · clawdhub CLI app · og OG rendering
Components 18
Web app
Browser-facing TanStack Start app and its route/UI layers.
- Web app · Browser UI for browsing, publishing, admin, search, and host-based site modes.
src - Routes · Route tree for skills, souls, packages, publish flows, search, users, and admin screens.
src/routes - UI panels · Specialized presentation panels for detail pages, comments, files, versions, security, and ownership.
src/components - Web logic · Shared frontend helpers for uploads, diffing, auth state, labels, site mode, and Convex integration.
src/lib
CLI
End-user command line client and local machine logic.
- CLI app · End-user terminal interface for auth, publish, inspect, sync, and local management.
packages/clawdhub - Commands · Command implementations for auth, publish, sync, skills, packages, moderation, ownership, and transfers.
packages/clawdhub/src/cli/commands - Local runtime · Homedir, config, discovery, scanning, and local install/update behavior.
packages/clawdhub/src
Convex backend
System of record for data, auth, policies, search, storage, and jobs.
- Convex app · Database schema, queries, mutations, storage, auth, HTTP APIs, search, and jobs.
convex - Policy lib · Reusable access control, publish rules, moderation, search text, security, and visibility logic.
convex/lib - Content domains · Feature modules for skills, souls, packages, users, stars, comments, downloads, uploads, and transfers.
convex - Integrations · GitHub import/backup/restore, webhooks, telemetry, rate limits, and public HTTP surfaces.
convex - Search stack · Embedding, digesting, vector search, and derived search updates for discovery.
convex/search.ts
Shared contract
Schema and protocol package shared by all runtimes.
- Schema · Common manifests, routes, text-file helpers, and OpenClaw contract definitions.
packages/schema
Server helpers
Server-only OG and metadata rendering utilities.
- OG rendering · Server-side metadata fetchers and SVG generation for social cards and previews.
server/og
External systems
Outside services that materially shape the architecture.
- Convex · Managed database, file storage, auth, query, mutation, and cron execution environment.
- GitHub · External identity provider and import/backup/restore source.
- OpenAI · Embedding provider used for search indexing and retrieval.
- Bun · Local runtime used by the CLI and repository tooling.
Connections 22
- Web app → Routes: renders · The app is organized around route-level pages and layouts.
- Web app → UI panels: composes · Routes assemble shared detail panels and UI widgets.
- Web app → Web logic: uses · Frontend logic relies on shared helpers for auth, uploads, and domain formatting.
- Web app → Schema: shares contract · The web app uses the shared protocol and manifest schemas.
- Web app → Convex app: reads/writes · Browser interactions call into Convex through the generated client.
- CLI app → Commands: dispatches · The CLI entrypoint routes to subcommands and workflows.
- CLI app → Local runtime: manages · The CLI owns local discovery, config, and install state.
- CLI app → Schema: shares contract · CLI parsing and publishing align with the common manifest schemas.
- CLI app → Convex app: syncs with · Commands authenticate, publish, inspect, and sync against Convex.
- Local runtime → Bun: runs on · Local CLI behavior depends on Bun runtime semantics.
- Convex app → Policy lib: delegates policy · Core functions call into reusable access, moderation, and publish rules.
- Convex app → Content domains: hosts domains · Feature modules implement the skills, souls, packages, users, and related catalog data.
- Convex app → Integrations: exposes · HTTP APIs, webhooks, telemetry, and GitHub flows are surfaced from the backend.
- Convex app → Search stack: indexes · Published and updated content is transformed into searchable representations.
- Convex app → Schema: validates against · Backend parsing and ingestion use the shared manifest and route schemas.
- Convex app → Convex: executes on · Convex provides the database, storage, auth, and scheduled execution runtime.
- Integrations → GitHub: integrates · Authentication, identity, import, backup, and restore depend on GitHub APIs.
- Search stack → OpenAI: embeds · Search indexing uses embeddings for semantic retrieval.
- OG rendering → Convex app: fetches metadata · OG rendering loads skill and soul data before generating assets.
- OG rendering → Web app: serves previews · Generated social-card assets support the web experience and sharing flows.
- Web app → OG rendering: requests images · The web app can reference server-rendered Open Graph assets.
- CLI app → OG rendering: optional preview · CLI-adjacent flows can consume the same metadata for previews and inspection.