GitHub - reorx/skm: A better skills manager
Key Points
- 1SKM is a CLI tool that manages global AI agent skills by fetching them from GitHub repositories or local paths and symlinking them into designated agent directories.
- 2It detects skills via `SKILL.md` files within repositories or directories and allows for installation through a declarative `skills.yaml` configuration or direct commands, with options for interactive selection.
- 3The tool supports a declarative sync behavior for skill links, enabling updates and removal of stale links, and operates at the user level, explicitly not for project-scoped skill management.
SKM (Skill Manager) is a command-line interface (CLI) tool designed for managing AI agent skills at a global, user-level scope rather than a project-specific one. It automates the process of discovering, installing, and synchronizing skills for various AI agents (e.g., Claude, Codex, OpenClaw) by symlinking them into designated agent directories.
The core methodology of SKM revolves around a declarative configuration file, ~/.config/skm/skills.yaml, which defines the desired state of installed skills. This YAML file specifies packages, each sourced either from a Git repository (repo) or a local directory (local_path). For each package, users can optionally list specific skills to install (skills field) or let SKM detect all available skills. Furthermore, the configuration allows for fine-grained control over which agent directories receive the links, either globally for all packages (agents at the top level) or on a per-package basis (agents within a package entry), including exclusion rules (excludes).
Skill Detection Mechanism:
A "skill" is technically defined as a directory containing a SKILL.md file with YAML frontmatter that includes a mandatory name field. SKM employs a specific detection order when scanning a package source:
- It first checks if the root of the cloned repository or local path itself contains a
SKILL.mdfile, treating the entire source as a single skill. - If not, it checks for the existence of a
skills/subdirectory and scans its immediate children forSKILL.mdfiles. - Otherwise, it recursively walks all subdirectories from the repository root, stopping descent into any directory once a
SKILL.mdfile is found within it (thus preventing nested skill detection).
Installation and Synchronization Process (skm install):
When skm install is executed, it treats skills.yaml as the authoritative declarative state:
- Cloning/Linking Sources: For
repopackages, it clones the Git repository into a local store (~/.local/share/skm/skills/). Forlocal_pathpackages, it directly references the specified directory. - Skill Detection: Within each source, it applies the skill detection logic to identify all available skills based on
SKILL.mdfiles. - Filtering: It filters the detected skills based on the
skillslist specified in theskills.yamlfor each package, if present. - Agent Mapping: It determines the target agent directories for each skill based on the global
agentsconfiguration and any package-specificagentsoverrides orexcludes. Default agent paths include~/.claude/skills/,~/.codex/skills/,~/.openclaw/skills/, and~/.agents/skills/(forstandard). These paths can be overridden via CLI arguments like--agents-dir. - Symlinking: For each skill intended for installation, SKM creates a symbolic link from its location within the SKM store (or local path) to the respective agent's skill directory.
- Lock File Management: It maintains a
~/.config/skm/skills-lock.yamlfile, which tracks all installed skills and their corresponding links. This lock file is crucial for the idempotent behavior. - Idempotency and State Sync:
skm installis idempotent. It not only establishes new links but also ensures the agent directories precisely match theskills.yamlconfiguration by:- Deleting symlinks for skills that have been removed from a package's
skillslist in the configuration. - Deleting symlinks for entire packages that have been removed from
skills.yaml. - Updating or deleting links from agent directories when
agentsfiltering rules (e.g.,excludes) change.
- Deleting symlinks for skills that have been removed from a package's
skills-lock.yaml, leaving any manually created files or skills installed by other tools untouched.Direct Installation:
SKM also supports direct installation from a source URL or local path () without prior skills.yaml modification. This mode interactively prompts the user to select skills and target agents, and then automatically updates skills.yaml to reflect the changes, effectively integrating the direct installation into the declarative management system.
Other Commands:
skm list: Displays installed skills and their linked paths, with an--alloption to show all skills across agent directories, marking those managed by SKM.- : Allows browsing and previewing skills from a given source without installing them.
skm check-updates: Fetches remote repositories to identify available updates for installed skills (skipslocal_pathsources).- : Pulls the latest changes for a specific skill's repository, re-detects skills, re-links them, and updates the lock file (also skips
local_pathsources).
SKM provides a robust and centralized solution for managing AI agent skills by leveraging a declarative configuration, precise skill detection, and systematic symlinking to maintain a synchronized state across various agent environments.