How do you create an OpenClaw skill with SKILL.md?
Create an OpenClaw skill from a folder and a SKILL.md: the documented frontmatter fields, where the file loads from, local testing and ClawHub publishing.
Checked against OpenClaw 2026.11.3 on
A custom skill is a folder with a SKILL.md file in it, and two required frontmatter fields: name and description. Put the folder in your workspace skills/ directory, write the instructions in Markdown below the frontmatter, and run openclaw skills list to confirm it loaded. The version behind every command and field below is v2026.11.3, the latest release listed in the OpenClaw docs as of November 14, 2026.
If you learned the format from an earlier tutorial that showed author, tools, triggers, permissions or priority keys, none of those appear in OpenClaw's current documentation. Neither does the layout those tutorials use, which files personal skills under a custom subfolder of the managed skills root. version is the one partial exception, and it is worth being exact about: ClawHub's skill format page shows it in both of its frontmatter examples, and the registry validates a version on every release, but you do not maintain the number by hand because the publishing CLI infers it. The documented schema is smaller than the one those tutorials describe, and the section below lists it field by field.
#What is an OpenClaw skill?
A directory with a Markdown file in it. OpenClaw's creating-skills page states it directly: "Skills teach the agent how and when to use tools. Each skill is a directory containing a SKILL.md file with YAML frontmatter and markdown instructions." The skills reference opens the same way, calling skills "markdown instruction files that teach the agent how and when to use tools".
There is no build step and no compiled artifact. The frontmatter tells OpenClaw the skill's name, what it is for, and what it needs in order to run; the Markdown body tells the model what to do once it decides to use it. OpenClaw's own words for the split are that "The frontmatter defines metadata; the body gives the agent instructions."
The docs also draw a line between skills and plugins. The skills reference notes that plugins can ship their own skills "by listing skills directories in openclaw.plugin.json", and the skills CLI page sends plugin packages to the separate openclaw plugins command. A skill on its own is just the folder.
OpenClaw's skills reference says it "follows the AgentSkills spec", and that frontmatter "is parsed as YAML first; if that fails, it falls back to a single-line-only parser." Nested metadata blocks are "flattened to a JSON string and re-parsed as JSON5", which is why both the inline and the multi-line forms of metadata.openclaw shown in the docs work.
#Where do skills live?
In your workspace skills/ folder. The creating-skills page says "Skills live in your workspace skills/ folder:" and gives the first command as mkdir -p ~/.openclaw/workspace/skills/hello-world. Subfolders are allowed for organization: the same page notes that "the skill is still named by the SKILL.md frontmatter, not the folder path", and the skills reference adds that OpenClaw "discovers a skill whenever SKILL.md appears anywhere under a configured root (up to 6 levels deep)".
That workspace folder is one of several roots. The skills reference publishes the full order and says that "When the same skill name appears in multiple places, the highest source wins." The table below carries the docs' rows unchanged, with the docs' em dash markers for highest and lowest rewritten in parentheses.
| Priority | Source | Path |
|---|---|---|
| 1 (highest) | Workspace skills | <workspace>/skills |
| 2 | Project agent skills | <workspace>/.agents/skills |
| 3 | Personal agent skills | ~/.agents/skills (default state only) |
| 4 | Managed / local skills | <state-dir>/skills |
| 5 | Workshop skills | <state-dir>/agents/<agentId>/agent/workshop-skills |
| 6 | Bundled skills | shipped with the install |
| 6 | Custodian skills | shipped; configured Custodian agent only |
| 7 (lowest) | Extra directories | skills.load.extraDirs + plugin skills |
Two of those roots are the ones you will actually type. The workspace root is where you author. The managed root is where shared installs land: the skills reference says openclaw skills install "installs into the active workspace skills/ directory by default", and that --global installs "into the shared ~/.openclaw/skills directory, visible to all local agents unless agent allowlists narrow it." The skills CLI page states the same boundary for all three commands that touch disk: "By default, install, update, and verify target the active workspace skills/ directory; with --global, they target the shared managed skills directory."
Installing someone else's skill from the registry is one command:
openclaw skills install @owner/<slug>openclaw skills install @owner/<slug> --globalThe skills CLI page also documents openclaw skills install git:owner/repo@ref for a Git source and openclaw skills install ./path/to/skill --as my-tool for a local directory, and notes that "Git and local directory installs expect SKILL.md at the source root."
Not every skill needs a workspace. The creating-skills page documents a second route for a skill that should follow your signed-in profile rather than belong to an agent workspace: "use Plugins → Skills → My skills", where you "Create or import the SKILL.md bundle there, then review the saved revision and activation result". The page is explicit about what that route does not require: "You do not need host shell access or permission to edit shared Gateway settings." An agent can also write one for you through its skill_workshop tool, which "uses the Gateway's authorized library service" rather than writing managed revision directories directly. From the command line the same library is openclaw skills library, with list, create, read, update, import, attach and refresh subcommands.
Folder name and name should agree. The creating-skills page's naming rules say to "Keep the directory name and frontmatter name aligned", and the skills reference explains what happens when they do not: "The skill's name and slash command come from the name frontmatter field (or the directory name when name is missing)."
#What goes in SKILL.md?
Two required fields, six optional top-level keys, and an optional metadata.openclaw block. The table lists every field documented across OpenClaw's creating-skills page, its skills reference, and ClawHub's skill format page, including ClawHub's version, which the publishing CLI sets for you.
| Field | Required | What it does |
|---|---|---|
name | Yes | "Unique slug using lowercase letters, digits, and hyphens" |
description | Yes | "One-line description shown to the agent and in discovery output". Keep it "one line and under 160 characters" |
user-invocable | No, default true | "When true, the skill is exposed as a user-invocable slash command." |
disable-model-invocation | No, default false | "When true, OpenClaw keeps the skill's instructions out of the agent's normal prompt." It stays reachable as a slash command while user-invocable is also true |
command-dispatch | No | "When set to tool, the slash command bypasses the model and dispatches directly to a registered tool." |
command-tool | No | "Tool name to invoke when command-dispatch: tool is set." |
command-arg-mode | No, default raw | "For tool dispatch, forwards the raw args string to the tool with no core parsing." |
homepage | No | URL shown as the Website link in the macOS Skills UI. Also supported as metadata.openclaw.homepage |
version | No, for the loader | Not read by OpenClaw itself. ClawHub's skill format page carries it in both frontmatter examples, and the registry validates a version at publish time, but the CLI infers the number |
metadata.openclaw.requires.bins | No | "Each binary must exist on PATH." |
metadata.openclaw.requires.anyBins | No | "At least one binary must exist on PATH." |
metadata.openclaw.requires.env | No | "Each env var must exist in the process or be provided via config." |
metadata.openclaw.requires.config | No | "Each openclaw.json path must be truthy." |
metadata.openclaw.os | No | "Hard platform filter" over darwin, macos, linux and win32. The skills reference says macos "is accepted as an alias for" darwin, so ClawHub's ["macos"] example works too |
metadata.openclaw.always | No | "When true, include the skill whenever its os requirement is compatible, bypassing requires.bins, requires.anyBins, requires.env, and requires.config." |
metadata.openclaw.primaryEnv | No | "Env var name associated with skills.entries.<name>.apiKey." |
metadata.openclaw.envVars | No | "Environment variable declarations with name, optional required, and optional description." |
metadata.openclaw.emoji | No | "Optional emoji shown in the macOS Skills UI." |
metadata.openclaw.install | No | "Optional installer specs used by the macOS Skills UI (brew / node / go / uv / download)." |
metadata.openclaw.skillKey | No | "Override the skill's invocation key." |
metadata.openclaw.nix | No | "Nix plugin spec (see README)." |
metadata.openclaw.config | No | "Clawdbot config spec (see README)." |
The two required fields and the six optional top-level keys come from OpenClaw's own SKILL.md reference. The gating keys under requires, plus os, always, primaryEnv, emoji and install, are documented on the skills reference under Gating. envVars, skillKey, nix and config are documented on ClawHub's skill format page, which also lists aliases for the block: "Declare your skill's runtime requirements under metadata.openclaw (aliases: metadata.clawdbot, metadata.clawdis)." Do not rely on them. OpenClaw's own skills reference says "The pre-July 2026 metadata.clawdbot format is no longer read", and that "the old block's dependency gates and installer hints are ignored until you update it". The two pages disagree, and this guide follows the loader: name the block metadata.openclaw.
Leaving the block out is fine. The skills reference is explicit that "A skill with no metadata.openclaw block is always eligible unless explicitly disabled."
The gating check runs on the host. The skills reference notes that "requires.bins is checked on the host at skill load time. If an agent runs in a sandbox, the binary must also exist inside the container." The same page warns that skills.entries.*.env and skills.entries.*.apiKey "inject secrets into the host process for that agent turn only", not into the sandbox.
#How does the agent decide to use a skill?
By reading descriptions. OpenClaw's skills reference describes the per-run sequence: it resolves the eligible skill list, injects any configured env and API keys, and then builds the prompt, where "Eligible skills are compiled into a compact XML block and injected into the system prompt." The cost is published at "~97 characters + your name, description, and location field lengths" per skill, which is why its token-impact note closes with "Keep descriptions short and descriptive to minimize prompt overhead."
So the description is the matching surface. The model sees the name, the description and the location of every eligible skill, and reads the full SKILL.md only once it picks one. A description that names the trigger condition in plain language does more work than a long body.
A person can also name the skill outright. The skills reference documents a $ reference in the Control UI composer that "matches the current agent's eligible, user-invocable skills and tells the model to read each referenced SKILL.md before acting", with a ceiling, and a documented failure mode rather than a silent one: "A single message can reference up to eight distinct skills; OpenClaw returns a visible error instead of ignoring extra or allowlist-hidden references." On the command side, the slash commands page says "/skill <name> [input] always works as the generic entrypoint", and that skills "may register as direct commands using their declared skill name."
Three frontmatter keys change that behavior:
user-invocableistrueby default, which is what exposes the slash command at all.disable-model-invocation: truetakes the skill off the model's menu without removing it from yours. The skills reference says user-invocable skills with it set "appear in the$picker and inline slash suggestions, but stay out of the model's normal prompt so it cannot select them on its own. Selecting one inserts an explicit$skill-namereference."command-dispatch: toolremoves the model from the path entirely. The slash commands page notes that by default "skill commands route to the model as a normal request", and that a skill can declarecommand-dispatch: tool"to route directly to a tool (fixed rules, no model involvement)."
Gating happens before any of this. The skills reference says OpenClaw "loads bundled skills plus any local overrides, and filters them at load time based on environment, config, and binary presence", so a skill whose requires.env variable is unset never reaches the prompt in the first place.
#Example: a complete skill you can run for free
Create the folder first. OpenClaw's creating-skills page opens with mkdir -p ~/.openclaw/workspace/skills/hello-world; the same command with this skill's folder name is:
mkdir -p ~/.openclaw/workspace/skills/release-notesThen write SKILL.md inside it. This skill needs no account, no API key and no paid service: its only declared dependency is git, which the body reaches through the exec tool, and every key in the frontmatter comes from the table above.
---name: release-notesdescription: Draft release notes from the commits on this branch since the last tag when the user asks for them.version: 1.0.0homepage: https://github.com/<your-handle>/release-notesmetadata: openclaw: requires: bins: - git emoji: "✏️"---# Release notesWhen the user asks for release notes, work in the repository the session isalready in, and produce one draft in this order.1. Find the range. Use the `exec` tool:```bashgit describe --tags --abbrev=0 2>/dev/null || git rev-list --max-parents=0 HEAD``` Treat that output as the start of the range and `HEAD` as the end.2. Read the commits in it:```bashgit log --no-merges --pretty=format:'%h %s' <start>..HEAD```3. Group them under Added, Changed and Fixed, one line each, written the way a reader of the changelog would phrase it rather than copying commit subjects.4. Put anything you could not classify under a final Unsorted heading rather than dropping it.Keep the draft under 200 words. If there are no commits in the range, say soin one line and stop.That description is 99 characters, inside the documented limit of one line under 160, and it names the condition that should trigger the skill rather than describing the skill in the abstract. That is what the token-impact note in the skills reference asks for: the description is paid for on every turn, the body only once the skill is picked.
version is in there for ClawHub's benefit rather than OpenClaw's. Nothing in the loader reads it, ClawHub's skill format page carries it in both of its frontmatter examples, and the publishing section below explains who sets the number.
#If the skill needs a credential
Gate it on the variable, then wire the value in openclaw.json. The creating-skills page's own gating example is a Gemini search skill, which declares the binary it needs and names the credential in one line:
---name: gemini-searchdescription: Search using Gemini CLI.metadata: { "openclaw": { "requires": { "bins": ["gemini"] }, "primaryEnv": "GEMINI_API_KEY" } }---{ skills: { entries: { "gemini-search": { enabled: true, apiKey: { source: "env", provider: "default", id: "GEMINI_API_KEY" }, }, }, },}The creating-skills page describes the effect in one sentence: "The key is injected into the host process for that agent turn only." It adds that the key "does not reach the sandbox". The skills config reference describes skills.entries.<key>.apiKey as a "Convenience field for skills that declare metadata.openclaw.primaryEnv", and it accepts either a plaintext string or a SecretRef. Use the SecretRef form. API key setup covers where the underlying value should live.
Declare an optional variable under envVars with required: false rather than in requires.env. ClawHub's skill format page gives the reason: "Do not add optional entries to requires.env, because requires.env means the skill cannot run without them." Declaring it somewhere is not optional, though, because ClawHub's security analysis compares the body against the frontmatter: "If your code references TODOIST_API_KEY but your frontmatter doesn't declare it under requires.env, primaryEnv, or envVars, the analysis will flag a metadata mismatch."
The creating-skills page documents {baseDir} for files that ship next to SKILL.md: the agent "resolves {baseDir} against the skill's own directory", so a helper script can be referenced as `{baseDir}/scripts/run.sh` without hardcoding a path that breaks when the skill is installed somewhere else.
#How do you test a skill locally?
By loading it, not by validating it. OpenClaw's skills CLI page documents search, install, update, verify, list, info, check, library and workshop subcommands. No validate subcommand appears there, so there is no documented way to lint a SKILL.md before OpenClaw reads it. Older tutorials that show openclaw skills validate <path> are describing a command the current documentation does not list.
What the docs do give you is a load, an inspection and a real turn:
openclaw skills listopenclaw skills info release-notesopenclaw skills checkopenclaw agent --message "draft the release notes"openclaw skills list is the verification step the creating-skills page uses after writing the file, and openclaw agent --message "give me a greeting" is its test step, shown there with the hello-world prompt. openclaw skills check is the prerequisite report, and the skills CLI page splits what it tells you into three: inventory, meaning "OpenClaw found the skill in a configured root or bundled source and can report its status"; readiness, meaning "the skill's declared prerequisites are satisfied for the selected Gateway or node"; and visibility, meaning "an eligible skill is exposed to the selected agent's prompt, picker, or command surface after agent filters and invocation flags are applied". It "reports missing prerequisites independently of agent exclusion", so a skill missing git shows up under Missing requirements rather than silently vanishing. openclaw skills info <name> prints one skill's details, and the same page notes that it "resolves an exact skill name before a metadata key."
A broken file will not take the others down. The skills reference states that "Invalid skill files are reported and skipped; valid siblings can still load", so a skill that disappears from openclaw skills list after an edit is the signal that its frontmatter did not parse.
Edits are usually picked up for you. The creating-skills page says "OpenClaw watches SKILL.md files under skills roots by default", and tells you what to do when it is not enough: "If the watcher is disabled or you are continuing an existing session, start a new one so the agent receives the refreshed list", with /new from chat or openclaw gateway restart as the two routes. The skills reference adds that "Existing sessions pick up changed file-backed skills on their next agent turn."
To invoke the skill by name rather than hoping the model picks it, the creating-skills page gives the explicit form: "Use /skill hello-world to invoke it explicitly by name."
For a broader sweep, openclaw doctor covers skills among other subsystems. Its CLI page describes it as "Health checks and quick fixes for the gateway, channels, plugins, skills, model routing, local state, and config migrations."
#How do you publish to ClawHub?
With the standalone clawhub CLI. OpenClaw's own creating-skills page routes publishing there rather than to an openclaw subcommand, and the ClawHub CLI reference names the package: "CLI package: clawhub, bin: clawhub."
npm i -g clawhubclawhub loginclawhub skill publish ./release-notes --dry-runclawhub skill publish ./release-notes --owner <handle> \ --categories development,operations --topics "git,changelog"The first two lines are the creating-skills page's publish sequence. clawhub login prints "a one-time code and verification URL" rather than opening a browser. --dry-run "resolves the publish without uploading", which is worth running first for the reason in the catalog-metadata note below.
Six details decide whether a publish does what you expect.
The slug comes from the folder. ClawHub's skill format page says slugs are "Derived from folder name by default." Settle the folder name before the first publish; if you need to change it afterwards, the CLI reference documents clawhub skill rename <skill> <new-name>, which keeps "the previous slug as a redirect alias".
The owner is a handle that already exists. The creating-skills page defines it: "An owner is a ClawHub publisher handle, such as @alice or @your-org. Your account has a personal owner", and adds that organization owners can have members with "owner, admin, or publisher roles; all three roles can publish." The publishing page says "Use --owner <handle> when publishing to an org owner. Omit it to publish as the authenticated user", and the CLI reference restricts it to publishers where "the actor has publisher access." Moving a skill between owners is its own flag: --migrate-owner "moves an existing skill to --owner while publishing a new version" and "Requires admin/owner access on both publishers."
Versions are the CLI's job, not yours. The publishing page says ClawHub "validates the metadata, name, version, files, and source information" on every release, so a release always carries a version. You do not pick it: "New skills default to 1.0.0; changed skills default to the next patch version", and --version <version> "explicitly selects a version and publishes even when the content matches an existing version." The creating-skills page calls the default the "inferred version" in the same breath. So keep version in your frontmatter if you like, because ClawHub's own examples do, but do not expect to have to bump it. Unchanged content is a no-op: publish "Compares the local bundle fingerprint with ClawHub and exits successfully when the content is already published."
Categories and topics decide where the skill appears, and --dry-run will not check them. The publishing page asks you to "Set both when you publish", and the rules are specific: a category must be a slug from ClawHub's own list ("matched exactly, so Development is rejected"), a skill carries "at most 3 categories and at most 5 topics", each topic is "at most 48 characters", and repeats are dropped after normalization, so "git,Git is one topic". Two traps are worth naming. First, "An unknown category slug fails the publish. --dry-run does not check slugs; the registry validates them when the publish runs", so the dry run cannot clear you here. Second, a skill "first published without --categories is stored as other", and a later publish that omits the flag keeps whatever is stored, so the fix is a publish that passes the flag.
ClawHub also reserves a set of topic names and rejects them, among them approved, audited, certified, curated, endorsed, featured, official, recommended, staff-pick, trusted and verified, with the check running "on the normalized form". A skill cannot label itself as vetted.
Undeclared environment variables get flagged. ClawHub's skill format page explains the check in its own words: "If your code references TODOIST_API_KEY but your frontmatter doesn't declare it under requires.env, primaryEnv, or envVars, the analysis will flag a metadata mismatch." Any one of the three clears it; requires.env is also what gates the skill locally, and primaryEnv is what skills.entries.<name>.apiKey binds to.
A changelog is optional and free-form. The CLI reference describes the flag's behavior through the workflow input that maps to it: changelog "reaches the CLI verbatim, the way skill publish --changelog stores it", so "Markdown indentation and trailing hard-break spaces survive the workflow; a value that is only whitespace counts as omitted."
Three rules are worth knowing before you upload. ClawHub's skill format page caps "Total bundle size: 50MB." Publisher handles are constrained too: "Package scopes must match the ClawHub publisher handle exactly. Publisher handles can use lowercase letters, numbers, hyphens, dots, and underscores; they must start and end with a lowercase letter or number." And the license is not negotiable: "All skills published on ClawHub are licensed under MIT-0", with the CLI reference repeating that "Publishing a skill means it is released under MIT-0 on ClawHub", that "Published skills are free to use, modify, and redistribute without attribution", and that "ClawHub does not support paid skills or per-skill pricing." The format page adds "Do not add conflicting license terms in SKILL.md; ClawHub does not support per-skill license overrides."
If validation fails, nothing lands. The publishing page: "If validation fails, nothing is published. A pending release stays out of search, install, and download surfaces until the security checks pass."
#Common mistakes
Using an environment variable the frontmatter never declares. ClawHub's security analysis compares the two, and the format page says a body that references a variable not listed "under requires.env, primaryEnv, or envVars" produces a metadata mismatch. The same declaration is what gates the skill locally, since requires.env means "Each env var must exist in the process or be provided via config."
Writing a description longer than one line. The creating-skills page's rule is to "keep it one line and under 160 characters", and the skills reference explains the cost of ignoring it: when the rendered block exceeds skills.limits.maxSkillsPromptChars, OpenClaw "first preserves as many skill identities (name and location) as the description-free compact format can fit", and "If no description budget remains, descriptions are omitted." A description the model never sees cannot get the skill selected.
Putting the folder somewhere that is not a skill root. The eight sources in the loading-order table above are the whole list, plus one addition the skills reference makes: "When a session uses a different execution workspace, OpenClaw also loads that workspace's skills/ and .agents/skills/ directories." A custom subfolder of the managed skills root is not among them, and neither is Codex CLI's own skills directory: the skills reference says it is not an OpenClaw skill root and points at openclaw migrate plan codex and openclaw migrate codex for moving those files across.
Carrying frontmatter fields over from an older tutorial. tools, triggers and permissions are not part of the documented schema. OpenClaw's SKILL.md reference lists name and description as the required fields and user-invocable, disable-model-invocation, command-dispatch, command-tool, command-arg-mode and homepage as the optional ones; the gating keys live under metadata.openclaw. Nothing in the documented format grants a skill access to a tool: command-tool names one dispatch target for a slash command, and nothing takes a list of trigger phrases. Tool access is an agent-level concern: the skills reference notes that a skill allowlist "is not a host shell authorization boundary" and that an eligible skill "does not grant tool access."
Trusting --dry-run to catch a bad category slug. It does not. The publishing page says so directly: "An unknown category slug fails the publish. --dry-run does not check slugs; the registry validates them when the publish runs." Copy the slug out of ClawHub's own list rather than guessing from the browse page's labels, because Development is rejected where development is accepted.
Letting the folder name and name drift apart. The creating-skills naming rules say to keep them aligned, the skills reference falls back to the directory name only "when name is missing", and ClawHub's format page expects name to match the parent directory for portable Agent Skills.
Trusting a community skill because it installed cleanly. The skills reference says to treat third-party skills as untrusted code and to "Read them before enabling." openclaw skills verify @owner/<slug> asks ClawHub for the skill's trust envelope, and --card prints the generated Skill Card instead of JSON. A trust envelope is not a review: work through how to audit a SKILL.md before you enable somebody else's skill. ClawDocx does not vet, endorse or certify any third-party skill, and neither does a ClawHub category or topic, which is why ClawHub rejects verified and endorsed as topic names.
#What to read next
- API key setup covers where the value behind
primaryEnvshould actually live, including the SecretRef sources OpenClaw accepts inopenclaw.json. - Security hardening is the companion read for the untrusted-code warning above, once you start installing skills you did not write.
- The best OpenClaw skills in 2026 is the browse-before-you-build step: the creating-skills page's own advice is to browse community skills at clawhub.ai before building from scratch.
- Skills explained is the shorter conceptual read if the loading order and the gating fields above are more detail than you wanted today.
- Publishing to ClawHub goes further into the registry side than the publish section above: owners, maintenance commands and what review does.
Every field, path and command on this page was checked against the OpenClaw and ClawHub documentation on November 14, 2026, against v2026.11.3, the newest release the docs list that day. The metadata block has already been renamed more than once: ClawHub's skill format page still lists metadata.clawdbot and metadata.clawdis as aliases, while the skills reference says the pre-July 2026 metadata.clawdbot format "is no longer read". So check the sources below before you copy a frontmatter block out of any tutorial, including this one.
Frequently asked questions
- What is an OpenClaw skill?
- A folder with a SKILL.md file in it. OpenClaw's skills reference describes skills as markdown instruction files that teach the agent how and when to use tools, and says each skill lives in a directory containing a SKILL.md file with YAML frontmatter and a markdown body. There is no compiled plugin and no build step.
- Where does a custom SKILL.md file go?
- In your workspace skills folder. OpenClaw's creating-skills page says skills live in your workspace skills/ folder and gives mkdir -p ~/.openclaw/workspace/skills/hello-world as the first step. The docs also list a shared managed root at ~/.openclaw/skills, which is where openclaw skills install --global puts a skill so that all local agents can see it.
- Which SKILL.md frontmatter fields are required?
- Two: name and description. OpenClaw's creating-skills reference lists name as a unique slug using lowercase letters, digits, and hyphens, and description as a one-line description shown to the agent and in discovery output, which the same page says to keep to one line and under 160 characters. Everything else, including the metadata.openclaw block, is optional.
- How does the agent decide to use a skill?
- From the description. OpenClaw compiles eligible skills into a compact XML block and injects it into the system prompt, spending roughly 97 characters per skill plus the length of its name, description and location, so the description is the text the model matches against. A user can also name a skill explicitly with a $skill-name reference or the /skill <name> command.
- How do you give a skill an API key?
- Declare the variable in metadata.openclaw, then wire the value in openclaw.json. Name the variable under requires.env or envVars and point primaryEnv at it, then set skills.entries.<name>.apiKey to a SecretRef such as { source: env, provider: default, id: WEATHER_API_KEY }. OpenClaw's creating-skills page says the key is injected into the host process for that agent turn only and does not reach the sandbox.
- How do you publish a skill to ClawHub?
- With the standalone clawhub CLI, not the openclaw command. Install it with npm i -g clawhub, run clawhub login, then clawhub skill publish ./my-skill. ClawHub validates a version on every release, but the CLI infers it: new skills default to 1.0.0 and changed skills default to the next patch version, and --version only overrides that. Set --categories and --topics in the same command, because a first publish without --categories is stored as other.