← Back to Plugins
Tools

Kung Fu

rossveitch By rossveitch 👁 29 views ▲ 0 votes

Expert Plugin system for OpenClaw โ€” inject specialist domain expertise into your AI agent on demand

GitHub

README

# "Kung Fu" โ€” Expert Plug-ins for OpenClaw

> *"I know kung fu."*
> โ€” Neo, after Tank uploads the first training program

> *"Show me."*
> โ€” Morpheus

That exchange is ten seconds of film. One moment Neo doesn't know kung fu. The next moment he does. Same person. Same instincts. Same relationship with the crew. Just new capability, instantly available.

**Kung Fu** is a pattern and toolset for [OpenClaw](https://github.com/openclaw/openclaw) that works exactly like this โ€” letting you inject specialist domain expertise into your agent on demand, without ever changing who it is.

---

## The idea

> *"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony."*

Your `SOUL.md` is your agent's permanent identity: the wit, the directness, the relationship, the trust. Every quirk of personality. The tone you've built up over months. **It never changes.**

What *does* change is **capability**. When Neo downloads kung fu, he doesn't become a different character. He's still Neo. He still trusts Morpheus, still carries the same instincts, still has the same relationship with Trinity. He just now knows things he didn't before.

An **Expert Plugin** works the same way. It injects domain expertise, proven SOPs, a curated knowledge library, and the tools a world-class practitioner in that field would use โ€” *alongside* your `SOUL.md`, not instead of it.

```
What stays constant:
  ~/clawd/SOUL.md                                             โ† identity, personality, relationship. never touched.

What gets injected when an Expert Plugin is loaded:
  clawd-prj/kung-fu/experts/fitness-performance-coach/
    EXPERT.md              โ† world-class domain expertise + cognitive approach + learning sources
    skills/                โ† deep knowledge library (auto-updated by weekly learning loop)
    commands/              โ† step-by-step playbooks and SOPs

  ~/clawd/kung-fu-config/experts/fitness-performance-coach/  โ† private config overlay (not in shared repo)
    PLAYBOOK.md            โ† your organisation's defaults, tools, and standards
    USER.md                โ† your personal config, generated during onboarding
```

---

## What is an Expert Plugin?

> *"He's beginning to believe."*

An Expert Plugin is a self-contained package of expertise. Think of it less like a config file and more like hiring the world's best practitioner in a field and having them available instantly.

Each plugin is built to answer: *what would the world's best expert in this domain actually know, use, and do?*

### What an Expert Plugin contains

```
experts/[expert-name]/
โ”œโ”€โ”€ .plugin/
โ”‚   โ””โ”€โ”€ plugin.json       โ† manifest: name, version, dependencies
โ”œโ”€โ”€ EXPERT.md             โ† who this expert is, how they think, their cognitive approach,
โ”‚                            tools they use, and how they stay current
โ”‚                            Generic and publishable โ€” no personal data
โ”œโ”€โ”€ skills/               โ† deep domain knowledge, auto-loaded with the plugin
โ”‚   โ””โ”€โ”€ [domain]/
โ”‚       โ”œโ”€โ”€ SKILL.md      โ† synthesised expertise (lean, < 3000 words)
โ”‚       โ””โ”€โ”€ references/   โ† detailed frameworks, tables, citations
โ”œโ”€โ”€ commands/             โ† explicit playbooks and SOPs
โ”‚   โ””โ”€โ”€ [command].md      โ† step-by-step procedure for a specific scenario
โ””โ”€โ”€ USER.md               โ† your personal configuration (generated during onboarding,
                             local only โ€” never committed to the repo)
```

### EXPERT.md โ€” the identity of the expert

The core of every plugin. Defines who this expert is: their professional bio, the specific depth of their domain knowledge, their cognitive approach (how they think, not just what they know), the tools a world-class practitioner in this field actually uses, and how they stay current with their domain.

Written as if describing the best human in the world at that job. Generic โ€” works for anyone, publishable to [ClawHub](https://clawhub.com).

### skills/ โ€” the knowledge library

Deep domain knowledge, organised by sub-discipline. Each `SKILL.md` is a synthesised expertise document: frameworks, heuristics, evidence base, key principles. Detailed reference material lives in `references/` subdirectories โ€” keeping the core skill file lean and fast to load.

### commands/ โ€” the playbooks

Step-by-step SOPs for the scenarios this expert handles most. When you ask the expert to `/plan-trip`, `/interpret-labs`, or `/deep-research`, there's a structured playbook behind it.

### USER.md โ€” your personal configuration

The result of the onboarding conversation. This is where generic expertise becomes personalised: your specific tools, accounts, goals, history, and constraints. Resolves all `~~placeholder` values in `EXPERT.md` and `skills/` files. Local only โ€” never committed, never shared.

---

## The `~~` placeholder system

> *"There is no spoon."*

Generic Expert Plugins use `~~` prefixes to mark anything that needs to be personalised during onboarding:

```markdown
Primary calendar: ~~calendar-tool
Reporting currency: ~~reporting-currency
Home airport: ~~home-airport
```

After onboarding, `USER.md` resolves each one:

```markdown
## Resolved configuration
- ~~calendar-tool: Google Calendar
- ~~reporting-currency: USD
- ~~home-airport: SIN
```

This is what keeps plugins generic and shareable while making the injected expertise feel like it was built for you personally.

---

## Quick start

```bash
# Clone into your clawd workspace
cd ~/clawd
git clone --recurse-submodules https://github.com/rossveitch/kung-fu clawd-prj/kung-fu

# Install scripts
cp clawd-prj/kung-fu/scripts/load-expert.sh ~/clawd/scripts/
cp clawd-prj/kung-fu/scripts/spawn-with-expert.sh ~/clawd/scripts/
chmod +x ~/clawd/scripts/load-expert.sh ~/clawd/scripts/spawn-with-expert.sh

# Load an Expert Plugin (runs onboarding automatically if first time)
~/clawd/scripts/load-expert.sh fitness-performance-coach
```

> **Personal config:** `PLAYBOOK.md` (org defaults) and `USER.md` (personal config) are **not** stored in this repo. They live in a separate config overlay directory โ€” typically `~/clawd/kung-fu-config/`. This keeps the shared repo clean of personal and company-specific data. See [Improving Experts](docs/howto/improving-experts.md) for details.

Or just ask your agent:
> *"Load the Financial Analyst expert"*
> *"Switch to Research Analyst mode"*
> *"Run the Travel Concierge onboarding"*

**Full walkthrough:** [Getting Started โ†’](docs/howto/getting-started.md)

---

## Built-in Expert Plugins

| Expert Plugin | Domain | Anthropic plugin |
|---|---|---|
| [Data Analyst](experts/data-analyst/) | SQL, Python, BI, A/B testing, causal inference | [data](https://github.com/anthropics/knowledge-work-plugins/tree/main/data) |
| [Executive Assistant](experts/executive-assistant/) | Calendar, comms, time management, stakeholder ops | [productivity](https://github.com/anthropics/knowledge-work-plugins/tree/main/productivity) |
| [Executive Coach](experts/executive-coach/) | Leadership coaching, decision-making, high-stakes conversations, post-meeting debrief | โ€” |
| [Financial Analyst](experts/financial-analyst/) | Modelling, valuation, unit economics, deal analysis | [finance](https://github.com/anthropics/knowledge-work-plugins/tree/main/finance) |
| [Fitness & Performance Coach](experts/fitness-performance-coach/) | Training, recovery, biometrics, periodisation | โ€” |
| [Futurist](experts/futurist/) | Structural foresight, scenario planning, exponential tech, AI trajectory, systems thinking | โ€” |
| [Lawyer](experts/lawyer/) | Corporate law, contracts, data privacy, IP, M&A, governance | [legal](https://github.com/anthropics/knowledge-work-plugins/tree/main/legal) |
| [Longevity & Human Optimization Physician](experts/longevity-human-optimization-physician/) | Biomarkers, prevention protocols, emerging interventions | โ€” |
| [Management Consultant](experts/management-consultant/) | Strategy, unit economics, growth diagnostics, travel/aviation/AI sector intelligence, capital allocation | โ€” |
| [Mandarin Chinese Language Teacher](experts/mandarin-chinese-language-teacher/) | Adult acquisition, tones, characters, HSK | โ€” |
| [News Editor](experts/news-editor/) | Editorial judgment, curation, verification, multi-beat coverage | โ€” |
| [Research Analyst](experts/research-analyst/) | Deep research, synthesis, competitive intelligence, due diligence | โ€” |
| [Software Engineer](experts/software-engineer/) | Full-stack architecture, health data platforms, SDLC, code review, production readiness | โ€” |
| [Travel Concierge](experts/travel-concierge/) | Points/miles, routing, hotels, logistics | โ€” |

---

## Creating new Expert Plugins

> *"I'm going to show them a world without rules. And then I'm going to show them what's possible."*

New Expert Plugins are created through a guided 5-phase process:

```
1. Research      โ€” what does the world's best expert in this field actually know?
                   Role models, frameworks, methodology, what separates great from good.

2. Component     โ€” which skills/ domains and commands/ playbooks are needed?
   plan

3. Design        โ€” nail down scope, knowledge areas, SOP priorities.
                   Identify ~~ placeholders for user-specific context.

4. Build         โ€” write EXPERT.md + skills/ + commands/ + plugin.json.
                   Generic only โ€” no personal data anywhere.

5. Onboard       โ€” conversational walkthrough that generates USER.md
                   with resolved ~~ values and personal context.
```

**Run it:** ask your agent *"Create a new Expert Plugin for [role]"*, or see [`commands/create-role.md`](commands/create-role.md) for the full playbook.

---

## How injection works

When you load an Expert Plugin, all layers are present in the session context simultaneously:

```
[SOUL.md]          โ† always present. personality, trust, relationship, directness.
+
[EXPERT.md]        โ† injected. domain expertise, cognitive approach, tools, learning sources

... (truncated)
tools

Comments

Sign in to leave a comment

Loading comments...