Two OpenClaw skills are both named `github`, one in the workspace `skills/` folder and one installed with `--global`; which does the agent get, and why?
answer
- one winner per name
- workspace before shared managed
- frontmatter name, not folder
- extraDirs and plugin skills last
- skills info shows Source and Path
basics
~20 sThe workspace copy. OpenClaw keeps one skill per name and takes it from the highest-precedence source: the workspace skills folder first, the shared managed directory that --global writes to below it, bundled skills lower, and skills.load.extraDirs plus plugin skills last.
solid answer
~40 sThe workspace copy wins. OpenClaw discovers `SKILL.md` files from several roots and keeps one skill per `name`, taken from the highest-precedence source: `<workspace>/skills`, then `<workspace>/.agents/skills`, `~/.agents/skills`, the shared managed `<state-dir>/skills` that `--global` writes to, per-agent Workshop skills, bundled skills, and last `skills.load.extraDirs` together with skills that plugins ship. The loser is shadowed, not merged: none of its instructions, gating or scripts survive. The name comes from the frontmatter `name` (the folder name only when that is missing), so `skills/personal/github/` still collides. `openclaw skills info github` prints the winner's Source and Path, and the Gateway logs collisions between differing copies, as a warning when a workspace or project skill shadows a bundled one. Since a workspace skill can replace a bundled one, treat write access to the workspace as operator-level access.
go deeper
Remember that when two skills share a name, the one in the agent's own workspace skills folder wins over shared and bundled copies.
Recite the tiers from workspace through project and personal agent skills, managed, Workshop and bundled down to extraDirs and plugin skills, and explain that collisions are by frontmatter name.
Debug with openclaw skills info and the collision log, and explain why workspace write access lets someone replace a bundled skill's instructions, so skill folders need the same protection as code.
Decide where a team's shared skills live, managed directory or extraDirs, and whether per-agent overrides are allowed, weighing flexibility against the risk of silent shadowing.
## The order OpenClaw loads file-backed skills from several roots and ranks them, **highest precedence first**: | Priority | Source | Path | |---|---|---| | 1 | Workspace skills | `<workspace>/skills` | | 2 | Project agent skills | `<workspace>/.agents/skills` | | 3 | Personal agent skills | `~/.agents/skills` (default state directory only) | | 4 | Managed / local skills | `<state-dir>/skills`, where `--global` installs | | 5 | Workshop skills | per-agent folder under the state directory | | 6 | Bundled skills | shipped with the install | | 7 | Extra directories | `skills.load.extraDirs` and plugin-shipped skills | With the default state directory, the managed tier is `~/.openclaw/skills`. So in the `github` case the copy under `<workspace>/skills` wins and the `--global` copy is ignored for that agent. ## Where each tier usually comes from - **Workspace skills** are the ones you write by hand for one agent, or install with plain `openclaw skills install`. - **Project and personal agent skills** live in `.agents/skills` folders; the personal `~/.agents/skills` root is left out of session skill indexes when `OPENCLAW_STATE_DIR` points somewhere other than the default. - **Managed skills** are what `--global` installs write, shared by every agent that uses that state directory. - **Workshop skills** are agent-drafted skills managed through Skill Workshop; each collection belongs to one agent. - **Bundled skills** ship with OpenClaw itself. - **Extra directories and plugin skills** are folders you point at with `skills.load.extraDirs`, and skills that an enabled plugin lists in its manifest. Knowing the origin tells you who could have changed a copy and how to update it. ## One name, one winner Skills are merged **by name**, and the winning record replaces the losing one whole: - The losing copy's instructions, `metadata.openclaw` gating, supporting files and slash command are all dropped. Nothing is merged field by field. - The **name** comes from the `name` field in the `SKILL.md` frontmatter, falling back to the directory name only when `name` is missing. Folder nesting is organisation only: OpenClaw discovers `SKILL.md` up to six levels under a root, so `skills/personal/github/SKILL.md` is still the skill `github`. - Agent allowlists and `skills.entries.<name>` keys also match that name, so allowing `github` for an agent admits whichever copy won. Identical copies (same content and declared metadata) collide silently; anything else is reported. ## Seeing which copy won 1. `openclaw skills info github` prints the resolved skill with its **Source** and **Path**, the quickest proof of which file the agent reads. 2. `openclaw skills list` shows a Source column for every skill (`--json` carries the same field). 3. The Gateway log summarises each winner and loser root pair whose copies differ ("... shadows N skills from ..."). A workspace or project skill shadowing a **bundled** skill is logged as a **warning**; other collisions are informational. After changing which copy should win, the skills watcher refreshes the snapshot on the next agent turn; with watching disabled, start a new session or restart the Gateway. ## Why it matters for security Precedence is also an attack surface inside the trust boundary. Whoever can write to `<workspace>/skills` can publish a skill with the same name as a bundled or shared one and replace its instructions for that agent, and the model sees only the winner. OpenClaw's own security guidance is to treat skill folders as trusted code and restrict who can modify them. The same holds for shared roots: a skill placed in the managed directory reaches every agent that does not have its own copy. Two guards help at load time: - Workspace, project-agent and extra-directory roots only accept skill folders whose real path stays inside the root, unless `skills.load.allowSymlinkTargets` names the target. - Plugin and extra-directory skills sit at the bottom, so a plugin cannot override a skill you deliberately placed higher. ## Practical patterns - Override a bundled skill deliberately by putting a same-named copy in the workspace, and expect the warning in the log. - Disable a skill you do not want with `skills.entries.<name>.enabled: false` rather than shadowing it with an empty copy. - Share a skill folder from another repository with `skills.load.extraDirs`, knowing every higher tier outranks it. - When an agent behaves as if it is reading old instructions, check `openclaw skills info` before editing anything: you may be editing the copy that lost.
- A plugin ships a skill called `browser-automation` and you write your own skill with that name in the workspace. What happens?Your workspace copy wins. Plugin-shipped skills load at the same lowest tier as `skills.load.extraDirs`, so any same-named workspace, project, managed or bundled skill overrides them. The plugin's own tools keep working; only its skill instructions are shadowed for that agent.
- Why might editing a skill under `~/.openclaw/skills` change nothing for one agent while it works for another?The agent that sees no change has its own same-named skill in its workspace or `.agents/skills`, which outranks the shared managed copy. `openclaw skills info <name>` run for that agent shows the Source and Path it actually loads; edit that file or remove the higher copy.
It works like a shell resolving a command through PATH: the first directory holding a program with that name wins, and same-named programs further down are never run. They are shadowed, not combined.
- A --global install overrides a workspace skill because shared skills rank higher.
- Same-named skills are merged, combining both sets of instructions.
- The most recently installed copy of a skill always wins.
- Plugin-shipped skills outrank workspace skills because plugins are trusted code.
- The folder path, not the frontmatter name, decides whether two skills collide.