From a216b6871f0baf632a97359e3311215730021ac8 Mon Sep 17 00:00:00 2001 From: Serhii Dziupin Date: Fri, 14 Aug 2026 18:49:31 +0000 Subject: [PATCH] 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 --- .../docs/content/docs/de/skills-catalog.mdx | 2 +- .../docs/content/docs/es/skills-catalog.mdx | 2 +- .../docs/content/docs/fr/skills-catalog.mdx | 2 +- .../docs/content/docs/ja/skills-catalog.mdx | 2 +- .../docs/content/docs/ko/skills-catalog.mdx | 2 +- .../docs/content/docs/pl/skills-catalog.mdx | 2 +- .../content/docs/pt-br/skills-catalog.mdx | 2 +- packages/docs/content/docs/skills-catalog.mdx | 2 +- .../docs/content/docs/uk/skills-catalog.mdx | 2 +- .../content/docs/zh-cn/skills-catalog.mdx | 2 +- ...seSkillsCatalogStore.clawhub-label.test.ts | 49 +++++++++++++++++++ .../ui/src/stores/useSkillsCatalogStore.ts | 2 +- packages/vscode/src/skillsCatalog.ts | 2 +- .../lib/skills-catalog/DOCUMENTATION.md | 44 ++++++++--------- .../lib/skills-catalog/curated-sources.js | 2 +- .../skills-catalog/curated-sources.test.js | 10 ++++ 16 files changed, 94 insertions(+), 35 deletions(-) create mode 100644 packages/ui/src/stores/useSkillsCatalogStore.clawhub-label.test.ts create mode 100644 packages/web/server/lib/skills-catalog/curated-sources.test.js diff --git a/packages/docs/content/docs/de/skills-catalog.mdx b/packages/docs/content/docs/de/skills-catalog.mdx index 1b1c35a7..afb5f31e 100644 --- a/packages/docs/content/docs/de/skills-catalog.mdx +++ b/packages/docs/content/docs/de/skills-catalog.mdx @@ -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. diff --git a/packages/docs/content/docs/es/skills-catalog.mdx b/packages/docs/content/docs/es/skills-catalog.mdx index 801874c2..eadec080 100644 --- a/packages/docs/content/docs/es/skills-catalog.mdx +++ b/packages/docs/content/docs/es/skills-catalog.mdx @@ -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. diff --git a/packages/docs/content/docs/fr/skills-catalog.mdx b/packages/docs/content/docs/fr/skills-catalog.mdx index 4ccea878..72123162 100644 --- a/packages/docs/content/docs/fr/skills-catalog.mdx +++ b/packages/docs/content/docs/fr/skills-catalog.mdx @@ -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. diff --git a/packages/docs/content/docs/ja/skills-catalog.mdx b/packages/docs/content/docs/ja/skills-catalog.mdx index c45fa791..8991f05f 100644 --- a/packages/docs/content/docs/ja/skills-catalog.mdx +++ b/packages/docs/content/docs/ja/skills-catalog.mdx @@ -12,7 +12,7 @@ Skills Catalog では、自分で書く代わりに、他の人が公開した ## スキルをインストールする 1. カタログを開きます。 -2. 組み込みソース(Anthropic skills repo と ClawdHub community registry)を閲覧するか、検索します。 +2. 組み込みソース(Anthropic skills repo と ClawHub community registry)を閲覧するか、検索します。 3. スキルを選び、インストールします。 4. インストール先を選びます。すべての作業で使うか、現在のプロジェクトだけで使うかです。 diff --git a/packages/docs/content/docs/ko/skills-catalog.mdx b/packages/docs/content/docs/ko/skills-catalog.mdx index 664241a0..ba16461a 100644 --- a/packages/docs/content/docs/ko/skills-catalog.mdx +++ b/packages/docs/content/docs/ko/skills-catalog.mdx @@ -12,7 +12,7 @@ Skills Catalog를 사용하면 직접 작성하는 대신 다른 사람이 게 ## 스킬 설치하기 1. 카탈로그를 엽니다. -2. 내장된 소스(Anthropic 스킬 저장소와 ClawdHub 커뮤니티 레지스트리)를 둘러보거나 검색합니다. +2. 내장된 소스(Anthropic 스킬 저장소와 ClawHub 커뮤니티 레지스트리)를 둘러보거나 검색합니다. 3. 스킬을 선택하고 설치합니다. 4. 설치 위치를 선택합니다. 모든 작업에 적용할지, 현재 프로젝트에만 적용할지 선택합니다. diff --git a/packages/docs/content/docs/pl/skills-catalog.mdx b/packages/docs/content/docs/pl/skills-catalog.mdx index 56b3724f..d3544fa1 100644 --- a/packages/docs/content/docs/pl/skills-catalog.mdx +++ b/packages/docs/content/docs/pl/skills-catalog.mdx @@ -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. diff --git a/packages/docs/content/docs/pt-br/skills-catalog.mdx b/packages/docs/content/docs/pt-br/skills-catalog.mdx index 00adaa0f..eea841f4 100644 --- a/packages/docs/content/docs/pt-br/skills-catalog.mdx +++ b/packages/docs/content/docs/pt-br/skills-catalog.mdx @@ -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. diff --git a/packages/docs/content/docs/skills-catalog.mdx b/packages/docs/content/docs/skills-catalog.mdx index 381a878b..9ddcb131 100644 --- a/packages/docs/content/docs/skills-catalog.mdx +++ b/packages/docs/content/docs/skills-catalog.mdx @@ -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. diff --git a/packages/docs/content/docs/uk/skills-catalog.mdx b/packages/docs/content/docs/uk/skills-catalog.mdx index 732abeb4..78c0c1d6 100644 --- a/packages/docs/content/docs/uk/skills-catalog.mdx +++ b/packages/docs/content/docs/uk/skills-catalog.mdx @@ -12,7 +12,7 @@ description: Переглядайте та встановлюйте готові ## Встановлення навички 1. Відкрийте каталог. -2. Перегляньте вбудовані джерела — репозиторій навичок Anthropic та спільнотний реєстр ClawdHub — або скористайтеся пошуком. +2. Перегляньте вбудовані джерела — репозиторій навичок Anthropic та спільнотний реєстр ClawHub — або скористайтеся пошуком. 3. Оберіть навичку й установіть її. 4. Виберіть, куди встановити: для всього, що ви робите, чи лише для поточного проєкту. diff --git a/packages/docs/content/docs/zh-cn/skills-catalog.mdx b/packages/docs/content/docs/zh-cn/skills-catalog.mdx index f17f2a05..f393944e 100644 --- a/packages/docs/content/docs/zh-cn/skills-catalog.mdx +++ b/packages/docs/content/docs/zh-cn/skills-catalog.mdx @@ -12,7 +12,7 @@ Skills 目录让你能够安装其他人发布的 skill,而不必自己编写 ## 安装 skill 1. 打开目录。 -2. 浏览内置来源 — Anthropic skills 仓库和 ClawdHub 社区注册表 — 或进行搜索。 +2. 浏览内置来源 — Anthropic skills 仓库和 ClawHub 社区注册表 — 或进行搜索。 3. 选择一个 skill 并安装它。 4. 选择安装位置:用于你的所有工作,或仅用于当前项目。 diff --git a/packages/ui/src/stores/useSkillsCatalogStore.clawhub-label.test.ts b/packages/ui/src/stores/useSkillsCatalogStore.clawhub-label.test.ts new file mode 100644 index 00000000..5fbd101a --- /dev/null +++ b/packages/ui/src/stores/useSkillsCatalogStore.clawhub-label.test.ts @@ -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'); + }); +}); diff --git a/packages/ui/src/stores/useSkillsCatalogStore.ts b/packages/ui/src/stores/useSkillsCatalogStore.ts index 6585d152..7270928c 100644 --- a/packages/ui/src/stores/useSkillsCatalogStore.ts +++ b/packages/ui/src/stores/useSkillsCatalogStore.ts @@ -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', diff --git a/packages/vscode/src/skillsCatalog.ts b/packages/vscode/src/skillsCatalog.ts index a61c887a..cefd3512 100644 --- a/packages/vscode/src/skillsCatalog.ts +++ b/packages/vscode/src/skillsCatalog.ts @@ -85,7 +85,7 @@ const CURATED_SOURCES: CuratedSource[] = [ }, { id: 'clawdhub', - label: 'ClawdHub', + label: 'ClawHub', description: 'Community skill registry with vector search', source: 'clawdhub:registry', }, diff --git a/packages/web/server/lib/skills-catalog/DOCUMENTATION.md b/packages/web/server/lib/skills-catalog/DOCUMENTATION.md index 4b4d1231..199a0271 100644 --- a/packages/web/server/lib/skills-catalog/DOCUMENTATION.md +++ b/packages/web/server/lib/skills-catalog/DOCUMENTATION.md @@ -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`. diff --git a/packages/web/server/lib/skills-catalog/curated-sources.js b/packages/web/server/lib/skills-catalog/curated-sources.js index 0144199c..ba62696d 100644 --- a/packages/web/server/lib/skills-catalog/curated-sources.js +++ b/packages/web/server/lib/skills-catalog/curated-sources.js @@ -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', diff --git a/packages/web/server/lib/skills-catalog/curated-sources.test.js b/packages/web/server/lib/skills-catalog/curated-sources.test.js new file mode 100644 index 00000000..7db92de5 --- /dev/null +++ b/packages/web/server/lib/skills-catalog/curated-sources.test.js @@ -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'); + }); +});