#21523: 1. CLI: Add a skill with one command: openclaw skills add <url>, 2. Control UI: "Add Skill from URL"
app: macos
app: web-ui
gateway
cli
scripts
commands
agents
size: L
Cluster:
Skill Security Enhancements
## Summary
- **Problem:** Adding a third-party skill (e.g. from GitHub) required manually cloning the repo into `~/.openclaw/skills` and running install steps; no single command or UI flow.
- **Why it matters:** Users expect to add skills in one step (like `openclaw skills add <url>` or a Control UI “Add from URL”), with clone + dependency install handled for them.
- **What changed:** (1) New `src/agents/skills-add-from-url.ts`: `parseSkillRepoUrl(url)` (https-only, safe dir name); `addSkillFromUrl(opts)` clones into `~/.openclaw/skills/<name>` and runs `npm install --omit=dev` (or pnpm/yarn/bun per `skills.install.nodeManager`). (2) CLI `openclaw skills add <url>`. (3) Gateway RPC `skills.addFromUrl` and Control UI “Add from URL” (input + button) that call the same logic.
- **What did NOT change:** No change to existing skill loading, eligibility, or install specs; no new permissions or secrets; URL restricted to https and safe directory names only.
## Change Type (select all)
- [x] Feature
## Scope (select all touched areas)
- [x] Skills / tool execution
- [x] Integrations
## Linked Issue/PR
- Closes #
- Related #
## User-visible / Behavior Changes
- **CLI:** New command `openclaw skills add <url>` (e.g. `openclaw skills add https://github.com/s87343472/backlink-pilot`). Clones repo to `~/.openclaw/skills/<repo-name>`, runs dependency install there if `package.json` exists. Prints success or error.
- **Control UI (Skills tab):** New “Add from URL” input and “Add skill” button. Submits URL to gateway; same clone + install runs on server; list refreshes and message is shown below the input.
## Security Impact (required)
- New permissions/capabilities? **No**
- Secrets/tokens handling changed? **No**
- New/changed network calls? **Yes** — git clone and npm/pnpm/yarn/bun install from user-supplied https URL. URL must be https; target path is strictly under `CONFIG_DIR/skills`; directory name is constrained to `[a-zA-Z0-9_.-]`.
- Command/tool execution surface changed? **Yes** — new CLI subcommand and new RPC `skills.addFromUrl` (admin scope). Execution is clone + install only in the skill directory.
- Data access scope changed? **No**
- If any Yes, explain risk + mitigation: Only https URLs accepted; repo name sanitized; destination path validated to stay under managed skills dir. No arbitrary shell or arbitrary URL schemes.
## Repro + Verification
### Environment
- OS: macOS (or Linux)
- Runtime: Node 22+
- Relevant config: default `~/.openclaw`; optional `skills.install.nodeManager` (npm/pnpm/yarn/bun).
### Steps
1. Run `openclaw skills add https://github.com/s87343472/backlink-pilot` (or another public https Git repo with optional `package.json`).
2. Check `~/.openclaw/skills/<repo-name>` exists and, if repo has `package.json`, that `node_modules` is present.
3. In Control UI, open Skills tab, enter same URL in “Add from URL”, click “Add skill”; confirm success message and that the skill appears after refresh.
### Expected
- Clone succeeds; install runs when `package.json` exists; CLI and UI both report success; new skill appears in `openclaw skills list` and in Control UI without restart.
### Actual
- (Confirm same as expected after your run.)
## Evidence
- [x] New unit/behavior covered by existing test patterns; manual CLI + UI run as above.
- [x] Failing test/log before + passing after (N/A for new feature)
- [x] Trace/log snippets (optional)
- [x] Screenshot/recording (optional for UI “Add from URL”)
## Human Verification (required)
- **Verified scenarios:** CLI `skills add <https-url>` for a repo with and without `package.json`; Control UI “Add from URL” with same URL; list refresh shows new skill.
- **Edge cases checked:** Invalid/non-https URL rejected; existing directory name reports clear error; path stays under `~/.openclaw/skills`.
- **What you did not verify:** Windows; very large repos or slow networks (timeouts).
## Compatibility / Migration
- Backward compatible? **Yes**
- Config/env changes? **No** (optional `skills.install.nodeManager` already exists).
- Migration needed? **No**
## Failure Recovery (if this breaks)
- Disable: do not use `skills add` or UI “Add from URL”; add skills manually under `~/.openclaw/skills` as before.
- No config to restore; bad state limited to contents of `~/.openclaw/skills` (user can remove a failed clone directory).
## Risks and Mitigations
- **Risk:** User supplies a malicious or huge repo URL; clone/install could consume disk or run install scripts.
- **Mitigation:** https-only; destination path and name constrained; install runs in isolated skill dir. Consider future hardening (e.g. install with `--ignore-scripts` or sandbox) if policy tightens.
- **Risk:** No rate limit on add-from-URL; repeated use could abuse network/disk.
- **Mitigation:** Same as today for manual clone; admin-only RPC; can add rate limit later if needed.
Most Similar PRs
#23252: feat(skills): add browser-use as bundled skill
by ShawnPana · 2026-02-22
76.0%
#22026: fix(summarize): support nodejs install by default, and brew install...
by austingamez91 · 2026-02-20
70.7%
#23372: Skills: quarantine ClawHub installs until explicitly enabled
by bmendonca3 · 2026-02-22
70.2%
#18196: feat(security): add client-side skill security enforcement
by orlyjamie · 2026-02-16
69.5%
#22467: fix: failure while installing skills
by vivganes · 2026-02-21
69.1%
#21308: feat(skills): add ClawTrust — reputation engine & gig marketplace f...
by clawtrustmolts · 2026-02-19
69.1%
#17503: feat(dashboard): add Uninstall button for bundled skills
by diegofornalha · 2026-02-15
68.9%
#16244: feat(gateway): add session files API and external skill management
by wanquanY · 2026-02-14
68.9%
#8075: fix(skills): add --ignore-scripts to all package managers
by yubrew · 2026-02-03
68.2%
#20266: feat: skills-audit — Phase 1 security scanner for installed skills
by theMachineClay · 2026-02-18
68.2%