This guide explains how to develop addons for OpenClaw for Business (OFB).
An addon is an independent Git repository installed to the addons/ directory. It can extend OFB in up to four ways, applied in this order by scripts/apply-addons.sh:
overrides.sh— pnpm dependency overrides (most stable, no line-number coupling)patches/*.patch— git patches for precise source changes (may need updating after upstream upgrades)skills/— global skills visible to all agentscrew/— Crew templates installed tocrews/and managed by HRBP
<addon-name>/
├── addon.json # Required: addon metadata
├── overrides.sh # Optional: dependency replacement script
├── patches/
│ └── *.patch # Optional: git patches against openclaw/
├── skills/
│ └── <skill-name>/
│ ├── SKILL.md # Skill definition (required)
│ └── scripts/ # Supporting scripts (optional)
└── crew/
└── <template-id>/
├── SOUL.md # Required — role definition (must declare command-tier)
├── AGENTS.md # Workflows and procedures
├── MEMORY.md # Initial memory / background context
├── USER.md # Assumptions about the user
├── IDENTITY.md # Name and persona
├── TOOLS.md # Tool guidance
├── HEARTBEAT.md # Health-check template
├── BOOTSTRAP.md # Onboarding intro (shown on first boot only)
├── DENIED_SKILLS # Optional: built-in skills to block
└── skills/
└── <skill-name>/ # Template-scoped skills (only this crew sees them)
└── SKILL.md
The internal_crews and external_crews arrays in addon.json are the sole authority for crew-type assignment:
- Templates listed in
internal_crews→ internal (inherits all global skills, Main Agent manages lifecycle) - Templates listed in
external_crews→ external (uses DECLARED_SKILLS only, HRBP manages lifecycle) - Templates in neither array → defaults to external with a warning
- A template listed in both arrays → error,
apply-addons.shwill abort
The crew-type: field in SOUL.md is not required for addon templates. If present, it will be overwritten by apply-addons.sh to match the addon.json declaration.
Receives two environment variables: ADDON_DIR and OPENCLAW_DIR.
Use it to inject pnpm overrides or replace packages before the build:
#!/bin/bash
# Example: replace a transitive dependency
cd "$OPENCLAW_DIR"
node -e "
const pkg = JSON.parse(require('fs').readFileSync('package.json','utf8'));
if (!pkg.pnpm) pkg.pnpm = {};
if (!pkg.pnpm.overrides) pkg.pnpm.overrides = {};
pkg.pnpm.overrides['some-package'] = '^2.0.0';
require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));
"Generate with git diff or git format-patch against the upstream openclaw/ source.
Patches are applied with --3way --ignore-whitespace --whitespace=fix.
Warning: Patches are fragile across upstream upgrades. Prefer
overrides.shfor dependency changes.
Skills placed here are installed to openclaw/skills/ and made available to all agents.
Each skill requires a SKILL.md file at the skill root.
Global skills are listed in ~/.openclaw/GLOBAL_SHARED_SKILLS after apply-addons.sh runs.
Every crew template must declare a command tier in its SOUL.md. setup-crew.sh reads this declaration and automatically generates:
agents.list[].tools.execinopenclaw.json(per-agent security/ask policy)~/.openclaw/exec-approvals.jsonentries (per-agent command allowlists with resolved binary paths)
Add this section to SOUL.md (before or after ## Communication Style):
## 权限级别
command-tier: T1The four tiers (see crews/shared/COMMAND_TIERS.md for the full command lists):
| Tier | Name | Exec Policy | Typical Crew Type |
|---|---|---|---|
T0 |
read-only | security: deny — no shell execution |
Customer service, content creation, research |
T1 |
basic-shell | security: allowlist — read-only commands: cat, ls, grep, ps, curl (GET only), … |
Coordination, operations |
T2 |
dev-tools | security: allowlist — T1 + git, npm, pnpm, node, python, cp, mv, mkdir, rm, … |
Development, automation |
T3 |
admin | security: full — unrestricted shell access |
Infrastructure, sysops |
Choose the minimum tier that the role genuinely needs. When in doubt, go lower — HRBP or the user can grant additional permissions after deployment.
To add or remove commands relative to the base tier, create an ALLOWED_COMMANDS file in the template directory:
# Prefix + to allow, - to deny
+./scripts/setup-crew.sh
-rm
These adjustments are applied on top of the tier's base allowlist and reflected in exec-approvals.json automatically.
Internal crews (internal_crews):
- Inherit all global skills — every skill installed in
openclaw/skills/(both built-in and addon-provided) is visible by default - Use
DENIED_SKILLSto exclude specific skills that the crew should not access BUILTIN_SKILLSfile is still supported for backward compatibility but rarely needed since the default is already "all"
External crews (external_crews):
- Use declaration mode — only skills explicitly listed in
DECLARED_SKILLSare visible DECLARED_SKILLScan reference both global skills (fromopenclaw/skills/) and template-scoped skills (fromcrew/<template>/skills/)- Template-scoped skills are automatically appended (no need to list them in
DECLARED_SKILLS) self-improvingskill is always blocked for external crews
By default, installed templates are not auto-instantiated — they become available in the HRBP/Main Agent template library and the user can instantiate them on demand.
To auto-instantiate on apply-addons.sh, set "auto-activate": true in addon.json. This creates workspace-<template-id> and registers the agent immediately. Use with caution: the instance ID will equal the template ID, and existing workspaces will be skipped (not overwritten).
If your internal crew template should not have access to certain skills, list them one per line in DENIED_SKILLS:
github
gh-issues
coding-agent
External crew templates must declare which skills they need in DECLARED_SKILLS:
customer-db
smart-search
rss-reader
- Clone your addon into
addons/<addon-name>/ - Run
./scripts/apply-addons.sh— it is fully idempotent - Restart the gateway:
./scripts/dev.sh gateway - For crew templates: ask HRBP to instantiate the new template
To force re-apply (e.g., after updating a crew template that already exists in crews/):
./scripts/apply-addons.sh --forceWhen the upstream openclaw version changes:
overrides.sh— usually unaffected (package-level override)patches/*.patch— re-generate against the new upstream commit if they fail to applyskills/— rarely affected unless openclaw's skill API changescrew/templates — update ifSOUL.mdreferences upstream-specific behaviors that changed
Check openclaw.version for the pinned upstream commit. When submitting your addon to the community, document which OFB version range it supports.
{ "name": "my-addon", "version": "1.0.0", "description": "What this addon does", "internal_crews": ["my-ops-bot"], // crew templates that are internal (managed by Main Agent) "external_crews": ["my-customer-bot"], // crew templates that are external (managed by HRBP) "auto-activate": false // set true to auto-instantiate crew templates on apply }