Skip to content

feat: add OpenClaw agent adapter (Clawdbot rebrand)#86

Open
austinmao wants to merge 2 commits intorohitg00:mainfrom
austinmao:feat/openclaw-agent-adapter
Open

feat: add OpenClaw agent adapter (Clawdbot rebrand)#86
austinmao wants to merge 2 commits intorohitg00:mainfrom
austinmao:feat/openclaw-agent-adapter

Conversation

@austinmao
Copy link
Copy Markdown

@austinmao austinmao commented Mar 22, 2026

Summary

OpenClaw (formerly Clawdbot) is a local-first AI agent framework with a persistent gateway daemon. Clawdbot was rebranded to OpenClaw, but the existing clawdbot adapter still uses the legacy .clawdbot/ paths and doesn't support OpenClaw's extended SKILL.md frontmatter schema.

This PR adds first-class openclaw as a new agent type with correct paths and extended frontmatter support.

Changes

  • New openclaw agent type in AgentType enum and all Record<AgentType, ...> types
  • New OpenClawAdapter (packages/agents/src/openclaw.ts) with detection for ~/.openclaw/ + openclaw.json
  • OpenClaw agent config in agent-config.ts: skills/ dir (workspace root), ~/.openclaw/skills/ global, CLAUDE.md config file
  • Extended frontmatter fields: permissions, triggers, metadata, version, scan_exempt
  • Agent dirs: agents/ and ~/.openclaw/agents/
  • Command format: .claude/commands/
  • Translator format map: openclawskill-md
  • Simplified clawdbot adapter: legacy .clawdbot/ detection only (no longer falsely detects OpenClaw workspaces as clawdbot)

OpenClaw SKILL.md Frontmatter

OpenClaw skills use an extended YAML frontmatter schema beyond the standard name + description:

---
name: skill-name
description: "Trigger phrase for routing"
version: "1.0.0"
permissions:
  filesystem: none  # none | read | write
  network: false    # true | false
triggers:
  - command: /skill-name
metadata:
  openclaw:
    requires:
      bins: ["jq", "curl"]
      env: ["MY_API_KEY"]
      os: ["darwin", "linux"]
---

This enables skillkit translate <skill> --to openclaw to produce SKILL.md files compatible with the OpenClaw gateway runtime.

Build verification

  • @skillkit/core builds successfully
  • @skillkit/agents builds successfully
  • TUI build error is pre-existing on main (not caused by this PR)

Test plan

  • skillkit doctor detects openclaw when ~/.openclaw/ exists
  • skillkit translate <skill> --to openclaw produces output in skills/ (not .clawdbot/skills/)
  • skillkit translate <skill> --to clawdbot still works for legacy users
  • Detection priority: openclaw checked before clawdbot (prevents false positive)

Open with Devin

Summary by CodeRabbit

  • New Features

    • Added OpenClaw agent support with automatic workspace detection and skill management.
    • OpenClaw can generate, parse, and invoke skill configurations and is recognized by command/translation tooling.
  • Improvements

    • Refined agent discovery and skill file discovery paths for both OpenClaw and Clawdbot.
    • Narrowed Clawdbot detection to reduce false positives.

OpenClaw (formerly Clawdbot) is a local-first AI agent framework with a
persistent gateway daemon. This adds first-class OpenClaw support:

- New `openclaw` agent type in AgentType enum and all Record types
- New `OpenClawAdapter` class with detection for `~/.openclaw/` + `openclaw.json`
- OpenClaw agent config: `skills/` dir (not `.clawdbot/skills/`), CLAUDE.md config
- Extended frontmatter fields: permissions, triggers, metadata, version, scan_exempt
- Agent dirs: `agents/` and `~/.openclaw/agents/`
- Command format: `.claude/commands/` directory
- Translator format map: `openclaw` → `skill-md`
- Simplified clawdbot adapter detection (legacy paths only)

OpenClaw SKILL.md files use an extended YAML frontmatter schema:
  - permissions: { filesystem: none|read|write, network: true|false }
  - triggers: [{ command: /skill-name }]
  - metadata.openclaw.requires: { bins: [], env: [], os: [] }

This enables `skillkit translate <skill> --to openclaw` producing
SKILL.md files compatible with the OpenClaw gateway runtime.

Ref: https://docs.openclaw.ai
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 22, 2026

Someone is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 50b58e5a-c668-472f-aa44-c9eaa9a20d13

📥 Commits

Reviewing files that changed from the base of the PR and between 3509b74 and 6ed78ce.

📒 Files selected for processing (2)
  • packages/agents/src/openclaw.ts
  • packages/core/src/agents/types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/core/src/agents/types.ts
  • packages/agents/src/openclaw.ts

📝 Walkthrough

Walkthrough

A new OpenClaw adapter and agent type were added and registered across the codebase. Clawdbot's workspace detection logic was narrowed to omit the project-local skills check. Agent configs, discovery paths, formats, and types were updated to include OpenClaw and adjusted Clawdbot settings.

Changes

Cohort / File(s) Summary
Core Type System
packages/core/src/types.ts
Added "openclaw" to the AgentType enum.
Agent Adapter Implementations
packages/agents/src/clawdbot.ts, packages/agents/src/openclaw.ts
Clawdbot detection narrowed to check only ~/.clawdbot and clawdbot.json. Added OpenClawAdapter with generateConfig, parseConfig, getInvokeCommand, and isDetected implementing project/global detection and XML skill serialization/parsing.
Agent Registry & Detection
packages/agents/src/index.ts
Exported and registered OpenClawAdapter, added 'openclaw' to adapter registry and detection checkOrder.
Agent Configuration
packages/core/src/agent-config.ts
Updated clawdbot config (skillsDir, configFile, altSkillsDirs, globalSkillsDir, frontmatter fields, supportsAutoDiscovery); added openclaw config mirroring these settings with ~/.openclaw paths.
Agent Discovery & Formats
packages/core/src/agents/types.ts, packages/core/src/commands/generator.ts, packages/core/src/translator/types.ts
Added OpenClaw discovery paths and format mappings: AGENT_DISCOVERY_PATHS, ALL_AGENT_DISCOVERY_PATHS, CUSTOM_AGENT_FORMAT_MAP, AGENT_FORMATS, and AGENT_FORMAT_MAP entries for openclaw.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A little rabbit taps the keys,
OpenClaw hops in with gentle ease,
Clawdbot trimmed to a tidier beat,
New configs, new paths — a tidy feat! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding OpenClaw agent adapter support as a rebrand of Clawdbot, which is the core objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

austinmao pushed a commit to austinmao/impeccable that referenced this pull request Mar 26, 2026
Add first-class OpenClaw support to the build system. OpenClaw is a
local-first AI agent framework whose SKILL.md files use an extended
YAML frontmatter schema (permissions, triggers, version, metadata).

Changes:
- New `openclaw` provider in PROVIDERS config
- New `frontmatterEnrich` hook on transformer factory — lets any
  provider post-process frontmatter before YAML serialization
- Extended `generateYamlFrontmatter` with recursive serializer for
  nested objects and arrays (backward-compatible)
- Model-agnostic placeholder config (uses 'the model' since OpenClaw
  operators configure their own LLM backend)
- Pre-built skills output to `.openclaw/skills/`

Complements rohitg00/skillkit#86 which adds the OpenClaw adapter to
SkillKit's translate command — both produce the same output format.
- Remove legacy clawdbot path checks from OpenClawAdapter.isDetected()
  so pure clawdbot workspaces are not hijacked by OpenClaw detection
- Add '.openclaw/agents' to ALL_AGENT_DISCOVERY_PATHS so agent
  discovery works for OpenClaw agent directories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant