chore(docs): remove legacy Docusaurus site

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
This commit is contained in:
XiaoSeS 2026-09-10 16:51:05 +08:00
parent 52d899257f
commit f966ce9d00
105 changed files with 2 additions and 5015 deletions

View file

@ -75,7 +75,7 @@ SkillHub includes controls that an operator can combine according to its risk:
The implementation and operating guidance are documented in the
[scanner guide](security-scanning.md),
[review guide](skillhub/en/guide/review.md), and
[security architecture](../document/docs/04-developer/architecture/security.md).
[security architecture](03-authentication-design.md).
## Important limitations

20
document/.gitignore vendored
View file

@ -1,20 +0,0 @@
# Dependencies
node_modules
# Build output
build
.docusaurus
.cache-loader
# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
# IDE
.idea
.vscode
*.swp
*.swo

View file

@ -1,8 +0,0 @@
{
"label": "快速入门",
"position": 1,
"link": {
"type": "generated-index",
"description": "快速了解并开始使用 SkillHub"
}
}

View file

@ -1,70 +0,0 @@
---
title: 产品概述
sidebar_position: 1
description: SkillHub 产品概述和核心特性介绍
---
# 产品概述
SkillHub 是企业级 AI 技能注册平台,支持技能发布、发现与管理,采用自托管架构保障数据安全。
## 核心特性
### 发布管理
- 版本控制与语义化版本Semantic Versioning
- 自定义标签(如 `beta`/`stable`
- `latest` 标签自动跟随最新发布版本
### 发现机制
- 全文搜索
- 多维度筛选(命名空间、下载量、评分)
- 可见性控制(公开/命名空间内/私有)
### 组织架构
- 命名空间隔离
- 基于角色的访问控制RBAC
- 团队与全局双层空间
### 治理体系
- 双层审核流程
- 审计日志
- 权限分离
### 存储与部署
- 支持 S3/MinIO/本地存储
- Docker/Kubernetes 部署
- 企业级可观测性
## 技术栈
### 后端
- **Java 21** - 运行时
- **Spring Boot 3.2.3** - 应用框架
- **PostgreSQL 16.x** - 主数据库 + 全文搜索
- **Redis 7.x** - 缓存与会话存储
### 前端
- **React 19** - UI 框架
- **TypeScript** - 类型安全
- **Vite** - 构建工具
- **Tailwind CSS** - 样式框架
### 部署
- **Docker Compose** - 单机部署
- **Kubernetes** - 生产环境编排
## 核心概念
### 命名空间
技能隔离边界,支持 `@global`(全局)和 `@team-*`(团队)前缀。
### 坐标系统
技能标识格式为 `@{namespace_slug}/{skill_slug}`,支持语义化版本。
### 兼容性
提供 REST API 和 ClawHub 兼容层,支持现有工具集成。
## 下一步
- [快速开始](./quick-start) - 一键启动体验
- [典型应用场景](./use-cases) - 了解如何在企业中应用

View file

@ -1,85 +0,0 @@
---
title: 快速开始
sidebar_position: 2
description: 一键启动 SkillHub 开发环境
---
# 快速开始
## 一键启动
使用以下命令一键启动完整的 SkillHub 环境:
```bash
curl -fsSL https://raw.githubusercontent.com/iflytek/skillhub/main/scripts/runtime.sh | sh -s -- up
```
或者克隆仓库后手动启动:
```bash
git clone https://github.com/iflytek/skillhub.git
cd skillhub
make dev-all
```
## 默认账号
两种启动方式都会默认创建一个 bootstrap 管理员账号:
- 用户名:`admin`
- 密码:`ChangeMe!2026`
### `curl` 一键部署
| 服务 | 地址 |
|------|------|
| Web UI | http://localhost |
| Backend API | http://localhost:8080 |
使用上述默认账号密码登录即可。**生产环境请务必修改密码。**
### `make dev-all` 本地开发
| 服务 | 地址 |
|------|------|
| Web UI | http://localhost:3000 |
| Backend API | http://localhost:8080 |
| MinIO Console | http://localhost:9001 |
除了上述 bootstrap 管理员,本地开发还预置两个模拟用户(无需密码):
| 用户 | 角色 | 说明 |
|------|------|------|
| `local-user` | 普通用户 | 可发布技能、管理命名空间 |
| `local-admin` | 超级管理员 | 拥有所有权限,包括审核和用户管理 |
使用 `X-Mock-User-Id` 请求头切换模拟用户。
如需关闭 bootstrap 管理员,启动前设置 `BOOTSTRAP_ADMIN_ENABLED=false`
## 常用命令
```bash
# 启动完整开发环境
make dev-all
# 停止所有服务
make dev-all-down
# 重置并重新启动
make dev-all-reset
# 仅启动后端
make dev
# 仅启动前端
make dev-web
# 查看所有可用命令
make help
```
## 下一步
- [产品概述](./overview) - 深入了解产品特性
- [典型应用场景](./use-cases) - 探索企业应用场景
- [单机部署](../administration/deployment/single-machine) - 生产环境部署指南

View file

@ -1,72 +0,0 @@
---
title: 典型应用场景
sidebar_position: 3
description: SkillHub 在企业中的典型应用场景
---
# 典型应用场景
## 企业内部技能共享
**场景描述**:企业内部多个团队开发 AI 技能,需要一个集中的平台进行共享和复用。
**解决方案**
- 各团队创建自己的命名空间
- 技能在团队内先审核发布
- 优秀技能可申请提升到全局空间
- 所有操作有完整审计记录
**价值**
- 避免重复开发
- 促进最佳实践传播
- 保障质量可控
## AI 技能治理与合规
**场景描述**:金融、政务等行业对 AI 应用有严格的合规要求,需要完整的审核和审计机制。
**解决方案**
- 双层审核流程(团队审核 + 平台审核)
- 细粒度 RBAC 权限控制
- 完整的操作审计日志
- 技能版本可追溯、可撤回
**价值**
- 满足合规要求
- 风险可控
- 责任可追溯
## 多团队协作开发
**场景描述**:大型组织中多个团队协作开发,需要清晰的权限边界和协作机制。
**解决方案**
- 命名空间隔离,团队自治
- 命名空间成员角色管理
- 技能可见性控制(公开/命名空间内/私有)
- 团队技能可申请提升到全局
**价值**
- 权责清晰
- 协作高效
- 安全可控
## CLI 工具集成
**场景描述**:已有使用 ClawHub CLI 的工作流,希望无缝迁移到 SkillHub。
**解决方案**
- 提供 ClawHub CLI 协议兼容层
- 通过 `/.well-known/clawhub.json` 自动发现
- 现有 CLI 工具无需修改即可使用
- 同时提供 SkillHub 自有 CLI 增强功能
**价值**
- 保护现有投资
- 迁移成本低
- 渐进式升级
## 下一步
- [单机部署](../administration/deployment/single-machine) - 开始部署
- [命名空间管理](../administration/governance/namespaces) - 了解组织治理

View file

@ -1,8 +0,0 @@
{
"label": "管理员指南",
"position": 2,
"link": {
"type": "generated-index",
"description": "部署、配置和管理 SkillHub"
}
}

View file

@ -1,4 +0,0 @@
{
"label": "部署指南",
"position": 1
}

View file

@ -1,69 +0,0 @@
---
title: 配置说明
sidebar_position: 3
description: SkillHub 配置项详细说明
---
# 配置说明
## 环境变量
SkillHub 通过环境变量进行配置,主要配置项如下:
### 基础配置
| 环境变量 | 说明 | 默认值 |
|---------|------|--------|
| `SKILLHUB_PUBLIC_BASE_URL` | 公网访问地址 | - |
| `SKILLHUB_VERSION` | 镜像版本 | `edge` |
### 数据库配置
| 环境变量 | 说明 | 默认值 |
|---------|------|--------|
| `POSTGRES_HOST` | PostgreSQL 主机 | `postgres` |
| `POSTGRES_PORT` | PostgreSQL 端口 | `5432` |
| `POSTGRES_DB` | 数据库名 | `skillhub` |
| `POSTGRES_USER` | 数据库用户 | `skillhub` |
| `POSTGRES_PASSWORD` | 数据库密码 | - |
### Redis 配置
| 环境变量 | 说明 | 默认值 |
|---------|------|--------|
| `REDIS_HOST` | Redis 主机 | `redis` |
| `REDIS_PORT` | Redis 端口 | `6379` |
| `REDIS_PASSWORD` | Redis 密码 | - |
### 存储配置
| 环境变量 | 说明 | 默认值 |
|---------|------|--------|
| `SKILLHUB_STORAGE_PROVIDER` | 存储提供方 | `local` |
| `SKILLHUB_STORAGE_S3_ENDPOINT` | S3 端点 | - |
| `SKILLHUB_STORAGE_S3_BUCKET` | S3 桶名 | - |
| `SKILLHUB_STORAGE_S3_ACCESS_KEY` | S3 Access Key | - |
| `SKILLHUB_STORAGE_S3_SECRET_KEY` | S3 Secret Key | - |
### OAuth 配置
| 环境变量 | 说明 | 默认值 |
|---------|------|--------|
| `OAUTH2_GITHUB_CLIENT_ID` | GitHub OAuth Client ID | - |
| `OAUTH2_GITHUB_CLIENT_SECRET` | GitHub OAuth Client Secret | - |
### 首登管理员配置
| 环境变量 | 说明 | 默认值 |
|---------|------|--------|
| `BOOTSTRAP_ADMIN_ENABLED` | 是否启用首登管理员 | `true` |
| `BOOTSTRAP_ADMIN_USERNAME` | 首登管理员用户名 | `admin` |
| `BOOTSTRAP_ADMIN_PASSWORD` | 首登管理员密码 | `ChangeMe!2026` |
## 配置文件
Spring Boot 配置文件位于 `server/skillhub-app/src/main/resources/`
## 下一步
- [认证配置](../security/authentication) - 配置身份认证

View file

@ -1,54 +0,0 @@
---
title: Kubernetes 部署
sidebar_position: 2
description: 在 Kubernetes 集群中部署 SkillHub
---
# Kubernetes 部署
本文介绍如何在 Kubernetes 集群中部署 SkillHub。
## 前置要求
- Kubernetes 1.24+
- kubectl 配置完成
- Helm 3.0+(可选)
- 可用的持久化存储类
## 部署清单
项目提供了 Kubernetes 部署清单:
```bash
cd deploy/k8s
# 1. 创建命名空间
kubectl create namespace skillhub
# 2. 配置 Secret
cp secret.yaml.example secret.yaml
# 编辑 secret.yaml 填入真实凭证
# 3. 应用配置
kubectl apply -f configmap.yaml
kubectl apply -f secret.yaml
# 4. 部署服务
kubectl apply -f backend-deployment.yaml
kubectl apply -f frontend-deployment.yaml
kubectl apply -f services.yaml
# 5. 配置 Ingress
kubectl apply -f ingress.yaml
```
## 高可用配置
- 后端和前端建议至少部署 2 个副本
- PostgreSQL 使用主从复制
- Redis 使用 Sentinel 或 Cluster 模式
- 存储使用高可用对象存储(如 MinIO 集群或云厂商 OSS
## 下一步
- [配置说明](./configuration) - 详细配置项说明

View file

@ -1,65 +0,0 @@
---
title: 单机部署
sidebar_position: 1
description: 使用 Docker Compose 单机部署 SkillHub
---
# 单机部署
本文介绍如何使用 Docker Compose 在单台服务器上部署 SkillHub。
## 前置要求
- Docker Engine 20.10+
- Docker Compose Plugin 2.0+
- 至少 4GB 可用内存
- 至少 20GB 可用磁盘空间
## 快速部署
```bash
# 1. 克隆仓库
git clone https://github.com/iflytek/skillhub.git
cd skillhub
# 2. 复制环境变量模板
cp .env.release.example .env.release
# 3. 编辑配置
# 修改 .env.release 中的配置项,特别是密码和公网地址
# 4. 验证配置
make validate-release-config
# 5. 启动服务
docker compose --env-file .env.release -f compose.release.yml up -d
```
## 配置说明
详见 [配置说明](./configuration) 文档。
## 验证部署
```bash
# 检查容器状态
docker compose --env-file .env.release -f compose.release.yml ps
# 检查后端健康状态
curl -i http://127.0.0.1:8080/actuator/health
# 访问 Web UI
# 浏览器打开 http://localhost或配置的公网地址
```
## 首登配置
1. 使用 `BOOTSTRAP_ADMIN_USERNAME``BOOTSTRAP_ADMIN_PASSWORD` 登录(默认 `admin` / `ChangeMe!2026`
2. 立即修改管理员密码
3. 配置企业 SSO可选
4. 创建团队命名空间
## 下一步
- [配置说明](./configuration) - 详细配置项说明
- [Kubernetes 部署](./kubernetes) - 高可用部署

View file

@ -1,4 +0,0 @@
{
"label": "治理与运营",
"position": 3
}

View file

@ -1,56 +0,0 @@
---
title: 命名空间管理
sidebar_position: 1
description: 命名空间创建与管理
---
# 命名空间管理
命名空间是 SkillHub 中技能的隔离边界和协作单元。
## 命名空间类型
| 类型 | 前缀 | 说明 |
|------|------|------|
| 全局 | `@global` | 平台级公共空间,由平台管理员管理 |
| 团队 | `@team-*` | 团队/部门空间,由团队管理员管理 |
## 创建命名空间
1. 登录后进入"我的命名空间"
2. 点击"创建命名空间"
3. 填写信息:
- 标识slugURL 友好名称
- 显示名:展示名称
- 描述:空间用途说明
4. 提交创建
## 命名空间成员管理
### 添加成员
1. 进入命名空间设置
2. 进入"成员管理"
3. 输入用户名搜索
4. 选择角色OWNER/ADMIN/MEMBER
5. 确认添加
### 角色变更
命名空间 OWNER 或 ADMIN 可变更成员角色。
### 移除成员
命名空间 OWNER 或 ADMIN 可移除成员。
## 命名空间状态
| 状态 | 说明 |
|------|------|
| `ACTIVE` | 正常使用 |
| `FROZEN` | 冻结,只读不可发布 |
| `ARCHIVED` | 归档,对外不可见 |
## 下一步
- [审核流程](./review-workflow) - 了解技能审核

View file

@ -1,44 +0,0 @@
---
title: 审核流程
sidebar_position: 2
description: 技能发布审核流程配置
---
# 审核流程
SkillHub 采用双层审核机制,保障技能质量。
## 审核流程
### 团队空间技能
1. 团队成员提交发布
2. 创建审核任务PENDING
3. 团队 ADMIN 或 OWNER 审核
- 通过 → 技能发布PUBLISHED
- 拒绝 → 返回修改REJECTED
### 全局空间技能
1. 提交发布
2. 平台 SKILL_ADMIN 或 SUPER_ADMIN 审核
3. 审核通过后发布
## 团队技能提升到全局
1. 团队技能已发布
2. 团队 ADMIN 或 OWNER 申请"提升到全局"
3. 平台管理员审核
4. 审核通过后在全局空间创建新技能
## 审核权限
| 审核类型 | 所需角色 |
|---------|---------|
| 团队空间技能审核 | 命名空间 ADMIN/OWNER |
| 全局空间技能审核 | SKILL_ADMIN/SUPER_ADMIN |
| 提升申请审核 | SKILL_ADMIN/SUPER_ADMIN |
## 下一步
- [用户管理](./user-management) - 管理平台用户

View file

@ -1,61 +0,0 @@
---
title: 用户管理
sidebar_position: 3
description: 平台用户管理
---
# 用户管理
## 用户状态
| 状态 | 实际逻辑 |
|------|----------|
| `ACTIVE` | 可正常登录和使用系统。OAuth 首次自动准入、local 注册成功后都会进入该状态。 |
| `PENDING` | 账号已建但不可登录。OAuth 在“需要审批”策略下会创建 `PENDING` 用户并跳转到待审批页local 登录遇到该状态会直接拒绝。 |
| `DISABLED` | 不可登录。OAuth 和 local 登录都会拒绝;`/api/v1/auth/me` 发现当前会话对应用户已被禁用时,会直接清掉 session。 |
| `MERGED` | 账号已并入其他账号,不可继续登录;主要由账号合并流程写入,不是普通用户管理流程的目标状态。 |
## 用户准入
可配置新用户是否需要审批:
- 自动准入:新用户登录后自动激活
- 审批准入:新用户需 USER_ADMIN 审批后激活
## 角色分配
`USER_ADMIN``SUPER_ADMIN` 可调用用户管理接口修改平台角色,但当前实现有几个关键点:
- 接口一次只能设置一个目标平台角色。
- 设置时会删除该用户已有的显式平台角色,再写入新的那个角色。
- 如果设置为 `USER`,不会写入 `user_role_binding`,而是依赖运行时默认角色补位。
- `USER_ADMIN` 不能分配 `SUPER_ADMIN`,只有 `SUPER_ADMIN` 能分配。
当前管理接口可设置的目标角色实际上是:
- `USER`
- `SKILL_ADMIN`
- `USER_ADMIN`
- `AUDITOR`
- `SUPER_ADMIN`
## 用户封禁/解封
`USER_ADMIN``SUPER_ADMIN` 可封禁/解封用户。
当前公开管理接口只支持把状态改成:
- `ACTIVE`
- `DISABLED`
其中:
- “审批通过”本质上也是把用户状态改成 `ACTIVE`
- 不能通过该接口直接改成 `PENDING``MERGED`
## 账号合并
支持将多个账号合并为一个,保留操作历史。
## 下一步
- [创建技能包](../../user-guide/publishing/create-skill) - 开始发布技能

View file

@ -1,4 +0,0 @@
{
"label": "安全与合规",
"position": 2
}

View file

@ -1,38 +0,0 @@
---
title: 审计日志
sidebar_position: 3
description: 操作审计日志查询与管理
---
# 审计日志
SkillHub 记录所有关键操作的审计日志,满足企业合规要求。
## 审计范围
记录的操作包括:
- 技能发布、下载、删除
- 审核通过、拒绝
- 用户登录、登出
- 权限变更
- 命名空间管理
- 配置变更
## 审计日志查询
通过管理后台审计日志页面或 Admin API 查询。
## 日志字段
- 操作时间
- 操作用户
- 操作类型
- 目标资源
- 客户端 IP
- User-Agent
- 请求 ID
- 详细信息
## 下一步
- [命名空间管理](../governance/namespaces) - 管理组织

View file

@ -1,36 +0,0 @@
---
title: 认证配置
sidebar_position: 1
description: 配置用户认证方式
---
# 认证配置
SkillHub 支持多种认证方式,满足不同企业的安全需求。
## OAuth2 登录
### GitHub OAuth
1. 在 GitHub 创建 OAuth App
2. 配置环境变量:
```bash
OAUTH2_GITHUB_CLIENT_ID=your-client-id
OAUTH2_GITHUB_CLIENT_SECRET=your-client-secret
```
### 扩展 OAuth Provider
架构支持扩展其他 OAuth Provider如 GitLab、Gitee 等。
## 本地账号登录
开发环境支持本地账号登录,生产环境默认关闭。
## 企业 SSO 集成
支持通过扩展点集成企业 SSOSAML/OIDC
## 下一步
- [权限管理](./authorization) - 配置权限控制

View file

@ -1,63 +0,0 @@
---
title: 权限管理
sidebar_position: 2
description: RBAC 权限系统配置
---
# 权限管理
SkillHub 采用基于角色的访问控制RBAC系统。
当前代码里实际存在两套并行角色体系:
- 平台角色:控制后台治理、用户管理、审计等平台级能力。
- 命名空间角色:控制某个团队空间内的成员、发布、审核、归档等操作。
二者会同时参与鉴权,但不是一套角色的上下级映射。
## 平台角色
### 代码里实际初始化的显式平台角色
数据库迁移只初始化了 4 个显式平台角色:
| 角色 | 代码 | 实际能力 |
|------|------|----------|
| 超级管理员 | `SUPER_ADMIN` | 拥有全部权限;`RbacService#getUserPermissions` 会直接返回全部权限码;可访问所有 `SUPER_ADMIN`/`SKILL_ADMIN`/`USER_ADMIN`/`AUDITOR` 能访问的接口;可分配 `SUPER_ADMIN`;发布技能时可绕过命名空间成员校验并直接自动发布;可以审批自己提交的 promotion普通审核单若是自己提交的也只有 `SUPER_ADMIN` 能特判审批。 |
| 技能管理员 | `SKILL_ADMIN` | 可访问技能治理后台接口;可隐藏/取消隐藏技能、撤回版本yank、处理技能举报可查看和处理全局空间审核、promotion 审核、治理工作台收件箱中的 review/promotion/report不能分配平台角色、不能看审计日志、不能管理用户。 |
| 用户管理员 | `USER_ADMIN` | 可访问用户管理接口;可列表用户、审批用户、启用/禁用用户、修改平台角色;不能分配 `SUPER_ADMIN`;不能处理技能治理、不能看审计日志。 |
| 审计员 | `AUDITOR` | 只读查看审计日志;可访问 `/api/v1/admin/audit-logs``/actuator/prometheus`;治理工作台中只能看 activity不能处理 review/promotion/report也不能管理用户或技能。 |
### 运行时默认平台角色
| 角色 | 代码 | 实际逻辑 |
|------|------|----------|
| 默认用户 | `USER` | 不是 `role` 表里的显式初始化记录。只要用户没有任何显式平台角色绑定,登录态和 `RbacService#getUserRoleCodes` 都会自动补上 `USER`。它主要表示“普通已登录用户”,没有额外后台治理权限。 |
### 需要特别注意的实现细节
- 当前管理接口的“修改用户角色”是单值覆盖,不是追加:`PUT /api/v1/admin/users/{userId}/role` 先清空该用户现有平台角色,再写入一个目标角色;当目标角色是 `USER` 时,不会写数据库记录,而是依赖运行时默认补位。
- 代码底层仍然支持“一个用户拥有多个显式平台角色”的读取与鉴权,因为 session、token 和 `RbacService` 都是按角色集合处理;只是当前管理接口不会这样分配。
- `SUPER_ADMIN` 是唯一一个在权限查询时被视为“拥有全部 permission code”的角色其它角色依赖 `role_permission` 关联表。
## 命名空间角色
| 角色 | 实际能力 |
|------|----------|
| `OWNER` | 创建团队空间时自动成为 `OWNER`。可更新命名空间信息、管理成员、冻结/解冻空间、归档/恢复空间、转移所有权;可提交 review可审核团队空间 review可访问私有技能可管理受限技能生命周期归档、反归档、删除草稿/驳回版本等)。 |
| `ADMIN` | 可更新命名空间信息、管理成员、冻结/解冻空间;不能归档/恢复空间,也不能直接把别人设为 `OWNER`;可提交 review可审核团队空间 review可访问私有技能可管理受限技能生命周期。 |
| `MEMBER` | 默认加入全局空间时获得 `MEMBER`。可在所在命名空间发布技能、提交 review但不能审核 review、不能管理成员、不能冻结/归档空间;私有技能也不能仅因 `MEMBER` 身份访问,私有技能要求 owner 或 `ADMIN/OWNER`。 |
### 命名空间角色的边界
- `GLOBAL` 空间是只读系统空间,不能通过命名空间治理接口修改;全局空间 review/promotion/report 处理依赖平台角色 `SKILL_ADMIN`/`SUPER_ADMIN`,不是依赖全局空间成员身份。
- `NAMESPACE_ONLY` 可见性的技能,任何该命名空间成员都能访问。
- `PRIVATE` 可见性的技能,只有技能 owner 或命名空间 `ADMIN/OWNER` 能访问,`MEMBER` 不行。
## 权限配置
通过后台分配平台角色,通过命名空间成员关系分配命名空间角色。
## 下一步
- [审计日志](./audit-logs) - 查看操作审计

View file

@ -1,8 +0,0 @@
{
"label": "用户指南",
"position": 3,
"link": {
"type": "generated-index",
"description": "学习如何发布、发现和使用技能"
}
}

View file

@ -1,4 +0,0 @@
{
"label": "协作",
"position": 3
}

View file

@ -1,41 +0,0 @@
---
title: 团队命名空间
sidebar_position: 1
description: 在团队命名空间中协作
---
# 团队命名空间
## 加入命名空间
需要命名空间管理员邀请才能加入团队命名空间。
## 命名空间角色
### MEMBER
- 可查看命名空间内所有技能
- 可发布技能(需审核)
- 可收藏和评分
### ADMIN
- 所有 MEMBER 权限
- 可审核技能发布
- 可管理成员
- 可编辑命名空间信息
### OWNER
- 所有 ADMIN 权限
- 可转让所有权
- 可归档命名空间
## 技能可见性
| 可见性 | 说明 |
|--------|------|
| `PUBLIC` | 所有人可见,匿名可下载 |
| `NAMESPACE_ONLY` | 仅命名空间成员可见 |
| `PRIVATE` | 仅 owner 和命名空间 ADMIN 可见 |
## 下一步
- [提升到全局](./promotion) - 将团队技能推广到全局

View file

@ -1,42 +0,0 @@
---
title: 提升到全局
sidebar_position: 2
description: 申请将团队技能提升到全局空间
---
# 提升到全局
优秀的团队技能可以申请提升到全局空间,供全企业使用。
## 提升前提
- 技能在团队空间已发布
- 申请人是技能 owner 或命名空间 ADMIN
- 技能没有待审核的提升申请
## 申请提升
1. 进入团队技能详情页
2. 点击"提升到全局"
3. 填写申请说明
4. 提交申请
## 审核流程
1. 平台管理员收到提升申请
2. 审核技能质量和适用性
3. 审核通过后:
- 在全局空间创建新技能
- 保留原团队技能
- 记录来源追溯关系
## 提升后
- 全局空间的新技能独立管理
- 原团队技能继续存在
- 两者版本不自动同步
- 如需同步需手动操作
## 下一步
- [API 概述](../../developer/api/overview) - API 集成

View file

@ -1,4 +0,0 @@
{
"label": "发现与使用",
"position": 2
}

View file

@ -1,53 +0,0 @@
---
title: 安装使用
sidebar_position: 2
description: 安装和使用技能
---
# 安装使用
## 通过 CLI 安装
### 安装最新版本
```bash
clawhub install @team/my-skill
```
### 安装指定版本
```bash
clawhub install @team/my-skill@1.2.0
```
### 按标签安装
```bash
clawhub install @team/my-skill@beta
```
### 使用 ClawHub CLI 安装
```bash
clawhub install my-skill
clawhub install team-name--my-skill
```
## 安装目录
按以下优先级安装:
| 优先级 | 路径 | 说明 |
|--------|------|------|
| 1 | `./.agent/skills/` | 项目级universal 模式 |
| 2 | `~/.agent/skills/` | 全局级universal 模式 |
| 3 | `./.claude/skills/` | 项目级Claude 默认 |
| 4 | `~/.claude/skills/` | 全局级Claude 默认 |
## 在 Claude Code 中使用
安装后,技能会被 Claude Code 自动发现和加载。
## 下一步
- [评分与收藏](./ratings) - 反馈和收藏技能

View file

@ -1,30 +0,0 @@
---
title: 评分与收藏
sidebar_position: 3
description: 技能评分和收藏功能
---
# 评分与收藏
## 收藏技能
点击技能详情页的"收藏"按钮可收藏技能。
查看已收藏的技能:
- Web进入"我的收藏"
- CLI`clawhub stars`
## 技能评分
可对技能进行 1-5 分评分:
1. 进入技能详情页
2. 点击评分区域
3. 选择评分1-5 星)
4. 提交评分
可随时修改自己的评分。
## 下一步
- [团队命名空间](../collaboration/namespaces) - 团队协作

View file

@ -1,36 +0,0 @@
---
title: 搜索技能
sidebar_position: 1
description: 搜索和筛选技能
---
# 搜索技能
## 全文搜索
在搜索框输入关键词SkillHub 会在以下字段中搜索:
- 技能名称
- 技能描述
- 技能 slug
- frontmatter 中除 `name``description``version` 外的其他字段
- `keywords` / `tags` 等关键词字段
## 筛选条件
可通过以下条件筛选搜索结果:
- 命名空间
- 可见性
- 下载量排序
- 评分排序
- 更新时间排序
## 高级搜索
使用搜索语法:
- `namespace:@team-ai` - 指定命名空间
- `category:code-review` - 指定分类
- `downloads:>100` - 下载量大于 100
## 下一步
- [安装使用](./install) - 安装和使用技能

View file

@ -1,4 +0,0 @@
{
"label": "发布技能",
"position": 1
}

View file

@ -1,56 +0,0 @@
---
title: 创建技能包
sidebar_position: 1
description: 学习如何创建符合规范的技能包
---
# 创建技能包
## 技能包结构
一个标准的 SkillHub 技能包结构如下:
```
my-skill/
├── SKILL.md # 主入口文件(必需)
├── references/ # 参考资料(可选)
├── scripts/ # 脚本(可选)
└── assets/ # 静态资源(可选)
```
## SKILL.md 格式
SKILL.md 是技能包的主入口文件,使用 YAML frontmatter + Markdown 正文格式:
```markdown
---
name: my-skill
description: 一句话描述这个技能的用途
x-astron-category: code-review
---
# 技能说明
这里是技能的详细说明...
```
### Frontmatter 字段
| 字段 | 必需 | 说明 |
|------|------|------|
| `name` | 是 | 技能标识kebab-case 格式 |
| `description` | 是 | 技能简短描述 |
| `x-astron-category` | 否 | 分类标签 |
| `x-astron-runtime` | 否 | 运行时要求 |
| `x-astron-min-version` | 否 | 最低版本要求 |
## 文件限制
- 单文件大小:最大 1MB
- 总包大小:最大 10MB
- 文件数量:最多 100 个
- 允许的文件类型:`.md`, `.txt`, `.json`, `.yaml`, `.yml`, `.js`, `.ts`, `.py`, `.sh`, `.png`, `.jpg`, `.svg`
## 下一步
- [发布流程](./publish) - 发布技能包

View file

@ -1,50 +0,0 @@
---
title: 发布流程
sidebar_position: 2
description: 发布技能到 SkillHub
---
# 发布流程
## 通过 Web 发布
1. 登录 SkillHub
2. 点击"发布技能"
3. 选择目标命名空间
4. 上传技能包 ZIP 文件
5. 填写版本信息(变更日志等)
6. 提交发布
7. 等待审核(如需要)
8. 审核通过后发布成功
## 通过 CLI 发布
```bash
# 1. 登录
clawhub login
# 2. 发布
clawhub publish ./my-skill.zip --namespace @team-myteam
```
## 通过 ClawHub CLI 发布
配置 registry 后使用:
```bash
clawhub publish ./my-skill.zip
```
## 发布状态
| 状态 | 说明 |
|------|------|
| `DRAFT` | 草稿,未提交审核 |
| `PENDING_REVIEW` | 等待审核 |
| `PUBLISHED` | 已发布,可被发现和下载 |
| `REJECTED` | 已拒绝,需修改后重新提交 |
| `YANKED` | 已撤回,不再推荐使用 |
## 下一步
- [版本管理](./versioning) - 管理技能版本

View file

@ -1,56 +0,0 @@
---
title: 版本管理
sidebar_position: 3
description: 技能版本和标签管理
---
# 版本管理
## 语义化版本
SkillHub 使用语义化版本Semantic Versioning`MAJOR.MINOR.PATCH`
- `MAJOR`:不兼容的 API 变更
- `MINOR`:向后兼容的功能新增
- `PATCH`:向后兼容的问题修复
示例:`1.0.0`, `1.1.0`, `2.0.0`
## latest 标签
`latest` 是系统保留标签,自动跟随最新已发布版本,不可手动移动。
## 自定义标签
可创建自定义标签用于版本通道管理:
- `beta` - 测试版本
- `stable` - 稳定版本
- `stable-2026q1` - 季度稳定版本
### 创建/移动标签
```bash
clawhub tag set @team/my-skill beta 1.2.0
```
### 删除标签
```bash
clawhub tag delete @team/my-skill beta
```
## 版本撤回
已发布版本发现问题可撤回:
1. 进入技能详情页
2. 找到目标版本
3. 点击"撤回版本"
4. 确认撤回
撤回后的版本仍可查看,但会标记为不推荐使用。
## 下一步
- [搜索技能](../discovery/search) - 发现技能

View file

@ -1,8 +0,0 @@
{
"label": "开发者参考",
"position": 4,
"link": {
"type": "generated-index",
"description": "API 参考、架构设计和扩展开发"
}
}

View file

@ -1,4 +0,0 @@
{
"label": "API 参考",
"position": 1
}

View file

@ -1,101 +0,0 @@
---
title: 认证 API
sidebar_position: 3
description: 需要认证的 API
---
# 认证 API
## 认证相关
### 获取当前用户
```http
GET /api/v1/auth/me
```
### 登出
```http
POST /api/v1/auth/logout
```
## 技能发布
```http
POST /api/v1/publish
Content-Type: multipart/form-data
file: <zip-file>
namespace: <namespace-slug>
```
## 收藏
```http
POST /api/v1/skills/{namespace}/{slug}/star
DELETE /api/v1/skills/{namespace}/{slug}/star
```
## 评分
```http
POST /api/v1/skills/{namespace}/{slug}/rating
Content-Type: application/json
{
"score": 5
}
```
## 标签管理
```http
GET /api/v1/skills/{namespace}/{slug}/tags
PUT /api/v1/skills/{namespace}/{slug}/tags/{tagName}
DELETE /api/v1/skills/{namespace}/{slug}/tags/{tagName}
```
## 我的资源
```http
GET /api/v1/me/stars
GET /api/v1/me/skills
```
## 命名空间管理
```http
POST /api/v1/namespaces
PUT /api/v1/namespaces/{slug}
GET /api/v1/namespaces/{slug}/members
POST /api/v1/namespaces/{slug}/members
PUT /api/v1/namespaces/{slug}/members/{userId}/role
DELETE /api/v1/namespaces/{slug}/members/{userId}
```
## 审核
```http
GET /api/v1/namespaces/{slug}/reviews
POST /api/v1/namespaces/{slug}/reviews/{id}/approve
POST /api/v1/namespaces/{slug}/reviews/{id}/reject
```
## 提升申请
```http
POST /api/v1/namespaces/{slug}/skills/{skillId}/promote
```
## API Token
```http
POST /api/v1/tokens
GET /api/v1/tokens
DELETE /api/v1/tokens/{id}
```
## 下一步
- [CLI 兼容层](./cli-compat) - ClawHub 兼容接口

View file

@ -1,159 +0,0 @@
---
title: CLI 兼容层
sidebar_position: 4
description: ClawHub CLI 协议兼容层
---
# CLI 兼容层
SkillHub 提供 ClawHub CLI 协议兼容层,现有工具可无缝迁移。
## 配置 ClawHub CLI
要让 ClawHub CLI 连接到你的 SkillHub 实例,需要配置以下环境变量:
### 环境变量配置
**Linux/macOS (bash/zsh):**
```bash
# ~/.bashrc 或 ~/.zshrc
export CLAWHUB_SITE=https://skill.xfyun.cn
export CLAWHUB_REGISTRY=https://skill.xfyun.cn
```
**Windows (PowerShell):**
```powershell
# 永久设置(当前用户)
[Environment]::SetEnvironmentVariable('CLAWHUB_SITE', 'https://skill.xfyun.cn', 'User')
[Environment]::SetEnvironmentVariable('CLAWHUB_REGISTRY', 'https://skill.xfyun.cn', 'User')
# 或者临时设置(当前会话)
$env:CLAWHUB_SITE = 'https://skill.xfyun.cn'
$env:CLAWHUB_REGISTRY = 'https://skill.xfyun.cn'
```
### 使用 CLI 标志(单次命令)
```bash
clawhub --site https://skill.xfyun.cn --registry https://skill.xfyun.cn install <skill>
```
### 前端一键复制
SkillHub 网页端的技能详情页会自动显示带有正确环境变量的安装命令,直接复制即可使用。
## Well-known 发现
```http
GET /.well-known/clawhub.json
```
响应:
```json
{
"apiBase": "/api/v1"
}
```
## 兼容层 API
### Whoami
```http
GET /api/v1/whoami
```
响应:
```json
{
"handle": "username",
"displayName": "User Name",
"role": "user"
}
```
### 搜索
```http
GET /api/v1/search?q={keyword}&page={page}&limit={limit}
```
响应:
```json
{
"results": [
{
"slug": "my-skill",
"name": "My Skill",
"description": "...",
"author": {
"handle": "username",
"displayName": "User Name"
},
"version": "1.2.0",
"downloadCount": 100,
"starCount": 50,
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "2026-03-01T00:00:00Z"
}
],
"total": 1,
"page": 1,
"limit": 20
}
```
### 解析
```http
GET /api/v1/resolve?slug={slug}&version={version}
```
响应:
```json
{
"slug": "my-skill",
"version": "1.2.0",
"downloadUrl": "/api/v1/download/my-skill/1.2.0"
}
```
### 下载
```http
GET /api/v1/download/{slug}/{version}
```
### 发布
```http
POST /api/v1/publish
Content-Type: multipart/form-data
file: <zip-file>
```
响应:
```json
{
"slug": "my-skill",
"version": "1.0.0",
"status": "published"
}
```
## 坐标映射
| SkillHub 坐标 | ClawHub canonical slug |
|---------------|------------------------|
| `@global/my-skill` | `my-skill` |
| `@team-name/my-skill` | `team-name--my-skill` |
## 下一步
- [系统架构](../architecture/overview) - 了解架构设计

View file

@ -1,86 +0,0 @@
---
title: API 概述
sidebar_position: 1
description: SkillHub API 概述
---
# API 概述
SkillHub 提供 RESTful API 用于集成和自动化。
## API 分类
### 公开 API
- 技能搜索
- 技能详情
- 版本列表
- 下载技能
- 无需认证PUBLIC 技能)
### 认证 API
- 发布技能
- 收藏/评分
- 命名空间管理
- 需要登录或 Bearer Token
### CLI 兼容层
- 兼容 ClawHub CLI 协议
- 现有工具可无缝迁移
## 响应格式
### 统一响应结构
```json
{
"code": 0,
"msg": "成功",
"data": {},
"timestamp": "2026-03-15T06:00:00Z",
"requestId": "req-123"
}
```
### 分页响应
```json
{
"code": 0,
"msg": "成功",
"data": {
"items": [],
"total": 100,
"page": 1,
"size": 20
},
"timestamp": "2026-03-15T06:00:00Z",
"requestId": "req-123"
}
```
## 认证方式
### Session Cookie
Web 端使用 Session Cookie 认证。
### Bearer Token
CLI 和 API 集成使用 Bearer Token
```bash
Authorization: Bearer <token>
```
### API Token
可创建长期有效的 API Token 用于自动化。
## 幂等性
所有写操作支持 `X-Request-Id` 请求头实现幂等:
```bash
X-Request-Id: <uuid-v4>
```
## 下一步
- [公开 API](./public) - 查看公开接口

View file

@ -1,72 +0,0 @@
---
title: 公开 API
sidebar_position: 2
description: 无需认证的公开 API
---
# 公开 API
## 技能搜索
```http
GET /api/v1/skills?keyword=...&namespace=...&page=1&size=20
```
**Query Parameters:**
- `keyword`: 搜索关键词
- `namespace`: 命名空间筛选
- `page`: 页码
- `size`: 每页数量
## 技能详情
```http
GET /api/v1/skills/{namespace}/{slug}
```
## 版本列表
```http
GET /api/v1/skills/{namespace}/{slug}/versions
```
## 版本详情
```http
GET /api/v1/skills/{namespace}/{slug}/versions/{version}
```
## 文件清单
```http
GET /api/v1/skills/{namespace}/{slug}/versions/{version}/files
```
## 下载技能
```http
GET /api/v1/skills/{namespace}/{slug}/download
GET /api/v1/skills/{namespace}/{slug}/versions/{version}/download
```
## 解析版本
```http
GET /api/v1/skills/{namespace}/{slug}/resolve?version=...&tag=...
```
## 命名空间列表
```http
GET /api/v1/namespaces
```
## 命名空间详情
```http
GET /api/v1/namespaces/{slug}
```
## 下一步
- [认证 API](./authenticated) - 查看认证接口

View file

@ -1,4 +0,0 @@
{
"label": "架构设计",
"position": 2
}

View file

@ -1,77 +0,0 @@
---
title: 领域模型
sidebar_position: 2
description: 核心领域实体和关系
---
# 领域模型
## 核心实体
### Namespace命名空间
| 字段 | 类型 | 说明 |
|------|------|------|
| id | bigint | 主键 |
| slug | varchar(64) | URL 友好标识 |
| display_name | varchar(128) | 展示名 |
| type | enum | `GLOBAL` / `TEAM` |
| description | text | 描述 |
| status | enum | `ACTIVE` / `FROZEN` / `ARCHIVED` |
### NamespaceMember命名空间成员
| 字段 | 类型 | 说明 |
|------|------|------|
| id | bigint | 主键 |
| namespace_id | bigint | 命名空间 ID |
| user_id | varchar(128) | 用户 ID |
| role | enum | `OWNER` / `ADMIN` / `MEMBER` |
### Skill技能
| 字段 | 类型 | 说明 |
|------|------|------|
| id | bigint | 主键 |
| namespace_id | bigint | 所属命名空间 |
| slug | varchar(128) | URL 友好标识 |
| display_name | varchar(256) | 展示名 |
| summary | varchar(512) | 摘要 |
| owner_id | varchar(128) | 主要维护人 |
| visibility | enum | `PUBLIC` / `NAMESPACE_ONLY` / `PRIVATE` |
| status | enum | `ACTIVE` / `HIDDEN` / `ARCHIVED` |
| latest_version_id | bigint | 最新已发布版本 |
**唯一约束**`(namespace_id, slug)`
### SkillVersion技能版本
| 字段 | 类型 | 说明 |
|------|------|------|
| id | bigint | 主键 |
| skill_id | bigint | 技能 ID |
| version | varchar(32) | semver 版本号 |
| status | enum | `DRAFT` / `PENDING_REVIEW` / `PUBLISHED` / `REJECTED` / `YANKED` |
| manifest_json | json | 文件清单 |
| parsed_metadata_json | json | SKILL.md 解析结果 |
**唯一约束**`(skill_id, version)`
### SkillTag技能标签
| 字段 | 类型 | 说明 |
|------|------|------|
| id | bigint | 主键 |
| skill_id | bigint | 技能 ID |
| tag_name | varchar(64) | 标签名 |
| target_version_id | bigint | 目标版本 |
**唯一约束**`(skill_id, tag_name)`
## 坐标系统
技能完整寻址:`@{namespace_slug}/{skill_slug}`
## 下一步
- [安全架构](./security) - 安全设计

View file

@ -1,69 +0,0 @@
---
title: 系统架构
sidebar_position: 1
description: SkillHub 系统架构概览
---
# 系统架构
## 架构原则
- **单体优先**:一期采用模块化单体,不拆微服务
- **依赖倒置**:领域层不依赖基础设施
- **可替换边界**:搜索、存储都有 SPI 抽象
## 模块结构
```
server/
├── skillhub-app/ # 启动、配置装配、Controller
├── skillhub-domain/ # 领域模型 + 领域服务 + 应用服务
├── skillhub-auth/ # OAuth2 认证 + RBAC + 授权判定
├── skillhub-search/ # 搜索 SPI + PostgreSQL 全文实现
├── skillhub-storage/ # 对象存储抽象 + LocalFile/S3
└── skillhub-infra/ # JPA、通用工具、配置基础
```
## 模块依赖
```
app → domain, auth, search, storage, infra
infra → domain
auth → domain
search → domain
storage → (独立)
```
## 技术栈
| 层级 | 技术 | 版本 |
|------|------|------|
| 运行时 | Java | 21 |
| 框架 | Spring Boot | 3.2.3 |
| 数据库 | PostgreSQL | 16.x |
| 缓存/会话 | Redis | 7.x |
## 部署架构
```
┌──────────────┐
│ Browser / CLI│
└──────┬───────┘
┌──────────────┐
│ Web/Nginx │
└──────┬───────┘
│ /api/*
┌──────────────┐
│ Spring Boot │
└───┬────┬─────┘
│ │
▼ ▼
PostgreSQL Redis
```
## 下一步
- [领域模型](./domain-model) - 核心实体

View file

@ -1,71 +0,0 @@
---
title: 安全架构
sidebar_position: 3
description: 安全架构设计
---
# 安全架构
## 认证架构
### OAuth2 登录
- 基于 Spring Security OAuth2 Client
- 一期支持 GitHub
- 架构支持扩展多 Provider
### CLI 认证
- OAuth Device Flow
- Web 授权后签发 CLI 凭证
- 支持 API Token
### Session 管理
- Spring Session + Redis
- 分布式 Session 共享
- 支持多 Pod 部署
## 授权架构
### 平台角色
| 角色 | 权限 |
|------|------|
| `SUPER_ADMIN` | 所有权限 |
| `SKILL_ADMIN` | 技能治理 |
| `USER_ADMIN` | 用户治理 |
| `AUDITOR` | 审计只读 |
### 命名空间角色
| 角色 | 权限 |
|------|------|
| `OWNER` | 命名空间所有者 |
| `ADMIN` | 审核、成员管理 |
| `MEMBER` | 发布技能 |
### 可见性规则
| 可见性 | 谁可访问 |
|--------|---------|
| `PUBLIC` | 任何人(匿名) |
| `NAMESPACE_ONLY` | 命名空间成员 |
| `PRIVATE` | owner + 命名空间 ADMIN |
## 审计
所有关键操作同步写入审计日志:
- 发布、下载、删除
- 审核通过、拒绝
- 权限变更
- 配置变更
## 限流
- Ingress 层基础限流Nginx
- 应用层精细限流Redis 滑动窗口)
## 下一步
- [技能协议](../plugins/skill-protocol) - 技能包规范

View file

@ -1,4 +0,0 @@
{
"label": "扩展与集成",
"position": 3
}

View file

@ -1,68 +0,0 @@
---
title: 技能协议
sidebar_position: 1
description: SKILL.md 规范和技能包协议
---
# 技能协议
## SKILL.md 规范
### 基本格式
```markdown
---
name: my-skill
description: When to use this skill
---
# Markdown 正文
技能指令内容...
```
### 必需字段
| 字段 | 说明 |
|------|------|
| `name` | 技能标识kebab-case |
| `description` | 技能简短描述 |
### 扩展字段
| 字段 | 说明 |
|------|------|
| `x-astron-category` | 分类标签 |
| `x-astron-runtime` | 运行时要求 |
| `x-astron-min-version` | 最低版本要求 |
## 技能包结构
```
my-skill/
├── SKILL.md # 主入口文件(必需)
├── references/ # 参考资料(可选)
├── scripts/ # 脚本(可选)
└── assets/ # 静态资源(可选)
```
## 文件校验
- 根目录必须包含 `SKILL.md`
- 文件类型白名单
- 单文件大小限制1MB
- 总包大小限制10MB
- 文件数量限制100 个
## 客户端安装目录
按以下优先级安装:
1. `./.agent/skills/`
2. `~/.agent/skills/`
3. `./.claude/skills/`
4. `~/.claude/skills/`
## 下一步
- [存储 SPI](./storage-spi) - 扩展存储后端

View file

@ -1,77 +0,0 @@
---
title: 存储 SPI
sidebar_position: 2
description: 存储服务提供方扩展
---
# 存储 SPI
## SPI 接口
```java
public interface ObjectStorageService {
void store(String key, InputStream content, String contentType);
InputStream retrieve(String key);
void delete(String key);
boolean exists(String key);
}
```
## 内置实现
### LocalFileStorageService
本地文件系统实现,用于开发环境。
### S3StorageService
S3 协议兼容实现,支持:
- AWS S3
- MinIO
- 阿里云 OSS
- 腾讯云 COS
- 其他 S3 兼容存储
## 配置
### 静态凭据Access Key / Secret Key
```bash
# 选择存储提供方
SKILLHUB_STORAGE_PROVIDER=s3
# S3 配置
SKILLHUB_STORAGE_S3_ENDPOINT=https://s3.example.com
SKILLHUB_STORAGE_S3_BUCKET=skillhub
SKILLHUB_STORAGE_S3_ACCESS_KEY=xxx
SKILLHUB_STORAGE_S3_SECRET_KEY=xxx
```
### IAM 认证
部署在 AWS 上时,可以不配置 Access Key / Secret Key让 SDK 自动使用 IAM 角色认证([Default Credentials Provider Chain](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html)
```bash
SKILLHUB_STORAGE_PROVIDER=s3
SKILLHUB_STORAGE_S3_BUCKET=skillhub
SKILLHUB_STORAGE_S3_REGION=us-east-1
# 留空或不设置 ACCESS_KEY / SECRET_KEYSDK 自动使用 IAM 认证
SKILLHUB_STORAGE_S3_ACCESS_KEY=
SKILLHUB_STORAGE_S3_SECRET_KEY=
```
支持的 IAM 认证方式(按 SDK 优先级):
- 环境变量(`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`
- Java 系统属性
- Web Identity TokenEKS IRSA
- AWS 配置文件(`~/.aws/credentials`
- EC2 Instance Profile
- ECS Task Role
## 自定义实现
实现 `ObjectStorageService` 接口,注册为 Spring Bean 即可。
## 下一步
- [常见问题](../../reference/faq) - FAQ

View file

@ -1,8 +0,0 @@
{
"label": "参考资料",
"position": 5,
"link": {
"type": "generated-index",
"description": "FAQ、故障排查和更多资源"
}
}

View file

@ -1,20 +0,0 @@
---
title: 变更日志
sidebar_position: 3
description: 版本变更历史
---
# 变更日志
## [Unreleased]
### Added
- 初始版本发布
- 技能发布与管理
- 命名空间与 RBAC
- 全文搜索
- ClawHub CLI 兼容层
## 下一步
- [路线图](./roadmap) - 未来规划

View file

@ -1,60 +0,0 @@
---
title: 常见问题
sidebar_position: 1
description: 常见问题解答
---
# 常见问题
## 部署相关
### 如何修改默认端口?
修改 `.env.release` 中的端口配置。
### 如何配置 HTTPS
建议使用反向代理Nginx/Ingress处理 TLS 终止。
### 数据库如何备份?
使用 PostgreSQL 标准备份工具pg_dump
## 使用相关
### 如何重置管理员密码?
如果忘记管理员密码,可通过环境变量重新设置首登管理员,或直接操作数据库。
### 技能包上传失败怎么办?
检查:
1. 文件大小是否超限
2. 文件类型是否在白名单内
3. 是否包含必需的 SKILL.md
4. SKILL.md frontmatter 格式是否正确
### 使用 CLI 安装技能时报 `namespace not found`
多数情况是 CLI 没有指向你自己的 SkillHub 实例,或命名空间格式不对:
1. **配置 registry 并登录**:用环境变量或 `--registry` 指向你的实例,例如
`clawhub --registry https://skillhub.your-company.com install <skill>`;登录需要先在 Web 控制台生成 API Token。
2. **命名空间 slug 格式**:全局命名空间的技能直接用名字(如 `my-skill`);团队命名空间要用 `team--skill` 的形式(`@team/skill``team--skill`)。
3. 最稳妥的方式是直接在 SkillHub Web 界面点技能的「安装」按钮,复制其中已经带好正确 registry 与命名空间的命令。
> SkillHub 同时提供 `clawhub``skillhub` 两种 CLI用法见各自 README通过 OpenClaw 对话安装技能时,底层同样调用 CLI。
## 开发相关
### 如何扩展 OAuth Provider
参考现有 GitHub 实现,添加新的 OAuth Provider 配置。
### 如何自定义搜索实现?
实现 `SearchIndexService``SearchQueryService` 接口。
## 下一步
- [故障排查](./troubleshooting) - 问题诊断

View file

@ -1,45 +0,0 @@
---
title: 路线图
sidebar_position: 4
description: 未来发展路线图
---
# 路线图
## Phase 1: 基础能力 ✅
- GitHub OAuth 登录
- Session 管理
- RBAC 权限体系
## Phase 2: 技能核心 ✅
- 命名空间管理
- 技能发布与下载
- 版本管理
- PostgreSQL 全文搜索
## Phase 3: 审核与 CLI
- 审核流程
- 技能提升到全局
- CLI 工具
- 收藏与评分
## Phase 4: 运维与完善
- 审计日志
- 管理后台
- 可观测性
- 部署优化
## Phase 5: 高级特性
- 评论与举报
- 自动安全扫描
- 向量搜索
- Webhook 通知
## 下一步
- [快速开始](../getting-started/quick-start) - 开始使用

View file

@ -1,74 +0,0 @@
---
title: 故障排查
sidebar_position: 2
description: 常见问题诊断和解决方案
---
# 故障排查
## 服务无法启动
### 检查清单
1. 检查容器状态:`docker compose ps`
2. 查看服务日志:`docker compose logs <service>`
3. 验证环境变量:检查 `.env.release` 配置
4. 检查端口占用:`netstat -tlnp`
### 常见原因
- 端口被占用
- 数据库连接失败
- Redis 连接失败
- 环境变量缺失
### PostgreSQL 容器启动报 `operation not permitted`(写 `postmaster.pid` / `pg_wal` 失败)
SkillHub 默认的 Compose / `runtime.sh` 使用 Docker named volume`postgres_data`),通常不需要手工处理宿主机目录权限。这个错误更多出现在你把 PostgreSQL 数据目录改成宿主机 bind mount 时,例如 `/data/skillhub/postgres:/var/lib/postgresql/data`
排查顺序:
1. 优先恢复为 Docker named volume或直接使用官方 `runtime.sh` 部署脚本,避免手写 compose 时漏配权限。
2. 如果必须使用 bind mount先确认当前镜像中的 `postgres` 用户 UID/GID`docker run --rm postgres:16-alpine id postgres`,再按实际 UID/GID 调整数据目录属主,例如 `chown -R <uid>:<gid> <数据目录>`。不要固定假设所有环境都是 `999:999`
3. 在 RHEL/CentOS 上检查 SELinux在启用 AppArmor、rootless Docker、NFS/CIFS/NAS 等环境时,也要确认宿主文件系统是否允许 PostgreSQL 需要的写入、锁和权限变更。
4. 不建议把 PostgreSQL `PGDATA` 放在不支持完整 POSIX 权限语义的网络文件系统上生产环境优先使用本地盘、Docker named volume、块存储或外部 PostgreSQL。
## 上传失败
### 技能包上传失败
1. 检查文件大小
2. 检查文件类型
3. 检查 SKILL.md 格式
4. 查看服务端日志
## 认证问题
### 无法登录
1. 检查 OAuth 配置
2. 检查回调地址配置
3. 检查 `SKILLHUB_PUBLIC_BASE_URL` 配置
## 性能问题
### 搜索慢
1. 检查 PostgreSQL 全文索引
2. 考虑升级到 Elasticsearch后续版本
### 下载慢
1. 检查对象存储配置
2. 检查网络带宽
## 获取帮助
如以上方案无法解决问题:
1. 查看日志
2. 提交 Issue
3. 联系技术支持
## 下一步
- [变更日志](./changelog) - 版本历史

View file

@ -1,101 +0,0 @@
---
title: SkillHub 文档中心
sidebar_position: 1
description: 企业级 AI 技能注册表 - 安全可控的技能发布、发现与管理平台
---
# SkillHub
<section className="hero-section">
<div className="container">
<h1 className="hero-section__title">🏢 企业级 AI 技能注册表</h1>
<p className="hero-section__tagline">
安全可控的技能发布、发现与管理平台,保障企业数据主权
</p>
<div className="hero-section__cta">
<a href="/getting-started/quick-start" className="btn-primary">立即部署</a>
<a href="/getting-started/overview" className="btn-secondary">了解更多</a>
</div>
</div>
</section>
---
## 企业价值
<div className="row" style={{ marginTop: '40px', marginBottom: '40px' }}>
<div className="col col--3">
<div className="enterprise-value-card">
<div className="enterprise-value-card__icon">🔐</div>
<h3 className="enterprise-value-card__title">数据主权可控</h3>
<p className="enterprise-value-card__description">
自托管部署,数据不离开企业网络;支持私有 S3/MinIO 存储;完整审计链路
</p>
</div>
</div>
<div className="col col--3">
<div className="enterprise-value-card">
<div className="enterprise-value-card__icon">🏢</div>
<h3 className="enterprise-value-card__title">治理体系完善</h3>
<p className="enterprise-value-card__description">
命名空间隔离;双层审核机制;细粒度 RBAC 权限控制
</p>
</div>
</div>
<div className="col col--3">
<div className="enterprise-value-card">
<div className="enterprise-value-card__icon">🔌</div>
<h3 className="enterprise-value-card__title">集成能力强</h3>
<p className="enterprise-value-card__description">
兼容 ClawHub CLI标准 REST APIOAuth2 企业 SSO 集成
</p>
</div>
</div>
<div className="col col--3">
<div className="enterprise-value-card">
<div className="enterprise-value-card__icon">📊</div>
<h3 className="enterprise-value-card__title">可观测性完善</h3>
<p className="enterprise-value-card__description">
完整审计日志Prometheus 指标;操作追踪与溯源
</p>
</div>
</div>
</div>
---
## 核心功能特性
<div style={{ textAlign: 'center', marginTop: '40px' }}>
<div className="feature-tags">
<span className="feature-tag">版本控制</span>
<span className="feature-tag">全文搜索</span>
<span className="feature-tag">命名空间</span>
<span className="feature-tag">审核流程</span>
<span className="feature-tag">语义化版本</span>
<span className="feature-tag">多维度筛选</span>
<span className="feature-tag">RBAC 权限</span>
<span className="feature-tag">审计日志</span>
</div>
</div>
---
## 快速开始
<div style={{ textAlign: 'center', marginTop: '40px' }}>
<div className="quick-start-code">
<code>$ curl -fsSL https://raw.githubusercontent.com/iflytek/skillhub/main/scripts/runtime.sh | sh -s -- up</code>
</div>
<p style={{ marginTop: '16px', color: 'var(--ifm-font-color-secondary)' }}>
访问 <a href="http://localhost:3000">http://localhost:3000</a> 开始使用
</p>
</div>
---
## 下一步
- [快速开始](./getting-started/quick-start) - 一键启动 SkillHub
- [产品概述](./getting-started/overview) - 了解更多产品特性
- [部署指南](./administration/deployment/single-machine) - 生产环境部署

View file

@ -1,115 +0,0 @@
import { themes as prismThemes } from 'prism-react-renderer';
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'SkillHub',
tagline: '企业级 AI 技能注册表',
favicon: 'img/favicon.ico',
url: 'https://skillhub.iflytek.com',
baseUrl: '/',
organizationName: 'iflytek',
projectName: 'skillhub',
i18n: {
defaultLocale: 'zh-CN',
locales: ['zh-CN', 'en'],
localeConfigs: {
'zh-CN': {
label: '中文',
htmlLang: 'zh-CN',
},
'en': {
label: 'English',
htmlLang: 'en',
},
},
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
routeBasePath: '/',
sidebarPath: './sidebars.js',
editUrl: 'https://github.com/iflytek/skillhub/edit/main/document/',
},
theme: {
customCss: './src/css/custom.css',
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/og-image.png',
navbar: {
title: 'SkillHub',
logo: {
alt: 'SkillHub Logo',
src: 'img/logo.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'docsSidebar',
position: 'left',
label: '文档',
},
{
type: 'localeDropdown',
position: 'right',
},
{
href: 'https://github.com/iflytek/skillhub',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: '文档',
items: [
{
label: '快速开始',
to: '/getting-started/quick-start',
},
{
label: '部署指南',
to: '/administration/deployment/single-machine',
},
{
label: 'API 参考',
to: '/developer/api/overview',
},
],
},
{
title: '社区',
items: [
{
label: 'GitHub',
href: 'https://github.com/iflytek/skillhub',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} iFlytek. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['java', 'bash', 'yaml', 'json'],
},
}),
};
export default config;

View file

@ -1,8 +0,0 @@
{
"label": "Getting Started",
"position": 1,
"link": {
"type": "generated-index",
"description": "Quickly understand and start using SkillHub"
}
}

View file

@ -1,70 +0,0 @@
---
title: Overview
sidebar_position: 1
description: SkillHub product overview and core features
---
# Overview
SkillHub is an enterprise-grade AI skill registry platform for publishing, discovering, and managing skills with a self-hosted architecture ensuring data security.
## Core Features
### Publishing Management
- Version control and Semantic Versioning
- Custom tags (like `beta`/`stable`)
- `latest` tag automatically follows the latest published version
### Discovery
- Full-text search
- Multi-dimensional filtering (namespace, downloads, ratings)
- Visibility control
### Organization
- Namespace isolation
- Role-based access control (RBAC)
- Team and global two-tier scopes
### Governance
- Two-tier review workflow
- Audit logs
- Permission separation
### Storage and Deployment
- S3/MinIO/Local storage support
- Docker/Kubernetes deployment
- Enterprise-grade observability
## Tech Stack
### Backend
- **Java 21** - Runtime
- **Spring Boot 3.2.3** - Application framework
- **PostgreSQL 16.x** - Primary database + full-text search
- **Redis 7.x** - Cache and session storage
### Frontend
- **React 19** - UI framework
- **TypeScript** - Type safety
- **Vite** - Build tool
- **Tailwind CSS** - Styling framework
### Deployment
- **Docker Compose** - Single-machine deployment
- **Kubernetes** - Production orchestration
## Core Concepts
### Namespace
Skill isolation boundary, supporting `@global` (global) and `@team-*` (team) prefixes.
### Coordinate System
Skill identifier format: `@{namespace_slug}/{skill_slug}`, supports semantic versioning.
### Compatibility
Provides REST API and ClawHub compatibility layer for existing tool integration.
## Next Steps
- [Quick Start](./quick-start) - One-click startup experience
- [Use Cases](./use-cases) - Explore enterprise application scenarios

View file

@ -1,85 +0,0 @@
---
title: Quick Start
sidebar_position: 2
description: One-click startup of SkillHub development environment
---
# Quick Start
## One-click Startup
Use the following command to start a complete SkillHub environment with one command:
```bash
curl -fsSL https://raw.githubusercontent.com/iflytek/skillhub/main/scripts/runtime.sh | sh -s -- up
```
Or clone the repository and start manually:
```bash
git clone https://github.com/iflytek/skillhub.git
cd skillhub
make dev-all
```
## Default Account
Both startup methods create a bootstrap admin account by default:
- username: `admin`
- password: `ChangeMe!2026`
### `curl` One-click Deployment
| Service | Address |
|---------|---------|
| Web UI | http://localhost |
| Backend API | http://localhost:8080 |
Log in with the default credentials above. **Change the password for production.**
### `make dev-all` Local Development
| Service | Address |
|---------|---------|
| Web UI | http://localhost:3000 |
| Backend API | http://localhost:8080 |
| MinIO Console | http://localhost:9001 |
In addition to the bootstrap admin, local development includes two mock users (no password needed):
| User | Role | Description |
|------|------|-------------|
| `local-user` | Regular user | Can publish skills, manage namespaces |
| `local-admin` | Super admin | Has all permissions including review and user management |
Use the `X-Mock-User-Id` request header to switch mock users.
To disable the bootstrap admin, set `BOOTSTRAP_ADMIN_ENABLED=false` before starting.
## Common Commands
```bash
# Start complete development environment
make dev-all
# Stop all services
make dev-all-down
# Reset and restart
make dev-all-reset
# Start backend only
make dev
# Start frontend only
make dev-web
# View all available commands
make help
```
## Next Steps
- [Overview](./overview) - Deep dive into product features
- [Use Cases](./use-cases) - Explore enterprise application scenarios
- [Single Machine Deployment](../administration/deployment/single-machine) - Production deployment guide

View file

@ -1,72 +0,0 @@
---
title: Use Cases
sidebar_position: 3
description: Typical enterprise application scenarios for SkillHub
---
# Use Cases
## Internal Skill Sharing
**Scenario**: Multiple teams within an enterprise develop AI skills and need a centralized platform for sharing and reuse.
**Solution**:
- Each team creates their own namespace
- Skills are reviewed and published within the team first
- Excellent skills can be promoted to the global space
- Complete audit records for all operations
**Value**:
- Avoid duplicate development
- Promote best practice sharing
- Ensure quality control
## AI Skill Governance and Compliance
**Scenario**: Industries such as finance and government have strict compliance requirements for AI applications, requiring complete review and audit mechanisms.
**Solution**:
- Two-tier review workflow (team review + platform review)
- Fine-grained RBAC permission control
- Complete operation audit logs
- Skill version traceability and withdrawability
**Value**:
- Meet compliance requirements
- Controllable risks
- Traceable responsibilities
## Multi-team Collaborative Development
**Scenario**: Large organizations with multiple teams collaborating need clear permission boundaries and collaboration mechanisms.
**Solution**:
- Namespace isolation, team autonomy
- Namespace member role management
- Skill visibility control (public/namespace-only/private)
- Team skills can apply for promotion to global
**Value**:
- Clear responsibilities
- Efficient collaboration
- Controllable security
## CLI Tool Integration
**Scenario**: Existing workflows using ClawHub CLI want to seamlessly migrate to SkillHub.
**Solution**:
- Provide ClawHub CLI protocol compatibility layer
- Auto-discovery via `/.well-known/clawhub.json`
- Existing CLI tools work without modification
- Also provide SkillHub-native CLI enhanced features
**Value**:
- Protect existing investments
- Low migration cost
- Gradual upgrade
## Next Steps
- [Single Machine Deployment](../administration/deployment/single-machine) - Start deployment
- [Namespace Management](../administration/governance/namespaces) - Learn about organization governance

View file

@ -1,8 +0,0 @@
{
"label": "Administration Guide",
"position": 2,
"link": {
"type": "generated-index",
"description": "Deploy, configure, and manage SkillHub"
}
}

View file

@ -1,4 +0,0 @@
{
"label": "Deployment Guide",
"position": 1
}

View file

@ -1,69 +0,0 @@
---
title: Configuration Reference
sidebar_position: 3
description: Detailed SkillHub configuration reference
---
# Configuration Reference
## Environment Variables
SkillHub is configured through environment variables. The main configuration items are listed below:
### Basic Configuration
| Environment Variable | Description | Default Value |
|---------------------|-------------|---------------|
| `SKILLHUB_PUBLIC_BASE_URL` | Public access URL | - |
| `SKILLHUB_VERSION` | Image version | `edge` |
### Database Configuration
| Environment Variable | Description | Default Value |
|---------------------|-------------|---------------|
| `POSTGRES_HOST` | PostgreSQL host | `postgres` |
| `POSTGRES_PORT` | PostgreSQL port | `5432` |
| `POSTGRES_DB` | Database name | `skillhub` |
| `POSTGRES_USER` | Database user | `skillhub` |
| `POSTGRES_PASSWORD` | Database password | - |
### Redis Configuration
| Environment Variable | Description | Default Value |
|---------------------|-------------|---------------|
| `REDIS_HOST` | Redis host | `redis` |
| `REDIS_PORT` | Redis port | `6379` |
| `REDIS_PASSWORD` | Redis password | - |
### Storage Configuration
| Environment Variable | Description | Default Value |
|---------------------|-------------|---------------|
| `SKILLHUB_STORAGE_PROVIDER` | Storage provider | `local` |
| `SKILLHUB_STORAGE_S3_ENDPOINT` | S3 endpoint | - |
| `SKILLHUB_STORAGE_S3_BUCKET` | S3 bucket name | - |
| `SKILLHUB_STORAGE_S3_ACCESS_KEY` | S3 Access Key | - |
| `SKILLHUB_STORAGE_S3_SECRET_KEY` | S3 Secret Key | - |
### OAuth Configuration
| Environment Variable | Description | Default Value |
|---------------------|-------------|---------------|
| `OAUTH2_GITHUB_CLIENT_ID` | GitHub OAuth Client ID | - |
| `OAUTH2_GITHUB_CLIENT_SECRET` | GitHub OAuth Client Secret | - |
### Bootstrap Admin Configuration
| Environment Variable | Description | Default Value |
|---------------------|-------------|---------------|
| `BOOTSTRAP_ADMIN_ENABLED` | Enable bootstrap admin | `true` |
| `BOOTSTRAP_ADMIN_USERNAME` | Bootstrap admin username | `admin` |
| `BOOTSTRAP_ADMIN_PASSWORD` | Bootstrap admin password | `ChangeMe!2026` |
## Configuration Files
Spring Boot configuration files are located at `server/skillhub-app/src/main/resources/`.
## Next Steps
- [Authentication Configuration](../security/authentication) - Configure authentication

View file

@ -1,54 +0,0 @@
---
title: Kubernetes Deployment
sidebar_position: 2
description: Deploy SkillHub in a Kubernetes cluster
---
# Kubernetes Deployment
This guide describes how to deploy SkillHub in a Kubernetes cluster.
## Prerequisites
- Kubernetes 1.24+
- kubectl configured
- Helm 3.0+ (optional)
- Available persistent storage class
## Deployment Manifests
Kubernetes deployment manifests are provided in the project:
```bash
cd deploy/k8s
# 1. Create namespace
kubectl create namespace skillhub
# 2. Configure Secret
cp secret.yaml.example secret.yaml
# Edit secret.yaml and fill in real credentials
# 3. Apply configuration
kubectl apply -f configmap.yaml
kubectl apply -f secret.yaml
# 4. Deploy services
kubectl apply -f backend-deployment.yaml
kubectl apply -f frontend-deployment.yaml
kubectl apply -f services.yaml
# 5. Configure Ingress
kubectl apply -f ingress.yaml
```
## High Availability Configuration
- Deploy at least 2 replicas for backend and frontend
- Use PostgreSQL with primary-replica replication
- Use Redis with Sentinel or Cluster mode
- Use highly available object storage (like MinIO cluster or cloud provider OSS)
## Next Steps
- [Configuration](./configuration) - Detailed configuration reference

View file

@ -1,65 +0,0 @@
---
title: Single Machine Deployment
sidebar_position: 1
description: Deploy SkillHub using Docker Compose on a single machine
---
# Single Machine Deployment
This guide describes how to deploy SkillHub on a single server using Docker Compose.
## Prerequisites
- Docker Engine 20.10+
- Docker Compose Plugin 2.0+
- At least 4GB available RAM
- At least 20GB available disk space
## Quick Deployment
```bash
# 1. Clone the repository
git clone https://github.com/iflytek/skillhub.git
cd skillhub
# 2. Copy environment variable template
cp .env.release.example .env.release
# 3. Edit configuration
# Modify configuration items in .env.release, especially passwords and public URLs
# 4. Validate configuration
make validate-release-config
# 5. Start services
docker compose --env-file .env.release -f compose.release.yml up -d
```
## Configuration
See [Configuration](./configuration) documentation for details.
## Verify Deployment
```bash
# Check container status
docker compose --env-file .env.release -f compose.release.yml ps
# Check backend health
curl -i http://127.0.0.1:8080/actuator/health
# Access Web UI
# Open http://localhost in browser (or configured public URL)
```
## First Login Configuration
1. Login with `BOOTSTRAP_ADMIN_USERNAME` and `BOOTSTRAP_ADMIN_PASSWORD` (default `admin` / `ChangeMe!2026`)
2. Change admin password immediately
3. Configure enterprise SSO (optional)
4. Create team namespaces
## Next Steps
- [Configuration](./configuration) - Detailed configuration reference
- [Kubernetes Deployment](./kubernetes) - High availability deployment

View file

@ -1,4 +0,0 @@
{
"label": "Governance & Operations",
"position": 3
}

View file

@ -1,56 +0,0 @@
---
title: Namespace Management
sidebar_position: 1
description: Namespace creation and management
---
# Namespace Management
Namespaces are the isolation boundary and collaboration unit for skills in SkillHub.
## Namespace Types
| Type | Prefix | Description |
|------|--------|-------------|
| Global | `@global` | Platform-level public space, managed by platform admins |
| Team | `@team-*` | Team/department space, managed by team admins |
## Create Namespace
1. After login, go to "My Namespaces"
2. Click "Create Namespace"
3. Fill in information:
- Slug: URL-friendly name
- Display name: Display name
- Description: Space purpose description
4. Submit creation
## Namespace Member Management
### Add Member
1. Go to namespace settings
2. Go to "Member Management"
3. Enter username to search
4. Select role (OWNER/ADMIN/MEMBER)
5. Confirm addition
### Role Change
Namespace OWNER or ADMIN can change member roles.
### Remove Member
Namespace OWNER or ADMIN can remove members.
## Namespace Status
| Status | Description |
|--------|-------------|
| `ACTIVE` | Normal use |
| `FROZEN` | Frozen, read-only, cannot publish |
| `ARCHIVED` | Archived, not visible externally |
## Next Steps
- [Review Workflow](./review-workflow) - Understand skill review

View file

@ -1,44 +0,0 @@
---
title: Review Workflow
sidebar_position: 2
description: Skill publishing review workflow configuration
---
# Review Workflow
SkillHub uses a two-tier review mechanism to ensure skill quality.
## Review Workflow
### Team Namespace Skills
1. Team member submits publishing
2. Create review task (PENDING)
3. Team ADMIN or OWNER reviews
- Approve → Skill published (PUBLISHED)
- Reject → Return for modification (REJECTED)
### Global Namespace Skills
1. Submit publishing
2. Platform SKILL_ADMIN or SUPER_ADMIN reviews
3. Published after review approval
## Promote Team Skill to Global
1. Team skill is published
2. Team ADMIN or OWNER applies "Promote to Global"
3. Platform admin reviews
4. Creates new skill in global namespace after approval
## Review Permissions
| Review Type | Required Role |
|------------|---------------|
| Team namespace skill review | Namespace ADMIN/OWNER |
| Global namespace skill review | SKILL_ADMIN/SUPER_ADMIN |
| Promotion request review | SKILL_ADMIN/SUPER_ADMIN |
## Next Steps
- [User Management](./user-management) - Manage platform users

View file

@ -1,61 +0,0 @@
---
title: User Management
sidebar_position: 3
description: Platform user management
---
# User Management
## User Status
| Status | Effective behavior |
|--------|--------------------|
| `ACTIVE` | Can log in and use the system normally. OAuth auto-admission and local registration both create users in this state. |
| `PENDING` | Account exists but cannot log in. Under approval-required OAuth flows, the system creates a `PENDING` user and redirects to the pending-approval page. Local login also rejects this status. |
| `DISABLED` | Cannot log in. Both OAuth and local auth reject it. `/api/v1/auth/me` will invalidate the current session if the backing user has been disabled. |
| `MERGED` | Account has been merged into another account and can no longer log in. This is mainly written by the account-merge flow, not by normal user administration. |
## User Admission
Configure whether new users require approval:
- Auto-admission: New users automatically activated after login
- Approval admission: New users require USER_ADMIN approval to activate
## Role Assignment
`USER_ADMIN` or `SUPER_ADMIN` can call the user-management API to change platform roles, but the implementation has a few important constraints:
- The API sets exactly one target platform role at a time.
- It deletes the user's existing explicit platform-role bindings before writing the new one.
- If the target role is `USER`, no `user_role_binding` row is written; runtime defaulting adds it later.
- `USER_ADMIN` cannot assign `SUPER_ADMIN`; only `SUPER_ADMIN` can do that.
The currently supported target roles in practice are:
- `USER`
- `SKILL_ADMIN`
- `USER_ADMIN`
- `AUDITOR`
- `SUPER_ADMIN`
## User Disable/Enable
`USER_ADMIN` or `SUPER_ADMIN` can disable or enable users.
The current public management API only supports changing status to:
- `ACTIVE`
- `DISABLED`
In practice:
- "Approve user" is implemented as changing the status to `ACTIVE`.
- The API does not directly set users to `PENDING` or `MERGED`.
## Account Merge
Supports merging multiple accounts into one, preserving operation history.
## Next Steps
- [Create Skill Package](../../user-guide/publishing/create-skill) - Start publishing skills

View file

@ -1,4 +0,0 @@
{
"label": "Security & Compliance",
"position": 2
}

View file

@ -1,38 +0,0 @@
---
title: Audit Logs
sidebar_position: 3
description: Operation audit log query and management
---
# Audit Logs
SkillHub records audit logs for all critical operations to meet enterprise compliance requirements.
## Audit Scope
Recorded operations include:
- Skill publishing, downloading, deletion
- Review approval, rejection
- User login, logout
- Permission changes
- Namespace management
- Configuration changes
## Audit Log Query
Query through admin dashboard audit log page or Admin API.
## Log Fields
- Operation time
- Operating user
- Operation type
- Target resource
- Client IP
- User-Agent
- Request ID
- Detailed information
## Next Steps
- [Namespace Management](../governance/namespaces) - Manage organization

View file

@ -1,36 +0,0 @@
---
title: Authentication Configuration
sidebar_position: 1
description: Configure user authentication methods
---
# Authentication Configuration
SkillHub supports multiple authentication methods to meet different enterprise security requirements.
## OAuth2 Login
### GitHub OAuth
1. Create an OAuth App on GitHub
2. Configure environment variables:
```bash
OAUTH2_GITHUB_CLIENT_ID=your-client-id
OAUTH2_GITHUB_CLIENT_SECRET=your-client-secret
```
### Extend OAuth Provider
The architecture supports extending to other OAuth providers like GitLab, Gitee, etc.
## Local Account Login
Local account login is supported in development environment, disabled by default in production.
## Enterprise SSO Integration
Supports integrating enterprise SSO (SAML/OIDC) through extension points.
## Next Steps
- [Authorization](./authorization) - Configure access control

View file

@ -1,64 +0,0 @@
---
title: Authorization Management
sidebar_position: 2
description: RBAC permission system configuration
---
# Authorization Management
SkillHub uses a Role-Based Access Control (RBAC) system.
The current codebase actually uses two parallel role systems:
- Platform roles: control platform-wide governance, user administration, and audit capabilities.
- Namespace roles: control actions inside a specific team namespace.
They participate in authorization together, but they are not a single hierarchy.
## Platform Roles
### Explicit platform roles seeded by code
The database migration seeds only 4 explicit platform roles:
| Role | Code | Effective behavior |
|------|------|--------------------|
| Super Admin | `SUPER_ADMIN` | Has all permissions. `RbacService#getUserPermissions` returns all permission codes for this role. Can access all endpoints available to `SUPER_ADMIN` / `SKILL_ADMIN` / `USER_ADMIN` / `AUDITOR`. Can assign `SUPER_ADMIN`. Can bypass namespace membership checks during publish and auto-publish directly. Can approve their own promotion request. For normal review tasks, the self-submission exception is also only bypassed by `SUPER_ADMIN`. |
| Skill Admin | `SKILL_ADMIN` | Can access skill governance admin endpoints. Can hide/unhide skills, yank versions, and resolve/dismiss skill reports. Can review global namespace review tasks, promotion requests, and governance inbox items for review/promotion/report. Cannot manage users or read audit logs. |
| User Admin | `USER_ADMIN` | Can access user management endpoints. Can list users, approve users, enable/disable users, and change platform roles. Cannot assign `SUPER_ADMIN`. Cannot perform skill governance or read audit logs. |
| Auditor | `AUDITOR` | Read-only audit access. Can access `/api/v1/admin/audit-logs` and `/actuator/prometheus`. In the governance workbench this role can read activity, but cannot process review/promotion/report items and cannot manage users or skills. |
### Runtime default platform role
| Role | Code | Effective behavior |
|------|------|--------------------|
| Default User | `USER` | Not an explicitly seeded row in the `role` table. If a user has no explicit platform-role binding, login/session resolution and `RbacService#getUserRoleCodes` automatically add `USER`. It represents a normal signed-in user with no extra governance privileges. |
### Important implementation details
- The current admin API changes platform role by replacement, not by append: `PUT /api/v1/admin/users/{userId}/role` deletes existing explicit platform-role bindings first, then writes one target role.
- If the target role is `USER`, no explicit binding is stored; the role is supplied later by runtime defaulting.
- The lower-level auth/session/RBAC code still supports multiple explicit platform roles on one user because it works with role sets. The current admin API simply does not assign roles that way.
- `SUPER_ADMIN` is the only role treated as "all permissions" during permission lookup. Other roles depend on `role_permission`.
## Namespace Roles
| Role | Effective behavior |
|------|--------------------|
| `OWNER` | Automatically assigned when creating a team namespace. Can update namespace settings, manage members, freeze/unfreeze the namespace, archive/restore it, and transfer ownership. Can submit reviews, review team-namespace review tasks, access private skills, and manage restricted skill lifecycle. |
| `ADMIN` | Can update namespace settings, manage members, and freeze/unfreeze the namespace. Cannot archive/restore the namespace and cannot directly set someone to `OWNER`. Can submit reviews, review team-namespace review tasks, access private skills, and manage restricted skill lifecycle. |
| `MEMBER` | Common member role, including auto-membership in the global namespace. Can publish skills in namespaces they belong to and can submit reviews. Cannot review review tasks, manage members, or freeze/archive namespaces. `MEMBER` alone is not enough to access private skills. |
### Namespace role boundaries
- The `GLOBAL` namespace is effectively immutable in namespace-governance flows. Review/promotion/report handling there depends on platform roles `SKILL_ADMIN` / `SUPER_ADMIN`, not on global namespace membership alone.
- For `NAMESPACE_ONLY` visibility, any namespace member can access the skill.
- For `PRIVATE` visibility, access is limited to the skill owner or namespace `ADMIN` / `OWNER`; `MEMBER` is not enough.
## Permission Configuration
Assign platform roles through admin user management, and namespace roles through namespace membership.
## Next Steps
- [Audit Logs](./audit-logs) - View operation audits

View file

@ -1,8 +0,0 @@
{
"label": "User Guide",
"position": 3,
"link": {
"type": "generated-index",
"description": "Learn how to publish, discover, and use skills"
}
}

View file

@ -1,4 +0,0 @@
{
"label": "Collaboration",
"position": 3
}

View file

@ -1,41 +0,0 @@
---
title: Team Namespaces
sidebar_position: 1
description: Collaborate in team namespaces
---
# Team Namespaces
## Join Namespace
Requires namespace admin invitation to join a team namespace.
## Namespace Roles
### MEMBER
- Can view all skills in namespace
- Can publish skills (requires review)
- Can favorite and rate
### ADMIN
- All MEMBER permissions
- Can review skill publishing
- Can manage members
- Can edit namespace information
### OWNER
- All ADMIN permissions
- Can transfer ownership
- Can archive namespace
## Skill Visibility
| Visibility | Description |
|------------|-------------|
| `PUBLIC` | Visible to everyone, anonymous downloadable |
| `NAMESPACE_ONLY` | Only visible to namespace members |
| `PRIVATE` | Only visible to owner and namespace ADMIN |
## Next Steps
- [Promote to Global](./promotion) - Promote team skills to global

View file

@ -1,42 +0,0 @@
---
title: Promote to Global
sidebar_position: 2
description: Apply to promote team skills to global namespace
---
# Promote to Global
Excellent team skills can be applied for promotion to the global namespace for enterprise-wide use.
## Promotion Prerequisites
- Skill is published in team namespace
- Applicant is skill owner or namespace ADMIN
- Skill has no pending promotion requests
## Apply for Promotion
1. Go to team skill detail page
2. Click "Promote to Global"
3. Fill in application description
4. Submit application
## Review Workflow
1. Platform admin receives promotion application
2. Reviews skill quality and suitability
3. After approval:
- Creates new skill in global namespace
- Preserves original team skill
- Records source traceability relationship
## After Promotion
- New skill in global namespace is independently managed
- Original team skill continues to exist
- Versions are not automatically synced
- Manual operation required if sync needed
## Next Steps
- [API Overview](../../developer/api/overview) - API integration

View file

@ -1,4 +0,0 @@
{
"label": "Discovery & Usage",
"position": 2
}

View file

@ -1,53 +0,0 @@
---
title: Install & Use
sidebar_position: 2
description: Install and use skills
---
# Install & Use
## Install via CLI
### Install Latest Version
```bash
clawhub install @team/my-skill
```
### Install Specific Version
```bash
clawhub install @team/my-skill@1.2.0
```
### Install by Tag
```bash
clawhub install @team/my-skill@beta
```
### Install with ClawHub CLI
```bash
clawhub install my-skill
clawhub install team-name--my-skill
```
## Installation Directory
Install by the following priority:
| Priority | Path | Description |
|----------|------|-------------|
| 1 | `./.agent/skills/` | Project level, universal mode |
| 2 | `~/.agent/skills/` | Global level, universal mode |
| 3 | `./.claude/skills/` | Project level, Claude default |
| 4 | `~/.claude/skills/` | Global level, Claude default |
## Use in Claude Code
After installation, skills are automatically discovered and loaded by Claude Code.
## Next Steps
- [Ratings & Stars](./ratings) - Feedback and favorite skills

View file

@ -1,30 +0,0 @@
---
title: Ratings & Stars
sidebar_position: 3
description: Skill rating and favorite features
---
# Ratings & Stars
## Favorite Skills
Click the "Favorite" button on the skill detail page to favorite a skill.
View your favorite skills:
- Web: Go to "My Favorites"
- CLI: `clawhub stars`
## Skill Rating
You can rate skills from 1-5 stars:
1. Go to skill detail page
2. Click rating area
3. Select rating (1-5 stars)
4. Submit rating
You can modify your rating at any time.
## Next Steps
- [Team Namespaces](../collaboration/namespaces) - Team collaboration

View file

@ -1,36 +0,0 @@
---
title: Search Skills
sidebar_position: 1
description: Search and filter skills
---
# Search Skills
## Full-text Search
Enter keywords in the search box, SkillHub searches in the following fields:
- Skill name
- Skill description
- Skill slug
- Frontmatter fields other than `name`, `description`, and `version`
- Keyword-style fields such as `keywords` and `tags`
## Filter Conditions
You can filter search results by the following conditions:
- Namespace
- Visibility
- Download count sorting
- Rating sorting
- Update time sorting
## Advanced Search
Use search syntax:
- `namespace:@team-ai` - Specify namespace
- `category:code-review` - Specify category
- `downloads:>100` - Downloads greater than 100
## Next Steps
- [Install & Use](./install) - Install and use skills

View file

@ -1,4 +0,0 @@
{
"label": "Publishing Skills",
"position": 1
}

View file

@ -1,56 +0,0 @@
---
title: Create Skill Package
sidebar_position: 1
description: Learn how to create a compliant skill package
---
# Create Skill Package
## Skill Package Structure
A standard SkillHub skill package structure looks like this:
```
my-skill/
├── SKILL.md # Main entry file (required)
├── references/ # References (optional)
├── scripts/ # Scripts (optional)
└── assets/ # Static assets (optional)
```
## SKILL.md Format
SKILL.md is the main entry file of a skill package, using YAML frontmatter + Markdown body format:
```markdown
---
name: my-skill
description: One sentence describing what this skill is for
x-astron-category: code-review
---
# Skill Description
Detailed skill description goes here...
```
### Frontmatter Fields
| Field | Required | Description |
|-------|----------|-------------|
| `name` | Yes | Skill identifier, kebab-case format |
| `description` | Yes | Brief skill description |
| `x-astron-category` | No | Category tag |
| `x-astron-runtime` | No | Runtime requirement |
| `x-astron-min-version` | No | Minimum version requirement |
## File Limits
- Single file size: Max 1MB
- Total package size: Max 10MB
- File count: Max 100
- Allowed file types: `.md`, `.txt`, `.json`, `.yaml`, `.yml`, `.js`, `.ts`, `.py`, `.sh`, `.png`, `.jpg`, `.svg`
## Next Steps
- [Publish Workflow](./publish) - Publish skill package

View file

@ -1,50 +0,0 @@
---
title: Publish Workflow
sidebar_position: 2
description: Publish skills to SkillHub
---
# Publish Workflow
## Publish via Web
1. Login to SkillHub
2. Click "Publish Skill"
3. Select target namespace
4. Upload skill package ZIP file
5. Fill in version information (changelog, etc.)
6. Submit publishing
7. Wait for review (if required)
8. Published successfully after review approval
## Publish via CLI
```bash
# 1. Login
skillhub login
# 2. Publish
skillhub publish ./my-skill.zip --namespace @team-myteam
```
## Publish via ClawHub CLI
Use after configuring registry:
```bash
clawhub publish ./my-skill.zip
```
## Publishing Status
| Status | Description |
|--------|-------------|
| `DRAFT` | Draft, not submitted for review |
| `PENDING_REVIEW` | Pending review |
| `PUBLISHED` | Published, discoverable and downloadable |
| `REJECTED` | Rejected, need modification and resubmit |
| `YANKED` | Withdrawn, no longer recommended for use |
## Next Steps
- [Version Management](./versioning) - Manage skill versions

View file

@ -1,56 +0,0 @@
---
title: Version Management
sidebar_position: 3
description: Skill version and tag management
---
# Version Management
## Semantic Versioning
SkillHub uses Semantic Versioning: `MAJOR.MINOR.PATCH`
- `MAJOR`: Incompatible API changes
- `MINOR`: Backward compatible feature additions
- `PATCH`: Backward compatible bug fixes
Examples: `1.0.0`, `1.1.0`, `2.0.0`
## latest Tag
`latest` is a system reserved tag that automatically follows the latest published version and cannot be manually moved.
## Custom Tags
You can create custom tags for version channel management:
- `beta` - Beta version
- `stable` - Stable version
- `stable-2026q1` - Quarterly stable version
### Create/Move Tag
```bash
clawhub tag set @team/my-skill beta 1.2.0
```
### Delete Tag
```bash
clawhub tag delete @team/my-skill beta
```
## Version Withdrawal
Published versions with issues can be withdrawn:
1. Go to skill detail page
2. Find target version
3. Click "Withdraw Version"
4. Confirm withdrawal
Withdrawn versions remain visible but are marked as not recommended for use.
## Next Steps
- [Search Skills](../discovery/search) - Discover skills

View file

@ -1,8 +0,0 @@
{
"label": "Developer Reference",
"position": 4,
"link": {
"type": "generated-index",
"description": "API reference, architecture design, and extension development"
}
}

View file

@ -1,4 +0,0 @@
{
"label": "API Reference",
"position": 1
}

View file

@ -1,101 +0,0 @@
---
title: Authenticated APIs
sidebar_position: 3
description: APIs requiring authentication
---
# Authenticated APIs
## Authentication Related
### Get Current User
```http
GET /api/v1/auth/me
```
### Logout
```http
POST /api/v1/auth/logout
```
## Skill Publishing
```http
POST /api/v1/publish
Content-Type: multipart/form-data
file: <zip-file>
namespace: <namespace-slug>
```
## Favorites
```http
POST /api/v1/skills/{namespace}/{slug}/star
DELETE /api/v1/skills/{namespace}/{slug}/star
```
## Ratings
```http
POST /api/v1/skills/{namespace}/{slug}/rating
Content-Type: application/json
{
"score": 5
}
```
## Tag Management
```http
GET /api/v1/skills/{namespace}/{slug}/tags
PUT /api/v1/skills/{namespace}/{slug}/tags/{tagName}
DELETE /api/v1/skills/{namespace}/{slug}/tags/{tagName}
```
## My Resources
```http
GET /api/v1/me/stars
GET /api/v1/me/skills
```
## Namespace Management
```http
POST /api/v1/namespaces
PUT /api/v1/namespaces/{slug}
GET /api/v1/namespaces/{slug}/members
POST /api/v1/namespaces/{slug}/members
PUT /api/v1/namespaces/{slug}/members/{userId}/role
DELETE /api/v1/namespaces/{slug}/members/{userId}
```
## Reviews
```http
GET /api/v1/namespaces/{slug}/reviews
POST /api/v1/namespaces/{slug}/reviews/{id}/approve
POST /api/v1/namespaces/{slug}/reviews/{id}/reject
```
## Promotion Requests
```http
POST /api/v1/namespaces/{slug}/skills/{skillId}/promote
```
## API Token
```http
POST /api/v1/tokens
GET /api/v1/tokens
DELETE /api/v1/tokens/{id}
```
## Next Steps
- [CLI Compatibility Layer](./cli-compat) - ClawHub compatible endpoints

View file

@ -1,159 +0,0 @@
---
title: CLI Compatibility Layer
sidebar_position: 4
description: ClawHub CLI protocol compatibility layer
---
# CLI Compatibility Layer
SkillHub provides a ClawHub CLI protocol compatibility layer for seamless migration of existing tools.
## Configuring ClawHub CLI
To connect ClawHub CLI to your SkillHub instance, configure the following environment variables:
### Environment Variable Configuration
**Linux/macOS (bash/zsh):**
```bash
# ~/.bashrc or ~/.zshrc
export CLAWHUB_SITE=https://skill.xfyun.cn
export CLAWHUB_REGISTRY=https://skill.xfyun.cn
```
**Windows (PowerShell):**
```powershell
# Permanent setting (current user)
[Environment]::SetEnvironmentVariable('CLAWHUB_SITE', 'https://skill.xfyun.cn', 'User')
[Environment]::SetEnvironmentVariable('CLAWHUB_REGISTRY', 'https://skill.xfyun.cn', 'User')
# Or temporary setting (current session)
$env:CLAWHUB_SITE = 'https://skill.xfyun.cn'
$env:CLAWHUB_REGISTRY = 'https://skill.xfyun.cn'
```
### Using CLI Flags (Single Command)
```bash
clawhub --site https://skill.xfyun.cn --registry https://skill.xfyun.cn install <skill>
```
### One-click Copy from Web UI
The SkillHub skill detail page automatically displays install commands with the correct environment variables pre-configured. Simply copy and use.
## Well-known Discovery
```http
GET /.well-known/clawhub.json
```
Response:
```json
{
"apiBase": "/api/v1"
}
```
## Compatibility Layer APIs
### Whoami
```http
GET /api/v1/whoami
```
Response:
```json
{
"handle": "username",
"displayName": "User Name",
"role": "user"
}
```
### Search
```http
GET /api/v1/search?q={keyword}&page={page}&limit={limit}
```
Response:
```json
{
"results": [
{
"slug": "my-skill",
"name": "My Skill",
"description": "...",
"author": {
"handle": "username",
"displayName": "User Name"
},
"version": "1.2.0",
"downloadCount": 100,
"starCount": 50,
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "2026-03-01T00:00:00Z"
}
],
"total": 1,
"page": 1,
"limit": 20
}
```
### Resolve
```http
GET /api/v1/resolve?slug={slug}&version={version}
```
Response:
```json
{
"slug": "my-skill",
"version": "1.2.0",
"downloadUrl": "/api/v1/download/my-skill/1.2.0"
}
```
### Download
```http
GET /api/v1/download/{slug}/{version}
```
### Publish
```http
POST /api/v1/publish
Content-Type: multipart/form-data
file: <zip-file>
```
Response:
```json
{
"slug": "my-skill",
"version": "1.0.0",
"status": "published"
}
```
## Coordinate Mapping
| SkillHub Coordinate | ClawHub canonical slug |
|---------------------|------------------------|
| `@global/my-skill` | `my-skill` |
| `@team-name/my-skill` | `team-name--my-skill` |
## Next Steps
- [System Architecture](../architecture/overview) - Understand architecture design

View file

@ -1,86 +0,0 @@
---
title: API Overview
sidebar_position: 1
description: SkillHub API overview
---
# API Overview
SkillHub provides RESTful APIs for integration and automation.
## API Categories
### Public APIs
- Skill search
- Skill details
- Version list
- Download skills
- No authentication required (for PUBLIC skills)
### Authenticated APIs
- Publish skills
- Favorites/ratings
- Namespace management
- Requires login or Bearer Token
### CLI Compatibility Layer
- ClawHub CLI protocol compatible
- Existing tools can migrate seamlessly
## Response Format
### Unified Response Structure
```json
{
"code": 0,
"msg": "Success",
"data": {},
"timestamp": "2026-03-15T06:00:00Z",
"requestId": "req-123"
}
```
### Pagination Response
```json
{
"code": 0,
"msg": "Success",
"data": {
"items": [],
"total": 100,
"page": 1,
"size": 20
},
"timestamp": "2026-03-15T06:00:00Z",
"requestId": "req-123"
}
```
## Authentication Methods
### Session Cookie
Web side uses Session Cookie authentication.
### Bearer Token
CLI and API integration use Bearer Token:
```bash
Authorization: Bearer <token>
```
### API Token
Can create long-lived API Tokens for automation.
## Idempotency
All write operations support `X-Request-Id` header for idempotency:
```bash
X-Request-Id: <uuid-v4>
```
## Next Steps
- [Public APIs](./public) - View public endpoints

View file

@ -1,72 +0,0 @@
---
title: Public APIs
sidebar_position: 2
description: Public APIs without authentication
---
# Public APIs
## Skill Search
```http
GET /api/v1/skills?keyword=...&namespace=...&page=1&size=20
```
**Query Parameters:**
- `keyword`: Search keyword
- `namespace`: Namespace filter
- `page`: Page number
- `size`: Page size
## Skill Details
```http
GET /api/v1/skills/{namespace}/{slug}
```
## Version List
```http
GET /api/v1/skills/{namespace}/{slug}/versions
```
## Version Details
```http
GET /api/v1/skills/{namespace}/{slug}/versions/{version}
```
## File List
```http
GET /api/v1/skills/{namespace}/{slug}/versions/{version}/files
```
## Download Skill
```http
GET /api/v1/skills/{namespace}/{slug}/download
GET /api/v1/skills/{namespace}/{slug}/versions/{version}/download
```
## Resolve Version
```http
GET /api/v1/skills/{namespace}/{slug}/resolve?version=...&tag=...
```
## Namespace List
```http
GET /api/v1/namespaces
```
## Namespace Details
```http
GET /api/v1/namespaces/{slug}
```
## Next Steps
- [Authenticated APIs](./authenticated) - View authenticated endpoints

View file

@ -1,4 +0,0 @@
{
"label": "Architecture",
"position": 2
}

View file

@ -1,77 +0,0 @@
---
title: Domain Model
sidebar_position: 2
description: Core domain entities and relationships
---
# Domain Model
## Core Entities
### Namespace
| Field | Type | Description |
|-------|------|-------------|
| id | bigint | Primary key |
| slug | varchar(64) | URL-friendly identifier |
| display_name | varchar(128) | Display name |
| type | enum | `GLOBAL` / `TEAM` |
| description | text | Description |
| status | enum | `ACTIVE` / `FROZEN` / `ARCHIVED` |
### NamespaceMember
| Field | Type | Description |
|-------|------|-------------|
| id | bigint | Primary key |
| namespace_id | bigint | Namespace ID |
| user_id | varchar(128) | User ID |
| role | enum | `OWNER` / `ADMIN` / `MEMBER` |
### Skill
| Field | Type | Description |
|-------|------|-------------|
| id | bigint | Primary key |
| namespace_id | bigint | Parent namespace |
| slug | varchar(128) | URL-friendly identifier |
| display_name | varchar(256) | Display name |
| summary | varchar(512) | Summary |
| owner_id | varchar(128) | Primary maintainer |
| visibility | enum | `PUBLIC` / `NAMESPACE_ONLY` / `PRIVATE` |
| status | enum | `ACTIVE` / `HIDDEN` / `ARCHIVED` |
| latest_version_id | bigint | Latest published version |
**Unique constraint**: `(namespace_id, slug)`
### SkillVersion
| Field | Type | Description |
|-------|------|-------------|
| id | bigint | Primary key |
| skill_id | bigint | Skill ID |
| version | varchar(32) | semver version |
| status | enum | `DRAFT` / `PENDING_REVIEW` / `PUBLISHED` / `REJECTED` / `YANKED` |
| manifest_json | json | File manifest |
| parsed_metadata_json | json | SKILL.md parsed result |
**Unique constraint**: `(skill_id, version)`
### SkillTag
| Field | Type | Description |
|-------|------|-------------|
| id | bigint | Primary key |
| skill_id | bigint | Skill ID |
| tag_name | varchar(64) | Tag name |
| target_version_id | bigint | Target version |
**Unique constraint**: `(skill_id, tag_name)`
## Coordinate System
Full skill address: `@{namespace_slug}/{skill_slug}`
## Next Steps
- [Security Architecture](./security) - Security design

View file

@ -1,69 +0,0 @@
---
title: System Architecture
sidebar_position: 1
description: SkillHub system architecture overview
---
# System Architecture
## Architecture Principles
- **Monolith-first**: Phase 1 uses modular monolith, no microservices
- **Dependency Inversion**: Domain layer does not depend on infrastructure
- **Replaceable Boundaries**: Search and storage both have SPI abstractions
## Module Structure
```
server/
├── skillhub-app/ # Startup, configuration assembly, Controllers
├── skillhub-domain/ # Domain models + domain services + application services
├── skillhub-auth/ # OAuth2 authentication + RBAC + authorization decisions
├── skillhub-search/ # Search SPI + PostgreSQL full-text implementation
├── skillhub-storage/ # Object storage abstraction + LocalFile/S3
└── skillhub-infra/ # JPA, utilities, configuration foundation
```
## Module Dependencies
```
app → domain, auth, search, storage, infra
infra → domain
auth → domain
search → domain
storage → (independent)
```
## Tech Stack
| Layer | Technology | Version |
|-------|------------|---------|
| Runtime | Java | 21 |
| Framework | Spring Boot | 3.2.3 |
| Database | PostgreSQL | 16.x |
| Cache/Session | Redis | 7.x |
## Deployment Architecture
```
┌──────────────┐
│ Browser / CLI│
└──────┬───────┘
┌──────────────┐
│ Web/Nginx │
└──────┬───────┘
│ /api/*
┌──────────────┐
│ Spring Boot │
└───┬────┬─────┘
│ │
▼ ▼
PostgreSQL Redis
```
## Next Steps
- [Domain Model](./domain-model) - Core entities

View file

@ -1,71 +0,0 @@
---
title: Security Architecture
sidebar_position: 3
description: Security architecture design
---
# Security Architecture
## Authentication Architecture
### OAuth2 Login
- Based on Spring Security OAuth2 Client
- Phase 1 supports GitHub
- Architecture supports extending multiple providers
### CLI Authentication
- OAuth Device Flow
- Web authorization issues CLI credentials
- Supports API Token
### Session Management
- Spring Session + Redis
- Distributed session sharing
- Supports multi-pod deployment
## Authorization Architecture
### Platform Roles
| Role | Permissions |
|------|-------------|
| `SUPER_ADMIN` | All permissions |
| `SKILL_ADMIN` | Skill governance |
| `USER_ADMIN` | User governance |
| `AUDITOR` | Audit read-only |
### Namespace Roles
| Role | Permissions |
|------|-------------|
| `OWNER` | Namespace owner |
| `ADMIN` | Review, member management |
| `MEMBER` | Publish skills |
### Visibility Rules
| Visibility | Who can access |
|------------|----------------|
| `PUBLIC` | Anyone (anonymous) |
| `NAMESPACE_ONLY` | Namespace members |
| `PRIVATE` | owner + namespace ADMIN |
## Auditing
All critical operations synchronously write to audit logs:
- Publish, download, delete
- Review approval, rejection
- Permission changes
- Configuration changes
## Rate Limiting
- Ingress layer basic rate limiting (Nginx)
- Application layer fine-grained rate limiting (Redis sliding window)
## Next Steps
- [Skill Protocol](../plugins/skill-protocol) - Skill package specification

View file

@ -1,4 +0,0 @@
{
"label": "Extensions & Integrations",
"position": 3
}

View file

@ -1,68 +0,0 @@
---
title: Skill Protocol
sidebar_position: 1
description: SKILL.md specification and skill package protocol
---
# Skill Protocol
## SKILL.md Specification
### Basic Format
```markdown
---
name: my-skill
description: When to use this skill
---
# Markdown Body
Skill instruction content...
```
### Required Fields
| Field | Description |
|-------|-------------|
| `name` | Skill identifier, kebab-case |
| `description` | Brief skill description |
### Extension Fields
| Field | Description |
|-------|-------------|
| `x-astron-category` | Category tag |
| `x-astron-runtime` | Runtime requirement |
| `x-astron-min-version` | Minimum version requirement |
## Skill Package Structure
```
my-skill/
├── SKILL.md # Main entry file (required)
├── references/ # References (optional)
├── scripts/ # Scripts (optional)
└── assets/ # Static assets (optional)
```
## File Validation
- Root directory must contain `SKILL.md`
- File type whitelist
- Single file size limit: 1MB
- Total package size limit: 10MB
- File count limit: 100
## Client Installation Directory
Install by the following priority:
1. `./.agent/skills/`
2. `~/.agent/skills/`
3. `./.claude/skills/`
4. `~/.claude/skills/`
## Next Steps
- [Storage SPI](./storage-spi) - Extend storage backend

View file

@ -1,77 +0,0 @@
---
title: Storage SPI
sidebar_position: 2
description: Storage service provider extension
---
# Storage SPI
## SPI Interface
```java
public interface ObjectStorageService {
void store(String key, InputStream content, String contentType);
InputStream retrieve(String key);
void delete(String key);
boolean exists(String key);
}
```
## Built-in Implementations
### LocalFileStorageService
Local filesystem implementation for development environment.
### S3StorageService
S3 protocol compatible implementation, supports:
- AWS S3
- MinIO
- Alibaba Cloud OSS
- Tencent Cloud COS
- Other S3-compatible storage
## Configuration
### Static Credentials (Access Key / Secret Key)
```bash
# Select storage provider
SKILLHUB_STORAGE_PROVIDER=s3
# S3 configuration
SKILLHUB_STORAGE_S3_ENDPOINT=https://s3.example.com
SKILLHUB_STORAGE_S3_BUCKET=skillhub
SKILLHUB_STORAGE_S3_ACCESS_KEY=xxx
SKILLHUB_STORAGE_S3_SECRET_KEY=xxx
```
### IAM Authentication
When deployed on AWS, you can omit the Access Key / Secret Key and let the SDK use IAM role authentication via the [Default Credentials Provider Chain](https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/credentials-chain.html):
```bash
SKILLHUB_STORAGE_PROVIDER=s3
SKILLHUB_STORAGE_S3_BUCKET=skillhub
SKILLHUB_STORAGE_S3_REGION=us-east-1
# Leave ACCESS_KEY / SECRET_KEY blank to use IAM authentication
SKILLHUB_STORAGE_S3_ACCESS_KEY=
SKILLHUB_STORAGE_S3_SECRET_KEY=
```
Supported IAM authentication methods (in SDK priority order):
- Environment variables (`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`)
- Java system properties
- Web Identity Token (EKS IRSA)
- AWS config file (`~/.aws/credentials`)
- EC2 Instance Profile
- ECS Task Role
## Custom Implementation
Implement `ObjectStorageService` interface and register as Spring Bean.
## Next Steps
- [FAQ](../../reference/faq) - FAQ

View file

@ -1,8 +0,0 @@
{
"label": "Reference",
"position": 5,
"link": {
"type": "generated-index",
"description": "FAQ, troubleshooting, and more resources"
}
}

View file

@ -1,20 +0,0 @@
---
title: Changelog
sidebar_position: 3
description: Version change history
---
# Changelog
## [Unreleased]
### Added
- Initial version release
- Skill publishing and management
- Namespace and RBAC
- Full-text search
- ClawHub CLI compatibility layer
## Next Steps
- [Roadmap](./roadmap) - Future plans

View file

@ -1,59 +0,0 @@
---
title: FAQ
sidebar_position: 1
description: Frequently asked questions
---
# FAQ
## Deployment Related
### How to change default port?
Modify port configuration in `.env.release`.
### How to configure HTTPS?
Recommended to use reverse proxy (Nginx/Ingress) for TLS termination.
### How to backup database?
Use PostgreSQL standard backup tools (pg_dump).
## Usage Related
### How to reset admin password?
If you forgot admin password, you can reconfigure bootstrap admin via environment variables or directly operate the database.
### Skill package upload failed?
Check:
1. Whether file size exceeds limit
2. Whether file type is in whitelist
3. Whether required SKILL.md is included
4. Whether SKILL.md frontmatter format is correct
### CLI install reports `namespace not found`?
Usually the CLI is not pointing at your own SkillHub instance, or the namespace format is wrong:
1. **Set the registry and log in**: point at your instance via an environment variable or `--registry`, e.g. `clawhub --registry https://skillhub.your-company.com install <skill>`. Logging in requires an API Token generated in the web console first.
2. **Namespace slug format**: skills in the global namespace use the bare name (e.g. `my-skill`); team namespaces use the `team--skill` form (`@team/skill``team--skill`).
3. The most reliable way is to click the **Install** button on the skill's page in the SkillHub web UI and copy the command, which already includes the correct registry and namespace.
> SkillHub ships both a `clawhub` and a `skillhub` CLI (see their respective READMEs); installing a skill through an OpenClaw conversation calls the CLI under the hood as well.
## Development Related
### How to extend OAuth Provider?
Refer to existing GitHub implementation, add new OAuth Provider configuration.
### How to customize search implementation?
Implement `SearchIndexService` and `SearchQueryService` interfaces.
## Next Steps
- [Troubleshooting](./troubleshooting) - Problem diagnosis

View file

@ -1,45 +0,0 @@
---
title: Roadmap
sidebar_position: 4
description: Future development roadmap
---
# Roadmap
## Phase 1: Foundation ✅
- GitHub OAuth login
- Session management
- RBAC permission system
## Phase 2: Skill Core ✅
- Namespace management
- Skill publishing and download
- Version management
- PostgreSQL full-text search
## Phase 3: Review and CLI
- Review workflow
- Skill promotion to global
- CLI tool
- Favorites and ratings
## Phase 4: Operations and Polish
- Audit logs
- Admin dashboard
- Observability
- Deployment optimization
## Phase 5: Advanced Features
- Comments and reports
- Automatic security scanning
- Vector search
- Webhook notifications
## Next Steps
- [Quick Start](../getting-started/quick-start) - Get started

View file

@ -1,74 +0,0 @@
---
title: Troubleshooting
sidebar_position: 2
description: Common problem diagnosis and solutions
---
# Troubleshooting
## Service Cannot Start
### Checklist
1. Check container status: `docker compose ps`
2. View service logs: `docker compose logs <service>`
3. Verify environment variables: Check `.env.release` configuration
4. Check port occupancy: `netstat -tlnp`
### Common Causes
- Port occupied
- Database connection failed
- Redis connection failed
- Environment variables missing
### PostgreSQL container fails to start with `operation not permitted` (cannot write `postmaster.pid` / `pg_wal`)
SkillHub's default Compose / `runtime.sh` deployment uses a Docker named volume (`postgres_data`), so you normally do not need to manage host directory permissions manually. This error is more common after changing PostgreSQL storage to a host bind mount, for example `/data/skillhub/postgres:/var/lib/postgresql/data`.
Recommended checks:
1. Prefer switching back to a Docker named volume, or use the official `runtime.sh` deployment script to avoid permission gaps from hand-written compose files.
2. If you must use a bind mount, first check the `postgres` UID/GID in the image you run: `docker run --rm postgres:16-alpine id postgres`. Then change the data directory owner to the actual UID/GID, for example `chown -R <uid>:<gid> <data-dir>`. Do not assume every environment is `999:999`.
3. On RHEL/CentOS, check SELinux. If AppArmor, rootless Docker, NFS/CIFS/NAS, or another restricted filesystem is involved, also verify that PostgreSQL can write, lock files, and change permissions as required.
4. Avoid putting PostgreSQL `PGDATA` on network filesystems that do not provide full POSIX permission semantics. For production, prefer local disks, Docker named volumes, block storage, or an external PostgreSQL service.
## Upload Failed
### Skill Package Upload Failed
1. Check file size
2. Check file type
3. Check SKILL.md format
4. View server logs
## Authentication Issues
### Cannot Login
1. Check OAuth configuration
2. Check callback URL configuration
3. Check `SKILLHUB_PUBLIC_BASE_URL` configuration
## Performance Issues
### Slow Search
1. Check PostgreSQL full-text index
2. Consider upgrading to Elasticsearch (future version)
### Slow Download
1. Check object storage configuration
2. Check network bandwidth
## Get Help
If above solutions cannot resolve the issue:
1. View logs
2. Submit Issue
3. Contact technical support
## Next Steps
- [Changelog](./changelog) - Version history

View file

@ -1,101 +0,0 @@
---
title: SkillHub Documentation
sidebar_position: 1
description: Enterprise-grade AI Skill Registry - Secure, controllable skill publishing, discovery, and management platform
---
# SkillHub
<section className="hero-section">
<div className="container">
<h1 className="hero-section__title">🏢 Enterprise-grade AI Skill Registry</h1>
<p className="hero-section__tagline">
Secure, controllable skill publishing, discovery, and management platform with full enterprise data sovereignty
</p>
<div className="hero-section__cta">
<a href="/getting-started/quick-start" className="btn-primary">Deploy Now</a>
<a href="/getting-started/overview" className="btn-secondary">Learn More</a>
</div>
</div>
</section>
---
## Enterprise Value
<div className="row" style={{ marginTop: '40px', marginBottom: '40px' }}>
<div className="col col--3">
<div className="enterprise-value-card">
<div className="enterprise-value-card__icon">🔐</div>
<h3 className="enterprise-value-card__title">Data Sovereignty</h3>
<p className="enterprise-value-card__description">
Self-hosted deployment, data stays within your network; private S3/MinIO storage; complete audit trail
</p>
</div>
</div>
<div className="col col--3">
<div className="enterprise-value-card">
<div className="enterprise-value-card__icon">🏢</div>
<h3 className="enterprise-value-card__title">Complete Governance</h3>
<p className="enterprise-value-card__description">
Namespace isolation; two-tier review workflow; fine-grained RBAC access control
</p>
</div>
</div>
<div className="col col--3">
<div className="enterprise-value-card">
<div className="enterprise-value-card__icon">🔌</div>
<h3 className="enterprise-value-card__title">Strong Integration</h3>
<p className="enterprise-value-card__description">
ClawHub CLI compatible; standard REST API; OAuth2 enterprise SSO integration
</p>
</div>
</div>
<div className="col col--3">
<div className="enterprise-value-card">
<div className="enterprise-value-card__icon">📊</div>
<h3 className="enterprise-value-card__title">Full Observability</h3>
<p className="enterprise-value-card__description">
Complete audit logs; Prometheus metrics; operation tracking and traceability
</p>
</div>
</div>
</div>
---
## Core Features
<div style={{ textAlign: 'center', marginTop: '40px' }}>
<div className="feature-tags">
<span className="feature-tag">Version Control</span>
<span className="feature-tag">Full-text Search</span>
<span className="feature-tag">Namespaces</span>
<span className="feature-tag">Review Workflow</span>
<span className="feature-tag">Semantic Versioning</span>
<span className="feature-tag">Multi-dimensional Filtering</span>
<span className="feature-tag">RBAC Permissions</span>
<span className="feature-tag">Audit Logs</span>
</div>
</div>
---
## Quick Start
<div style={{ textAlign: 'center', marginTop: '40px' }}>
<div className="quick-start-code">
<code>$ curl -fsSL https://raw.githubusercontent.com/iflytek/skillhub/main/scripts/runtime.sh | sh -s -- up</code>
</div>
<p style={{ marginTop: '16px', color: 'var(--ifm-font-color-secondary)' }}>
Visit <a href="http://localhost:3000">http://localhost:3000</a> to get started
</p>
</div>
---
## Next Steps
- [Quick Start](./getting-started/quick-start) - Deploy SkillHub with one command
- [Overview](./getting-started/overview) - Learn more about product features
- [Deployment Guide](./administration/deployment/single-machine) - Production deployment

View file

@ -1,47 +0,0 @@
{
"name": "skillhub-docs",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "^3.9.2",
"@docusaurus/preset-classic": "^3.9.2",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.9.2",
"@docusaurus/tsconfig": "^3.9.2",
"@docusaurus/types": "^3.9.2",
"typescript": "~5.2.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
},
"engines": {
"node": ">=18.0"
}
}

Some files were not shown because too many files have changed in this diff Show more