left-skills 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +95 -0
  3. package/dist/cli.js +3246 -0
  4. package/package.json +41 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 cuikexi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ <div align="center">
2
+
3
+ # left-skills
4
+
5
+ **shift-left for skills** — 在 skill 投入使用前就度量它用没用,而不是等用户撞 bug。
6
+
7
+ [![npm version](https://img.shields.io/npm/v/left-skills)](https://www.npmjs.com/package/left-skills)
8
+ [![license](https://img.shields.io/npm/l/left-skills)](./LICENSE)
9
+ [![stars](https://img.shields.io/github/stars/cuikexi/left-skills)](https://github.com/cuikexi/left-skills)
10
+
11
+ </div>
12
+
13
+ ## 命名由来
14
+
15
+ `left-skills` = **shift-left for skills**。把质量/度量左移到"投入使用前"——你写完 skill,先看它用没用、写得好不好,而不是等用户撞 bug 才发现。
16
+
17
+ ## How It Works
18
+
19
+ ```
20
+ 打 /skill 或 AI 调 skill
21
+ │ Claude Code hook 触发
22
+
23
+ left-skills hook(三数据源)
24
+ - UserPromptExpansion.command_name (手动 /slash)
25
+ - PreToolUse.tool_input.skill (AI 调 Skill 工具)
26
+ - UserPromptSubmit.prompt (自然语言提及)
27
+ │ 解析 payload,取 skill 名
28
+
29
+ ~/.left-skills/usage.json (append 记录)
30
+
31
+
32
+ left-skills usage 报告(手动/AI/提及 分开 + 从未调用 ⚠)
33
+ ```
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ npm i -g left-skills
39
+ left-skills install # 输出 hook 片段,复制进 ~/.claude/settings.json 的 hooks 字段
40
+ ```
41
+
42
+ 详见 [docs/install.md](docs/install.md)。
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ left-skills usage # 人看报告
48
+ left-skills usage --json # AI 用(JSON)
49
+ left-skills usage --since 7 # 近 7 天
50
+ ```
51
+
52
+ 报告示例:
53
+
54
+ ```
55
+ skill 调用报告(14 个 skill)
56
+ ────────────────────────────────────
57
+ 3 grill-me (手动1 + AI1 + 提及1,最近 今天)
58
+ 0 gitlab-ci-generate ⚠ 从未调用
59
+ ```
60
+
61
+ ## Highlights
62
+
63
+ - **三数据源 hook 埋点**:手动 /slash、AI 调 Skill、自然语言提及,分开记
64
+ - **诚实报告**:手动/AI/提及 分开标(不混"调用次数"),从未调用 ⚠
65
+ - **给 AI 用**:`--json` 输出,AI 能解析决策(改/删 skill)
66
+ - **单文件 bundle**:TS 打包单 `.js`,随 skill 生态分发
67
+
68
+ ## Limitations
69
+
70
+ - 只 **Claude Code**(Cursor / Codex 后扩)
71
+ - **AI 纯 progressive disclosure 自主激活**(不走 Skill 工具)抓不到——只手动 /slash + AI 调 Skill 工具 + 自然语言提及
72
+ - 需装 hook 配置(用户加 settings.json)
73
+ - MVP 期(早期,API 可能变)
74
+
75
+ ## Contributing
76
+
77
+ PR 欢迎。开发:
78
+
79
+ ```bash
80
+ git clone https://github.com/cuikexi/left-skills
81
+ cd left-skills
82
+ npm install
83
+ npm run build
84
+ npm link # 本地 left-skills 进 PATH
85
+ ```
86
+
87
+ 提 PR 前 `npm run build` 确保 dist 最新。理念 / roadmap 见 [docs/roadmap.md](docs/roadmap.md)。
88
+
89
+ ## Star History
90
+
91
+ [![Star History Chart](https://api.star-history.com/svg?repos=cuikexi/left-skills&type=Date)](https://star-history.com/#cuikexi/left-skills&date)
92
+
93
+ ## License
94
+
95
+ [MIT](./LICENSE)