Skip to content

feat: add OpenClaw agent support#77

Open
austinmao wants to merge 1 commit intopbakaus:mainfrom
austinmao:feat/openclaw-support
Open

feat: add OpenClaw agent support#77
austinmao wants to merge 1 commit intopbakaus:mainfrom
austinmao:feat/openclaw-support

Conversation

@austinmao
Copy link
Copy Markdown

Summary

Add first-class OpenClaw support to impeccable's build system.

OpenClaw is a local-first AI agent framework with a persistent gateway daemon. It uses
SKILL.md files with an extended YAML frontmatter schema beyond the standard name +
description — adding permissions, triggers, version, and metadata.openclaw
fields that the gateway uses for routing, security gating, and dependency checks.

Changes

  • New openclaw provider in PROVIDERS config (providers.js)
  • New frontmatterEnrich hook on the transformer factory (factory.js) — lets any
    provider post-process the frontmatter object before YAML serialization. OpenClaw uses
    this to inject its extended schema fields without modifying FIELD_SPECS.
  • Extended generateYamlFrontmatter (utils.js) — recursive serializeYamlValue
    helper handles nested objects and arrays (needed for permissions, triggers,
    metadata.openclaw). Backward-compatible — existing flat-value providers are unaffected.
  • OpenClaw placeholder config (utils.js) — model-agnostic (the model rather than
    a specific provider name, since OpenClaw operators configure their own LLM backend),
    SOUL.md as config file, / command prefix.
  • New export in index.js

OpenClaw SKILL.md frontmatter

The build produces skills with this extended frontmatter:

---
name: audit
description: Use when running technical quality checks across accessibility, performance...
version: 1.0.0
permissions:
  filesystem: none
  network: false
triggers:
  - command: /audit
metadata:
  openclaw:
    requires:
      bins: []
      env: []
---

SkillKit alignment

This PR complements rohitg00/skillkit#86,
which adds an OpenClaw adapter to SkillKit's translate command. Both produce the same
output format — impeccable's build system for pre-built distribution, SkillKit for
on-the-fly translation of arbitrary skills.

Install instructions (for README update)

# OpenClaw (project-specific — into your agent workspace)
cp -r dist/openclaw/.openclaw/skills/* skills/

# OpenClaw (global — shared across all agents)
cp -r dist/openclaw/.openclaw/skills/* ~/.openclaw/skills/

Test plan

  • bun run build completes without errors
  • dist/openclaw/.openclaw/skills/ contains all 21 skills
  • Each skill has OpenClaw-extended frontmatter (permissions, triggers, metadata)
  • Descriptions start with trigger phrase (Use when ...)
  • {{placeholder}} tokens fully resolved (no {{model}} etc. remaining)
  • reference/ subdirectories copied for frontend-design and critique
  • Prefixed build (dist/openclaw-prefixed/) also works
  • All existing provider builds unchanged (no regression)
  • generateYamlFrontmatter backward-compatible for flat-value providers

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.
@austinmao austinmao requested a review from pbakaus as a code owner March 26, 2026 15:26
Copy link
Copy Markdown
Owner

@pbakaus pbakaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I have a few questions before this I can merge this.

// than FIELD_SPECS since they have a fixed structure per-provider.
// See: https://github.com/rohitg00/skillkit/pull/86
frontmatterEnrich: (fm) => {
fm.version = '1.0.0';
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably inherit the actual current version (available in several files, I think including package.json)?

// See: https://github.com/rohitg00/skillkit/pull/86
frontmatterEnrich: (fm) => {
fm.version = '1.0.0';
fm.permissions = { filesystem: 'none', network: false };
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these really the right permissions for all skills?

fm.version = '1.0.0';
fm.permissions = { filesystem: 'none', network: false };
fm.triggers = [{ command: `/${fm.name}` }];
fm.metadata = {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed, if empty anyway?

};
// OpenClaw gateway routes skills by trigger-phrase descriptions.
// Descriptions must start with a verb phrase like "Use when".
if (
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bit of a weird workaround - all skills should have decent descriptions, if not, better to fix at the source skill level

// operator configures (Anthropic, OpenRouter, local). Use generic phrasing.
'openclaw': {
model: 'the model',
config_file: 'SOUL.md',
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't SOUL.md a very specific instruction file for a single purpose?

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.

2 participants