docs: add VitePress bilingual documentation site
- Add VitePress-based documentation with Chinese (root) and English (/en/) locales - Include 6 feature guides: skill-publish, skill-discovery, namespace, review, scanner, social - Add quickstart, introduction, and FAQ pages - Include AI-generated diagrams and screenshots - Add GitHub Pages deployment workflow - Add Makefile targets: docs-dev, docs-build, docs-preview
54
.github/workflows/deploy-docs.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
name: Deploy Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'docs/claude/**'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
cache-dependency-path: docs/claude/package-lock.json
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
- name: Install dependencies
|
||||
run: cd docs/claude && npm ci
|
||||
- name: Build with VitePress
|
||||
run: cd docs/claude && npm run build
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: docs/claude/.vitepress/dist
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
11
Makefile
|
|
@ -1,4 +1,4 @@
|
|||
.PHONY: help dev dev-all dev-down dev-all-down dev-all-reset dev-logs dev-status build test check clean web-deps web-install web-install-ci dev-server dev-server-restart dev-web build-backend test-backend build-frontend test-frontend test-e2e-frontend test-e2e-smoke-frontend build-web test-web typecheck-web lint-web generate-api db-reset namespace-smoke validate-release-config staging staging-down staging-logs pr parallel-init parallel-sync parallel-up parallel-down
|
||||
.PHONY: help dev dev-all dev-down dev-all-down dev-all-reset dev-logs dev-status build test check clean web-deps web-install web-install-ci dev-server dev-server-restart dev-web build-backend test-backend build-frontend test-frontend test-e2e-frontend test-e2e-smoke-frontend build-web test-web typecheck-web lint-web generate-api db-reset namespace-smoke validate-release-config staging staging-down staging-logs pr parallel-init parallel-sync parallel-up parallel-down docs-dev docs-build docs-preview
|
||||
|
||||
DEV_DIR := .dev
|
||||
DEV_SERVER_PID := $(DEV_DIR)/server.pid
|
||||
|
|
@ -347,3 +347,12 @@ parallel-up: ## 在 integration worktree 合并并启动联调环境(自动识
|
|||
|
||||
parallel-down: ## 在 integration worktree 停止联调环境
|
||||
./scripts/parallel-down.sh
|
||||
|
||||
docs-dev: ## 启动文档开发服务器
|
||||
cd docs/skillhub && npm run dev
|
||||
|
||||
docs-build: ## 构建文档站点
|
||||
cd docs/skillhub && npm run build
|
||||
|
||||
docs-preview: ## 预览构建后的文档站点
|
||||
cd docs/skillhub && npm run preview
|
||||
|
|
|
|||
3
docs/claude/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
.vitepress/cache/
|
||||
.vitepress/dist/
|
||||
node_modules/
|
||||
125
docs/claude/.vitepress/config.ts
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
import { defineConfig } from 'vitepress'
|
||||
|
||||
export default defineConfig({
|
||||
title: 'SkillHub',
|
||||
description: 'Enterprise Self-hosted Agent Skill Registry',
|
||||
base: '/skillhub/',
|
||||
ignoreDeadLinks: [/^http:\/\/localhost/],
|
||||
|
||||
head: [],
|
||||
|
||||
// Define root locale for redirect
|
||||
locales: {
|
||||
root: {
|
||||
label: '中文',
|
||||
lang: 'zh-CN',
|
||||
description: '企业级自托管 Agent Skill 注册中心',
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{ text: '首页', link: '/' },
|
||||
{ text: '快速开始', link: '/quickstart' },
|
||||
{ text: '功能指南', link: '/guide/skill-publish' },
|
||||
{ text: 'FAQ', link: '/faq' },
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
text: '开始使用',
|
||||
items: [
|
||||
{ text: '项目简介', link: '/introduction' },
|
||||
{ text: '快速开始', link: '/quickstart' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: '核心功能',
|
||||
items: [
|
||||
{ text: 'Skill 发布与版本管理', link: '/guide/skill-publish' },
|
||||
{ text: 'Skill 搜索与发现', link: '/guide/skill-discovery' },
|
||||
{ text: '命名空间与团队管理', link: '/guide/namespace' },
|
||||
{ text: '审核与治理', link: '/guide/review' },
|
||||
{ text: '安全扫描', link: '/guide/scanner' },
|
||||
{ text: '用户交互与社交', link: '/guide/social' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: '更多',
|
||||
items: [
|
||||
{ text: '常见问题', link: '/faq' },
|
||||
],
|
||||
},
|
||||
],
|
||||
outline: { label: '页面导航', level: [2, 3] },
|
||||
lastUpdated: { text: '最后更新' },
|
||||
docFooter: { prev: '上一页', next: '下一页' },
|
||||
footer: { message: '版权所有 © 科大讯飞股份有限公司' },
|
||||
},
|
||||
},
|
||||
en: {
|
||||
label: 'English',
|
||||
lang: 'en',
|
||||
link: '/en/',
|
||||
description: 'Enterprise Self-hosted Agent Skill Registry',
|
||||
themeConfig: {
|
||||
nav: [
|
||||
{ text: 'Home', link: '/en/' },
|
||||
{ text: 'Quick Start', link: '/en/quickstart' },
|
||||
{ text: 'Guide', link: '/en/guide/skill-publish' },
|
||||
{ text: 'FAQ', link: '/en/faq' },
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
text: 'Getting Started',
|
||||
items: [
|
||||
{ text: 'Introduction', link: '/en/introduction' },
|
||||
{ text: 'Quick Start', link: '/en/quickstart' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Core Features',
|
||||
items: [
|
||||
{ text: 'Skill Publishing & Versioning', link: '/en/guide/skill-publish' },
|
||||
{ text: 'Skill Search & Discovery', link: '/en/guide/skill-discovery' },
|
||||
{ text: 'Namespace & Team Management', link: '/en/guide/namespace' },
|
||||
{ text: 'Review & Governance', link: '/en/guide/review' },
|
||||
{ text: 'Security Scanning', link: '/en/guide/scanner' },
|
||||
{ text: 'Social & Interaction', link: '/en/guide/social' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'More',
|
||||
items: [
|
||||
{ text: 'FAQ', link: '/en/faq' },
|
||||
],
|
||||
},
|
||||
],
|
||||
outline: { label: 'On this page', level: [2, 3] },
|
||||
lastUpdated: { text: 'Last updated' },
|
||||
docFooter: { prev: 'Previous', next: 'Next' },
|
||||
footer: { message: 'Copyright © iFlytek Co., Ltd.' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
themeConfig: {
|
||||
socialLinks: [
|
||||
{ icon: 'github', link: 'https://github.com/iflytek/skillhub' },
|
||||
],
|
||||
|
||||
search: {
|
||||
provider: 'local',
|
||||
options: {
|
||||
locales: {
|
||||
root: {
|
||||
translations: {
|
||||
button: { buttonText: '搜索文档' },
|
||||
modal: {
|
||||
noResultsText: '未找到结果',
|
||||
resetButtonTitle: '清除搜索',
|
||||
footer: { selectText: '选择', navigateText: '切换' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
133
docs/claude/en/faq.md
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
# FAQ
|
||||
|
||||
## Q: What is the difference between SkillHub and ClawHub?
|
||||
|
||||
A: SkillHub is an enterprise-grade, self-hosted solution that provides stronger access control, review mechanisms, and governance capabilities. ClawHub is a public registry, similar to npm.
|
||||
|
||||
**Key Differences**:
|
||||
|
||||
| Feature | SkillHub | ClawHub |
|
||||
|------|----------|---------|
|
||||
| **Deployment** | Self-hosted | Public cloud |
|
||||
| **Access Control** | Namespace RBAC | Basic permissions |
|
||||
| **Review Mechanism** | Multi-level review | None |
|
||||
| **Security Scanning** | Built-in Skill Scanner | None |
|
||||
| **Data Sovereignty** | Fully self-managed | Hosted in the cloud |
|
||||
| **Use Case** | Enterprise internal | Public sharing |
|
||||
|
||||
## Q: How do I back up data?
|
||||
|
||||
A: SkillHub stores data in PostgreSQL and object storage. Regularly backing up these two components is sufficient.
|
||||
|
||||
**Back up PostgreSQL**:
|
||||
```bash
|
||||
pg_dump -h localhost -U postgres skillhub > backup.sql
|
||||
```
|
||||
|
||||
**Back up Object Storage**:
|
||||
- If using MinIO, back up the MinIO data directory
|
||||
- If using S3, use the AWS CLI or an S3 backup tool
|
||||
|
||||
## Q: What authentication methods are supported?
|
||||
|
||||
A: SkillHub supports multiple authentication methods:
|
||||
|
||||
- **OAuth2**: GitHub, Google, GitLab, etc.
|
||||
- **Local Accounts**: Username/password login (built-in administrator: admin / ChangeMe!2026)
|
||||
- **Enterprise SSO**: Integrates with LDAP, SAML, etc.
|
||||
|
||||
Refer to the authentication configuration section in the project README for setup instructions.
|
||||
|
||||
## Q: Is there a size limit for skill packages?
|
||||
|
||||
A: The default limit is **100MB**. This can be adjusted via configuration:
|
||||
|
||||
```yaml
|
||||
# application.yml
|
||||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
```
|
||||
|
||||
## Q: How do I use the CLI tool to manage skill packages?
|
||||
|
||||
A: SkillHub is compatible with the OpenClaw CLI. Use the `npx clawhub` command to interact with it:
|
||||
|
||||
```bash
|
||||
# Configure the registry URL
|
||||
export CLAWHUB_REGISTRY=http://your-skillhub-host:8080
|
||||
|
||||
# Search for skill packages
|
||||
npx clawhub search email
|
||||
|
||||
# Install a skill package
|
||||
npx clawhub install my-skill
|
||||
|
||||
# Publish a skill package
|
||||
npx clawhub publish ./my-skill
|
||||
```
|
||||
|
||||
## Q: How do I configure HTTPS?
|
||||
|
||||
A: For production environments, it is recommended to use Nginx or Traefik as a reverse proxy with SSL certificates.
|
||||
|
||||
**Nginx Configuration Example**:
|
||||
```nginx
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name skillhub.example.com;
|
||||
|
||||
ssl_certificate /path/to/cert.pem;
|
||||
ssl_certificate_key /path/to/key.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:3000;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://localhost:8080;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Q: How do I monitor SkillHub?
|
||||
|
||||
A: SkillHub provides several monitoring options:
|
||||
|
||||
- **Health Check**: `GET /actuator/health`
|
||||
- **Scanner Health Check**: `GET http://localhost:8000/health`
|
||||
- **Metrics**: `GET /actuator/metrics` (Prometheus format)
|
||||
- **Audit Logs**: All critical operations are recorded in the audit log
|
||||
- **Application Logs**: Collect logs using ELK or Loki
|
||||
|
||||
## Q: Does it support multi-tenancy?
|
||||
|
||||
A: SkillHub achieves logical multi-tenant isolation through namespaces. Each namespace acts as a tenant with its own members, permissions, and skill packages.
|
||||
|
||||
For physical isolation, you can deploy a separate SkillHub instance for each tenant.
|
||||
|
||||
## Q: How do I upgrade SkillHub?
|
||||
|
||||
A: Use the curl command to upgrade:
|
||||
|
||||
```bash
|
||||
# Pull the latest images and restart
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- pull
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- down
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up
|
||||
|
||||
# Or upgrade to a specific version
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up --version v0.2.0
|
||||
```
|
||||
|
||||
> **Note**: It is recommended to back up the database and object storage before upgrading. Database migrations are handled automatically by Flyway.
|
||||
|
||||
## Q: What should I do if I encounter issues?
|
||||
|
||||
A: You can get help through the following channels:
|
||||
|
||||
- **GitHub Issues**: https://github.com/iflytek/skillhub/issues
|
||||
- **Documentation**: Refer to the project README.md
|
||||
- **Community Discussions**: https://github.com/iflytek/skillhub/discussions
|
||||
178
docs/claude/en/guide/namespace.md
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
# Namespace & Team Management
|
||||
|
||||
## Overview
|
||||
|
||||
Namespaces are the core organizational unit in SkillHub. Each namespace represents a team or project with its own members, permissions, and skill packages.
|
||||
|
||||

|
||||
|
||||
**Purpose of Namespaces**:
|
||||
|
||||
- **Isolation**: Skill packages from different teams don't interfere with each other
|
||||
- **Permissions**: Role-based access control (RBAC)
|
||||
- **Collaboration**: Team members can jointly manage skill packages
|
||||
- **Governance**: Administrators can review, archive, and freeze skill packages
|
||||
|
||||
**Role System**:
|
||||
|
||||
| Role | Permissions |
|
||||
|------|-------------|
|
||||
| **Owner** | Full control, including deleting the namespace and managing all members |
|
||||
| **Admin** | Manage members, review skill packages, modify settings |
|
||||
| **Member** | Publish skill packages, view private skill packages |
|
||||
|
||||
**Namespace States**:
|
||||
|
||||
- **Active**: Normal operation
|
||||
- **Frozen**: Cannot publish new skill packages
|
||||
- **Archived**: Hidden from search results
|
||||
|
||||
## Use Cases
|
||||
|
||||
**Case 1: Create a Team Namespace**
|
||||
|
||||
A team lead creates a new namespace to manage the team's skill packages.
|
||||
|
||||

|
||||
|
||||
**Case 2: Add Team Members**
|
||||
|
||||
An administrator invites new members to join the namespace and assigns appropriate roles.
|
||||
|
||||

|
||||
|
||||
**Case 3: Permission Management**
|
||||
|
||||
Adjust member roles to control who can publish, review, and manage skill packages.
|
||||
|
||||
**Case 4: Namespace Freeze**
|
||||
|
||||
Discover a security issue in the namespace and temporarily freeze all publish operations.
|
||||
|
||||
## Step-by-Step Guide
|
||||
|
||||
**Create a Namespace**:
|
||||
|
||||
1. Navigate to `/dashboard/namespaces`
|
||||
2. Click "Create Namespace"
|
||||
3. Fill in the information:
|
||||
- Name: Team name (e.g., "iFlytek AI Team")
|
||||
- Slug: URL identifier (e.g., "iflytek")
|
||||
- Description: Brief description of the team's responsibilities and skill package scope
|
||||
|
||||

|
||||
|
||||
4. Submit to create; you are automatically set as the Owner
|
||||
|
||||
**Add Members**:
|
||||
|
||||
1. Go to the namespace detail page
|
||||
2. Click the "Members" tab
|
||||
3. Click "Add Member"
|
||||
4. Search for users (supports searching by username, email)
|
||||
5. Select a role (Owner / Admin / Member)
|
||||
6. Confirm to add
|
||||
|
||||
**Manage Permissions**:
|
||||
|
||||
1. Find the target user in the member list
|
||||
2. Click "Change Role"
|
||||
3. Select a new role and confirm
|
||||
4. Permission changes are recorded in the audit log
|
||||
|
||||
**Freeze a Namespace**:
|
||||
|
||||
1. Go to namespace settings
|
||||
2. Click "Freeze Namespace"
|
||||
3. Provide a reason for freezing (optional)
|
||||
4. Confirm to freeze
|
||||
|
||||
> After freezing, all skill packages in the namespace cannot publish new versions, but existing versions remain downloadable.
|
||||
|
||||
## API Reference
|
||||
|
||||
**Create a Namespace**:
|
||||
```bash
|
||||
POST /api/v1/namespaces
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "iFlytek AI Team",
|
||||
"slug": "iflytek",
|
||||
"description": "iFlytek's AI agent skills"
|
||||
}
|
||||
```
|
||||
|
||||
**Parameter Reference**:
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| name | string | Namespace name (required, 2-50 characters) |
|
||||
| slug | string | URL identifier (required, unique, 2-64 characters, lowercase letters, numbers, hyphens only) |
|
||||
| description | string | Description (optional, max 500 characters) |
|
||||
|
||||
**Get Namespace Details**:
|
||||
```bash
|
||||
GET /api/v1/namespaces/{slug}
|
||||
```
|
||||
|
||||
**Update a Namespace**:
|
||||
```bash
|
||||
PUT /api/v1/namespaces/{slug}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "iFlytek AI Team (Updated)",
|
||||
"description": "Updated description"
|
||||
}
|
||||
```
|
||||
|
||||
**Add a Member**:
|
||||
```bash
|
||||
POST /api/v1/namespaces/{slug}/members
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"userId": "user-123",
|
||||
"role": "MEMBER"
|
||||
}
|
||||
```
|
||||
|
||||
**Update Member Role**:
|
||||
```bash
|
||||
PUT /api/v1/namespaces/{slug}/members/{userId}/role
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"role": "ADMIN"
|
||||
}
|
||||
```
|
||||
|
||||
**Remove a Member**:
|
||||
```bash
|
||||
DELETE /api/v1/namespaces/{slug}/members/{userId}
|
||||
```
|
||||
|
||||
**Freeze a Namespace**:
|
||||
```bash
|
||||
POST /api/v1/namespaces/{slug}/freeze
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"reason": "Security investigation"
|
||||
}
|
||||
```
|
||||
|
||||
**Unfreeze a Namespace**:
|
||||
```bash
|
||||
POST /api/v1/namespaces/{slug}/unfreeze
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
> **Slug Uniqueness**: Namespace slugs must be globally unique and cannot be changed after creation. Use a short identifier for your team or project.
|
||||
|
||||
- **Owner Requirement**: Each namespace must have at least one Owner; the last Owner cannot be removed
|
||||
- **Role Inheritance**: Namespace members automatically have access to all skill packages in that namespace
|
||||
- **Freeze Mechanism**: Administrators can freeze a namespace; no new skill packages can be published while frozen
|
||||
- **Archive Mechanism**: Archived namespaces are hidden from search results, but existing skill packages remain accessible
|
||||
- **Audit Logs**: All member changes and permission adjustments are recorded in the audit log
|
||||
186
docs/claude/en/guide/review.md
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
# Review & Governance
|
||||
|
||||
## Overview
|
||||
|
||||
SkillHub provides a complete review workflow to ensure that skill packages published to the registry comply with team standards.
|
||||
|
||||
The review mechanism operates on two levels:
|
||||
- **Namespace Review**: Team administrators review skill packages within their namespace
|
||||
- **Platform Review**: Platform administrators review skill packages promoted to the global scope
|
||||
|
||||

|
||||
|
||||
**Review Process**:
|
||||
|
||||
1. A developer publishes a skill package -> it enters the "Pending Review" state
|
||||
2. An administrator receives a notification -> reviews the skill package details
|
||||
3. The administrator makes a decision -> approve or reject
|
||||
4. Upon approval -> the skill package is officially published
|
||||
5. Upon rejection -> the developer receives feedback and can revise and resubmit
|
||||
|
||||
**Review Statuses**:
|
||||
|
||||
| Status | Description |
|
||||
|------|------|
|
||||
| **PENDING** | Awaiting review |
|
||||
| **APPROVED** | Approved |
|
||||
| **REJECTED** | Rejected |
|
||||
| **WITHDRAWN** | Withdrawn |
|
||||
|
||||
**Governance Features**:
|
||||
|
||||
- **Review Workflow**: Multi-level review, batch review
|
||||
- **Reporting System**: Users can report inappropriate skill packages
|
||||
- **Promotion Management**: Promote namespace skill packages to the global scope
|
||||
- **Audit Logs**: All governance actions are recorded
|
||||
|
||||
## Use Cases
|
||||
|
||||
**Case 1: Namespace Administrator Review**
|
||||
|
||||
A team administrator reviews skill packages submitted by team members to ensure compliance with team standards.
|
||||
|
||||

|
||||
|
||||
**Case 2: Platform Administrator Reviews Promotions**
|
||||
|
||||
A platform administrator reviews skill packages being promoted from a namespace to the global scope.
|
||||
|
||||
**Case 3: Report Handling**
|
||||
|
||||
A user reports an inappropriate skill package, and an administrator investigates and takes action.
|
||||
|
||||
**Case 4: Batch Review**
|
||||
|
||||
An administrator batch-approves multiple skill packages that meet the standards.
|
||||
|
||||
## Step-by-Step Guide
|
||||
|
||||
**Submitting for Review**:
|
||||
|
||||
1. When a skill package is published, the system automatically creates a review task
|
||||
2. The developer can check the review status under "My Submissions"
|
||||
3. Wait for an administrator to review
|
||||
|
||||
**Reviewing Skill Packages**:
|
||||
|
||||
1. Navigate to `/dashboard/reviews`
|
||||
2. View the pending review list
|
||||
3. Click on a skill package to view details:
|
||||
- Review metadata (name, description, version)
|
||||
- Browse the file list
|
||||
- View file contents online
|
||||
- Download the full package for local testing
|
||||
|
||||

|
||||
|
||||
4. Make a decision:
|
||||
- **Approve**: The skill package is officially published and the developer is notified
|
||||
- **Reject**: Provide a rejection reason; the developer can revise and resubmit
|
||||
|
||||
5. Add review comments (optional)
|
||||
|
||||
**Withdrawing a Review**:
|
||||
|
||||
If a developer discovers an issue, they can withdraw the submission before it is approved:
|
||||
|
||||
1. Navigate to "My Submissions"
|
||||
2. Find the skill package pending review
|
||||
3. Click "Withdraw"
|
||||
4. Confirm the withdrawal
|
||||
|
||||
**Handling Reports**:
|
||||
|
||||
1. Navigate to `/dashboard/reports`
|
||||
2. View the report list
|
||||
3. Investigate the reported content
|
||||
4. Take action (archive the skill package, warn the user, etc.)
|
||||
|
||||
## API Reference
|
||||
|
||||
**Submit for Review**:
|
||||
```bash
|
||||
POST /api/v1/reviews
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"skillVersionId": "version-123"
|
||||
}
|
||||
```
|
||||
|
||||
**Approve a Review**:
|
||||
```bash
|
||||
POST /api/v1/reviews/{id}/approve
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"comment": "Looks good! Approved."
|
||||
}
|
||||
```
|
||||
|
||||
**Reject a Review**:
|
||||
```bash
|
||||
POST /api/v1/reviews/{id}/reject
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"comment": "Please fix the documentation and add more examples."
|
||||
}
|
||||
```
|
||||
|
||||
**Parameter Reference**:
|
||||
| Parameter | Type | Description |
|
||||
|------|------|------|
|
||||
| id | string | Review task ID (path parameter) |
|
||||
| comment | string | Review comment (optional, max 1000 characters) |
|
||||
|
||||
**List Pending Reviews**:
|
||||
```bash
|
||||
GET /api/v1/reviews/pending?namespaceId=ns-123&page=0&size=20
|
||||
```
|
||||
|
||||
**List My Submissions**:
|
||||
```bash
|
||||
GET /api/v1/reviews/my-submissions?page=0&size=20
|
||||
```
|
||||
|
||||
**Get Review Details**:
|
||||
```bash
|
||||
GET /api/v1/reviews/{id}
|
||||
```
|
||||
|
||||
**Get Skill Package Details Under Review**:
|
||||
```bash
|
||||
GET /api/v1/reviews/{id}/skill-detail
|
||||
```
|
||||
|
||||
**Download Review Package**:
|
||||
```bash
|
||||
GET /api/v1/reviews/{id}/download
|
||||
```
|
||||
|
||||
**Withdraw a Review**:
|
||||
```bash
|
||||
POST /api/v1/reviews/{id}/withdraw
|
||||
```
|
||||
|
||||
**Report a Skill Package**:
|
||||
```bash
|
||||
POST /api/v1/skills/{namespace}/{slug}/reports
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"reason": "INAPPROPRIATE_CONTENT",
|
||||
"details": "This skill contains malicious code"
|
||||
}
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
> **Review Permissions**: Only namespace Admins and Owners can review skill packages within their namespace. Platform administrators can review all skill packages.
|
||||
|
||||
- **Review Turnaround**: It is recommended to complete reviews within 24 hours to avoid blocking developers
|
||||
- **Review Records**: All review actions are recorded in the audit log
|
||||
- **Batch Review**: Administrators can batch-approve multiple skill packages
|
||||
- **Review Comments**: When rejecting, it is recommended to provide detailed improvement suggestions
|
||||
- **Withdrawal Restrictions**: Only skill packages in the pending review state can be withdrawn
|
||||
99
docs/claude/en/guide/scanner.md
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
# Skill Scanner Security Scanning
|
||||
|
||||
## Overview
|
||||
|
||||
SkillHub includes a built-in **Skill Scanner** security scanning service that automatically detects potential security risks when skill packages are published. This serves as a critical line of defense for ensuring the security of skill packages within an enterprise.
|
||||
|
||||
Every skill package undergoes a security scan after publication. The scan results inform review decisions and help administrators quickly assess whether a skill package is safe and reliable.
|
||||
|
||||
**Key Features**:
|
||||
|
||||
- **Automatic Triggering**: Security scanning is triggered automatically after a skill package is published, requiring no manual intervention
|
||||
- **Multi-Engine Analysis**: Supports multiple analysis engines including behavioral analysis, LLM analysis, and metadata analysis
|
||||
- **Configurable Policies**: Includes a built-in `balanced` policy preset with support for custom scanning policies
|
||||
- **Severity Threshold**: Configurable severity level at which publication is automatically blocked
|
||||
- **Scan Reports**: Detailed scan results are displayed on the skill package detail page
|
||||
|
||||
**Analysis Engines**:
|
||||
|
||||
| Engine | Description | Default Status |
|
||||
|------|------|----------|
|
||||
| **Metadata Analysis** | Checks package structure, file types, sizes, etc. | Enabled |
|
||||
| **Behavioral Analysis** | Analyzes code behavior patterns to detect malicious operations | Optional |
|
||||
| **LLM Analysis** | Uses large language models to analyze code security | Optional |
|
||||
| **AI Defense** | Cisco AI Defense integration | Optional |
|
||||
| **VirusTotal** | VirusTotal virus scanning | Optional |
|
||||
|
||||
## Use Cases
|
||||
|
||||
**Case 1: Automatic Scanning on Publish**
|
||||
|
||||
After a developer publishes a skill package, the Scanner automatically runs a scan in the background with no additional steps required.
|
||||
|
||||
**Case 2: Administrator Reviews Scan Report**
|
||||
|
||||
When reviewing a skill package, an administrator can view the scan report to help make review decisions.
|
||||
|
||||
**Case 3: Custom Scanning Policies**
|
||||
|
||||
Enterprise administrators can configure scanning policies and severity thresholds based on their security requirements.
|
||||
|
||||
## Workflow
|
||||
|
||||
```
|
||||
Developer publishes a skill package
|
||||
|
|
||||
SkillHub backend receives the upload
|
||||
|
|
||||
Security scan is triggered (via Redis Stream)
|
||||
|
|
||||
Skill Scanner performs multi-engine analysis
|
||||
|
|
||||
Scan results are written to the database
|
||||
|
|
||||
Skill package detail page displays the scan report
|
||||
|
|
||||
Administrator reviews with scan results in consideration
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Basic Configuration
|
||||
|
||||
Configure via `.env` file or environment variables:
|
||||
|
||||
| Environment Variable | Description | Default |
|
||||
|----------|------|--------|
|
||||
| `SKILLHUB_SECURITY_SCANNER_ENABLED` | Enable security scanning | `true` |
|
||||
| `SKILLHUB_SECURITY_SCANNER_URL` | Scanner service URL | `http://localhost:8000` |
|
||||
| `SKILLHUB_SECURITY_SCANNER_MODE` | Scan mode (local / upload) | `local` |
|
||||
| `SKILLHUB_SCANNER_POLICY_PRESET` | Policy preset | `balanced` |
|
||||
| `SKILLHUB_SCANNER_FAIL_ON_SEVERITY` | Severity level for automatic blocking | `high` |
|
||||
|
||||
### LLM Analysis Configuration (Optional)
|
||||
|
||||
Enabling the LLM analysis engine can improve the accuracy of security detection:
|
||||
|
||||
| Environment Variable | Description | Default |
|
||||
|----------|------|--------|
|
||||
| `SKILLHUB_SCANNER_USE_LLM` | Enable LLM analysis | `false` |
|
||||
| `SKILLHUB_SCANNER_LLM_PROVIDER` | LLM provider (anthropic / openai / azure) | `anthropic` |
|
||||
| `SKILL_SCANNER_LLM_API_KEY` | LLM API key | - |
|
||||
|
||||
### Deployment Notes
|
||||
|
||||
When using the one-click deployment, the Scanner service is enabled by default. If security scanning is not needed, it can be disabled with the `--no-scanner` flag:
|
||||
|
||||
```bash
|
||||
# Disable Scanner during deployment
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up --no-scanner
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
> **Scanning Does Not Block Publishing**: Security scanning runs asynchronously and does not block the skill package upload process. Scan results are updated on the skill package detail page once completed.
|
||||
|
||||
- **Scan Duration**: Depending on the skill package size and the number of enabled engines, scanning may take from a few seconds to several minutes
|
||||
- **LLM Analysis Cost**: Enabling LLM analysis incurs API call charges; it is recommended to evaluate costs in production environments
|
||||
- **Policy Tuning**: The `balanced` policy is suitable for most scenarios; enterprises can customize policies based on their security needs
|
||||
- **Health Check**: Check the Scanner service status via `GET http://localhost:8000/health`
|
||||
143
docs/claude/en/guide/skill-discovery.md
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
# Skill Search & Discovery
|
||||
|
||||
## Overview
|
||||
|
||||
SkillHub provides powerful full-text search functionality, enabling users to quickly find the skill packages they need.
|
||||
|
||||
Search supports not only keyword matching but also multi-dimensional filtering and sorting by namespace, tag, downloads, rating, and more.
|
||||
|
||||

|
||||
|
||||
**Core Features**:
|
||||
|
||||
- **Full-text Search**: Search skill package names, descriptions, tags, authors
|
||||
- **Smart Filters**: Filter by namespace, tag, visibility
|
||||
- **Multiple Sorting**: Sort by relevance, downloads, rating, update time
|
||||
- **Permission-aware**: Only show skill packages user has access to
|
||||
- **Real-time Updates**: Newly published skill packages appear immediately in search results
|
||||
|
||||
**Search Algorithm**:
|
||||
|
||||
SkillHub uses PostgreSQL full-text search, supporting:
|
||||
- Chinese and English word segmentation
|
||||
- Fuzzy matching
|
||||
- Weighted ranking (title weight > description weight > tag weight)
|
||||
|
||||
## Use Cases
|
||||
|
||||
**Case 1: New Member Exploration**
|
||||
|
||||
New developer joins the team and wants to know what skill packages are available.
|
||||
|
||||

|
||||
|
||||
**Case 2: On-Demand Search**
|
||||
|
||||
Developer needs a PDF processing skill package, searches for "pdf" keyword.
|
||||
|
||||
**Case 3: Browse Popular**
|
||||
|
||||
View skill packages with highest downloads and best ratings in the team, learn best practices.
|
||||
|
||||
**Case 4: Filter by Tag**
|
||||
|
||||
Only view skill packages with `data-processing` tag.
|
||||
|
||||
## Steps
|
||||
|
||||
### Using CLI to Search and Install (Recommended)
|
||||
|
||||
```bash
|
||||
# Configure registry
|
||||
export CLAWHUB_REGISTRY=http://localhost:8080
|
||||
|
||||
# Search skill packages
|
||||
npx clawhub search pdf
|
||||
|
||||
# Install skill package
|
||||
npx clawhub install pdf-parser
|
||||
|
||||
# Install skill package from specific namespace
|
||||
npx clawhub install my-team--pdf-parser
|
||||
```
|
||||
|
||||
### Using Web UI to Search
|
||||
|
||||
1. **Access Search Page**
|
||||
|
||||
Visit `http://localhost:3000/search` or use the search box on the homepage.
|
||||
|
||||
2. **Enter Keywords**
|
||||
|
||||
Enter keywords in the search box, e.g., "pdf parser".
|
||||
|
||||
3. **Apply Filters**
|
||||
|
||||
- Select namespace (e.g., only `iflytek` namespace)
|
||||
- Select tag (e.g., `data-processing`)
|
||||
- Select sort order (e.g., by downloads descending)
|
||||
|
||||

|
||||
|
||||
4. **View Results**
|
||||
|
||||
Search results update in real-time, showing matching skill package list.
|
||||
|
||||
5. **View Details**
|
||||
|
||||
Click skill package card to view detailed information, version history, file list.
|
||||
|
||||
6. **Install**
|
||||
|
||||
After finding the right skill package, use CLI command to install or click "Download" button.
|
||||
|
||||
## API Reference
|
||||
|
||||
**Search Skill Packages**:
|
||||
```bash
|
||||
GET /api/web/skills?q=pdf&namespace=iflytek&label=data-processing&sort=downloads&page=0&size=20
|
||||
```
|
||||
|
||||
**Parameter Reference**:
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| q | string | Search keyword (optional) |
|
||||
| namespace | string | Namespace filter (optional) |
|
||||
| label | string[] | Tag filter (optional, multiple allowed) |
|
||||
| sort | enum | Sort by: relevance, downloads, rating, updated |
|
||||
| page | number | Page number (starts from 0) |
|
||||
| size | number | Page size (default 20, max 100) |
|
||||
|
||||
**Response Example**:
|
||||
```json
|
||||
{
|
||||
"content": [
|
||||
{
|
||||
"id": "skill-123",
|
||||
"namespace": "iflytek",
|
||||
"slug": "pdf-parser",
|
||||
"name": "PDF Parser",
|
||||
"description": "Extract text and metadata from PDF files",
|
||||
"downloads": 1234,
|
||||
"rating": 4.5,
|
||||
"starCount": 56,
|
||||
"latestVersion": "1.2.3",
|
||||
"updatedAt": "2026-03-15T10:30:00Z",
|
||||
"labels": ["data-processing", "pdf"]
|
||||
}
|
||||
],
|
||||
"totalElements": 42,
|
||||
"totalPages": 3,
|
||||
"number": 0,
|
||||
"size": 20
|
||||
}
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
> **Permission Control**: Search results are automatically filtered by user permissions. PRIVATE skill packages are only visible to namespace members, INTERNAL skill packages are only visible to logged-in users.
|
||||
|
||||
- **Search Performance**: SkillHub uses PostgreSQL full-text search with Chinese and English word segmentation
|
||||
- **Real-time Updates**: Newly published skill packages appear immediately in search results
|
||||
- **Tag Convention**: Recommend using consistent tag naming conventions for easier filtering
|
||||
- **Search Suggestions**: Supports search suggestions and autocomplete (frontend implementation)
|
||||
156
docs/claude/en/guide/skill-publish.md
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
# Skill Publishing & Version Management
|
||||
|
||||
## Overview
|
||||
|
||||
Skill publishing is the core feature of SkillHub. Developers can upload locally developed Agent skill packages to the registry with one click. The system automatically handles version management, metadata extraction, and file indexing.
|
||||
|
||||

|
||||
|
||||
**Problems Solved**:
|
||||
|
||||
Traditionally, team members distribute skill packages through Git repositories or file sharing. This approach has several pain points:
|
||||
|
||||
- **Version Chaos**: Different versions scattered everywhere, hard to track
|
||||
- **Permission Control Lost**: Cannot finely control who can access which skill packages
|
||||
- **Discovery Difficulty**: New members don't know what skills are available
|
||||
|
||||
SkillHub provides an npm-like publishing experience with enterprise-grade permission control and review mechanisms.
|
||||
|
||||
**Core Features**:
|
||||
|
||||
- **Semantic Versioning**: Supports `major.minor.patch` version specification
|
||||
- **Tag System**: `latest`, `beta`, `stable` and custom tags
|
||||
- **Multi-version Coexistence**: Same skill package can retain multiple historical versions
|
||||
- **Version Resolution**: Smart parsing of version selectors (e.g., `^1.2.0`, `~2.0.0`)
|
||||
- **File Browsing**: Browse skill package file structure online
|
||||
- **Download Distribution**: Download by version or tag
|
||||
|
||||
## Use Cases
|
||||
|
||||
**Case 1: Developer Publishes New Skill**
|
||||
|
||||
You just completed a Claude Code skill package and want other team members to use it.
|
||||
|
||||

|
||||
|
||||
**Case 2: Version Iteration**
|
||||
|
||||
Skill package needs bug fixes or new features, publish new version while maintaining backward compatibility.
|
||||
|
||||
**Case 3: Beta Testing**
|
||||
|
||||
New features are not stable yet, publish with `beta` tag for limited testing before promoting to `latest`.
|
||||
|
||||
**Case 4: Version Rollback**
|
||||
|
||||
New version has serious issues, need to point `latest` tag to previous stable version.
|
||||
|
||||
## Steps
|
||||
|
||||
1. **Prepare Skill Package**
|
||||
|
||||
Ensure skill package conforms to SkillHub specification:
|
||||
- Contains `skill.md` (skill description)
|
||||
- Contains `package.json` or `SKILL.md` (metadata)
|
||||
- Clear file structure, no sensitive information
|
||||
|
||||
2. **Publish via CLI (Recommended)**
|
||||
|
||||
```bash
|
||||
# Configure registry
|
||||
export CLAWHUB_REGISTRY=http://localhost:8080
|
||||
|
||||
# Publish to default namespace
|
||||
npx clawhub publish ./my-skill
|
||||
|
||||
# Publish to specific namespace
|
||||
npx clawhub publish ./my-skill --namespace my-team
|
||||
```
|
||||
|
||||
3. **Publish via Web UI**
|
||||
|
||||
Visit `http://localhost:3000/dashboard/publish`, select namespace, upload zip file, choose visibility, and click "Publish".
|
||||
|
||||
4. **Publish via REST API**
|
||||
|
||||
```bash
|
||||
POST /api/v1/skills/{namespace}/publish
|
||||
Content-Type: multipart/form-data
|
||||
|
||||
file: skill-package.zip
|
||||
visibility: PUBLIC
|
||||
```
|
||||
|
||||

|
||||
|
||||
5. **Security Scan**
|
||||
|
||||
After publishing, [Skill Scanner](/en/guide/scanner) automatically scans the skill package for potential security risks. Results appear on the skill package detail page.
|
||||
|
||||
6. **Wait for Review** (if namespace has review enabled)
|
||||
|
||||
Team admins receive review notifications and approve skill packages for official release.
|
||||
|
||||
7. **Publish Success**
|
||||
|
||||
Skill package can be discovered through search, others can download via CLI or Web UI.
|
||||
|
||||
## API Reference
|
||||
|
||||
**Publish Skill Package**:
|
||||
```bash
|
||||
POST /api/v1/skills/{namespace}/publish
|
||||
Content-Type: multipart/form-data
|
||||
|
||||
# Parameters
|
||||
file: MultipartFile (required)
|
||||
visibility: PUBLIC | PRIVATE | INTERNAL (optional, default PUBLIC)
|
||||
```
|
||||
|
||||
**Parameter Reference**:
|
||||
| Parameter | Type | Description |
|
||||
|-----------|------|-------------|
|
||||
| namespace | string | Namespace slug (path parameter) |
|
||||
| file | MultipartFile | Skill package zip file |
|
||||
| visibility | enum | Visibility level: PUBLIC, PRIVATE, INTERNAL |
|
||||
|
||||
**Get Skill Details**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}
|
||||
```
|
||||
|
||||
**List Versions**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/versions?page=0&size=20
|
||||
```
|
||||
|
||||
**Get Version Details**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/versions/{version}
|
||||
```
|
||||
|
||||
**Download Specific Version**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/versions/{version}/download
|
||||
```
|
||||
|
||||
**Download by Tag**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/tags/{tagName}/download
|
||||
```
|
||||
|
||||
**Version Resolution**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/resolve?version=^1.2.0
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
> **Version Specification**: SkillHub uses Semantic Versioning. Version format is `major.minor.patch`, e.g., `1.2.3`.
|
||||
|
||||
- **First Publish**: Version should start from `0.1.0` or `1.0.0`
|
||||
- **Tag Management**: `latest` tag automatically points to the latest stable version
|
||||
- **Review Process**: If namespace has review enabled, new versions need admin approval
|
||||
- **File Size Limit**: Single skill package max 100MB (configurable)
|
||||
- **Naming Convention**: Skill slug supports lowercase letters, numbers, hyphens, and Unicode characters
|
||||
- **Version Immutability**: Published versions cannot be modified, only new versions can be published
|
||||
143
docs/claude/en/guide/social.md
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
# User Interaction & Social Features
|
||||
|
||||
## Overview
|
||||
|
||||
SkillHub provides a rich set of social features that allow team members to interact, share, and recommend skill packages.
|
||||
|
||||

|
||||
|
||||
**Core Features**:
|
||||
|
||||
- **Star**: Bookmark your favorite skill packages for easy access later
|
||||
- **Rating**: Rate skill packages (1-5 stars) to help others assess quality
|
||||
- **Download Statistics**: Track download counts to highlight popular skill packages
|
||||
- **Notification System**: Receive timely notifications for review results, comment replies, and more
|
||||
|
||||
**Social Metrics**:
|
||||
|
||||
| Metric | Description |
|
||||
|------|------|
|
||||
| **Star Count** | Number of users who have bookmarked the skill package |
|
||||
| **Average Rating** | Mean score across all user ratings |
|
||||
| **Download Count** | Total number of downloads |
|
||||
| **Activity** | Last updated time, release frequency |
|
||||
|
||||
## Use Cases
|
||||
|
||||
**Case 1: Bookmarking Frequently Used Skill Packages**
|
||||
|
||||
A developer finds a useful skill package and clicks the star button to bookmark it.
|
||||
|
||||

|
||||
|
||||
**Case 2: Rating and Recommending**
|
||||
|
||||
After using a skill package, a developer gives it a rating and review to help other team members.
|
||||
|
||||
**Case 3: Viewing Notifications**
|
||||
|
||||
A developer receives a notification that their submission has been approved, or someone has commented on their skill package.
|
||||
|
||||

|
||||
|
||||
**Case 4: Browsing Popular Skill Packages**
|
||||
|
||||
View skill packages with the most stars and highest ratings to discover best practices.
|
||||
|
||||
## Step-by-Step Guide
|
||||
|
||||
**Starring a Skill Package**:
|
||||
|
||||
1. Navigate to the skill package detail page
|
||||
2. Click the "Star" button
|
||||
3. The skill package will appear in your "My Stars" list
|
||||
4. Click again to unstar
|
||||
|
||||
**Rating a Skill Package**:
|
||||
|
||||
1. Navigate to the skill package detail page
|
||||
2. Click the star icons to select a rating (1-5 stars)
|
||||
3. The rating takes effect immediately and impacts the skill package's average rating
|
||||
4. You can update your rating at any time
|
||||
|
||||
**Viewing Notifications**:
|
||||
|
||||
1. Click the notification icon in the top navigation bar
|
||||
2. View the list of unread notifications
|
||||
3. Click a notification to navigate to the relevant page
|
||||
4. Mark as read or mark all as read
|
||||
|
||||
**Viewing My Stars**:
|
||||
|
||||
1. Navigate to `/dashboard/stars`
|
||||
2. View all starred skill packages
|
||||
3. Sort by star date or last updated date
|
||||
4. Quickly access frequently used skill packages
|
||||
|
||||
## API Reference
|
||||
|
||||
**Star a Skill Package**:
|
||||
```bash
|
||||
PUT /api/v1/skills/{skillId}/star
|
||||
```
|
||||
|
||||
**Unstar a Skill Package**:
|
||||
```bash
|
||||
DELETE /api/v1/skills/{skillId}/star
|
||||
```
|
||||
|
||||
**Check Star Status**:
|
||||
```bash
|
||||
GET /api/v1/skills/{skillId}/star
|
||||
```
|
||||
|
||||
**Response Example**:
|
||||
```json
|
||||
{
|
||||
"starred": true,
|
||||
"starredAt": "2026-03-15T10:30:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
**Rate a Skill Package**:
|
||||
```bash
|
||||
PUT /api/v1/skills/{skillId}/rating
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"score": 5
|
||||
}
|
||||
```
|
||||
|
||||
**Parameter Reference**:
|
||||
| Parameter | Type | Description |
|
||||
|------|------|------|
|
||||
| skillId | string | Skill package ID (path parameter) |
|
||||
| score | number | Rating (1-5, required) |
|
||||
|
||||
**Get My Stars**:
|
||||
```bash
|
||||
GET /api/v1/me/stars?page=0&size=20
|
||||
```
|
||||
|
||||
**Get My Rating**:
|
||||
```bash
|
||||
GET /api/v1/skills/{skillId}/rating
|
||||
```
|
||||
|
||||
**Response Example**:
|
||||
```json
|
||||
{
|
||||
"score": 5,
|
||||
"ratedAt": "2026-03-15T10:30:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
> **Rating Rules**: Each user can rate each skill package only once. Ratings can be updated but not deleted.
|
||||
|
||||
- **Star Count**: A skill package's star count is displayed in search results and on the detail page
|
||||
- **Average Rating**: A skill package's average rating affects search ranking
|
||||
- **Notification Settings**: Users can disable certain notification types in their settings
|
||||
- **Download Statistics**: Each download increments the download counter, which is used for popularity ranking
|
||||
50
docs/claude/en/index.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: SkillHub
|
||||
text: Enterprise-Grade Agent Skill Registry
|
||||
tagline: Manage your team's AI skill packages as easily as npm
|
||||
image:
|
||||
src: /diagrams/cover.png
|
||||
alt: SkillHub
|
||||
actions:
|
||||
- theme: brand
|
||||
text: Quick Start
|
||||
link: /quickstart
|
||||
- theme: alt
|
||||
text: Feature Guide
|
||||
link: /guide/skill-publish
|
||||
- theme: alt
|
||||
text: GitHub
|
||||
link: https://github.com/iflytek/skillhub
|
||||
|
||||
features:
|
||||
- icon: 🚀
|
||||
title: Skill Publishing & Version Management
|
||||
details: Publish skill packages with one click, semantic versioning, tag system, and multi-version coexistence
|
||||
link: /guide/skill-publish
|
||||
- icon: 🔍
|
||||
title: Skill Search & Discovery
|
||||
details: Full-text search, smart filtering, permission-aware — quickly find the skill packages you need
|
||||
link: /guide/skill-discovery
|
||||
- icon: 👥
|
||||
title: Namespace & Team Management
|
||||
details: Namespace-based RBAC permission system with Owner/Admin/Member three-tier roles
|
||||
link: /guide/namespace
|
||||
- icon: ✅
|
||||
title: Review & Governance
|
||||
details: Multi-level review workflows and reporting system to ensure skill package quality
|
||||
link: /guide/review
|
||||
- icon: ⭐
|
||||
title: User Interaction & Social
|
||||
details: Starring, ratings, notification system — build an active skill package community
|
||||
link: /guide/social
|
||||
- icon: 🛡️
|
||||
title: Security Scanning
|
||||
details: Built-in Skill Scanner with multi-engine security analysis, automatic detection of malicious code and security risks
|
||||
link: /guide/scanner
|
||||
- icon: 🏢
|
||||
title: Enterprise Self-Hosting
|
||||
details: Fully self-hosted with complete data sovereignty, supports Docker Compose and K8s deployment
|
||||
---
|
||||
42
docs/claude/en/introduction.md
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# Introduction
|
||||
|
||||
SkillHub is a self-hosted Agent Skill registry built for the enterprise.
|
||||
|
||||
In the age of AI Agents, every team accumulates its own skill packages (Skills). But these packages are scattered everywhere: some on developers' local machines, some in Git repositories, and some buried in internal documentation. Team members struggle to discover each other's work, let alone reuse existing capabilities.
|
||||
|
||||
SkillHub solves this problem. It provides a **private, controllable, and easy-to-use** skill package registry, allowing teams to manage Agent Skills just like using npm or PyPI.
|
||||
|
||||

|
||||
|
||||
## Core Value
|
||||
|
||||
- **Publish in 3 minutes**: From local development to global distribution with a single command
|
||||
- **Enterprise-grade permissions**: Namespace-based RBAC with team collaboration and review workflows
|
||||
- **Full lifecycle**: Version management, tag system, review workflows, and archiving mechanisms
|
||||
- **Ready out of the box**: Start the full environment with a single curl command
|
||||
- **Security scanning**: Built-in Skill Scanner for automatic security risk detection
|
||||
- **Data sovereignty**: Fully self-hosted — all data stays within your firewall
|
||||
|
||||
## Tech Stack
|
||||
|
||||

|
||||
|
||||
| Layer | Technology | Description |
|
||||
|-------|------------|-------------|
|
||||
| **Frontend** | React 19 + Vite + TanStack Router | Modern SPA with Chinese/English language support |
|
||||
| **Backend** | Java 21 + Spring Boot 3.2 | Enterprise-grade REST API |
|
||||
| **Database** | PostgreSQL 16 | Full-text search, Flyway auto-migration |
|
||||
| **Cache** | Redis 7 | Session management, hot data caching |
|
||||
| **Storage** | MinIO / S3 | Skill package file storage, supports local and cloud |
|
||||
| **Deployment** | Docker Compose / K8s | One-click startup, supports self-hosting |
|
||||
|
||||
## Feature Overview
|
||||
|
||||
| Feature | Description |
|
||||
|---------|-------------|
|
||||
| [Skill Publishing & Version Management](/en/guide/skill-publish) | One-click skill package publishing with semantic versioning |
|
||||
| [Skill Search & Discovery](/en/guide/skill-discovery) | Full-text search, smart filtering, permission-aware |
|
||||
| [Namespace & Team Management](/en/guide/namespace) | Namespace-based RBAC permission system |
|
||||
| [Review & Governance](/en/guide/review) | Multi-level review workflows, reporting system |
|
||||
| [Security Scanning](/en/guide/scanner) | Built-in Skill Scanner with multi-engine security analysis |
|
||||
| [User Interaction & Social](/en/guide/social) | Starring, ratings, notification system |
|
||||
202
docs/claude/en/quickstart.md
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
# Quick Start
|
||||
|
||||
## One-Click Deployment
|
||||
|
||||
Use the curl command to quickly deploy SkillHub (includes all services: Web UI, Backend API, PostgreSQL, Redis, MinIO, Skill Scanner):
|
||||
|
||||
**Official images (recommended)**:
|
||||
```bash
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime-github.sh | sh -s -- up
|
||||
```
|
||||
|
||||
**Alibaba Cloud mirror** (recommended for users in China):
|
||||
```bash
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up --aliyun
|
||||
```
|
||||
|
||||
**Custom parameters**:
|
||||
```bash
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up \
|
||||
--version v0.2.0 \
|
||||
--home /opt/skillhub \
|
||||
--aliyun
|
||||
```
|
||||
|
||||
**Parameter reference**:
|
||||
| Parameter | Description | Example |
|
||||
|-----------|-------------|---------|
|
||||
| `--version <tag>` | Specify version | `--version v0.2.0` |
|
||||
| `--aliyun` | Use Alibaba Cloud mirror | `--aliyun` |
|
||||
| `--home <dir>` | Specify installation directory | `--home /opt/skillhub` |
|
||||
| `--no-scanner` | Disable security scanning service | `--no-scanner` |
|
||||
| `--mirror-registry <url>` | Custom image registry | `--mirror-registry registry.example.com` |
|
||||
|
||||
**Other commands**:
|
||||
```bash
|
||||
# Stop services
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- down
|
||||
|
||||
# Check service status
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- ps
|
||||
|
||||
# View logs
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- logs
|
||||
|
||||
# Clean all data
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- clean
|
||||
```
|
||||
|
||||
After successful deployment, visit:
|
||||
- **Web UI**: http://localhost:3000
|
||||
- **Backend API**: http://localhost:8080
|
||||
- **API Docs**: http://localhost:8080/swagger-ui.html
|
||||
- **Skill Scanner**: http://localhost:8000
|
||||
|
||||
## Local Development
|
||||
|
||||
To start the development environment from source:
|
||||
|
||||
```bash
|
||||
# Clone the repository
|
||||
git clone https://github.com/iflytek/skillhub.git
|
||||
cd skillhub
|
||||
|
||||
# Start all services (including Scanner)
|
||||
make dev-all
|
||||
```
|
||||
|
||||
## Logging In
|
||||
|
||||
### Option 1: Use the Built-in Admin Account
|
||||
|
||||
SkillHub comes with a built-in super admin account for direct login:
|
||||
|
||||
- **Username**: `admin`
|
||||
- **Password**: `ChangeMe!2026`
|
||||
|
||||
> **Security notice**: Change the default password immediately after deploying to production.
|
||||
|
||||
### Option 2: Register a New Account
|
||||
|
||||
Visit http://localhost:3000/register to create a new account.
|
||||
|
||||
### Option 3: Use Mock Users (Local Development Only)
|
||||
|
||||
During local development, you can use mock user headers for quick login:
|
||||
|
||||
```bash
|
||||
# Regular user
|
||||
curl -H "X-Mock-User-Id: local-user" http://localhost:8080/api/v1/auth/me
|
||||
|
||||
# Super admin
|
||||
curl -H "X-Mock-User-Id: local-admin" http://localhost:8080/api/v1/auth/me
|
||||
```
|
||||
|
||||
In the browser, you can add the `X-Mock-User-Id` header via a browser extension (e.g., ModHeader).
|
||||
|
||||
## Install the CLI Tool
|
||||
|
||||
SkillHub is compatible with the OpenClaw CLI. You can use the `npx clawhub` command to manage skill packages:
|
||||
|
||||
```bash
|
||||
# Configure the SkillHub registry URL
|
||||
export CLAWHUB_REGISTRY=http://localhost:8080
|
||||
|
||||
# Search for skill packages
|
||||
npx clawhub search email
|
||||
|
||||
# Install a skill package
|
||||
npx clawhub install my-skill
|
||||
|
||||
# Publish a skill package
|
||||
npx clawhub publish ./my-skill
|
||||
```
|
||||
|
||||
## Publish Your First Skill Package
|
||||
|
||||
### Publish via CLI (Recommended)
|
||||
|
||||
1. **Prepare the skill package**
|
||||
|
||||
Create a simple skill package directory:
|
||||
|
||||
```
|
||||
my-skill/
|
||||
├── skill.md # Skill description
|
||||
├── package.json # Metadata
|
||||
└── scripts/ # Script files
|
||||
└── main.py
|
||||
```
|
||||
|
||||
2. **Publish using the CLI**
|
||||
|
||||
```bash
|
||||
# Configure the registry
|
||||
export CLAWHUB_REGISTRY=http://localhost:8080
|
||||
|
||||
# Publish to the default namespace
|
||||
npx clawhub publish ./my-skill
|
||||
|
||||
# Publish to a specific namespace
|
||||
npx clawhub publish ./my-skill --namespace my-team
|
||||
```
|
||||
|
||||
3. **Wait for security scanning**
|
||||
|
||||
After publishing, the Skill Scanner will automatically scan the skill package for potential security issues:
|
||||
- Malicious code detection
|
||||
- Sensitive information leakage
|
||||
- Dependency vulnerability scanning
|
||||
- Behavioral analysis
|
||||
|
||||
Scan results are displayed on the skill package detail page.
|
||||
|
||||
4. **Wait for review** (if the namespace has review enabled)
|
||||
|
||||
Administrators will receive a notification and the skill package will be officially published once approved.
|
||||
|
||||
### Publish via Web UI
|
||||
|
||||
1. Visit http://localhost:3000/dashboard/publish
|
||||
2. Select a namespace (create one first if needed)
|
||||
3. Upload a zip file
|
||||
4. Choose visibility (PUBLIC / PRIVATE / INTERNAL)
|
||||
5. Click "Publish"
|
||||
|
||||
## Search and Download Skill Packages
|
||||
|
||||
### Using the CLI
|
||||
|
||||
```bash
|
||||
# Search for skill packages
|
||||
npx clawhub search pdf
|
||||
|
||||
# Install a skill package
|
||||
npx clawhub install pdf-parser
|
||||
|
||||
# Install a skill package from a specific namespace
|
||||
npx clawhub install my-team--pdf-parser
|
||||
```
|
||||
|
||||
### Using the Web UI
|
||||
|
||||
1. Visit http://localhost:3000/search
|
||||
2. Enter keywords to search
|
||||
3. Click a skill package to view details
|
||||
4. Click "Download" or copy the install command
|
||||
|
||||
## Upgrade SkillHub
|
||||
|
||||
Use the curl command to upgrade to the latest version:
|
||||
|
||||
```bash
|
||||
# Upgrade to the latest version
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- pull
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- down
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up
|
||||
|
||||
# Upgrade to a specific version
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up --version v0.2.0
|
||||
```
|
||||
|
||||
> **Note**: It is recommended to back up the database and object storage before upgrading.
|
||||
133
docs/claude/faq.md
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
# 常见问题
|
||||
|
||||
## Q: SkillHub 和 ClawHub 有什么区别?
|
||||
|
||||
A: SkillHub 是企业级的自托管方案,提供了更强的权限控制、审核机制和治理能力。ClawHub 是公共注册中心,类似 npm。
|
||||
|
||||
**主要区别**:
|
||||
|
||||
| 特性 | SkillHub | ClawHub |
|
||||
|------|----------|---------|
|
||||
| **部署方式** | 自托管 | 公共云 |
|
||||
| **权限控制** | 命名空间 RBAC | 基础权限 |
|
||||
| **审核机制** | 多级审核 | 无 |
|
||||
| **安全扫描** | 内置 Skill Scanner | 无 |
|
||||
| **数据主权** | 完全自主 | 托管在云端 |
|
||||
| **适用场景** | 企业内部 | 公开分享 |
|
||||
|
||||
## Q: 如何备份数据?
|
||||
|
||||
A: SkillHub 的数据存储在 PostgreSQL 和对象存储中。定期备份这两部分即可。
|
||||
|
||||
**备份 PostgreSQL**:
|
||||
```bash
|
||||
pg_dump -h localhost -U postgres skillhub > backup.sql
|
||||
```
|
||||
|
||||
**备份对象存储**:
|
||||
- 如果使用 MinIO,备份 MinIO 数据目录
|
||||
- 如果使用 S3,使用 AWS CLI 或 S3 备份工具
|
||||
|
||||
## Q: 支持哪些认证方式?
|
||||
|
||||
A: SkillHub 支持多种认证方式:
|
||||
|
||||
- **OAuth2**:GitHub、Google、GitLab 等
|
||||
- **本地账号**:用户名密码登录(内置管理员:admin / ChangeMe!2026)
|
||||
- **企业 SSO**:可以集成 LDAP、SAML 等
|
||||
|
||||
配置方式参考项目 README 中的认证配置章节。
|
||||
|
||||
## Q: 技能包大小有限制吗?
|
||||
|
||||
A: 默认限制为 **100MB**。可以通过配置调整:
|
||||
|
||||
```yaml
|
||||
# application.yml
|
||||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 100MB
|
||||
max-request-size: 100MB
|
||||
```
|
||||
|
||||
## Q: 如何使用 CLI 工具管理技能包?
|
||||
|
||||
A: SkillHub 兼容 OpenClaw CLI,使用 `npx clawhub` 命令即可操作:
|
||||
|
||||
```bash
|
||||
# 配置注册中心地址
|
||||
export CLAWHUB_REGISTRY=http://your-skillhub-host:8080
|
||||
|
||||
# 搜索技能包
|
||||
npx clawhub search email
|
||||
|
||||
# 安装技能包
|
||||
npx clawhub install my-skill
|
||||
|
||||
# 发布技能包
|
||||
npx clawhub publish ./my-skill
|
||||
```
|
||||
|
||||
## Q: 如何配置 HTTPS?
|
||||
|
||||
A: 生产环境建议使用 Nginx 或 Traefik 作为反向代理,配置 SSL 证书。
|
||||
|
||||
**Nginx 配置示例**:
|
||||
```nginx
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name skillhub.example.com;
|
||||
|
||||
ssl_certificate /path/to/cert.pem;
|
||||
ssl_certificate_key /path/to/key.pem;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:3000;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://localhost:8080;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Q: 如何监控 SkillHub?
|
||||
|
||||
A: SkillHub 提供了多种监控方式:
|
||||
|
||||
- **健康检查**:`GET /actuator/health`
|
||||
- **Scanner 健康检查**:`GET http://localhost:8000/health`
|
||||
- **指标监控**:`GET /actuator/metrics`(Prometheus 格式)
|
||||
- **审计日志**:所有关键操作都会记录到审计日志
|
||||
- **应用日志**:使用 ELK 或 Loki 收集日志
|
||||
|
||||
## Q: 支持多租户吗?
|
||||
|
||||
A: SkillHub 通过命名空间实现了逻辑上的多租户隔离。每个命名空间相当于一个租户,拥有独立的成员、权限和技能包。
|
||||
|
||||
如果需要物理隔离,可以为每个租户部署独立的 SkillHub 实例。
|
||||
|
||||
## Q: 如何升级 SkillHub?
|
||||
|
||||
A: 使用 curl 命令升级:
|
||||
|
||||
```bash
|
||||
# 拉取最新镜像并重启
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- pull
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- down
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up
|
||||
|
||||
# 或直接指定版本升级
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up --version v0.2.0
|
||||
```
|
||||
|
||||
> **注意**:升级前建议先备份数据库和对象存储。数据库迁移由 Flyway 自动执行。
|
||||
|
||||
## Q: 遇到问题怎么办?
|
||||
|
||||
A: 可以通过以下方式获取帮助:
|
||||
|
||||
- **GitHub Issues**: https://github.com/iflytek/skillhub/issues
|
||||
- **文档**: 参考项目 README.md
|
||||
- **社区讨论**: https://github.com/iflytek/skillhub/discussions
|
||||
178
docs/claude/guide/namespace.md
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
# 命名空间与团队管理
|
||||
|
||||
## 功能描述
|
||||
|
||||
命名空间(Namespace)是 SkillHub 的核心组织单元。每个命名空间代表一个团队或项目,拥有独立的成员、权限和技能包。
|
||||
|
||||

|
||||
|
||||
**命名空间的作用**:
|
||||
|
||||
- **隔离**:不同团队的技能包互不干扰
|
||||
- **权限**:基于角色的访问控制(RBAC)
|
||||
- **协作**:团队成员可以共同管理技能包
|
||||
- **治理**:管理员可以审核、归档、冻结技能包
|
||||
|
||||
**角色体系**:
|
||||
|
||||
| 角色 | 权限 |
|
||||
|------|------|
|
||||
| **Owner** | 完全控制,包括删除命名空间、管理所有成员 |
|
||||
| **Admin** | 管理成员、审核技能包、修改设置 |
|
||||
| **Member** | 发布技能包、查看私有技能包 |
|
||||
|
||||
**命名空间状态**:
|
||||
|
||||
- **Active**:正常运行
|
||||
- **Frozen**:冻结状态,无法发布新技能包
|
||||
- **Archived**:归档状态,从搜索结果中隐藏
|
||||
|
||||
## 使用场景
|
||||
|
||||
**场景一:创建团队命名空间**
|
||||
|
||||
团队负责人创建一个新的命名空间,用于管理团队的技能包。
|
||||
|
||||

|
||||
|
||||
**场景二:添加团队成员**
|
||||
|
||||
管理员邀请新成员加入命名空间,分配合适的角色。
|
||||
|
||||

|
||||
|
||||
**场景三:权限管理**
|
||||
|
||||
调整成员角色,控制谁可以发布、审核、管理技能包。
|
||||
|
||||
**场景四:命名空间冻结**
|
||||
|
||||
发现命名空间有安全问题,临时冻结所有发布操作。
|
||||
|
||||
## 使用步骤
|
||||
|
||||
**创建命名空间**:
|
||||
|
||||
1. 访问 `/dashboard/namespaces`
|
||||
2. 点击「创建命名空间」
|
||||
3. 填写信息:
|
||||
- 名称:团队名称(例如 "iFlytek AI Team")
|
||||
- Slug:URL 标识符(例如 "iflytek")
|
||||
- 描述:简要说明团队职责和技能包范围
|
||||
|
||||

|
||||
|
||||
4. 提交创建,系统自动将你设为 Owner
|
||||
|
||||
**添加成员**:
|
||||
|
||||
1. 进入命名空间详情页
|
||||
2. 点击「成员」标签
|
||||
3. 点击「添加成员」
|
||||
4. 搜索用户(支持按用户名、邮箱搜索)
|
||||
5. 选择角色(Owner / Admin / Member)
|
||||
6. 确认添加
|
||||
|
||||
**管理权限**:
|
||||
|
||||
1. 在成员列表中找到目标用户
|
||||
2. 点击「修改角色」
|
||||
3. 选择新角色并确认
|
||||
4. 系统会记录权限变更到审计日志
|
||||
|
||||
**冻结命名空间**:
|
||||
|
||||
1. 进入命名空间设置
|
||||
2. 点击「冻结命名空间」
|
||||
3. 填写冻结原因(可选)
|
||||
4. 确认冻结
|
||||
|
||||
> 冻结后,命名空间内的所有技能包无法发布新版本,但已有版本仍可下载。
|
||||
|
||||
## API 接口
|
||||
|
||||
**创建命名空间**:
|
||||
```bash
|
||||
POST /api/v1/namespaces
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "iFlytek AI Team",
|
||||
"slug": "iflytek",
|
||||
"description": "iFlytek's AI agent skills"
|
||||
}
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| name | string | 命名空间名称(必需,2-50 字符) |
|
||||
| slug | string | URL 标识符(必需,唯一,2-64 字符,只能包含小写字母、数字、连字符) |
|
||||
| description | string | 描述(可选,最多 500 字符) |
|
||||
|
||||
**获取命名空间详情**:
|
||||
```bash
|
||||
GET /api/v1/namespaces/{slug}
|
||||
```
|
||||
|
||||
**更新命名空间**:
|
||||
```bash
|
||||
PUT /api/v1/namespaces/{slug}
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"name": "iFlytek AI Team (Updated)",
|
||||
"description": "Updated description"
|
||||
}
|
||||
```
|
||||
|
||||
**添加成员**:
|
||||
```bash
|
||||
POST /api/v1/namespaces/{slug}/members
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"userId": "user-123",
|
||||
"role": "MEMBER"
|
||||
}
|
||||
```
|
||||
|
||||
**更新成员角色**:
|
||||
```bash
|
||||
PUT /api/v1/namespaces/{slug}/members/{userId}/role
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"role": "ADMIN"
|
||||
}
|
||||
```
|
||||
|
||||
**移除成员**:
|
||||
```bash
|
||||
DELETE /api/v1/namespaces/{slug}/members/{userId}
|
||||
```
|
||||
|
||||
**冻结命名空间**:
|
||||
```bash
|
||||
POST /api/v1/namespaces/{slug}/freeze
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"reason": "Security investigation"
|
||||
}
|
||||
```
|
||||
|
||||
**解冻命名空间**:
|
||||
```bash
|
||||
POST /api/v1/namespaces/{slug}/unfreeze
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
> **Slug 唯一性**:命名空间 slug 在全局范围内必须唯一,且创建后不可修改。建议使用团队或项目的简短标识符。
|
||||
|
||||
- **Owner 权限**:每个命名空间至少需要一个 Owner,最后一个 Owner 无法被移除
|
||||
- **角色继承**:命名空间成员自动拥有该命名空间下所有技能包的访问权限
|
||||
- **冻结机制**:管理员可以冻结命名空间,冻结后无法发布新技能包
|
||||
- **归档机制**:归档的命名空间会从搜索结果中隐藏,但已有技能包仍可访问
|
||||
- **审计日志**:所有成员变更、权限调整都会记录到审计日志
|
||||
186
docs/claude/guide/review.md
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
# 审核与治理
|
||||
|
||||
## 功能描述
|
||||
|
||||
SkillHub 提供了完整的审核工作流,确保发布到注册中心的技能包符合团队规范。
|
||||
|
||||
审核机制分为两层:
|
||||
- **命名空间审核**:团队管理员审核本命名空间的技能包
|
||||
- **平台审核**:平台管理员审核推广到全局的技能包
|
||||
|
||||

|
||||
|
||||
**审核流程**:
|
||||
|
||||
1. 开发者发布技能包 → 进入「待审核」状态
|
||||
2. 管理员收到通知 → 查看技能包详情
|
||||
3. 管理员决策 → 批准或拒绝
|
||||
4. 批准后 → 技能包正式发布
|
||||
5. 拒绝后 → 开发者收到反馈,可修改后重新提交
|
||||
|
||||
**审核状态**:
|
||||
|
||||
| 状态 | 说明 |
|
||||
|------|------|
|
||||
| **PENDING** | 待审核 |
|
||||
| **APPROVED** | 已批准 |
|
||||
| **REJECTED** | 已拒绝 |
|
||||
| **WITHDRAWN** | 已撤回 |
|
||||
|
||||
**治理功能**:
|
||||
|
||||
- **审核工作流**:多级审核、批量审核
|
||||
- **举报系统**:用户可以举报不当技能包
|
||||
- **推广管理**:将命名空间技能包推<EFBFBD><EFBFBD><EFBFBD>到全局
|
||||
- **审计日志**:记录所有治理操作
|
||||
|
||||
## 使用场景
|
||||
|
||||
**场景一:命名空间管理员审核**
|
||||
|
||||
团队管理员审核成员提交的技能包,确保符合团队规范。
|
||||
|
||||

|
||||
|
||||
**场景二:平台管理员审核推广**
|
||||
|
||||
平台管理员审核从命名空间推广到全局的技能包。
|
||||
|
||||
**场景三:举报处理**
|
||||
|
||||
用户举报不当技能包,管理员调查并处理。
|
||||
|
||||
**场景四:批量审核**
|
||||
|
||||
管理员批量批准多个符合规范的技能包。
|
||||
|
||||
## 使用步骤
|
||||
|
||||
**提交审核**:
|
||||
|
||||
1. 发布技能包时,系统自动创建审核任务
|
||||
2. 开发者可以在「我的提交」中查看审核状态
|
||||
3. 等待管理<E7AEA1><E79086><EFBFBD>审核
|
||||
|
||||
**审核技能包**:
|
||||
|
||||
1. 访问 `/dashboard/reviews`
|
||||
2. 查看待审核列表
|
||||
3. 点击技能包查看详情:
|
||||
- 查看元数据(名称、描述、版本)
|
||||
- 浏览文件列表
|
||||
- 在线查看文件内容
|
||||
- 下载完整包进行本地测试
|
||||
|
||||

|
||||
|
||||
4. 做出决策:
|
||||
- **批准**:技能包正式发布,开发者收到通知
|
||||
- **拒绝**:填写拒绝原因,开发者可修改后重新提交
|
||||
|
||||
5. 添加审核意见(可选)
|
||||
|
||||
**撤回审核**:
|
||||
|
||||
开发者发现问题,可以在审核通过前撤回提交:
|
||||
|
||||
1. 访问「我的提交」
|
||||
2. 找到待审核的技能包
|
||||
3. 点击「撤回」
|
||||
4. 确认撤回
|
||||
|
||||
**处理举报**:
|
||||
|
||||
1. 访问 `/dashboard/reports`
|
||||
2. 查看举报列表
|
||||
3. 调查举报内容
|
||||
4. 采取行动(归档技能包、警告用户等)
|
||||
|
||||
## API 接口
|
||||
|
||||
**提交审核**:
|
||||
```bash
|
||||
POST /api/v1/reviews
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"skillVersionId": "version-123"
|
||||
}
|
||||
```
|
||||
|
||||
**批准审核**:
|
||||
```bash
|
||||
POST /api/v1/reviews/{id}/approve
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"comment": "Looks good! Approved."
|
||||
}
|
||||
```
|
||||
|
||||
**拒绝审核**:
|
||||
```bash
|
||||
POST /api/v1/reviews/{id}/reject
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"comment": "Please fix the documentation and add more examples."
|
||||
}
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| id | string | 审核任务 ID(路径参数) |
|
||||
| comment | string | 审核意见(可选,最多 1000 字符) |
|
||||
|
||||
**列出待审核任务**:
|
||||
```bash
|
||||
GET /api/v1/reviews/pending?namespaceId=ns-123&page=0&size=20
|
||||
```
|
||||
|
||||
**列出我的提交**:
|
||||
```bash
|
||||
GET /api/v1/reviews/my-submissions?page=0&size=20
|
||||
```
|
||||
|
||||
**获取审核详情**:
|
||||
```bash
|
||||
GET /api/v1/reviews/{id}
|
||||
```
|
||||
|
||||
**获取审核中的技能包详情**:
|
||||
```bash
|
||||
GET /api/v1/reviews/{id}/skill-detail
|
||||
```
|
||||
|
||||
**下载审核包**:
|
||||
```bash
|
||||
GET /api/v1/reviews/{id}/download
|
||||
```
|
||||
|
||||
**撤回审核**:
|
||||
```bash
|
||||
POST /api/v1/reviews/{id}/withdraw
|
||||
```
|
||||
|
||||
**举报技能包**:
|
||||
```bash
|
||||
POST /api/v1/skills/{namespace}/{slug}/reports
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"reason": "INAPPROPRIATE_CONTENT",
|
||||
"details": "This skill contains malicious code"
|
||||
}
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
> **审核权限**:只有命名空间的 Admin 和 Owner 可以审核本命名空间的技能包。平台管理员可以审核所有技能包。
|
||||
|
||||
- **审核时效**:建议在 24 小时内完成审核,避免阻塞开发者
|
||||
- **审核记录**:所有审核操作都会记录到审计日志
|
||||
- **批量审核**:管理员可以批量批准多个技能包
|
||||
- **审核意见**:拒绝时建议提供详细的改进建议
|
||||
- **撤回限制**:只有待审核状态的技能包可以撤回
|
||||
99
docs/claude/guide/scanner.md
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
# Skill Scanner 安全扫描
|
||||
|
||||
## 功能描述
|
||||
|
||||
SkillHub 内置了 **Skill Scanner** 安全扫描服务,在技能包发布时自动检测潜在的安全风险。这是保障企业内部技能包安全的重要防线。
|
||||
|
||||
每个技能包在发布后都会经过安全扫描,扫描结果会影响审核决策,帮助管理员快速判断技能包是否安全可靠。
|
||||
|
||||
**核心特性**:
|
||||
|
||||
- **自动触发**:技能包发布后自动触发安全扫描,无需手动操作
|
||||
- **多引擎分析**:支持行为分析、LLM 分析、元数据分析等多种引擎
|
||||
- **策略可配**:内置 balanced 策略预设,支持自定义扫描策略
|
||||
- **严重级别阈值**:可配置在哪个严重级别自动阻止发布
|
||||
- **扫描报告**:详细的扫描结果展示在技能包详情页
|
||||
|
||||
**分析引擎**:
|
||||
|
||||
| 引擎 | 说明 | 默认状态 |
|
||||
|------|------|----------|
|
||||
| **元数据分析** | 检查包结构、文件类型、大小等 | 启用 |
|
||||
| **行为分析** | 分析代码行为模式,检测恶意操作 | 可选 |
|
||||
| **LLM 分析** | 使用大模型分析代码安全性 | 可选 |
|
||||
| **AI Defense** | Cisco AI Defense 集成 | 可选 |
|
||||
| **VirusTotal** | VirusTotal 病毒扫描 | 可选 |
|
||||
|
||||
## 使用场景
|
||||
|
||||
**场景一:发布时自动扫描**
|
||||
|
||||
开发者发布技能包后,Scanner 自动在后台运行扫描,无需额外操作。
|
||||
|
||||
**场景二:管理员查看扫描报告**
|
||||
|
||||
管理员在审核技能包时,可以查看扫描报告,帮助做出审核决策。
|
||||
|
||||
**场景三:自定义扫描策略**
|
||||
|
||||
企业管理员可以根据安全需求,配置扫描策略和严重级别阈值。
|
||||
|
||||
## 工作流程
|
||||
|
||||
```
|
||||
开发者发布技能包
|
||||
↓
|
||||
SkillHub 后端接收上传
|
||||
↓
|
||||
触发安全扫描(通过 Redis Stream)
|
||||
↓
|
||||
Skill Scanner 执行多引擎分析
|
||||
↓
|
||||
扫描结果写入数据库
|
||||
↓
|
||||
技能包详情页展示扫描报告
|
||||
↓
|
||||
管理员结合扫描结果进行审核
|
||||
```
|
||||
|
||||
## 配置说明
|
||||
|
||||
### 基础配置
|
||||
|
||||
在 `.env` 文件或环境变量中配置:
|
||||
|
||||
| 环境变量 | 说明 | 默认值 |
|
||||
|----------|------|--------|
|
||||
| `SKILLHUB_SECURITY_SCANNER_ENABLED` | 启用安全扫描 | `true` |
|
||||
| `SKILLHUB_SECURITY_SCANNER_URL` | Scanner 服务地址 | `http://localhost:8000` |
|
||||
| `SKILLHUB_SECURITY_SCANNER_MODE` | 扫描模式(local / upload) | `local` |
|
||||
| `SKILLHUB_SCANNER_POLICY_PRESET` | 策略预设 | `balanced` |
|
||||
| `SKILLHUB_SCANNER_FAIL_ON_SEVERITY` | 自动阻止的严重级别 | `high` |
|
||||
|
||||
### LLM 分析配置(可选)
|
||||
|
||||
启用 LLM 分析引擎可以提高安全检测的准确性:
|
||||
|
||||
| 环境变量 | 说明 | 默认值 |
|
||||
|----------|------|--------|
|
||||
| `SKILLHUB_SCANNER_USE_LLM` | 启用 LLM 分析 | `false` |
|
||||
| `SKILLHUB_SCANNER_LLM_PROVIDER` | LLM 提供商(anthropic / openai / azure) | `anthropic` |
|
||||
| `SKILL_SCANNER_LLM_API_KEY` | LLM API 密钥 | - |
|
||||
|
||||
### 部署说明
|
||||
|
||||
使用一键部署时,Scanner 服务默认启用。如果不需要安全扫描,可以通过 `--no-scanner` 参数禁用:
|
||||
|
||||
```bash
|
||||
# 部署时禁用 Scanner
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up --no-scanner
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
> **扫描不阻塞发布**:安全扫描是异步执行的,不会阻塞技能包的上传流程。扫描结果会在完成后更新到技能包详情页。
|
||||
|
||||
- **扫描耗时**:根据技能包大小和启用的引擎数量,扫描可能需要几秒到几分钟
|
||||
- **LLM 分析成本**:启用 LLM 分析会产生 API 调用费用,建议在生产环境中评估成本
|
||||
- **策略调优**:`balanced` 策略适合大多数场景,企业可以根据安全需求自定义策略
|
||||
- **健康检查**:通过 `GET http://localhost:8000/health` 检查 Scanner 服务状态
|
||||
143
docs/claude/guide/skill-discovery.md
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
# Skill 搜索与发现
|
||||
|
||||
## 功能描述
|
||||
|
||||
SkillHub 提供了强大的全文搜索功能,让用户可以快速找到需要的技能包。
|
||||
|
||||
搜索不仅支持关键词匹配,还支持按命名空间、标签、下载量、评分等多维度过滤和排序。
|
||||
|
||||

|
||||
|
||||
**核心特性**:
|
||||
|
||||
- **全文搜索**:搜索技能包名称、描述、标签、作者
|
||||
- **智能过滤**:按命名空间、标签、可见性过滤
|
||||
- **多种排序**:按相关性、下载量、评分、更新时间排序
|
||||
- **权限感知**:只显示用户有权访问的技能包
|
||||
- **实时更新**:新发布的技能包立即出现在搜索结果中
|
||||
|
||||
**搜索算法**:
|
||||
|
||||
SkillHub 使用 PostgreSQL 全文搜索,支持:
|
||||
- 中英文分词
|
||||
- 模糊匹配
|
||||
- 权重排序(标题权重 > 描述权重 > 标签权重)
|
||||
|
||||
## 使用场景
|
||||
|
||||
**场景一:新成员探索**
|
||||
|
||||
新加入团队的开发者想了解团队已有哪些可用的技能包。
|
||||
|
||||

|
||||
|
||||
**场景二:按需查找**
|
||||
|
||||
开发者需要一个处理 PDF 的技能包,搜索 "pdf" 关键词。
|
||||
|
||||
**场景三:浏览热门**
|
||||
|
||||
查看团队内下载量最高、评分最好的技能包,学习最佳实践。
|
||||
|
||||
**场景四:按标签过滤**
|
||||
|
||||
只查看 `data-processing` 标签的技能包。
|
||||
|
||||
## 使用步骤
|
||||
|
||||
### 使用 CLI 搜索和安装(推荐)
|
||||
|
||||
```bash
|
||||
# 配置注册中心
|
||||
export CLAWHUB_REGISTRY=http://localhost:8080
|
||||
|
||||
# 搜索技能包
|
||||
npx clawhub search pdf
|
||||
|
||||
# 安装技能包
|
||||
npx clawhub install pdf-parser
|
||||
|
||||
# 安装指定命名空间的技能包
|
||||
npx clawhub install my-team--pdf-parser
|
||||
```
|
||||
|
||||
### 使用 Web UI 搜索
|
||||
|
||||
1. **访问搜索页面**
|
||||
|
||||
访问 `http://localhost:3000/search` 或在首页使用搜索框。
|
||||
|
||||
2. **输入关键词**
|
||||
|
||||
在搜索框输入关键词,例如 "pdf parser"。
|
||||
|
||||
3. **应用过滤器**
|
||||
|
||||
- 选择命名空间(例如只看 `iflytek` 命名空间)
|
||||
- 选择标签(例如 `data-processing`)
|
||||
- 选择排序方式(例如按下载量降序)
|
||||
|
||||

|
||||
|
||||
4. **查看结果**
|
||||
|
||||
搜索结果会实时更新,显示匹配的技能包列表。
|
||||
|
||||
5. **查看详情**
|
||||
|
||||
点击技能包卡片,查看详细信息、版本历史、文件列表。
|
||||
|
||||
6. **安装使用**
|
||||
|
||||
找到合适的技能包后,使用 CLI 命令安装或点击「下载」按钮。
|
||||
|
||||
## API 接口
|
||||
|
||||
**搜索技能包**:
|
||||
```bash
|
||||
GET /api/web/skills?q=pdf&namespace=iflytek&label=data-processing&sort=downloads&page=0&size=20
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| q | string | 搜索关键词(可选) |
|
||||
| namespace | string | 命名空间过滤(可选) |
|
||||
| label | string[] | 标签过滤(可选,可多选) |
|
||||
| sort | enum | 排序方式:relevance(相关性)、downloads(下载量)、rating(评分)、updated(更新时间) |
|
||||
| page | number | 页码(从 0 开始) |
|
||||
| size | number | 每页数量(默认 20,最大 100) |
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"content": [
|
||||
{
|
||||
"id": "skill-123",
|
||||
"namespace": "iflytek",
|
||||
"slug": "pdf-parser",
|
||||
"name": "PDF Parser",
|
||||
"description": "Extract text and metadata from PDF files",
|
||||
"downloads": 1234,
|
||||
"rating": 4.5,
|
||||
"starCount": 56,
|
||||
"latestVersion": "1.2.3",
|
||||
"updatedAt": "2026-03-15T10:30:00Z",
|
||||
"labels": ["data-processing", "pdf"]
|
||||
}
|
||||
],
|
||||
"totalElements": 42,
|
||||
"totalPages": 3,
|
||||
"number": 0,
|
||||
"size": 20
|
||||
}
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
> **权限控制**:搜索结果会根据用户权限自动过滤。PRIVATE 技能包只对命名空间成员可见,INTERNAL 技能包只对登录用户可见。
|
||||
|
||||
- **搜索性能**:SkillHub 使用 PostgreSQL 全文搜索,支持中英文分词
|
||||
- **实时更新**:新发布的技能包会立即出现在搜索结果中
|
||||
- **标签规范**:建议使用统一的标签命名规范,便于过滤
|
||||
- **搜索提示**:支持搜索建议和自动补全(前端实现)
|
||||
156
docs/claude/guide/skill-publish.md
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
# Skill 发布与版本管理
|
||||
|
||||
## 功能描述
|
||||
|
||||
Skill 发布是 SkillHub 的核心功能。开发者可以将本地开发的 Agent 技能包一键上传到注册中心,系统会自动处理版本管理、元数据提取、文件索引等工作。
|
||||
|
||||

|
||||
|
||||
**解决的问题**:
|
||||
|
||||
传统方式下,团队成员通过 Git 仓库或文件共享来分发技能包。这种方式存在几个痛点:
|
||||
|
||||
- **版本混乱**:不同版本散落在各处,难以追踪
|
||||
- **权限失控**:无法精细控制谁能访问哪些技能包
|
||||
- **发现困难**:新成员不知道团队已有哪些可用技能
|
||||
|
||||
SkillHub 提供了类似 npm 的发布体验,但增加了企业级的权限控制和审核机制。
|
||||
|
||||
**核心特性**:
|
||||
|
||||
- **语义化版本**:支持 `major.minor.patch` 版本号规范
|
||||
- **标签系统**:`latest`、`beta`、`stable` 等自定义标签
|
||||
- **多版本共存**:同一技能包可以保留多个历史版本
|
||||
- **版本解析**:智能解析版本选择器(如 `^1.2.0`、`~2.0.0`)
|
||||
- **文件浏览**:在线浏览技能包内的文件结构
|
||||
- **下载分发**:支持按版本、按标签下载
|
||||
|
||||
## 使用场景
|
||||
|
||||
**场景一:开发者发布新技能**
|
||||
|
||||
你刚完成了一个 Claude Code 技能包,想让团队其他成员也能使用。
|
||||
|
||||

|
||||
|
||||
**场景二:版本迭代**
|
||||
|
||||
技能包需要修复 bug 或添加新功能,发布新版本并保持向后兼容。
|
||||
|
||||
**场景三:Beta 测试**
|
||||
|
||||
新功能还不稳定,先发布 `beta` 标签让少数人测试,稳定后再推广到 `latest`。
|
||||
|
||||
**场景四:版本回滚**
|
||||
|
||||
发现新版本有严重问题,需要将 `latest` 标签指向上一个稳定版本。
|
||||
|
||||
## 使用步骤
|
||||
|
||||
1. **准备技能包**
|
||||
|
||||
确保技能包符合 SkillHub 规范:
|
||||
- 包含 `skill.md`(技能描述)
|
||||
- 包含 `package.json` 或 `SKILL.md`(元数据)
|
||||
- 文件结构清晰,无敏感信息
|
||||
|
||||
2. **使用 CLI 发布(推荐)**
|
||||
|
||||
```bash
|
||||
# 配置注册中心
|
||||
export CLAWHUB_REGISTRY=http://localhost:8080
|
||||
|
||||
# 发布到默认命名空间
|
||||
npx clawhub publish ./my-skill
|
||||
|
||||
# 发布到指定命名空间
|
||||
npx clawhub publish ./my-skill --namespace my-team
|
||||
```
|
||||
|
||||
3. **使用 Web UI 发布**
|
||||
|
||||
访问 `http://localhost:3000/dashboard/publish`,选择命名空间、上传 zip 文件、选择可见性后点击「发布」。
|
||||
|
||||
4. **使用 REST API 发布**
|
||||
|
||||
```bash
|
||||
POST /api/v1/skills/{namespace}/publish
|
||||
Content-Type: multipart/form-data
|
||||
|
||||
file: skill-package.zip
|
||||
visibility: PUBLIC
|
||||
```
|
||||
|
||||

|
||||
|
||||
5. **安全扫描**
|
||||
|
||||
发布后,[Skill Scanner](/guide/scanner) 会自动扫描技能包,检测潜在的安全风险。扫描结果会显示在技能包详情页。
|
||||
|
||||
6. **等待审核**(如果命名空间开启了审核)
|
||||
|
||||
团队管理员会收到审核通知,审核通过后技能包正式发布。
|
||||
|
||||
7. **发布成功**
|
||||
|
||||
技能包可以通过搜索发现,其他人可以通过 CLI 或 Web UI 下载使用。
|
||||
|
||||
## API 接口
|
||||
|
||||
**发布技能包**:
|
||||
```bash
|
||||
POST /api/v1/skills/{namespace}/publish
|
||||
Content-Type: multipart/form-data
|
||||
|
||||
# 参数
|
||||
file: MultipartFile (必需)
|
||||
visibility: PUBLIC | PRIVATE | INTERNAL (可选,默认 PUBLIC)
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| namespace | string | 命名空间 slug(路径参数) |
|
||||
| file | MultipartFile | 技能包 zip 文件 |
|
||||
| visibility | enum | 可见性级别:PUBLIC(公开)、PRIVATE(私有)、INTERNAL(内部) |
|
||||
|
||||
**获取 Skill 详情**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}
|
||||
```
|
||||
|
||||
**列出版本**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/versions?page=0&size=20
|
||||
```
|
||||
|
||||
**获取版本详情**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/versions/{version}
|
||||
```
|
||||
|
||||
**下载特定版本**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/versions/{version}/download
|
||||
```
|
||||
|
||||
**按标签下载**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/tags/{tagName}/download
|
||||
```
|
||||
|
||||
**版本解析**:
|
||||
```bash
|
||||
GET /api/v1/skills/{namespace}/{slug}/resolve?version=^1.2.0
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
> **版本号规范**:SkillHub 使用语义化版本(Semantic Versioning)。版本号格式为 `major.minor.patch`,例如 `1.2.3`。
|
||||
|
||||
- **首次发布**:版本号建议从 `0.1.0` 或 `1.0.0` 开始
|
||||
- **标签管理**:`latest` 标签会自动指向最新的稳定版本
|
||||
- **审核流程**:如果命名空间开启了审核,新版本需要等待管理员批准
|
||||
- **文件大小限制**:单个技能包不超过 100MB(可配置)
|
||||
- **命名规范**:Skill slug 支持小写字母、数字、连字符和 Unicode 字符
|
||||
- **版本不可变**:已发布的版本不能修改,只能发布新版本
|
||||
143
docs/claude/guide/social.md
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
# 用户交互与社交
|
||||
|
||||
## 功能描述
|
||||
|
||||
SkillHub 提供了丰富的社交功能,让团队成员可以互动、分享、推荐技能包。
|
||||
|
||||

|
||||
|
||||
**核心功能**:
|
||||
|
||||
- **星标(Star)**:收藏喜欢的技能包,方便后续查找
|
||||
- **评分(Rating)**:给技能包打分(1-5 星),帮助其他人判断质量
|
||||
- **下载统计**:记录下载次数,展示热门技能包
|
||||
- **通知系统**:及时接收审核结果、评论回复等通知
|
||||
|
||||
**社交数据**:
|
||||
|
||||
| 指标 | 说明 |
|
||||
|------|------|
|
||||
| **星标数** | 有多少人收藏了这个技能包 |
|
||||
| **平均评分** | 所有用户评分的平均值 |
|
||||
| **下载量** | 累计下载次数 |
|
||||
| **活跃度** | 最近更新时间、发布频率 |
|
||||
|
||||
## 使用场景
|
||||
|
||||
**场景一:收藏常用技能包**
|
||||
|
||||
开发者发现一个好用的技能包,点击星标收藏。
|
||||
|
||||

|
||||
|
||||
**场景二:评分推荐**
|
||||
|
||||
使用技能包后,给出评分和评价,帮助团队其他成员。
|
||||
|
||||
**场景三:查看通知**
|
||||
|
||||
收到审核通过的通知,或者有人评论了你的技能包。
|
||||
|
||||

|
||||
|
||||
**场景四:浏览热门**
|
||||
|
||||
查看星标数最多、评分最高的技能包,学习最佳实践。
|
||||
|
||||
## 使用步骤
|
||||
|
||||
**星标技能包**:
|
||||
|
||||
1. 访问技能包详情页
|
||||
2. 点击「Star」按钮
|
||||
3. 技能包会出现在「我的收藏」列表中
|
||||
4. 再次点击可以取消星标
|
||||
|
||||
**评分技能包**:
|
||||
|
||||
1. 访问技能包详情页
|
||||
2. 点击星星图标选择评分(1-5 星)
|
||||
3. 评分会立即生效,影响技能包的平均评分
|
||||
4. 可以随时修改评分
|
||||
|
||||
**查看通知**:
|
||||
|
||||
1. 点击顶部导航栏的通知图标
|
||||
2. 查看未读通知列表
|
||||
3. 点击通知跳转到相关页面
|
||||
4. 标记为已读或全部已读
|
||||
|
||||
**查看我的收藏**:
|
||||
|
||||
1. 访问 `/dashboard/stars`
|
||||
2. 查看所有星标的技能包
|
||||
3. 按星标时间、更新时间排序
|
||||
4. 快速访问常用技能包
|
||||
|
||||
## API 接口
|
||||
|
||||
**星标技能包**:
|
||||
```bash
|
||||
PUT /api/v1/skills/{skillId}/star
|
||||
```
|
||||
|
||||
**取消星标**:
|
||||
```bash
|
||||
DELETE /api/v1/skills/{skillId}/star
|
||||
```
|
||||
|
||||
**检查星标状态**:
|
||||
```bash
|
||||
GET /api/v1/skills/{skillId}/star
|
||||
```
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"starred": true,
|
||||
"starredAt": "2026-03-15T10:30:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
**评分技能包**:
|
||||
```bash
|
||||
PUT /api/v1/skills/{skillId}/rating
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"score": 5
|
||||
}
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
| 参数 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| skillId | string | 技能包 ID(路径参数) |
|
||||
| score | number | 评分(1-5,必需) |
|
||||
|
||||
**获取我的星标**:
|
||||
```bash
|
||||
GET /api/v1/me/stars?page=0&size=20
|
||||
```
|
||||
|
||||
**获取我的评分**:
|
||||
```bash
|
||||
GET /api/v1/skills/{skillId}/rating
|
||||
```
|
||||
|
||||
**响应示例**:
|
||||
```json
|
||||
{
|
||||
"score": 5,
|
||||
"ratedAt": "2026-03-15T10:30:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
> **评分规则**:每个用户对每个技能包只能评分一次,可以修改评分但不能删除。
|
||||
|
||||
- **星标数量**:技能包的星标数会显示在搜索结果和详情页
|
||||
- **平均评分**:技能包的平均评分会影响搜索排序
|
||||
- **通知设置**:用户可以在设置中关闭某些类型的通知
|
||||
- **下载统计**:每次下载都会增加下载计数,用于热门排序
|
||||
50
docs/claude/index.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: SkillHub
|
||||
text: 企业级 Agent Skill 注册中心
|
||||
tagline: 让团队的 AI 技能包管理像 npm 一样简单
|
||||
image:
|
||||
src: /diagrams/cover.png
|
||||
alt: SkillHub
|
||||
actions:
|
||||
- theme: brand
|
||||
text: 快速开始
|
||||
link: /quickstart
|
||||
- theme: alt
|
||||
text: 功能指南
|
||||
link: /guide/skill-publish
|
||||
- theme: alt
|
||||
text: GitHub
|
||||
link: https://github.com/iflytek/skillhub
|
||||
|
||||
features:
|
||||
- icon: 🚀
|
||||
title: Skill 发布与版本管理
|
||||
details: 一键发布技能包,语义化版本管理,支持标签系统和多版本共存
|
||||
link: /guide/skill-publish
|
||||
- icon: 🔍
|
||||
title: Skill 搜索与发现
|
||||
details: 全文搜索、智能过滤、权限感知,快速找到需要的技能包
|
||||
link: /guide/skill-discovery
|
||||
- icon: 👥
|
||||
title: 命名空间与团队管理
|
||||
details: 基于命名空间的 RBAC 权限体系,Owner/Admin/Member 三级角色
|
||||
link: /guide/namespace
|
||||
- icon: ✅
|
||||
title: 审核与治理
|
||||
details: 多级审核工作流,举报系统,确保技能包质量
|
||||
link: /guide/review
|
||||
- icon: ⭐
|
||||
title: 用户交互与社交
|
||||
details: 星标收藏、评分推荐、通知系统,打造活跃的技能包社区
|
||||
link: /guide/social
|
||||
- icon: 🛡️
|
||||
title: 安全扫描
|
||||
details: 内置 Skill Scanner,多引擎安全分析,自动检测恶意代码和安全风险
|
||||
link: /guide/scanner
|
||||
- icon: 🏢
|
||||
title: 企业级自托管
|
||||
details: 完全自托管,数据主权在手,支持 Docker Compose 和 K8s 部署
|
||||
---
|
||||
42
docs/claude/introduction.md
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# 项目简介
|
||||
|
||||
SkillHub 是一个专为企业打造的自托管 Agent Skill 注册中心。
|
||||
|
||||
在 AI Agent 时代,每个团队都在积累自己的技能包(Skills)。但这些技能包散落在各处:有的在开发者本地,有的在 Git 仓库,有的在内部文档里。团队成员很难发现彼此的工作,更难复用已有的能力。
|
||||
|
||||
SkillHub 解决了这个问题。它提供了一个**私有、可控、易用**的技能包注册中心,让团队可以像使用 npm、PyPI 一样管理 Agent Skills。
|
||||
|
||||

|
||||
|
||||
## 核心价值
|
||||
|
||||
- **3 分钟发布**:从本地开发到全球分发,只需一条命令
|
||||
- **企业级权限**:基于命名空间的 RBAC,支持团队协作和审核流程
|
||||
- **完整生命周期**:版本管理、标签系统、审核工作流、归档机制
|
||||
- **开箱即用**:一条 curl 命令启动完整环境
|
||||
- **安全扫描**:内置 Skill Scanner,自动检测安全风险
|
||||
- **数据主权**:完全自托管,所有数据都在你的防火墙内
|
||||
|
||||
## 技术栈
|
||||
|
||||

|
||||
|
||||
| 层级 | 技术 | 说明 |
|
||||
|------|------|------|
|
||||
| **前端** | React 19 + Vite + TanStack Router | 现代化 SPA,支持中英文切换 |
|
||||
| **后端** | Java 21 + Spring Boot 3.2 | 企业级 REST API |
|
||||
| **数据库** | PostgreSQL 16 | 全文搜索、Flyway 自动迁移 |
|
||||
| **缓存** | Redis 7 | 会话管理、热点缓存 |
|
||||
| **存储** | MinIO / S3 | 技能包文件存储,支持本地和云端 |
|
||||
| **部署** | Docker Compose / K8s | 一键启动,支持自托管 |
|
||||
|
||||
## 核心功能一览
|
||||
|
||||
| 功能 | 说明 |
|
||||
|------|------|
|
||||
| [Skill 发布与版本管理](/guide/skill-publish) | 一键发布技能包,语义化版本管理 |
|
||||
| [Skill 搜索与发现](/guide/skill-discovery) | 全文搜索、智能过滤、权限感知 |
|
||||
| [命名空间与团队管理](/guide/namespace) | 基于命名空间的 RBAC 权限体系 |
|
||||
| [审核与治理](/guide/review) | 多级审核工作流、举报系统 |
|
||||
| [安全扫描](/guide/scanner) | 内置 Skill Scanner,多引擎安全分析 |
|
||||
| [用户交互与社交](/guide/social) | 星标、评分、通知系统 |
|
||||
2550
docs/claude/package-lock.json
generated
Normal file
13
docs/claude/package.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"name": "skillhub-docs",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vitepress dev",
|
||||
"build": "vitepress build",
|
||||
"preview": "vitepress preview"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitepress": "^1.6.3"
|
||||
}
|
||||
}
|
||||
BIN
docs/claude/public/diagrams/architecture.png
Normal file
|
After Width: | Height: | Size: 274 KiB |
BIN
docs/claude/public/diagrams/cover.png
Normal file
|
After Width: | Height: | Size: 331 KiB |
BIN
docs/claude/public/diagrams/namespace-concept.png
Normal file
|
After Width: | Height: | Size: 653 KiB |
BIN
docs/claude/public/diagrams/namespace-create-flow.png
Normal file
|
After Width: | Height: | Size: 307 KiB |
BIN
docs/claude/public/diagrams/review-concept.png
Normal file
|
After Width: | Height: | Size: 268 KiB |
BIN
docs/claude/public/diagrams/review-flow.png
Normal file
|
After Width: | Height: | Size: 237 KiB |
BIN
docs/claude/public/diagrams/skill-discovery-concept.png
Normal file
|
After Width: | Height: | Size: 631 KiB |
BIN
docs/claude/public/diagrams/skill-discovery-flow.png
Normal file
|
After Width: | Height: | Size: 288 KiB |
BIN
docs/claude/public/diagrams/skill-publish-concept.png
Normal file
|
After Width: | Height: | Size: 576 KiB |
BIN
docs/claude/public/diagrams/skill-publish-flow.png
Normal file
|
After Width: | Height: | Size: 628 KiB |
BIN
docs/claude/public/diagrams/social-concept.png
Normal file
|
After Width: | Height: | Size: 192 KiB |
BIN
docs/claude/public/diagrams/tech-stack.png
Normal file
|
After Width: | Height: | Size: 974 KiB |
BIN
docs/claude/public/screenshots/homepage.png
Normal file
|
After Width: | Height: | Size: 322 KiB |
BIN
docs/claude/public/screenshots/namespace-create.png
Normal file
|
After Width: | Height: | Size: 316 KiB |
BIN
docs/claude/public/screenshots/namespace-members.png
Normal file
|
After Width: | Height: | Size: 273 KiB |
BIN
docs/claude/public/screenshots/notifications.png
Normal file
|
After Width: | Height: | Size: 328 KiB |
BIN
docs/claude/public/screenshots/review-list.png
Normal file
|
After Width: | Height: | Size: 276 KiB |
BIN
docs/claude/public/screenshots/search-page.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
docs/claude/public/screenshots/skill-detail-star.png
Normal file
|
After Width: | Height: | Size: 373 KiB |
BIN
docs/claude/public/screenshots/skill-discovery-search.png
Normal file
|
After Width: | Height: | Size: 485 KiB |
202
docs/claude/quickstart.md
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
# 快速开始
|
||||
|
||||
## 一键部署
|
||||
|
||||
使用 curl 命令快速部署 SkillHub(包含所有服务:Web UI、Backend API、PostgreSQL、Redis、MinIO、Skill Scanner):
|
||||
|
||||
**官方镜像(推荐)**:
|
||||
```bash
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime-github.sh | sh -s -- up
|
||||
```
|
||||
|
||||
**阿里云镜像**(国内用户推荐):
|
||||
```bash
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up --aliyun
|
||||
```
|
||||
|
||||
**自定义参数**:
|
||||
```bash
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up \
|
||||
--version v0.2.0 \
|
||||
--home /opt/skillhub \
|
||||
--aliyun
|
||||
```
|
||||
|
||||
**参数说明**:
|
||||
| 参数 | 说明 | 示例 |
|
||||
|------|------|------|
|
||||
| `--version <tag>` | 指定版本 | `--version v0.2.0` |
|
||||
| `--aliyun` | 使用阿里云镜像 | `--aliyun` |
|
||||
| `--home <dir>` | 指定安装目录 | `--home /opt/skillhub` |
|
||||
| `--no-scanner` | 禁用安全扫描服务 | `--no-scanner` |
|
||||
| `--mirror-registry <url>` | 自定义镜像仓库 | `--mirror-registry registry.example.com` |
|
||||
|
||||
**其他命令**:
|
||||
```bash
|
||||
# 停止服务
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- down
|
||||
|
||||
# 查看服务状态
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- ps
|
||||
|
||||
# 查看日志
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- logs
|
||||
|
||||
# 清理所有数据
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- clean
|
||||
```
|
||||
|
||||
部署成功后访问:
|
||||
- **Web UI**: http://localhost:3000
|
||||
- **Backend API**: http://localhost:8080
|
||||
- **API 文档**: http://localhost:8080/swagger-ui.html
|
||||
- **Skill Scanner**: http://localhost:8000
|
||||
|
||||
## 本地开发
|
||||
|
||||
如果需要从源码启动开发环境:
|
||||
|
||||
```bash
|
||||
# 克隆仓库
|
||||
git clone https://github.com/iflytek/skillhub.git
|
||||
cd skillhub
|
||||
|
||||
# 启动所有服务(包含 Scanner)
|
||||
make dev-all
|
||||
```
|
||||
|
||||
## 登录系统
|
||||
|
||||
### 方式一:使用内置管理员账号
|
||||
|
||||
SkillHub 内置了一个超级管理员账号,可以直接登录:
|
||||
|
||||
- **用户名**:`admin`
|
||||
- **密码**:`ChangeMe!2026`
|
||||
|
||||
> **安全提示**:生产环境部署后,请立即修改默认密码。
|
||||
|
||||
### 方式二:注册新账号
|
||||
|
||||
访问 http://localhost:3000/register 注册新账号。
|
||||
|
||||
### 方式三:使用 Mock 用户(仅本地开发)
|
||||
|
||||
本地开发时,可以使用 Mock 用户头快速登录:
|
||||
|
||||
```bash
|
||||
# 普通用户
|
||||
curl -H "X-Mock-User-Id: local-user" http://localhost:8080/api/v1/auth/me
|
||||
|
||||
# 超级管理员
|
||||
curl -H "X-Mock-User-Id: local-admin" http://localhost:8080/api/v1/auth/me
|
||||
```
|
||||
|
||||
在浏览器中,可以通过浏览器插件(如 ModHeader)添加 `X-Mock-User-Id` 请求头。
|
||||
|
||||
## 安装 CLI 工具
|
||||
|
||||
SkillHub 兼容 OpenClaw CLI,可以使用 `npx clawhub` 命令管理技能包:
|
||||
|
||||
```bash
|
||||
# 配置 SkillHub 注册中心地址
|
||||
export CLAWHUB_REGISTRY=http://localhost:8080
|
||||
|
||||
# 搜索技能包
|
||||
npx clawhub search email
|
||||
|
||||
# 安装技能包
|
||||
npx clawhub install my-skill
|
||||
|
||||
# 发布技能包
|
||||
npx clawhub publish ./my-skill
|
||||
```
|
||||
|
||||
## 发布第一个技能包
|
||||
|
||||
### 使用 CLI 工具发布(推荐)
|
||||
|
||||
1. **准备技能包**
|
||||
|
||||
创建一个简单的技能包目录:
|
||||
|
||||
```
|
||||
my-skill/
|
||||
├── skill.md # 技能描述
|
||||
├── package.json # 元数据
|
||||
└── scripts/ # 脚本文件
|
||||
└── main.py
|
||||
```
|
||||
|
||||
2. **使用 CLI 发布**
|
||||
|
||||
```bash
|
||||
# 配置注册中心
|
||||
export CLAWHUB_REGISTRY=http://localhost:8080
|
||||
|
||||
# 发布到默认命名空间
|
||||
npx clawhub publish ./my-skill
|
||||
|
||||
# 发布到指定命名空间
|
||||
npx clawhub publish ./my-skill --namespace my-team
|
||||
```
|
||||
|
||||
3. **等待安全扫描**
|
||||
|
||||
发布后,Skill Scanner 会自动扫描技能包,检测潜在的安全问题:
|
||||
- 恶意代码检测
|
||||
- 敏感信息泄露
|
||||
- 依赖漏洞扫描
|
||||
- 行为分析
|
||||
|
||||
扫描结果会显示在技能包详情页。
|
||||
|
||||
4. **等待审核**(如果命名空间开启了审核)
|
||||
|
||||
管理员会收到通知,审核通过后技能包正式发布。
|
||||
|
||||
### 使用 Web UI 发布
|
||||
|
||||
1. 访问 http://localhost:3000/dashboard/publish
|
||||
2. 选择命名空间(如果没有,先创建一个)
|
||||
3. 上传 zip 文件
|
||||
4. 选择可见性(PUBLIC / PRIVATE / INTERNAL)
|
||||
5. 点击「发布」
|
||||
|
||||
## 搜索和下载技能包
|
||||
|
||||
### 使用 CLI 工具
|
||||
|
||||
```bash
|
||||
# 搜索技能包
|
||||
npx clawhub search pdf
|
||||
|
||||
# 安装技能包
|
||||
npx clawhub install pdf-parser
|
||||
|
||||
# 安装指定命名空间的技能包
|
||||
npx clawhub install my-team--pdf-parser
|
||||
```
|
||||
|
||||
### 使用 Web UI
|
||||
|
||||
1. 访问 http://localhost:3000/search
|
||||
2. 输入关键词搜索
|
||||
3. 点击技能包查看详情
|
||||
4. 点击「下载」或复制安装命令
|
||||
|
||||
## 升级 SkillHub
|
||||
|
||||
使用 curl 命令升级到最新版本:
|
||||
|
||||
```bash
|
||||
# 升级到最新版本
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- pull
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- down
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up
|
||||
|
||||
# 升级到指定版本
|
||||
curl -fsSL https://imageless.oss-cn-beijing.aliyuncs.com/runtime.sh | sh -s -- up --version v0.2.0
|
||||
```
|
||||
|
||||
> **注意**:升级前建议备份数据库和对象存储。
|
||||