Fix ClawHub display name typo in Skills Catalog (#2895)
The Skills Catalog source dropdown showed "ClawdHub"; the registry brands itself as ClawHub. Update curated/fallback labels across web, UI, and VS Code, align docs, and add regression tests. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
This commit is contained in:
co-authored by
Serhii Dziupin
parent
397b9840b7
commit
a216b6871f
@@ -12,7 +12,7 @@ Zum Schreiben eigener Skills siehe [Skills](/skills/).
|
||||
## Einen Skill installieren
|
||||
|
||||
1. Öffne den Katalog.
|
||||
2. Durchsuche die eingebauten Quellen — das Anthropic-Skills-Repo und die ClawdHub-Community-Registry — oder nutze die Suche.
|
||||
2. Durchsuche die eingebauten Quellen — das Anthropic-Skills-Repo und die ClawHub-Community-Registry — oder nutze die Suche.
|
||||
3. Wähle einen Skill aus und installiere ihn.
|
||||
4. Entscheide, wo er installiert werden soll: für alles, was du tust, oder nur für das aktuelle Projekt.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Para escribir tus propias skills, consulta [Skills](/es/skills/).
|
||||
## Instala una skill
|
||||
|
||||
1. Abre el catálogo.
|
||||
2. Explora las fuentes integradas —el repositorio de skills de Anthropic y el registro comunitario de ClawdHub— o busca.
|
||||
2. Explora las fuentes integradas —el repositorio de skills de Anthropic y el registro comunitario de ClawHub— o busca.
|
||||
3. Elige una skill e instálala.
|
||||
4. Elige dónde instalarla: para todo lo que hagas, o solo en el proyecto actual.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Pour écrire vos propres skills, voir [Skills](/skills/).
|
||||
## Installer un skill
|
||||
|
||||
1. Ouvrez le catalogue.
|
||||
2. Parcourez les sources intégrées — le dépôt de skills Anthropic et le registre communautaire ClawdHub — ou lancez une recherche.
|
||||
2. Parcourez les sources intégrées — le dépôt de skills Anthropic et le registre communautaire ClawHub — ou lancez une recherche.
|
||||
3. Choisissez un skill et installez-le.
|
||||
4. Choisissez où l’installer : pour tout ce que vous faites, ou seulement pour le projet actuel.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Skills Catalog では、自分で書く代わりに、他の人が公開した
|
||||
## スキルをインストールする
|
||||
|
||||
1. カタログを開きます。
|
||||
2. 組み込みソース(Anthropic skills repo と ClawdHub community registry)を閲覧するか、検索します。
|
||||
2. 組み込みソース(Anthropic skills repo と ClawHub community registry)を閲覧するか、検索します。
|
||||
3. スキルを選び、インストールします。
|
||||
4. インストール先を選びます。すべての作業で使うか、現在のプロジェクトだけで使うかです。
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Skills Catalog를 사용하면 직접 작성하는 대신 다른 사람이 게
|
||||
## 스킬 설치하기
|
||||
|
||||
1. 카탈로그를 엽니다.
|
||||
2. 내장된 소스(Anthropic 스킬 저장소와 ClawdHub 커뮤니티 레지스트리)를 둘러보거나 검색합니다.
|
||||
2. 내장된 소스(Anthropic 스킬 저장소와 ClawHub 커뮤니티 레지스트리)를 둘러보거나 검색합니다.
|
||||
3. 스킬을 선택하고 설치합니다.
|
||||
4. 설치 위치를 선택합니다. 모든 작업에 적용할지, 현재 프로젝트에만 적용할지 선택합니다.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Aby pisać własne skille, zobacz [Skille](/pl/skills/).
|
||||
## Zainstaluj skill
|
||||
|
||||
1. Otwórz katalog.
|
||||
2. Przeglądaj wbudowane źródła — repozytorium skilli Anthropic oraz rejestr społeczności ClawdHub — albo wyszukaj.
|
||||
2. Przeglądaj wbudowane źródła — repozytorium skilli Anthropic oraz rejestr społeczności ClawHub — albo wyszukaj.
|
||||
3. Wybierz skill i zainstaluj go.
|
||||
4. Wybierz, gdzie go zainstalować: dla wszystkiego, co robisz, albo tylko dla bieżącego projektu.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Para escrever suas próprias skills, veja [Skills](/pt-br/skills/).
|
||||
## Instalar uma skill
|
||||
|
||||
1. Abra o catálogo.
|
||||
2. Navegue pelas fontes integradas — o repositório de skills da Anthropic e o registro comunitário ClawdHub — ou pesquise.
|
||||
2. Navegue pelas fontes integradas — o repositório de skills da Anthropic e o registro comunitário ClawHub — ou pesquise.
|
||||
3. Escolha uma skill e instale-a.
|
||||
4. Escolha onde instalá-la: para tudo o que você faz, ou apenas no projeto atual.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ For writing your own skills, see [Skills](/skills/).
|
||||
## Install a skill
|
||||
|
||||
1. Open the catalog.
|
||||
2. Browse the built-in sources — the Anthropic skills repo and the ClawdHub community registry — or search.
|
||||
2. Browse the built-in sources — the Anthropic skills repo and the ClawHub community registry — or search.
|
||||
3. Pick a skill and install it.
|
||||
4. Choose where to install it: for everything you do, or just the current project.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ description: Переглядайте та встановлюйте готові
|
||||
## Встановлення навички
|
||||
|
||||
1. Відкрийте каталог.
|
||||
2. Перегляньте вбудовані джерела — репозиторій навичок Anthropic та спільнотний реєстр ClawdHub — або скористайтеся пошуком.
|
||||
2. Перегляньте вбудовані джерела — репозиторій навичок Anthropic та спільнотний реєстр ClawHub — або скористайтеся пошуком.
|
||||
3. Оберіть навичку й установіть її.
|
||||
4. Виберіть, куди встановити: для всього, що ви робите, чи лише для поточного проєкту.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Skills 目录让你能够安装其他人发布的 skill,而不必自己编写
|
||||
## 安装 skill
|
||||
|
||||
1. 打开目录。
|
||||
2. 浏览内置来源 — Anthropic skills 仓库和 ClawdHub 社区注册表 — 或进行搜索。
|
||||
2. 浏览内置来源 — Anthropic skills 仓库和 ClawHub 社区注册表 — 或进行搜索。
|
||||
3. 选择一个 skill 并安装它。
|
||||
4. 选择安装位置:用于你的所有工作,或仅用于当前项目。
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import { beforeEach, describe, expect, mock, test } from 'bun:test';
|
||||
|
||||
mock.module('@/lib/opencode/client', () => ({
|
||||
opencodeClient: {
|
||||
getDirectory: () => undefined,
|
||||
},
|
||||
}));
|
||||
|
||||
mock.module('@/stores/useProjectsStore', () => ({
|
||||
useProjectsStore: {
|
||||
getState: () => ({
|
||||
getActiveProject: () => null,
|
||||
}),
|
||||
},
|
||||
}));
|
||||
|
||||
mock.module('@/lib/runtime-fetch', () => ({
|
||||
runtimeFetch: async () => new Response('{}', { status: 500 }),
|
||||
}));
|
||||
|
||||
mock.module('@/stores/useSkillsStore', () => ({
|
||||
invalidateSkillsLoadCache: () => undefined,
|
||||
refreshSkillsAfterOpenCodeRestart: async () => undefined,
|
||||
useSkillsStore: {
|
||||
getState: () => ({}),
|
||||
},
|
||||
}));
|
||||
|
||||
mock.module('@/lib/configUpdate', () => ({
|
||||
startConfigUpdate: () => undefined,
|
||||
finishConfigUpdate: () => undefined,
|
||||
updateConfigUpdateMessage: () => undefined,
|
||||
}));
|
||||
|
||||
const { useSkillsCatalogStore } = await import('./useSkillsCatalogStore');
|
||||
|
||||
describe('skills catalog ClawHub label', () => {
|
||||
beforeEach(() => {
|
||||
useSkillsCatalogStore.setState({
|
||||
sources: useSkillsCatalogStore.getState().sources,
|
||||
});
|
||||
});
|
||||
|
||||
test('fallback sources label ClawHub correctly', () => {
|
||||
const clawhub = useSkillsCatalogStore.getState().sources.find((source) => source.id === 'clawdhub');
|
||||
expect(clawhub).toBeDefined();
|
||||
expect(clawhub?.label).toBe('ClawHub');
|
||||
});
|
||||
});
|
||||
@@ -30,7 +30,7 @@ const FALLBACK_SOURCES: SkillsCatalogSource[] = [
|
||||
},
|
||||
{
|
||||
id: 'clawdhub',
|
||||
label: 'ClawdHub',
|
||||
label: 'ClawHub',
|
||||
description: 'Community skill registry with vector search',
|
||||
source: 'clawdhub:registry',
|
||||
sourceType: 'clawdhub',
|
||||
|
||||
@@ -85,7 +85,7 @@ const CURATED_SOURCES: CuratedSource[] = [
|
||||
},
|
||||
{
|
||||
id: 'clawdhub',
|
||||
label: 'ClawdHub',
|
||||
label: 'ClawHub',
|
||||
description: 'Community skill registry with vector search',
|
||||
source: 'clawdhub:registry',
|
||||
},
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
# Skills Catalog Module Documentation
|
||||
|
||||
## Purpose
|
||||
This module provides skill discovery, scanning, and installation capabilities for OpenCode. It supports multiple skill sources including git repositories and the ClawdHub registry, with caching and conflict resolution for skill installation.
|
||||
This module provides skill discovery, scanning, and installation capabilities for OpenCode. It supports multiple skill sources including git repositories and the ClawHub registry, with caching and conflict resolution for skill installation.
|
||||
|
||||
## Entrypoints and structure
|
||||
- `packages/web/server/lib/skills-catalog/`: Skills catalog module directory containing all skill-related functionality.
|
||||
- `cache.js`: In-memory cache for scan results with TTL support.
|
||||
- `curated-sources.js`: Predefined skill sources (Anthropic, ClawdHub).
|
||||
- `curated-sources.js`: Predefined skill sources (Anthropic, ClawHub).
|
||||
- `git.js`: Git operations helpers for cloning and auth error detection.
|
||||
- `install.js`: Skills installation from git repositories.
|
||||
- `scan.js`: Skills scanning from git repositories.
|
||||
- `source.js`: Source string parsing for git repositories.
|
||||
- `clawdhub/`: ClawdHub registry integration.
|
||||
- `index.js`: Public API exports for ClawdHub.
|
||||
- `scan.js`: Scanning ClawdHub registry with pagination.
|
||||
- `install.js`: Installation from ClawdHub (ZIP download).
|
||||
- `api.js`: ClawdHub API client with rate limiting.
|
||||
- `clawdhub/`: ClawHub registry integration.
|
||||
- `index.js`: Public API exports for ClawHub.
|
||||
- `scan.js`: Scanning ClawHub registry with pagination.
|
||||
- `install.js`: Installation from ClawHub (ZIP download).
|
||||
- `api.js`: ClawHub API client with rate limiting.
|
||||
|
||||
## Public API
|
||||
|
||||
@@ -28,7 +28,7 @@ The following functions are exported and used by the web server:
|
||||
- `clearCache()`: Clear all cached scan results.
|
||||
|
||||
### Curated Sources (`curated-sources.js`)
|
||||
- `getCuratedSkillsSources()`: Return list of curated skill sources (Anthropic, ClawdHub).
|
||||
- `getCuratedSkillsSources()`: Return list of curated skill sources (Anthropic, ClawHub).
|
||||
- `CURATED_SKILLS_SOURCES`: Constant array of predefined sources.
|
||||
|
||||
### Source Parsing (`source.js`)
|
||||
@@ -40,17 +40,17 @@ The following functions are exported and used by the web server:
|
||||
### Git Repository Installation (`install.js`)
|
||||
- `installSkillsFromRepository({ source, subpath, defaultSubpath, identity, scope, targetSource, workingDirectory, userSkillDir, selections, conflictPolicy, conflictDecisions })`: Install skills from git repository. Supports user/project scopes, opencode/agents targets, conflict resolution (prompt/skipAll/overwriteAll), and sparse checkout for efficiency.
|
||||
|
||||
### ClawdHub Integration (`clawdhub/index.js`)
|
||||
- `isClawdHubSource(source)`: Check if source string refers to ClawdHub.
|
||||
- `scanClawdHub()`: Scan entire ClawdHub registry for all skills (paginated, max 20 pages).
|
||||
- `scanClawdHubPage({ cursor })`: Scan a single page of ClawdHub results with cursor-based pagination.
|
||||
- `installSkillsFromClawdHub({ scope, targetSource, workingDirectory, userSkillDir, selections, conflictPolicy, conflictDecisions })`: Install skills from ClawdHub by downloading ZIP files.
|
||||
- `fetchClawdHubSkills({ cursor })`: Fetch paginated skills list from ClawdHub API.
|
||||
### ClawHub Integration (`clawdhub/index.js`)
|
||||
- `isClawdHubSource(source)`: Check if source string refers to ClawHub.
|
||||
- `scanClawdHub()`: Scan entire ClawHub registry for all skills (paginated, max 20 pages).
|
||||
- `scanClawdHubPage({ cursor })`: Scan a single page of ClawHub results with cursor-based pagination.
|
||||
- `installSkillsFromClawdHub({ scope, targetSource, workingDirectory, userSkillDir, selections, conflictPolicy, conflictDecisions })`: Install skills from ClawHub by downloading ZIP files.
|
||||
- `fetchClawdHubSkills({ cursor })`: Fetch paginated skills list from ClawHub API.
|
||||
- `fetchClawdHubSkillVersion(slug, version)`: Fetch specific skill version details.
|
||||
- `fetchClawdHubSkillInfo(slug)`: Fetch skill metadata without version details.
|
||||
- `downloadClawdHubSkill(slug, version)`: Download skill package as ZIP buffer.
|
||||
|
||||
### ClawdHub Constants (`clawdhub/index.js`)
|
||||
### ClawHub Constants (`clawdhub/index.js`)
|
||||
- `CLAWDHUB_SOURCE_ID`: Source identifier for curated sources.
|
||||
- `CLAWDHUB_SOURCE_STRING`: Source string format.
|
||||
|
||||
@@ -82,9 +82,9 @@ The following functions are internal helpers used by exported functions:
|
||||
- `toFsPath(repoDir, repoRelPosixPath)`: Convert POSIX path to filesystem path.
|
||||
- `getTargetSkillDir({ scope, targetSource, workingDirectory, userSkillDir, skillName })`: Determine target installation directory based on scope (user/project), targetSource (opencode/agents), and skill name.
|
||||
|
||||
### ClawdHub API Helpers (`clawdhub/api.js`)
|
||||
### ClawHub API Helpers (`clawdhub/api.js`)
|
||||
- `rateLimitedFetch(url, options)`: Fetch with rate limiting (120 req/min limit, 100ms delay between requests, exponential backoff on 429/500 errors).
|
||||
- `mapClawdHubItem(item)`: Transform ClawdHub API response to SkillsCatalogItem format.
|
||||
- `mapClawdHubItem(item)`: Transform ClawHub API response to SkillsCatalogItem format.
|
||||
|
||||
## Response Contracts
|
||||
|
||||
@@ -101,9 +101,9 @@ The following functions are internal helpers used by exported functions:
|
||||
- `skipped`: Array of skipped skills with `{ skillName, reason }`.
|
||||
- `error`: Error object with `{ kind, message, conflicts? }` on failure. Kinds: `authRequired`, `networkError`, `conflicts`, `invalidSource`, `unknown`.
|
||||
|
||||
### ClawdHub Scan Response
|
||||
### ClawHub Scan Response
|
||||
- `ok`: Boolean indicating success.
|
||||
- `items`: Array of skill items with ClawdHub-specific metadata in `clawdhub` property.
|
||||
- `items`: Array of skill items with ClawHub-specific metadata in `clawdhub` property.
|
||||
- `nextCursor`: Pagination cursor for next page (only for `scanClawdHubPage`).
|
||||
- `error`: Error object with `{ kind, message }` on failure.
|
||||
|
||||
@@ -129,7 +129,7 @@ The following functions are internal helpers used by exported functions:
|
||||
|
||||
### Skill Name Validation
|
||||
- All skill names must match `/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/` (1-64 chars).
|
||||
- Skill names are derived from directory basenames for git repos and slugs for ClawdHub.
|
||||
- Skill names are derived from directory basenames for git repos and slugs for ClawHub.
|
||||
- Invalid names result in non-installable skills with appropriate warnings.
|
||||
|
||||
### Git Cloning Strategy
|
||||
@@ -144,8 +144,8 @@ The following functions are internal helpers used by exported functions:
|
||||
- Per-skill decisions override global policy via `conflictDecisions` map.
|
||||
- Conflict response includes `{ skillName, scope, source }` for each conflict.
|
||||
|
||||
### ClawdHub Integration
|
||||
- ClawdHub API base URL: `https://clawdhub.com/api/v1`.
|
||||
### ClawHub Integration
|
||||
- ClawHub API base URL: `https://clawdhub.com/api/v1`.
|
||||
- Pagination uses cursor-based approach with `MAX_PAGES=20` safety limit.
|
||||
- Rate limiting: 120 req/min with 100ms delay between requests.
|
||||
- Downloaded skills are extracted from ZIP files using `adm-zip`.
|
||||
|
||||
@@ -9,7 +9,7 @@ const CURATED_SKILLS_SOURCES = [
|
||||
},
|
||||
{
|
||||
id: 'clawdhub',
|
||||
label: 'ClawdHub',
|
||||
label: 'ClawHub',
|
||||
description: 'Community skill registry with vector search',
|
||||
source: 'clawdhub:registry',
|
||||
sourceType: 'clawdhub',
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { getCuratedSkillsSources } from './curated-sources.js';
|
||||
|
||||
describe('getCuratedSkillsSources', () => {
|
||||
it('labels the ClawHub curated source as ClawHub', () => {
|
||||
const clawhub = getCuratedSkillsSources().find((source) => source.id === 'clawdhub');
|
||||
expect(clawhub).toBeDefined();
|
||||
expect(clawhub.label).toBe('ClawHub');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user