{"skill":{"slug":"multi-workplace","displayName":"Multi Workplace","summary":"Manage multiple workplaces (project directories) with multi-agent orchestration, isolated memory, and inter-agent communication. Use when the user mentions:...","description":"---\nname: workplace\ndescription: >\n  Manage multiple workplaces (project directories) with multi-agent orchestration,\n  isolated memory, and inter-agent communication. Use when the user mentions:\n  workplace init/list/switch/scan/status/agents/export/import, managing projects,\n  switching between codebases, multi-agent workflows, agent handoff, kernel agent,\n  workspace structure, deploy environments, or any variation of \"workplace\" commands.\n  Also triggered by /workplace slash command. Auto-detects .git folders as workplaces.\n  Each workplace has its own agents, memory, skills, and deployment configs in a\n  .workplace/ directory. Syncs context to Cursor, Claude Code, and OpenCode.\n  Interactive Telegram/Discord UI with inline buttons for switching workplaces,\n  starting agents, and deploying.\nuser-invocable: true\n---\n\n# Workplace Skill\n\nManage multiple project workplaces with per-workspace agents, isolated memory, and Swarm-style agent orchestration.\n\n## /workplace Command (Telegram / Slash)\n\nHierarchical navigation with parent → child drill-down.\n\n- **`/workplace`** or **`/workplace list`** → Show top-level view: parent workspaces and standalone workplaces as buttons. Parents show `(N)` child count. Current workspace marked with ✓.\n- **Click a parent button** → Drill into children. Shows child buttons + \"Use parent\" + \"← Back\".\n- **`/workplace <name>`** → If standalone or child, switch directly. If parent with children, show drill-in.\n- **`/workplace parent:child`** → Direct switch using colon syntax (e.g. `log-stream:logstream`).\n- **`/workplace status`** → Current workspace card with parent, linked, agents, deploy envs.\n- **`/workplace agents`** → Agent list with start/stop buttons.\n\n### Colon Syntax\n\n`/workplace log-stream:logstream` resolves parent by name, then finds child under that parent. Supports quick switching without navigating menus.\n\n### Context Switching\n\nWhen the user switches workplaces (via button click, name, or colon syntax):\n\n1. Update `~/.openclaw/workspace/.workplaces/current.json` with the selected UUID and path\n2. Update `lastActive` in `registry.json`\n3. Load the new workspace's `.workplace/config.json` for context\n4. Send confirmation: name, path, parent (if any), linked workplaces, agent list\n5. Subsequent messages in the session should be aware of the active workspace context\n\nRead `current.json` at the start of any workplace operation to know which workspace is active.\n\nSee [telegram-ui.md](references/telegram-ui.md) for full button layouts, callback routing, and platform fallbacks.\n\n## Quick Reference\n\n| Command | Action |\n|---------|--------|\n| `workplace init [path]` | Initialize workplace (scan existing or set up new) |\n| `workplace list` | List all workplaces (inline buttons to switch) |\n| `workplace switch <name\\|uuid>` | Switch active workplace |\n| `workplace scan [path]` | Discover .git workplaces in subdirectories |\n| `workplace link <path>` | Link a related workplace |\n| `workplace unlink <path\\|uuid>` | Remove a linked workplace |\n| `workplace status` | Current workplace info + agent status |\n| `workplace agents` | List agents in current workplace |\n| `workplace agent start <name>` | Start an agent (runs as sub-agent) |\n| `workplace agent stop <name>` | Stop a running agent |\n| `workplace kernel start` | Start persistent kernel agent |\n| `workplace kernel stop` | Stop kernel agent |\n| `workplace export [zip\\|json]` | Export workplace config |\n| `workplace import <file>` | Import workplace from export |\n| `workplace delete <name\\|uuid>` | Remove from registry |\n| `workplace deploy <env>` | Show/run deploy instructions |\n| `workplace sync <ide>` | Generate context for cursor/claude/opencode/all |\n\n## Architecture\n\n### Registry\n\nCentral registry at `~/.openclaw/workspace/.workplaces/`:\n- `registry.json` — all known workplaces with UUID, path, hostname, links\n- `current.json` — currently active workplace\n\n### Per-Workplace Structure\n\nEach project gets a `.workplace/` directory:\n\n```\n.workplace/\n├── config.json          # UUID, name, path, hostname, linked, parent\n├── agents/*.md          # Agent role definitions (kernel.md always present)\n├── memory/              # Isolated daily logs (YYYY-MM-DD.md)\n├── skills/              # Workplace-specific skills (user-managed via git)\n├── chat.md              # Inter-agent communication\n├── structure.json       # Auto-scanned file tree\n├── full-tree.md         # Full tree with parent + linked workplaces (by hostname)\n├── process-status.json  # Agent runtime states and errors\n└── deploy/              # Deployment docs: dev.md, main.md, pre.md\n```\n\n### Workplace Detection\n\n- Any directory with `.git/` is a potential workplace\n- Submodules included as nested workplaces\n- Parent workplace auto-detected from parent directories\n- Manual linking via `workplace link`\n\n## Workflows\n\n### Initialize a Workplace\n\n1. Run `scripts/init_workplace.sh <path> [--name <name>] [--desc <desc>]`\n2. For existing projects: scan file structure, read `*.md` files, analyze project type, suggest agents\n3. For empty folders: ask project name, description, language/framework, roles needed\n4. Creates `.workplace/` structure, registers in central registry, sets as current\n5. See [init-guide.md](references/init-guide.md) for full flow details\n\n### Agent System\n\nAgents are defined as `.md` files in `.workplace/agents/` with YAML frontmatter (name, role, triggers, handoff_to). Run agents via `sessions_spawn` with system prompts built from their definitions + workplace context.\n\n- See [agent-system.md](references/agent-system.md) for agent creation, Swarm handoff, and runtime details\n\n### Inter-Agent Communication\n\nAgents communicate via `chat.md` using a structured message protocol. The Rust file-watcher server monitors changes and outputs parsed messages as JSON lines.\n\n- See [chat-protocol.md](references/chat-protocol.md) for message format spec\n\n### Rust File-Watcher Server\n\nBinary at `assets/bin/workplace-server-{os}-{arch}`. Build from source with `scripts/build.sh`.\n\n```bash\n# Start server for a workplace\nworkplace-server /path/to/project\n\n# Server outputs JSON lines to stdout for each new chat.md message\n{\"timestamp\":\"...\",\"sender\":\"coder\",\"recipient\":\"reviewer\",\"broadcast\":[],\"message\":\"...\",\"line_number\":1}\n```\n\n### Export/Import\n\n- **ZIP**: Full `.workplace/` folder (memory excluded by default)\n- **JSON**: Config + agent definitions + deploy docs as portable manifest\n- Import generates a new UUID to avoid collisions\n\n## Chat UI (Telegram / Discord)\n\nOn platforms with inline buttons, `workplace list` shows a clickable switcher. `workplace agents` shows start/stop buttons per agent. `workplace deploy` shows environment buttons.\n\nSee [telegram-ui.md](references/telegram-ui.md) for message formats, button components, and callback handling.\n\nFallback: numbered text lists on platforms without button support (WhatsApp, Signal).\n\n## IDE Integration\n\nSync workplace context to external coding tools:\n\n- **Cursor** → `.cursor/rules/workplace.mdc` (MDC with frontmatter)\n- **Claude Code** → `CLAUDE.md` (markdown, marker-based updates)\n- **OpenCode** → `opencode.jsonc` instructions field\n\nRun `workplace sync all` to update all detected IDEs, or target one: `workplace sync cursor`.\n\nSee [ide-sync.md](references/ide-sync.md) for implementation details.\n\n## Scripts\n\n| Script | Purpose |\n|--------|---------|\n| `scripts/init_workplace.sh` | Initialize .workplace/ in a directory |\n| `scripts/scan_workplaces.sh` | Find .git workplaces under a path |\n| `scripts/build.sh` | Build Rust server for current platform |\n\n## Supermemory Integration\n\nEach workplace uses its UUID as `containerTag` for supermemory operations:\n- Kernel agent saves structure summaries and project facts\n- All workplace memories are isolated by containerTag\n- Enables cross-session project state awareness\n\n## Command Details\n\nSee [commands.md](references/commands.md) for full command reference with examples.\n","tags":{"latest":"0.4.0"},"stats":{"comments":0,"downloads":1224,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":4},"createdAt":1771348573501,"updatedAt":1778991232556},"latestVersion":{"version":"0.4.0","createdAt":1771351468031,"changelog":"Hierarchical /workplace navigation: parent→child drill-down with inline buttons, parent:child colon syntax for direct switching, auto-init parent folders (no .git) with recursive child init and cross-linking","license":null},"metadata":null,"owner":{"handle":"dickwu","userId":"s170yef1evv0j3rvfsxmqwnjr5884p9v","displayName":"farmerwu","image":"https://avatars.githubusercontent.com/u/4208695?v=4"},"moderation":null}