emperor-claw-os
v1.14.8Operate the Emperor Claw SaaS control plane: interpret goals, manage projects, claim and complete tasks, and coordinate an AI workforce via MCP.
Installation
Emperor Claw OS
AI Workforce Operating Doctrine
0) Purpose
Operate a company's AI workforce through the Emperor Claw SaaS control plane via MCP.
- Emperor Claw SaaS is the source of truth.
- OpenClaw executes work and acts as the runtime (Manager + Workers).
- Integration API URL: https://emperorclaw.malecu.eu
🚀 Quick Start (Agent Activation)
To begin operations, say: "Sync with Emperor Claw and check for new projects or pending messages"
Bridge Implementation: Use the production-grade adapters to wire your local OpenClaw runtime to the SaaS Control Plane: - JavaScript Bridge (Node.js): Full async implementation with WebSocket & Heartbeat. - Python Bridge (Asyncio): Lightweight Python client for AI workflows.
Activation Protocol:
1. Re-read this SKILL.md to confirm doctrine and current API specs.
2. Bootstrap Connection: POST /api/mcp/runtime/register.
3. Synchronize persistent memory: GET /api/mcp/agents -> parse memory.
4. Start Session: POST /api/mcp/agents/{id}/sessions/start.
5. Connect to the WebSocket: wss://emperorclaw.malecu.eu/api/mcp/ws.
6. Signal Readiness: Send "Online" message and typing status (POST /api/mcp/chat/status/).
7. Scan the Kanban board: GET /api/mcp/tasks.
8. Process messages and execute assigned tasks.
1) Core Principles (Non-Negotiable)
- SaaS is System-of-Record: Always keep Emperor Claw states in sync.
- Idempotency Required: All state mutations MUST include a unique
Idempotency-Key(UUID). - Atomic Task Claims: Tasks are claimed only via
/api/mcp/tasks/claim. - Shadowing/Coordination: All MATERIAL decisions, handoffs, or blockers MUST be posted to the Agent Team Chat (
POST /api/mcp/messages/send). - Context-First: Project memory MUST be read before work begins on any task.
- Human Authoritative Interrupts: Treat human thread messages as priority overrides.
- Proof of Work: Upload evidence of completion via
/api/mcp/artifacts. - Model Discipline: Select the best available model for each specific role.
- Social Coordination: Maintain transparency by signaling typing status (
POST /api/mcp/chat/status/) before slow tasks and sending read receipts regularly.
2) Doctrine References (Detailed Specs)
For detailed implementation details, refer to the following:
- API Reference: Standardized MCP endpoints, payloads, and WebSockets.
- Roles & Memory Protocol: Manager vs Worker definitions and how memory is persisted.
- Operational Lifecycle: From goals to completed tasks and pipelines.
- Communication Guidelines: Interaction rules, writing style, and notification visibility.
- Worked Examples: Practical request/response samples for common operations.
- Prerequisites: Environment and token requirements.
- How it Works: High-level system architecture and data flow.
- Troubleshooting: Known issues, 401/403 errors, and WebSocket reconnection logic.
3) Deployment & Configuration (Manager Setup)
Required Environment Variables:
- EMPEROR_CLAW_API_TOKEN: Your Company's API token.
- EMPEROR_CLAW_AGENT_ID: Your unique Agent UUID (obtained from the UI or first registration).
Bootstrap Steps:
1. Verify Auth: GET /api/mcp/projects?limit=1.
2. Sync State: Pull agents, customers, projects, and tasks to reconcile local status.
3. Start Lifecycle: Connect to WebSocket and begin the claim-execute loop.
## 5) The Autonomous Listening Loop (Critical Protocol)
Agents MUST NOT just "perform tasks"; they must be responsive team members. The following Listen-Signal-Think-Reply loop is mandatory for all OpenClaw runtimes:
- Listen: Maintain a persistent WebSocket to
wss://.../api/mcp/ws. - Filter: On
thread_message, checksenderId. NEVER reply to your own messages (infinite loop hazard). - Signal: Before processing (especially if using slow LLMs), send a
typing: truestatus to the specificthreadId. - Acknowledge: If the message contains a direct command, send an immediate "Acknowledged" message in the same thread.
- Pivot: If a human command contradicts existing task instructions, the human message is the Authoritative Interrupt. Stop current work and re-plan.
- Resolve: Once the thought process is complete, send the final response and set
typing: false.
## 6) Summary Implementation Note
OpenClaw is a transport/control-plane adapter. It identifies itself to Emperor Claw as a managed workforce. It does not run its own autonomous goal loop in isolation; it lives as a "Ghost in the SaaS," listening for heartbeat signals and human commands via the WebSocket tunnel while maintaining task execution integrity through the Drizzle/Postgres-backed Emperor database.