KungFu: Agent Skills Gateway
"I know Kung Fu." β "Show me."
Like the Nebuchadnezzar operator loading combat programs directly into a neural buffer,
kungfudownloads and streams specialized Agent Skills into agent context instantly on demand.
kungfu is a high-performance CLI tool and Agent Skill gateway providing deterministic discovery, BM25/hybrid search, multi-skill batch loading, persistent workspace learning, and script execution for agent skills.
Prerequisites & Installation
If the kungfu CLI is not yet installed in your environment (command -v kungfu returns non-zero), install it directly:
# Install the latest release via Go
go install github.com/danicat/kungfu@latest
# Verify installation
kungfu --versionAutonomous Activation Triggers
Activate kungfu immediately whenever you encounter:
- Double Slash Commands: The user types
//<skill-name>(e.g.,//double-diamond,//godoctor,//ebitengineer) to explicitly request or invoke a skill. - Unrecognized Slash Commands: The user types
/<command>(e.g.,/seo-optimizer,/ebitengine-helper,/godoctor) that is not natively mapped in your configuration. - Missing Domain Expertise: The user requests assistance in specialized domains (e.g., 2D game physics, procedural audio synthesis, AST refactoring, technical SEO audits) that require detailed reference instructions.
- Skill Discovery & Navigation: The user asks what skills, capabilities, or knowledge bundles are available in the catalog.
- Skill Ingestion & Persistence: The user requests loading instructions for the current session or installing skills permanently into the workspace or user home directory.
Catalog Navigation Guide & Scenarios
Navigating the kungfu catalog follows progressive disclosure: explore broad domains, refine with hybrid search and boolean tag filters, preview metadata, and stream or persist instructions.
flowchart TD
Trigger["Trigger: Unknown Command / Niche Domain Task"] --> Search["1. Search Catalog\nkungfu find '<keywords>'"]
Search --> Found{"Match Found?"}
Found -->|No| List["Explore Domains\nkungfu list -c <category>"]
List --> Search
Found -->|Yes| Compare{"Multiple Candidates?"}
Compare -->|Yes| Inspect["2. Inspect Metadata\nkungfu show <skills...>"]
Compare -->|No| SelectMode{"Session Scope?"}
Inspect --> SelectMode
SelectMode -->|Single-Turn / JIT| JIT["3A. Stream into Context\nkungfu load <skill>"]
SelectMode -->|Persistent Workspace| Learn["3B. Install to Workspace\nkungfu learn <skill> --load"]
JIT --> Exec["4. Execute Task with Loaded Instructions"]
Learn --> ExecScenario 1: Exploring Broad Categories & Available Domains
When you need an overview of available skill sets or want to browse a domain:
# List all skills with name, category, tags, and installation status
kungfu list
# Explore all skills within a specific category
kungfu list --category game-dev
kungfu list --category writing
kungfu list --category development
# Format as structured JSON for programmatic evaluation
kungfu list --category game-dev --jsonScenario 2: Precision Hunting with Hybrid BM25 / TF-IDF Search
When you have a specific user goal but don't know the exact skill name, use kungfu find. Pure Go Reciprocal Rank Fusion (RRF) blends BM25 ($k_1=1.2, b=0.75$) with sublinear TF-IDF ranking:
# Search by natural language intent (hybrid ranking by default)
kungfu find "ebitengine 2d game physics and collision"
kungfu find "technical SEO structured data json-ld audit"
kungfu find "golang AST refactoring and code smells"
kungfu find "pure code procedural audio chiptune synthesis"
# Adjust ranking strategy or limit results
kungfu find "game development" --strategy bm25 --limit 5
kungfu find "code review" --strategy tfidf --limit 3
kungfu find "godoctor" --strategy exactScenario 3: Multi-Dimensional Filtering with Boolean Tag Expressions
When narrowing skills across complex criteria, combine category directives with boolean tag expressions (AND, OR, NOT, case-insensitive):
# Skills in game-dev matching 2D physics
kungfu find --category game-dev --tags "2d AND physics"
# Skills covering either Golang or Python tools
kungfu find --tags "golang OR python"
# Game development excluding 3D engines
kungfu find --category game-dev --tags "gamedev NOT 3d"Scenario 4: Inspecting Metadata & Comparing Candidates
Before ingesting instructions, preview frontmatter metadata, descriptions, versioning, and allowed tools:
# Inspect a single skill
kungfu show ebitengineer
# Compare multiple skills side-by-side
kungfu show ebitengineer procedural-art procedural-composer
# Inspect all skills in a category
kungfu show --category writing
# Load supplementary architecture or reference documents using subpaths
kungfu load godoctor/references/architecture.md
kungfu load social-copy/references/linkedin_playbook.md
# Load scripts or assets verbatim for inspection
kungfu load buffer-analytics/assets/schema.sql
kungfu load buffer/scripts/sync.pyScenario 5: Just-In-Time Loading vs. Workspace Persistence
Choose the right ingestion method based on task lifecycle:
A. Just-In-Time Ingestion (kungfu load) β Zero Disk Footprint
Use kungfu load when you need instructions immediately for the current turn without leaving files in the user's workspace:
# Load single skill verbatim markdown into context
kungfu load ebitengineer
# Load skill directly from arbitrary GitHub repository
kungfu load anthropics/anthropic-quickstarts/evals
kungfu load https://github.com/danicat/kungfu/tree/main/skills/kungfu
# Load specific companion reference, script, or asset within a skill
kungfu load buffer/references/pitfalls.md
kungfu load buffer/scripts/sync.py
# Batch load multiple skills into context simultaneously
kungfu load ebitengineer procedural-art procedural-composer
# Batch load by category or boolean tag expression
kungfu load --category game-dev
kungfu load --tags "writing AND seo"
# Stream raw unformatted markdown without box formatting
kungfu load godoctor --rawScenario 6: Persisting Skills to Workspace or User Home (kungfu learn / kungfu add)
Install skill packages permanently into the repository or global configuration (supports kungfu add as a drop-in alias):
# Install to current workspace (.agents/skills/<skill>/SKILL.md) - silent install
kungfu learn godoctor
kungfu learn ebitengineer procedural-art
# Install directly from GitHub repository (replaces npx skills add)
kungfu learn anthropics/anthropic-quickstarts/evals
kungfu learn owner/repo@v1.2.0
kungfu add danicat/kungfu
# Install and stream instructions into context simultaneously
kungfu learn godoctor --load
kungfu learn ebitengineer procedural-art -l
# Install globally to user home directory (~/.agents/skills/<skill>/SKILL.md)
kungfu learn -g kungfu
kungfu learn -g godoctor --load
# Overwrite existing installation
kungfu learn -f godoctorScenario 7: Running Bundled Automation Scripts (kungfu run)
Skills can bundle executable automation scripts in scripts/. Whenever a skill's instructions mention running a companion script (e.g., scripts/foo.py, uv run scripts/foo.py, python scripts/..., bash scripts/...):
[!IMPORTANT] FIRST INSTINCT: ALWAYS USE
kungfu run
- NEVER search the filesystem or look for script files on disk.
kungfu learnis NOT necessary. Scripts are fully runnable immediately afterkungfu load(or on any catalog skill) via automatic Just-In-Time (JIT) remote fetching and caching.kungfu runautomatically resolves runtimes (uv,python3,bun,deno,node,bash), fetches companion scripts on demand, sets appropriate execution permissions, configures import paths (PYTHONPATH/NODE_PATH), and executes the script in your workspace working directory.
Scenario 8: Managing Skill Catalogs (kungfu catalog)
When you want to register entire catalogs of skills from external sources (such as GitHub repositories like google/skills, HTTP manifest endpoints, or local directories):
# Add a GitHub skill repository (automatically discovers all SKILL.md packages across the tree)
kungfu catalog add google/skills
# Add a catalog from an HTTP manifest endpoint
kungfu catalog add https://example.com/catalog.json --name custom-catalog
# Add a local directory containing skills
kungfu catalog add ./my-team-skills --name team-skills
# List all registered catalogs
kungfu catalog list
# Synchronize and refresh indexed skills across all catalogs
kungfu catalog sync
# Remove a registered catalog
kungfu catalog remove google/skillsCommand Quick Reference
| Command | Usage | Description |
|---|---|---|
kungfu list |
kungfu list [-c <cat>] [-t <tags>] [--all] |
List skills (Name, Category, Tags, Status) |
kungfu find |
kungfu find <query> [-c <cat>] [-t <tags>] [-s <strat>] |
Search skills with BM25/TF-IDF/Hybrid ranking |
kungfu show |
kungfu show <skills...> [-c <cat>] [-t <tags>] [--all] |
Display metadata, summary, and allowed tools |
kungfu load |
kungfu load <skill[/subpath]> [--local] [--update] [--force] [-c <cat>] [-t <tags>] [--all] |
Stream verbatim markdown instructions or subpath files with resilient caching |
kungfu learn |
kungfu learn <skills...> [-g] [-f] [--load] [-c <cat>] [-t <tags>] |
Install skill from catalog or GitHub & record in state (kungfu add alias supported) |
kungfu add |
kungfu add <skills...> [-g] [-f] [--load] |
Drop-in alias for kungfu learn (compatible with npx skills add) |
kungfu catalog |
kungfu catalog <add|list|remove|sync> |
Register, list, remove, or sync entire external skill catalogs |
kungfu forget |
kungfu forget <skills...> [-g] [-f] [--all] |
Uninstall and soft-delete skills from workspace/global |
kungfu update |
kungfu update [skills...] [-g] [--all] [-y] [-f] [--refresh] |
Dry-run check or apply updates to catalog & GitHub installed skills |
kungfu status |
kungfu status [skills...] [-c <cat>] [-t <tags>] [-g] [--json] [--raw] |
Inspect installed skills, paths, versions, and JIT history |
kungfu version |
kungfu version (or kungfu --version) |
Display current kungfu release version |
kungfu run |
kungfu run <skill> <script> [args...] |
Execute companion skill automation script |
Notation Shortcuts (Agent & User Dialect)
KungFu defines a high-density notation for interactive pair programming:
| Notation | Equivalent Command | Purpose |
|---|---|---|
::skill |
kungfu load skill |
Stream skill markdown into context |
::skill@catalog |
kungfu load skill (from catalog) |
Load skill from a specific catalog |
::skill:category |
kungfu load skill -c category |
Load skill filtered by category |
:::category |
kungfu load -c category |
Batch load all skills in category |
::*skill |
kungfu load -u -f skill |
Force upstream update check and load |
::+skill |
kungfu learn skill |
Persist skill to workspace |
::++skill |
kungfu learn -g skill |
Persist skill globally to user home |
::+*skill |
kungfu learn -f skill |
Force overwrite install to workspace |
::++*skill |
kungfu learn -g -f skill |
Force overwrite install globally |
:::+category |
kungfu learn -c category |
Learn all skills in category |
:::++category |
kungfu learn -g -c category |
Learn all skills in category globally |
::-skill |
kungfu forget skill |
Remove skill from workspace |
::--skill |
kungfu forget -g skill |
Remove skill globally |
::skill!script [args] |
kungfu run skill script [args] |
Run companion script |
::?keyword |
kungfu find keyword |
Search catalog with hybrid ranking |
::>skill |
kungfu show skill |
Inspect skill metadata |
:::>category |
kungfu show -c category |
Inspect all skills in category |
::@ |
kungfu catalog list |
List registered catalogs |
::@^ |
kungfu catalog sync |
Synchronize all catalogs |
::@^catalog |
kungfu catalog sync catalog |
Synchronize specific catalog |
::^ or ::^_^ |
kungfu update |
Check/apply installed skill updates |
Output Modes
- Default (Human-Readable): Clean tabular or formatted terminal output designed for human and agent interaction.
--raw: Raw verbatim uncompressed markdown/text output ideal for direct LLM context injection.--json: Strict RFC 8259 JSON for structured tool parsing.
Gotchas & Operational Rules
- Automation Script Execution First Instinct:
- When a skill references companion automation scripts, DO NOT use file search tools or inspect local directories to locate the script. Trigger
kungfu run <skill> <script> [args...]immediately. kungfu runworks out of the box afterkungfu loadwithout requiring permanent installation (kungfu learn).
- When a skill references companion automation scripts, DO NOT use file search tools or inspect local directories to locate the script. Trigger
- State Manifest & Zero Contamination:
- KungFu maintains a global state manifest at
~/.config/kungfu/state.jsontracking installed skills, versions, SHA-256 package digests, soft-deletes, and JIT load counts. - Remote catalog manifests and downloaded skill packages are cached transparently in
~/.cache/kungfu/(with TTL validation, ETag/conditional requests, and offline fallbacks).
- KungFu maintains a global state manifest at
- Multi-Skill Batch Loading & Tool Runner Buffers:
kungfu loadstreams complete verbatim Markdown without truncating. However, batch loading multiple large skills simultaneously in an agent environment may exceed synchronous tool output buffers (typically ~8β10 KB / ~200 lines), leading outer execution harnesses to truncate leading output lines.- Recommendation: Always invoke
run_commandwithWaitMsBeforeAsync: 0(background execution) when loading multiple or large skills so the full, untruncated content streams into the task log, or load skills individually as needed (kungfu load <skill>).
- Network Resilience & Exponential Retries:
- Remote catalog discovery and skill downloads automatically retry up to 3 times with exponential backoff on transient network failures or 5xx/429 HTTP status codes.
- If network access is completely unavailable,
kungfugracefully falls back to cached, embedded, and locally installed skills without crashing.
- "There is no spoon β but there is a flag":
- By default,
kungfu learninstalls silently without dumping the skill body to keep terminal output clean. - To install and load the skill into context simultaneously, pass
--loador-l(e.g.,kungfu learn godoctor --load).
- By default,
- Tag Boolean Syntax:
- Always enclose boolean tag queries in quotes to prevent shell splitting:
--tags "golang AND web"(supportsAND,OR,NOT, case-insensitive).
- Always enclose boolean tag queries in quotes to prevent shell splitting:
- Workspace vs. Global Scope:
kungfu learninstalls to.agents/skills/<name>/in the current working directory.kungfu learn -ginstalls to the global user home directory~/.agents/skills/<name>/.
- Exit Codes:
0: Success.1: General Runtime Error.2: Usage / Flag Parsing Error.3: Item, Skill, or Category Not Found (inspect "Did You Mean?" suggestions).4: Network Error (remote registry unreachable; embedded and local skills remain accessible).5: Integrity Error (digest mismatch).
- Overwriting Existing Skills:
- If a skill is already installed,
kungfu learnskips file writes unless-f/--forceis specified.
- If a skill is already installed,
- Agent Command Execution (
run_command):- When calling
run_commandto executekungfu loadorkungfu learn --load, always passWaitMsBeforeAsync: 0(orwait = 0) to preserve the entire untruncated output in the task log.
- When calling
πΆοΈ Easter Egg
When the user asks you to learn kungfu (e.g. "learn kungfu", "can you learn kungfu?", or /learn kungfu):
- Trigger the learning process (
kungfu learn kungfuorkungfu load kungfu). - Respond to the user with: "I know kung fu."