Skip to content

Commit effb44e

Browse files
OpenClawteknium1
authored andcommitted
fix(skills): distinguish local skills from builtin in 'skills list'
Use _read_manifest() to identify true bundled skills. Non-hub, non-builtin skills are now labeled 'local' instead of 'builtin'. Adds --source local filter and updates summary counts. Cherry-picked from PR #869 by Jah-yee. Fixes #861 Co-authored-by: OpenClaw <openclaw@sparklab.ai>
1 parent 2e4ccbc commit effb44e

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

hermes_cli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,7 @@ def cmd_pairing(args):
22782278
skills_inspect.add_argument("identifier", help="Skill identifier")
22792279

22802280
skills_list = skills_subparsers.add_parser("list", help="List installed skills")
2281-
skills_list.add_argument("--source", default="all", choices=["all", "hub", "builtin"])
2281+
skills_list.add_argument("--source", default="all", choices=["all", "hub", "builtin", "local"])
22822282

22832283
skills_audit = skills_subparsers.add_parser("audit", help="Re-scan installed hub skills")
22842284
skills_audit.add_argument("name", nargs="?", help="Specific skill to audit (default: all)")

hermes_cli/skills_hub.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,17 @@ def do_inspect(identifier: str, console: Optional[Console] = None) -> None:
409409
def do_list(source_filter: str = "all", console: Optional[Console] = None) -> None:
410410
"""List installed skills, distinguishing builtins from hub-installed."""
411411
from tools.skills_hub import HubLockFile, ensure_hub_dirs
412+
from tools.skills_sync import _read_manifest
412413
from tools.skills_tool import _find_all_skills
413414

414415
c = console or _console
415416
ensure_hub_dirs()
416417
lock = HubLockFile()
417418
hub_installed = {e["name"]: e for e in lock.list_installed()}
418419

420+
# Read bundled manifest to distinguish true builtins from local skills
421+
bundled_skills = _read_manifest()
422+
419423
all_skills = _find_all_skills()
420424

421425
table = Table(title="Installed Skills")
@@ -432,22 +436,29 @@ def do_list(source_filter: str = "all", console: Optional[Console] = None) -> No
432436
if hub_entry:
433437
source_display = hub_entry.get("source", "hub")
434438
trust = hub_entry.get("trust_level", "community")
435-
else:
439+
elif name in bundled_skills:
436440
source_display = "builtin"
437441
trust = "builtin"
442+
else:
443+
# User-provided local skills (e.g., from ~/.hermes/skills/)
444+
source_display = "local"
445+
trust = "local"
438446

439447
if source_filter == "hub" and not hub_entry:
440448
continue
441-
if source_filter == "builtin" and hub_entry:
449+
if source_filter == "builtin" and source_display != "builtin":
450+
continue
451+
if source_filter == "local" and source_display != "local":
442452
continue
443453

444-
trust_style = {"builtin": "bright_cyan", "trusted": "green", "community": "yellow"}.get(trust, "dim")
454+
trust_style = {"builtin": "bright_cyan", "trusted": "green", "community": "yellow", "local": "dim"}.get(trust, "dim")
445455
trust_label = "official" if source_display == "official" else trust
446456
table.add_row(name, category, source_display, f"[{trust_style}]{trust_label}[/]")
447457

448458
c.print(table)
449459
c.print(f"[dim]{len(hub_installed)} hub-installed, "
450-
f"{len(all_skills) - len(hub_installed)} builtin[/]\n")
460+
f"{len([s for s in all_skills if s['name'] in bundled_skills])} builtin, "
461+
f"{len([s for s in all_skills if s['name'] not in hub_installed and s['name'] not in bundled_skills])} local[/]\n")
451462

452463

453464
def do_audit(name: Optional[str] = None, console: Optional[Console] = None) -> None:
@@ -1014,7 +1025,7 @@ def _print_skills_help(console: Console) -> None:
10141025
" [cyan]search[/] <query> Search registries for skills\n"
10151026
" [cyan]install[/] <identifier> Install a skill (with security scan)\n"
10161027
" [cyan]inspect[/] <identifier> Preview a skill without installing\n"
1017-
" [cyan]list[/] [--source hub|builtin] List installed skills\n"
1028+
" [cyan]list[/] [--source hub|builtin|local] List installed skills\n"
10181029
" [cyan]audit[/] [name] Re-scan hub skills for security\n"
10191030
" [cyan]uninstall[/] <name> Remove a hub-installed skill\n"
10201031
" [cyan]publish[/] <path> --repo <r> Publish a skill to GitHub via PR\n"

0 commit comments

Comments
 (0)