跳到正文
GitHub·· 8 天前AI 评分38

skl-x:为 Claude Code 和 Codex 安装、审计与管理 AI 智能体技能

sentimony/skl-x

AI 导读

skl-x 是一款 CLI 工具,用于为 Claude Code 和 Codex 安装、审计和管理 AI 智能体技能,安装命令 `npx -y skl-x i` 与 `npx skills add` 参数完全兼容。

正文

Install, audit and manage AI agent skills for Claude Code and Codex.

npm version npm downloads CI CodeQL OpenSSF Scorecard codecov license node

Install skills

npx -y skl-x i sentimony/skills

skl-x i runs npx -y skills add with the same arguments, so every source format and option of npx skills add works as is.

# List skills in a repository
npx -y skl-x i sentimony/skills -l

# Specific skills to specific agents, non-interactive
npx -y skl-x i sentimony/skills -s tdd cross-review -a codex claude-code -y

# Hide the npx skills output, print a progress line and a table (needs -y)
npx -y skl-x i sentimony/skills -s tdd -a codex claude-code -y -m s
Installing from https://github.com/sentimony/skills ██████████ 100% · Installed 1 skill
skill  .agents    .claude    skills-lock.json  cost
tdd    universal  symlinked  +                 ~125 tok

In a terminal the bar fills while npx runs; in scripts and CI only the final line is printed. If npx fails, its full output is printed.

Local skills

--link <path> (-ln) symlinks <path>/skills/<name> into .agents/skills and .claude/skills. The links point straight at the clone, so edits there show up without reinstalling.

# Every skill in the clone
npx -y skl-x i -ln ../skills -a codex claude-code -y

# Every skill except the listed ones
npx -y skl-x i -ln ../skills -x scope-check echarts -y

# Only the listed skills, only .claude/skills
npx -y skl-x i -ln ../skills -s tdd cross-review -a claude-code
Symlinking from ../skills ██████████ 100% · Symlinked 2 skills
skill         .agents    .claude    skills-lock.json  cost
cross-review  symlinked  symlinked  -                 ~186 tok
tdd           symlinked  symlinked  -                 ~125 tok
  • Without -s, every <path>/skills/<name>/SKILL.md is linked, except skills with metadata.internal: true (as npx skills add does).
  • An existing copy or symlink with the same name is replaced after a Replace N existing skills? prompt, or at once with -y.
  • skills-lock.json is not changed. Global scope (-g) is not supported yet.
Option Description
--link, -ln Symlink from a local clone instead of running npx skills add
--skill, -s <names...> Only these skills; a name starting with a space is skipped
--reject, -x <names...> Every skill except these (not with -s)
--agent, -a <agents...> codex (.agents/skills), claude-code (.claude/skills); default: both
--yes, -y Skip npx prompts; with -ln: replace existing copies without asking
--mode, -m silent Hide the npx output (needs -y); no effect with -ln

Cost

npx -y skl-x cost       # project scope
npx -y skl-x cost -g    # global scope

Per-skill ambient token cost (name + description, chars/3), sorted descending. Skills with disable-model-invocation: true show - and stay out of the total.

Usage

Skill usage from agent session logs, multiplied by cost.

npx -y skl-x usage -a claude -p 7d
npx -y skl-x usage -a codex --mode activations
Project scope · Usage 22 times by 7d
skill         .agents  .claude  cost      total
cross-review  9        2        ~186 tok  ~2,046 tok
tdd           0        11       ~125 tok  ~1,375 tok
2 skills      9        13       ~311 tok  ~3,421 tok

.agents counts Codex runs, .claude - Claude Code runs; total is cost × runs. A skill that is no longer installed is shown in red with ~? tok.

Flag Default Description
--agent, -a both claude-code (claude), codex
--period, -p all 60s, 30m, 24h, 7d, 2w, 6mo, all (1m is a minute, 1mo is 30 days)
--since - yyyy-mm-dd, overrides --period
--mode merged (claude) / activations (codex) merged, attributed, activations, mentions
--format text text, json
--scan-all-files - Ignore file mtime, read everything
  • merged - per-session union of attributed and activations (max per skill).
  • attributed - entries with an attributionSkill field set by Claude Code.
  • activations - Skill tool calls (Claude), read-like exec_command_end events or <skill> XML (Codex).
  • mentions - foo/SKILL.md paths or superpowers:name strings anywhere. The broadest signal; can match prompts, specs or docs.

Other commands

Command Alias Description
skl-x list ls Table of skills: .agents, .claude, lock and cost per skill
skl-x remove rm Remove skills from disk and skills-lock.json
skl-x completion Print a shell completion script

skl-x with no command opens a menu in a terminal and prints cost otherwise.

skl-x list

Project scope
skill            .agents    .claude    skills-lock.json  cost
cross-review     universal  symlinked  +                 ~186 tok
echarts          -          copied     -                 ~98 tok
old-skill        -          -          +                 ~? tok
webapp-debugger  symlinked  broken     -                 ~? tok
4 skills         2          3          2                 ~284 tok
Cell Meaning
universal a folder in .agents/skills (the canonical copy of npx skills)
copied a folder in .claude/skills
symlinked a symlink, to .agents/skills or to a local clone
broken a symlink whose target is gone
- not there
+ in the lock; red when the skill is on neither disk

skl-x ls --names prints one name per line, for scripts and completion.

skl-x remove

skl-x rm tdd                     # plan, Proceed? [y/n], then Clean lock? [y/n]
skl-x rm .                       # every skill in scope
skl-x rm . -x tdd cross-review   # every skill except the listed ones
skl-x rm tdd -y                  # no prompts, no plan
skl-x rm . -y -m s               # one line: Executed A/B/C skills
skl-x rm tdd --lock-only         # also --agents-only, --claude-only
skl-x rm tdd -g                  # global scope

skl-x completion

Tab-completes subcommands and skill names for rm. Needs a global install.

skl-x completion bash >> ~/.bashrc
skl-x completion zsh >> ~/.zshrc
skl-x completion fish > ~/.config/fish/completions/skl.fish

Scope

Where you run it Scope
inside a git repo (any subdirectory) the repo root
anywhere else, $HOME included that directory
cost, ls, rm with --global / -g global: ~/.agents/.skill-lock.json, ~/.claude/skills, ~/.agents/skills

skl usage is always project scope. skl i installs into the current directory.

Global install

npm i -g skl-x    # provides `skl-x` and the short `skl`

Moving from @sentimony/sklx or skillio: all three packages install the skl bin, so remove the old one first:

npm rm -g @sentimony/sklx skillio && npm i -g skl-x

To skip the daily update check set SKL_X_NO_UPDATE_CHECK=1 (SKLX_NO_UPDATE_CHECK still works).

Requires Node.js 22 or newer.

License

MIT

来源:GitHub · github.com