Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "skillmanager",
"version": "0.4.1",
"description": "Inspect, organize, and safely converge local Agent Skills from Codex.",
"author": {
"name": "Backtthefuture",
"url": "https://github.com/Backtthefuture"
},
"homepage": "https://backtthefuture.github.io/skillmanager-plugin/",
"repository": "https://github.com/Backtthefuture/skillmanager-plugin",
"license": "MIT",
"keywords": [
"skills",
"codex",
"agents",
"diagnostics",
"local-first",
"skill-manager",
"symlinks",
"rollback"
],
"skills": "./skills/",
"interface": {
"displayName": "SkillManager",
"shortDescription": "Organize local Agent Skills safely",
"longDescription": "Use SkillManager to inventory local Agent Skills, distinguish installed Agents from compatible targets, find duplicate or weak trigger configurations, choose one canonical Skill version, preview shared-link convergence, and apply or roll back recoverable edits from a session-protected local Dashboard.",
"developerName": "Backtthefuture",
"category": "Productivity",
"capabilities": [
"Interactive",
"Read",
"Write"
],
"websiteURL": "https://backtthefuture.github.io/skillmanager-plugin/",
"privacyPolicyURL": "https://backtthefuture.github.io/skillmanager-plugin/privacy.html",
"termsOfServiceURL": "https://backtthefuture.github.io/skillmanager-plugin/terms.html",
"brandColor": "#FACC15",
"composerIcon": "./assets/icon.png",
"logo": "./assets/logo.png",
"logoDark": "./assets/logo-dark.png",
"screenshots": [
"./assets/screenshots/dashboard-convergence.png"
],
"defaultPrompt": [
"\u6253\u5f00 SkillManager\uff0c\u68c0\u67e5\u5f53\u524d\u9879\u76ee\u7684 Skill \u914d\u7f6e",
"\u68c0\u67e5\u6211\u7684 Skills \u662f\u5426\u91cd\u590d\u3001\u51b2\u7a81\u6216\u9002\u5408\u5408\u5e76",
"\u8bca\u65ad\u8fd9\u4e2a Skill \u4e3a\u4ec0\u4e48\u6ca1\u6709\u89e6\u53d1"
]
},
"mcpServers": "./.mcp.json"
}
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: ci

on:
push:
pull_request:

permissions:
contents: read

jobs:
verify:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node: [20, 22]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm run test
- run: npm run test:integration
- run: npm run build
- run: npm run pack:verify
- run: npm run plugin:pack:verify
- run: npm run audit:release
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
node_modules/
dist/
release/*.tgz
release/codex-marketplace/
coverage/
.DS_Store
*.log
.env
Expand Down
8 changes: 8 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"skillmanager": {
"command": "./bin/skillmanager-mcp.js",
"cwd": "."
}
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Backtthefuture

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# SkillManager Privacy

SkillManager is local-first. Its Dashboard binds to `127.0.0.1`, and its MCP tools inspect Skill metadata on the user's machine.

- Skill bodies and supporting-file contents are not returned by default through MCP.
- Absolute home paths, local control credentials, session cookies, and GitHub tokens are excluded from MCP and diagnostic output.
- A GitHub token entered in the local Dashboard is stored in the operating system credential store; the local config keeps only a credential reference.
- Git synchronization is optional and runs only after an explicit browser preview and confirmation.
- Skill edits, replacements, and deletions use server-bound plans with stale-state checks and recovery snapshots or trash entries.

SkillManager does not operate a hosted data-collection service. Network access occurs only for features the user invokes, such as optional GitHub synchronization.
132 changes: 81 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,117 @@
# Skill Hub
# SkillManager

> 黄叔的 Claude Skill 可视化管理器 — 一键扫描并管理你机器上所有 Claude Agent Skills
> 本地优先的 Agent Skill 管理与诊断工作台

## 它解决了什么问题
SkillManager 扫描本机和当前项目中的 Agent Skills,集中展示安装位置、作用域、冲突、相似项、健康诊断、版本与回收站。Web 服务只监听 `127.0.0.1`;Skill 内容默认留在本机。

当你装了几十个 Skill 后,你会遇到:
`0.4.0` 已统一产品名和主命令为 SkillManager,并提供可独立运行的 Codex Public Git Marketplace。不要继续使用历史 `huangshu/tools/skill-hub` tarball。

- 同名 Skill 散落在不同目录(`~/.claude/skills/`、插件、各个项目的 `.claude/skills/`)
- 想改个 Skill 得手动翻目录
- 不知道哪些是全局、哪些是项目私有、哪些来自插件、哪些重复了
- 改坏了想回滚,没有版本历史
## 安装 Codex Plugin 发布版

Skill Hub 是一个本地 Web UI:扫描全盘、聚合展示、可视化编辑、自动版本快照。

## 快速开始(一行命令)
公开发布仓库安装:

```bash
npm install -g https://github.com/Backtthefuture/huangshu/raw/main/tools/skill-hub/release/claude-skill-hub.tgz && skill-hub
codex plugin marketplace add Backtthefuture/skillmanager-plugin
codex plugin add skillmanager@backtthefuture
```

首次运行会自动:
1. 下载预构建的 tarball 并全局安装
2. 安装运行期依赖
3. 启动服务并打开浏览器到 `http://localhost:3456`
重新新建一个 Codex 对话,输入“打开 SkillManager”。插件会先查询运行状态,再启动或复用只监听 `127.0.0.1` 的本地服务,并返回 60 秒内有效、只能使用一次的可点击安全入口。

**之后每次启动只要敲 `skill-hub` 就行**,不用再打这串长命令
同一个发布物包含 `@napi-rs/keyring` 锁定的 12 个官方原生目标,并在运行时按操作系统、CPU 和 Linux libc 自动选择。源码 CI 在 macOS、Ubuntu、Windows 的 Node.js 20/22 上分别执行隔离运行验收;FreeBSD、Linux ARM/RISC-V 和 musl 目标只完成锁定制品与哈希静态校验,不表述为真实运行通过

要求:Node.js ≥ 20
开发者也可以在执行 `npm run plugin:pack:verify` 后,从本地 `release/codex-marketplace/` 添加 Marketplace

> **为什么用 tarball URL 而不是 `github:user/repo`**:npm 11 + node 24 在 macOS 上通过 `npm install -g github:...` 全局安装时,会把包软链到 `~/.npm/_cacache/tmp/` 里的临时克隆目录,随后临时目录被清理、留下悬空符号链接导致 `skill-hub` 无法运行。直接装预构建 tarball 走的是真正的文件拷贝路径,完全绕开这个 bug。
>
> **更新到最新版**:再跑一次同样的命令即可。
>
> **卸载**:`npm uninstall -g claude-skill-hub`。
## 从源码运行

## 扫描覆盖的位置
要求:Node.js 20 或 22、Git。

- `~/.claude/skills/` — 全局 skill
- `~/.claude/plugins/**/skills/` — Claude Code 插件附带的 skill(递归扫描)
- `~/.claude/projects/*` 里注册过的项目 `.claude/skills/`
- 常见开发目录:`~/Documents`、`~/Projects`、`~/Developer`、`~/Code`、`~/code`、`~/workspace`、`~/dev`、`~/work`、`~/repos`、`~/src` 下一层的项目
- 当前工作目录及其向上 3 级目录的 `.claude/skills/`
- 环境变量 `SKILL_HUB_EXTRA_PATHS=/path/a:/path/b` 指定的额外路径
```bash
git clone https://github.com/Backtthefuture/skillmanager.git
cd skillmanager
npm ci
npm run build
npm install -g .
skillmanager
```

## 排查问题
兼容命令 `skill-hub` 和 `claude-skill-hub` 仍会保留至少一个大版本。

如果发现扫到的 skill 数量不对、或者页面打开是白屏,访问
卸载

```bash
npm uninstall -g skillmanager
```
http://localhost:3456/api/debug

## 当前能力

- 扫描多种 Agent 的全局、项目与已启用插件 Skill。
- 搜索、筛选、分类、同名冲突与语义相似检测。
- 本地编辑、自动快照、版本对比与回滚。
- 回收站删除与恢复。
- 可选的 GitHub 私有仓库备份和恢复。
- React Web UI、Fastify 本地服务与 WebSocket 实时刷新。

Codex 用户应优先把个人共享 Skill 放在 `~/.agents/skills/`,项目共享 Skill 放在 `<project>/.agents/skills/`。`~/.codex/skills/` 只作为兼容/历史位置展示。

## 从 Codex 打开

在 Codex 新对话中输入“打开当前项目的 SkillManager”,或使用:

```bash
skillmanager open --project <项目目录>
```

返回 JSON 包含:node 版本、cwd、homedir、所有被扫的路径及每个路径的命中数、耗时、错误。报 bug 时发这份 JSON 即可快速定位
不要直接打开 `web/index.html`、`dist/web/index.html` 或 Codex 开发记录中自动生成的“网站预览”。它们不会启动本地服务,也没有一次性会话。正确入口会返回实际端口的 `/launch/<nonce>` 链接,设置本地会话后再进入 Dashboard

## 本地开发

```bash
git clone https://github.com/Backtthefuture/huangshu.git
cd huangshu/tools/skill-hub

npm install
npm run dev # 开发模式:前端 5173 + 后端 3456
npm ci
npm run dev
```

生产模式
发布前门禁

```bash
npm run lint
npm run typecheck
npm run test
npm run test:integration
npm run build
npm start
npm run pack:verify
npm run plugin:pack:verify
npm run audit:release
```

## 可选环境变量
`pack:verify` 会连续构建两次,生成带 commit/source hash 的 manifest,再把 tarball 安装到全新的临时目录并启动包内服务。测试只允许使用 `SKILLMANAGER_FIXTURE_ROOT` 与 `SKILLMANAGER_DATA_DIR`,不得读写真实用户 Skill。

`plugin:pack:verify` 会生成 `release/codex-marketplace/`,下载并校验 lockfile 中的 12 个官方钥匙串二进制,再验证 Marketplace/Plugin manifest、MCP 初始化与工具清单、状态查询、服务启动/复用、可点击启动入口、单次跳转、健康检查、当前平台原生绑定和停止流程。同时审计软链、开发依赖、绝对源码路径与常见凭据模式。

## 开发环境变量

- `PORT`:当前前台服务的起始端口,默认 `3456`。
- `SKILLMANAGER_NO_OPEN=1`:启动时不自动打开系统浏览器。
- `SKILLMANAGER_EXTRA_PATHS`:额外扫描目录;兼容旧名 `SKILL_HUB_EXTRA_PATHS`。
- `SKILLMANAGER_FIXTURE_ROOT`:测试专用的虚拟用户目录,必须是绝对路径。
- `SKILLMANAGER_DATA_DIR`:显式数据目录,必须是绝对路径。
- `SKILLMANAGER_PROJECT_ROOT`:显式当前项目目录,必须是绝对路径。

不要把服务暴露到 `0.0.0.0`,也不要提交 GitHub token、Skill 私有内容或本地数据目录。

## 构建与发布物

- `PORT` — 自定义起始端口(默认 3456;占用时自动向上尝试到 3460)
- `SKILL_HUB_NO_OPEN=1` — 启动时不自动打开浏览器
- `SKILL_HUB_EXTRA_PATHS` — 额外的扫描路径,冒号或逗号分隔
`dist/`、`release/*.tgz` 和 `release/codex-marketplace/` 都是本地生成物,不提交到源码仓库。`npm pack` 会先执行严格构建,并在 `dist/build-manifest.json` 写入包版本、Git commit、源码树哈希与每个产物哈希,避免源码、构建物和安装包漂移。Codex Plugin 构建还会写入通用目标矩阵、各原生依赖的 registry integrity 与 SHA-256、安全约束和全目录内容哈希;生成目录会单独发布到 `Backtthefuture/skillmanager-plugin`。

## 目录结构
## 目录

- `server/` — Fastify 后端(API + WebSocket + 文件监听 + 扫描器)
- `web/` — React + Vite + Tailwind 前端(含 ErrorBoundary)
- `bin/` — CLI 入口与首次安装构建脚本
- `server/`:扫描、诊断、版本、回收站、同步与本地 API。
- `web/`:React + Vite + Tailwind 工作台。
- `bin/`:CLI 入口。
- `scripts/`:测试、构建 manifest、依赖审计和打包验证。
- `tests/`:单元与隔离文件系统集成测试。
- `branding/`:六版 Logo 方案、定稿源文件与展示页。
- `public-marketplace/`:公开安装页、隐私、条款、支持与安全说明源文件。

## 许可
## License

MIT
[MIT](LICENSE)
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/screenshots/dashboard-convergence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading