Install
openclaw skills install @jaggerxzj/digital-employee-builderBuild a runnable Agent digital employee from a business codebase or business-function description. Input a business system/module (source code, API docs, or functional spec); output a complete digital-employee workspace — AGENTS.md (operating rules), SOUL.md (persona), IDENTITY.md, USER.md, TOOLS.md, HEARTBEAT.md, an MCP server wrapping business capabilities, per-workflow Skills — plus steps to onboard, run, and verify it in OpenClaw (default) or other harness frameworks (Claude Code, Cursor, custom). Triggers: digital employee, business-code-to-agent, turn a business system into an agent, SOUL.md, AGENTS.md, OpenClaw agent workspace, agent-ify a business function.
openclaw skills install @jaggerxzj/digital-employee-builderTurn a business capability into an agent employee with identity, rules, tools, and a runtime.
Business input → 1. Interactive analysis (incl. interface-gap proposals) → ⛔ Gate 1: capability & proposal sign-off → 2. Role modeling → 2.5 Plan proposal → ⛔ Gate 2: plan sign-off → 3. Workspace → 4. MCP wrapping → 5. Skills (with scripts) → 6. Onboarding & verification
Gates 1 and 2 are stop-and-wait points, not notifications. At each gate: present the artifact in the conversation, let the user add/remove/adjust, and re-present after every revision round. Only an explicit approval ("approved / looks good / go ahead") unlocks the next step — silence or ambiguous replies mean not approved. Only after approval may the artifact be written into the workspace (docs/business-capabilities.md — plus docs/business-api-proposals.md when interface gaps exist — for Gate 1, docs/employee-plan.md for Gate 2) — create the workspace directory ahead of step 3 if needed to hold these approved docs. Never start generation (steps 3–6) before Gate 2 approval.
The employee workspace gets deployed standalone into the OpenClaw/harness runtime — the business codebase does not exist on that machine. Therefore:
sys.path, absolute paths, or relative paths (e.g. ../../service) — source code is read at build time for porting; at runtime there is zero source dependency.Prompts are suggestions; code is the guardrail. Route every capability point through this table before wrapping:
| Capability shape | Packaging | Why |
|---|---|---|
| Single atomic call, no branching (queries, one-step writes) | MCP tool (step 4) | Thin wrapper suffices; no flow to enforce |
| Fixed-order multi-step flows with validation/branching/rollback (refunds, approvals, reconciliation) | Executable script in the skill's scripts/ (step 5), ported/orchestrated from the business code — or, when the user opts for MCP-only packaging, a composite tool in the MCP server (step 4) | Ordering, validation, and exception branches are enforced by code — the model cannot skip steps |
| Steps requiring comprehension, judgment, or content generation (interpreting reports, drafting replies) | Prompt orchestration in SKILL.md | That is the model's job anyway |
| Any capability whose business-side interface is missing or inadequate | Modification proposal in docs/business-api-proposals.md (Core Principle 3), then build against the approved contract | The builder never modifies business code; contract-first keeps the build unblocked |
A common failure: writing a multi-step business flow as prose steps in SKILL.md and letting the model call tools step by step — the model may skip steps, reorder them, or drop validations. Whatever if/else, state machines, and validation rules exist in the business code must still exist as code after wrapping.
Script-porting patterns and engineering standards: references/script-encapsulation.md — required reading for step 5.
The build pipeline is read-only against the business codebase. When a capability cannot be packaged because the business side lacks the needed interface (no flow-level endpoint for a Pattern A / composite-tool flow, a query the system computes but never exposes, missing idempotency keys), do not work around it — and never patch the business code yourself. Instead:
references/business-api-proposals.md): the interface to add (REST endpoint / MCP server / SDK module) with the full parameter contract — request/response schemas, error codes, auth, idempotency.docs/business-api-proposals.md (revisions are re-presented like any gate artifact).proposed → approved → implemented → deployed → verified).Pattern C ports rarely trigger this (scripts are self-contained); API-consuming routes and data-sync needs do.
Confirm three things before starting (ask the user if missing):
docs/business-api-proposals.md (Core Principle 3).references/harness-adapters.md.Work through the business code interactively and produce a business capability inventory — the basis for every artifact that follows. Interaction protocol:
docs/business-capabilities.md and the proposals (when any) in docs/business-api-proposals.md — then proceed to step 2.Map the capability inventory to the employee's identity using three mapping rules:
Persona tone follows the business context: customer-facing → polite and restrained; internal ops → direct and efficient; finance/compliance → rigorous and conservative.
The mapping outputs are a draft proposal for step 2.5 — do not write them into any workspace file yet.
Based on the approved capability inventory, present a complete employee plan in the conversation — a hard stop (see Confirmation Gates above). The plan has four blocks:
contract-pending: <proposal-id> so scope expectations are explicit.The user may adjust any block; update the plan and re-present after each revision round. Only on explicit approval of all four blocks, write the plan to docs/employee-plan.md in the workspace — it becomes the authoritative spec for steps 3–6. Never start generation before this approval.
Generate everything according to the approved plan in docs/employee-plan.md — positioning, scope, and approval gates come from there, not from re-derivation.
Use assets/workspace/ as templates to generate the full directory (default output: ./digital-employees/<employee-name>/):
<employee-name>/
├── AGENTS.md # Operating rules: session startup, scope, approval gates, forbidden zone
├── SOUL.md # Persona: identity, tone, expertise, boundaries
├── IDENTITY.md # Name, emoji, one-line role
├── USER.md # Audience profile (initial skeleton)
├── TOOLS.md # Environment notes: MCP server, ports, credential variable names
├── HEARTBEAT.md # Periodic tasks (optional; omit if no periodic needs)
├── memory/ # Empty dir; the employee writes daily logs at runtime
├── skills/ # Generated in step 5
├── mcp-server/ # Generated in step 4
├── docs/business-capabilities.md # Capability inventory from step 1 (Gate-1 approved)
├── docs/employee-plan.md # Approved plan from step 2.5 (Gate 2)
└── docs/business-api-proposals.md # Business-side modification proposals (Gate-1 approved; omit if no gaps)
Template usage notes (templates in assets/workspace/*.tmpl; OpenClaw field details in references/openclaw-workspace.md):
Wrap exactly the MCP tool list approved in docs/employee-plan.md as an MCP server — no additions, no omissions. Templates:
assets/mcp-server-python/server.py.tmpl (FastMCP — preferred, fewest dependencies)assets/mcp-server-ts/server.ts.tmpl (use when the business system itself is Node/TS)Wrapping rules:
query_order, create_refund); descriptions state parameter meanings and side effects.docs/harness-setup.md (OpenClaw openclaw.json mcpServers snippet, Claude Code .mcp.json, Cursor mcp.json — formats in references/harness-adapters.md).process_refund) whose server code holds the whole orchestration — every validation, branch, ordering, and compensation step from the business code (run the Porting Checklist from references/script-encapsulation.md over this code). Requirements:
dry_run parameter, default true for dangerous flows — the server-side equivalent of the script --dry-run convention.# Ported from src/services/refund.py::process_refund) and mapping registration in docs/business-capabilities.md, exactly as script ports do. Flow changes mean editing + redeploying the server — call this trade-off out when the user chooses this route; missing flow-level interfaces on the business side go through Core Principle 3 proposals.references/mcp-integration.md → Composite Tools.docs/business-api-proposals.md — parameters, response fields, error codes verbatim. Point the client at a stub backend behind an env var (e.g. BUSINESS_API_STUB=true) so the server starts and passes smoke tests before the business side deploys; record stubbed tools in TOOLS.md and docs/harness-setup.md. On deployment, flip the env var and re-run the smoke test — the tool definition must not change.Then actually start the server once (send an initialize request for stdio, or curl a health check for HTTP) and confirm tools/list returns every capability point. If it won't start, fix it — never deliver an MCP server that doesn't run.
Generate workspace skills per the skills list approved in docs/employee-plan.md (templates in assets/skill-template/, including SKILL.md.tmpl and scripts/workflow.py.tmpl). Each skill takes one of two shapes per the routing table:
A. Script-driven (multi-step deterministic flows — the default)
skills/<workflow-name>/
├── SKILL.md # Thin shell: triggers, parameters, how to run the script, output interpretation
└── scripts/
└── <workflow>.py # Executable ported/orchestrated from business code; holds ALL deterministic logic
references/script-encapsulation.md. Default is Pattern C: port the business logic fully into the script (zero network dependency, most reliable); fall back to Pattern A (orchestrate the deployed API) or Pattern B (published SDK) only when the user explicitly confirms a reliable runtime channel. In all three patterns the script must be self-contained — no sys.path/path references to business source code. Never deliver a flow as a fresh natural-language description alone.--dry-run flag (validate only). Approval gates in AGENTS.md still apply: dry-run first, show the user, then execute for real.B. Prompt-orchestrated (judgment-heavy flows)
Common constraint: workspace skills reference only this employee's MCP tools, scripts/, and docs/ — no external environment dependencies.
Provide complete onboarding steps in docs/harness-setup.md and verify each item:
OpenClaw (default):
~/.openclaw/workspace-<employee-name>/ (or register as a standalone agent: openclaw agents add <employee-name> pointing at the workspace)openclaw agent prompt to preview the assembled system prompt; confirm AGENTS/SOUL inject cleanly with no truncationVerification checklist (check every item before delivery):
docs/employee-plan.md exactly — nothing added, nothing droppedsys.path.insert, no absolute/relative paths into the business repo, no hardcoded secretsdocs/business-api-proposals.md (when present) covers every interface gap; each proposal has explicit user confirmation and a current lifecycle statusdocs/harness-setup.mdreferences/script-encapsulation.md — Core: script-porting patterns and engineering standards for business code (required reading for step 5)references/business-api-proposals.md — Modification-proposal format, contract minimums, stub discipline, lifecycle (required reading when the business side lacks interfaces)references/openclaw-workspace.md — OpenClaw workspace file spec, loading mechanics, character budgetsreferences/harness-adapters.md — Onboarding formats for Claude Code / Cursor / generic harnessesreferences/mcp-integration.md — MCP protocol essentials and wrapping details