Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(skills): install ClawHub and skills.sh registry entries; unique catalog ids

M3gA-Mind4a3fc5233769
diff --git a/app/src/components/skills/SkillsExplorerTab.tsx b/app/src/components/skills/SkillsExplorerTab.tsx
index 2293d05408..0e7dbcbbea 100644
--- a/app/src/components/skills/SkillsExplorerTab.tsx
+++ b/app/src/components/skills/SkillsExplorerTab.tsx
@@ -282,6 +282,13 @@ function CatalogRow({ entry, installed, installing, onInstall, onClick }: Catalo
<TableCell className="w-px whitespace-nowrap text-right">
{installed ? (
<Badge variant="success">{t('skills.explorer.installed')}</Badge>
+ ) : !entry.download_url ? (
+ <Badge
+ variant="neutral"
+ title={t('skills.explorer.notInstallableHint')}
+ data-testid={`registry-not-installable-${entry.id}`}>
+ {t('skills.explorer.notInstallable')}
+ </Badge>
) : (
<Button
variant="secondary"
@@ -348,9 +355,15 @@ function SkillDetailDialog({
footer={
!installed && onInstall ? (
<div className="flex justify-end">
- <Button variant="secondary" size="sm" disabled={installing} onClick={onInstall}>
- {installing ? t('skills.explorer.installing') : t('skills.explorer.install')}
- </Button>
+ {downloadUrl ? (
+ <Button variant="secondary" size="sm" disabled={installing} onClick={onInstall}>
+ {installing ? t('skills.explorer.installing') : t('skills.explorer.install')}
+ </Button>
+ ) : (
+ <p className="text-xs text-content-muted">
+ {t('skills.explorer.notInstallableHint')}
+ </p>
+ )}
</div>
) : undefined
}>
diff --git a/app/src/components/skills/__tests__/SkillsExplorerTab.test.tsx b/app/src/components/skills/__tests__/SkillsExplorerTab.test.tsx
index 1c8f69d20e..83e2e3ef99 100644
--- a/app/src/components/skills/__tests__/SkillsExplorerTab.test.tsx
+++ b/app/src/components/skills/__tests__/SkillsExplorerTab.test.tsx
@@ -624,6 +624,27 @@ describe('SkillsExplorerTab', () => {
});
});
+ it('marks an entry with no SKILL.md download as not installable instead of offering Install', async () => {
+ const { skillsApi } = await import('../../../services/api/skillsApi');
+ const { skillRegistryApi } = await import('../../../services/api/skillRegistryApi');
+ vi.mocked(skillsApi.listWorkflows).mockResolvedValue([]);
+ vi.mocked(skillRegistryApi.browse).mockResolvedValue([
+ {
+ ...MOCK_CATALOG_ENTRY,
+ id: 'lobehub/prompt-agent',
+ name: 'Prompt Agent',
+ source: 'LobeHub',
+ download_url: '',
+ },
+ ]);
+
+ render(<SkillsExplorerTab />);
+
+ const badge = await screen.findByTestId('registry-not-installable-lobehub/prompt-agent');
+ expect(badge).toHaveTextContent('Not installable');
+ expect(screen.queryByTestId('registry-install-lobehub/prompt-agent')).toBeNull();
+ });
+
it('shows error toast when registry install fails', async () => {
const { skillsApi } = await import('../../../services/api/skillsApi');
const { skillRegistryApi } = await import('../../../services/api/skillRegistryApi');
diff --git a/app/src/lib/i18n/ar.ts b/app/src/lib/i18n/ar.ts
index dad03bbed6..e4a7293ede 100644
--- a/app/src/lib/i18n/ar.ts
+++ b/app/src/lib/i18n/ar.ts
@@ -756,6 +756,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'مثبت',
'skills.explorer.install': 'تثبيت',
'skills.explorer.installing': 'جارٍ التثبيت…',
+ 'skills.explorer.notInstallable': 'غير قابل للتثبيت',
+ 'skills.explorer.notInstallableHint':
+ 'لا يحتوي هذا الإدخال على ملف SKILL.md للتنزيل، لذا لا يمكن تثبيته من هنا.',
'skills.integrations': 'تكاملات Composio',
'skills.integrationsSubtitle':
'اتصالات OAuth السحابية: سجّل الدخول بحسابك ويتولى Composio إدارة الرموز حتى يتمكن الوكلاء من القراءة والتصرف نيابةً عنك. لا حاجة لإدارة مفاتيح API.',
diff --git a/app/src/lib/i18n/bn.ts b/app/src/lib/i18n/bn.ts
index de2145d4e4..028ba17f40 100644
--- a/app/src/lib/i18n/bn.ts
+++ b/app/src/lib/i18n/bn.ts
@@ -776,6 +776,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'ইনস্টল করা হয়েছে',
'skills.explorer.install': 'ইনস্টল করুন',
'skills.explorer.installing': 'ইনস্টল হচ্ছে…',
+ 'skills.explorer.notInstallable': 'ইনস্টলযোগ্য নয়',
+ 'skills.explorer.notInstallableHint':
+ 'এই এন্ট্রিতে ডাউনলোড করার মতো কোনো SKILL.md নেই, তাই এখান থেকে এটি ইনস্টল করা যাবে না।',
'skills.integrations': 'Composio ইন্টিগ্রেশন',
'skills.integrationsSubtitle':
'ক্লাউড-ভিত্তিক OAuth সংযোগ: আপনার অ্যাকাউন্ট দিয়ে সাইন ইন করুন এবং Composio টোকেন পরিচালনা করে যাতে এজেন্টরা আপনার পক্ষে পড়তে এবং কাজ করতে পারে। কোনো API কী পরিচালনা করতে হবে না।',
diff --git a/app/src/lib/i18n/de.ts b/app/src/lib/i18n/de.ts
index 4e7d6423b1..75d4182e88 100644
--- a/app/src/lib/i18n/de.ts
+++ b/app/src/lib/i18n/de.ts
@@ -809,6 +809,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'Installiert',
'skills.explorer.install': 'Installieren',
'skills.explorer.installing': 'Wird installiert…',
+ 'skills.explorer.notInstallable': 'Nicht installierbar',
+ 'skills.explorer.notInstallableHint':
+ 'Für diesen Eintrag gibt es keine SKILL.md zum Herunterladen, daher kann er hier nicht installiert werden.',
'skills.integrations': 'Composio-Integrationen',
'skills.integrationsSubtitle':
'Cloud-basierte OAuth-Verbindungen – mit deinem Konto anmelden und Composio verwaltet die Tokens, damit Agenten in deinem Namen lesen und handeln können. Keine API-Schlüssel notwendig.',
diff --git a/app/src/lib/i18n/en.ts b/app/src/lib/i18n/en.ts
index 0050246798..b86c5321d1 100644
--- a/app/src/lib/i18n/en.ts
+++ b/app/src/lib/i18n/en.ts
@@ -631,6 +631,9 @@ const en: TranslationMap = {
'skills.explorer.installed': 'Installed',
'skills.explorer.install': 'Install',
'skills.explorer.installing': 'Installing…',
+ 'skills.explorer.notInstallable': 'Not installable',
+ 'skills.explorer.notInstallableHint':
+ 'This entry has no SKILL.md to download, so it cannot be installed from here.',
'skills.integrations': 'Composio Integrations',
'skills.integrationsSubtitle':
'Cloud-based OAuth connections: sign in with your account and Composio brokers the tokens so agents can read and act on your behalf. No API keys to manage.',
diff --git a/app/src/lib/i18n/es.ts b/app/src/lib/i18n/es.ts
index 66b7cbdd8f..983eb5a14b 100644
--- a/app/src/lib/i18n/es.ts
+++ b/app/src/lib/i18n/es.ts
@@ -796,6 +796,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'Instalada',
'skills.explorer.install': 'Instalar',
'skills.explorer.installing': 'Instalando…',
+ 'skills.explorer.notInstallable': 'No instalable',
+ 'skills.explorer.notInstallableHint':
+ 'Esta entrada no tiene un SKILL.md para descargar, así que no se puede instalar desde aquí.',
'skills.integrations': 'Integraciones de Composio',
'skills.integrationsSubtitle':
'Conexiones OAuth en la nube: inicia sesión con tu cuenta y Composio gestiona los tokens para que los agentes puedan leer y actuar en tu nombre. Sin claves de API que administrar.',
diff --git a/app/src/lib/i18n/fr.ts b/app/src/lib/i18n/fr.ts
index 7bae8b9dec..8e65fb2f42 100644
--- a/app/src/lib/i18n/fr.ts
+++ b/app/src/lib/i18n/fr.ts
@@ -808,6 +808,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'Installée',
'skills.explorer.install': 'Installer',
'skills.explorer.installing': 'Installation…',
+ 'skills.explorer.notInstallable': 'Non installable',
+ 'skills.explorer.notInstallableHint':
+ "Cette entrée n'a pas de SKILL.md à télécharger, elle ne peut donc pas être installée ici.",
'skills.integrations': 'Intégrations Composio',
'skills.integrationsSubtitle':
'Connexions OAuth cloud: connectez-vous avec votre compte et Composio gère les jetons pour que les agents puissent lire et agir en votre nom. Aucune clé API à gérer.',
diff --git a/app/src/lib/i18n/hi.ts b/app/src/lib/i18n/hi.ts
index 9bf030ec58..3ce163ed85 100644
--- a/app/src/lib/i18n/hi.ts
+++ b/app/src/lib/i18n/hi.ts
@@ -777,6 +777,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'इंस्टॉल किया गया',
'skills.explorer.install': 'इंस्टॉल करें',
'skills.explorer.installing': 'इंस्टॉल हो रहा है…',
+ 'skills.explorer.notInstallable': 'इंस्टॉल नहीं हो सकता',
+ 'skills.explorer.notInstallableHint':
+ 'इस प्रविष्टि में डाउनलोड करने के लिए कोई SKILL.md नहीं है, इसलिए इसे यहाँ से इंस्टॉल नहीं किया जा सकता।',
'skills.integrations': 'Composio इंटीग्रेशन',
'skills.integrationsSubtitle':
'क्लाउड-आधारित OAuth कनेक्शन: अपने अकाउंट से साइन इन करें और Composio टोकन ब्रोकर करता है ताकि एजेंट आपकी ओर से पढ़ और कार्य कर सकें। कोई API कुंजी प्रबंधित नहीं करनी।',
diff --git a/app/src/lib/i18n/id.ts b/app/src/lib/i18n/id.ts
index 4e462a94a1..4484f29c29 100644
--- a/app/src/lib/i18n/id.ts
+++ b/app/src/lib/i18n/id.ts
@@ -786,6 +786,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'Terpasang',
'skills.explorer.install': 'Pasang',
'skills.explorer.installing': 'Memasang…',
+ 'skills.explorer.notInstallable': 'Tidak dapat dipasang',
+ 'skills.explorer.notInstallableHint':
+ 'Entri ini tidak memiliki SKILL.md untuk diunduh, jadi tidak dapat dipasang dari sini.',
'skills.integrations': 'Integrasi Composio',
'skills.integrationsSubtitle':
'Koneksi OAuth berbasis cloud: masuk dengan akun Anda dan Composio mengelola token agar agen dapat membaca dan bertindak atas nama Anda. Tidak perlu mengelola API key.',
diff --git a/app/src/lib/i18n/it.ts b/app/src/lib/i18n/it.ts
index 270cf39ef9..a1edbd415a 100644
--- a/app/src/lib/i18n/it.ts
+++ b/app/src/lib/i18n/it.ts
@@ -797,6 +797,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'Installata',
'skills.explorer.install': 'Installa',
'skills.explorer.installing': 'Installazione…',
+ 'skills.explorer.notInstallable': 'Non installabile',
+ 'skills.explorer.notInstallableHint':
+ 'Questa voce non ha un file SKILL.md da scaricare, quindi non può essere installata da qui.',
'skills.integrations': 'Integrazioni Composio',
'skills.integrationsSubtitle':
'Connessioni OAuth basate su cloud: accedi con il tuo account e Composio gestisce i token affinché gli agenti possano leggere e agire per tuo conto. Nessuna chiave API da gestire.',
diff --git a/app/src/lib/i18n/ko.ts b/app/src/lib/i18n/ko.ts
index 6dbb523d99..451dc9392a 100644
--- a/app/src/lib/i18n/ko.ts
+++ b/app/src/lib/i18n/ko.ts
@@ -769,6 +769,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': '설치됨',
'skills.explorer.install': '설치',
'skills.explorer.installing': '설치 중…',
+ 'skills.explorer.notInstallable': '설치 불가',
+ 'skills.explorer.notInstallableHint':
+ '이 항목에는 다운로드할 SKILL.md가 없어 여기서 설치할 수 없습니다.',
'skills.integrations': 'Composio 통합',
'skills.integrationsSubtitle':
'클라우드 기반 OAuth 연결: 계정으로 로그인하면 Composio가 토큰을 관리하여 에이전트가 사용자를 대신해 읽고 작동할 수 있습니다. API 키 관리가 필요 없습니다.',
diff --git a/app/src/lib/i18n/pl.ts b/app/src/lib/i18n/pl.ts
index 2c190fef41..840853e4bd 100644
--- a/app/src/lib/i18n/pl.ts
+++ b/app/src/lib/i18n/pl.ts
@@ -792,6 +792,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'Zainstalowano',
'skills.explorer.install': 'Zainstaluj',
'skills.explorer.installing': 'Instalowanie…',
+ 'skills.explorer.notInstallable': 'Nie można zainstalować',
+ 'skills.explorer.notInstallableHint':
+ 'Ten wpis nie ma pliku SKILL.md do pobrania, więc nie można go tu zainstalować.',
'skills.integrations': 'Integracje Composio',
'skills.integrationsSubtitle':
'Chmurowe połączenia OAuth: zaloguj się swoim kontem, a Composio pośredniczy w tokenach, dzięki czemu agenci mogą czytać i działać w Twoim imieniu. Bez kluczy API do utrzymywania.',
diff --git a/app/src/lib/i18n/pt.ts b/app/src/lib/i18n/pt.ts
index cf433476a1..f198fb008c 100644
--- a/app/src/lib/i18n/pt.ts
+++ b/app/src/lib/i18n/pt.ts
@@ -794,6 +794,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'Instalada',
'skills.explorer.install': 'Instalar',
'skills.explorer.installing': 'Instalando…',
+ 'skills.explorer.notInstallable': 'Não instalável',
+ 'skills.explorer.notInstallableHint':
+ 'Esta entrada não tem um SKILL.md para baixar, então não pode ser instalada aqui.',
'skills.integrations': 'Integrações do Composio',
'skills.integrationsSubtitle':
'Conexões OAuth baseadas em nuvem: faça login com sua conta e o Composio gerencia os tokens para que os agentes possam ler e agir em seu nome. Sem chaves de API para gerenciar.',
diff --git a/app/src/lib/i18n/ru.ts b/app/src/lib/i18n/ru.ts
index 3f303df653..a62473bbb1 100644
--- a/app/src/lib/i18n/ru.ts
+++ b/app/src/lib/i18n/ru.ts
@@ -787,6 +787,9 @@ const messages: TranslationMap = {
'skills.explorer.installed': 'Установлено',
'skills.explorer.install': 'Установить',
'skills.explorer.installing': 'Установка…',
+ 'skills.explorer.notInstallable': 'Нельзя установить',
+ 'skills.explorer.notInstallableHint':
+ 'У этой записи нет файла SKILL.md для загрузки, поэтому её нельзя установить отсюда.',
'skills.integrations': 'Интеграции Composio',
'skills.integrationsSubtitle':
'Облачные OAuth-подключения: войдите в свой аккаунт, и Composio управляет токенами, чтобы агенты могли читать и действовать от вашего имени. Никаких API-ключей для управления.',
diff --git a/app/src/lib/i18n/zh-CN.ts b/app/src/lib/i18n/zh-CN.ts
index 63a0995222..333de79125 100644
--- a/app/src/lib/i18n/zh-CN.ts
+++ b/app/src/lib/i18n/zh-CN.ts
@@ -722,6 +722,8 @@ const messages: TranslationMap = {
'skills.explorer.installed': '已安装',
'skills.explorer.install': '安装',
'skills.explorer.installing': '安装中…',
+ 'skills.explorer.notInstallable': '无法安装',
+ 'skills.explorer.notInstallableHint': '此条目没有可下载的 SKILL.md,因此无法在此安装。',
'skills.integrations': 'Composio 集成',
'skills.integrationsSubtitle':
'基于云端的 OAuth 连接:使用您的账户登录,Composio 代管令牌,让智能体能以您的名义读取数据并执行操作,无需管理 API 密钥。',
diff --git a/crates/openhuman-core/src/skills/catalog/README.md b/crates/openhuman-core/src/skills/catalog/README.md
index 4b443460d0..5bd44211b5 100644
--- a/crates/openhuman-core/src/skills/catalog/README.md
+++ b/crates/openhuman-core/src/skills/catalog/README.md
@@ -12,9 +12,12 @@ Owns remote skill catalogs and installed-skill lifecycle:
- Browse/search registry entries.
- Derive `SKILL.md` download URLs: Hermes bundled/optional skills from
`docsPath`, GitHub-hosted community skills from `sourceUrl` (blob/tree
- rewritten to `raw.githubusercontent.com`); portal-only sources
- (ClawHub/LobeHub/skills.sh) get no URL and `install` returns an actionable
- error instead of a 404.
+ rewritten to `raw.githubusercontent.com`), ClawHub from its file API by
+ slug, and skills.sh from the listed GitHub repo (located at install time).
+ LobeHub agents have no `SKILL.md`: they get no URL, search ranks them last,
+ and `install` returns an actionable error instead of a 404.
+- Give entries unique ids (the source-qualified Hermes `identifier`, or the
+ name for bundled skills) and resolve install requests to exactly one entry.
- Install catalog entries into the user skills directory.
- Uninstall user-scope skills.
- Host the built-in `skill_setup` agent.
@@ -24,7 +27,8 @@ Owns remote skill catalogs and installed-skill lifecycle:
| File | Purpose |
| --- | --- |
| `mod.rs` | Feature gate (`skills` Cargo feature) and module wiring; re-exports the controller aggregators |
-| `ops.rs` | Catalog fetch/cache, boot refresh, browse/search/sources/categories, download-URL derivation, `install_from_catalog` |
+| `ops.rs` | Catalog fetch/cache, boot refresh, browse/search/sources/categories, entry ids, download-URL derivation, `find_catalog_entry`, `install_from_catalog` |
+| `download.rs` | `SKILL.md` locations for ClawHub (file API) and skills.sh (GitHub repo probe + tree lookup) |
| `store.rs` | Catalog cache at `~/.openhuman/skill-registry/cache.json`, 1-hour TTL, kept past TTL for stale-while-revalidate; `OPENHUMAN_SKILL_REGISTRY_CACHE_DIR` relocates it (tests) |
| `tools.rs` | LLM-callable tools `skill_registry_browse`, `skill_registry_search`, `skill_registry_sources`, `skill_registry_install`, `skill_registry_uninstall` |
| `types.rs` | `CatalogEntry` |
diff --git a/crates/openhuman-core/src/skills/catalog/download.rs b/crates/openhuman-core/src/skills/catalog/download.rs
new file mode 100644
index 0000000000..3ebca0e5b7
--- /dev/null
+++ b/crates/openhuman-core/src/skills/catalog/download.rs
@@ -0,0 +1,147 @@
+//! Where a community skill's `SKILL.md` lives when its catalog entry is not a
+//! GitHub link.
+//!
+//! - **ClawHub** entries carry only a slug; ClawHub's file API serves the raw
+//! `SKILL.md` for it.
+//! - **skills.sh** entries point at `skills.sh/<owner>/<repo>/<skill>`, a
+//! listing of a GitHub repo. Repos keep skills in different directories, so
+//! the file is located at install time: the conventional directories first,
+//! then one recursive tree listing of the repo.
+//!
+//! LobeHub entries are system-prompt agents with no `SKILL.md` at all and stay
+//! uninstallable.
+
+use std::time::Duration;
+
+use serde_json::Value;
+
+const CLAWHUB_SKILLS_API: &str = "https://clawhub.ai/api/v1/skills";
+const GITHUB_RAW: &str = "https://raw.githubusercontent.com";
+const GITHUB_REPOS_API: &str = "https://api.github.com/repos";
+/// Directories a skills.sh repo conventionally keeps a skill under, probed in
+/// this order before listing the whole repo.
+const SKILLS_SH_BASE_DIRS: [&str; 4] = ["", "skills/", ".agents/skills/", ".claude/skills/"];
+const PROBE_TIMEOUT_SECS: u64 = 15;
+
+/// A catalog value is spliced into a URL path, so it must be one plain segment.
+fn is_safe_segment(value: &str) -> bool {
+ !value.is_empty()
+ && value != "."
+ && value != ".."
+ && value
+ .chars()
+ .all(|c| c.is_ascii_alphanumeric() || matches!(c, '-' | '_' | '.'))
+}
+
+/// Raw `SKILL.md` URL for a ClawHub skill slug.
+pub(super) fn clawhub_download_url(slug: &str) -> Option<String> {
+ is_safe_segment(slug).then(|| format!("{CLAWHUB_SKILLS_API}/{slug}/file?path=SKILL.md"))
+}
+
+/// A skills.sh listing, `https://skills.sh/<owner>/<repo>/<skill>`.
+#[derive(Debug)]
+pub(super) struct SkillsShRef<'a> {
+ pub(super) owner: &'a str,
+ pub(super) repo: &'a str,
+ pub(super) skill: &'a str,
+}
+
+impl<'a> SkillsShRef<'a> {
+ pub(super) fn parse(source_url: &'a str) -> Option<Self> {
+ let rest = source_url.strip_prefix("https://skills.sh/")?;
+ let mut parts = rest.trim_end_matches('/').split('/');
+ let (owner, repo, skill) = (parts.next()?, parts.next()?, parts.next()?);
+ if parts.next().is_some() || ![owner, repo, skill].into_iter().all(is_safe_segment) {
+ return None;
+ }
+ Some(Self { owner, repo, skill })
+ }
+
+ /// Raw URLs of the conventional skill locations, most common first.
+ pub(super) fn candidate_urls(&self) -> Vec<String> {
+ SKILLS_SH_BASE_DIRS
+ .iter()
+ .map(|base| self.raw_url(&format!("{base}{}/SKILL.md", self.skill)))
+ .collect()
+ }
+
+ fn raw_url(&self, path: &str) -> String {
+ format!("{GITHUB_RAW}/{}/{}/HEAD/{path}", self.owner, self.repo)
+ }
+
+ /// Locate this skill's `SKILL.md` in its GitHub repo.
+ pub(super) async fn resolve(&self) -> Result<String, String> {
+ let client = reqwest::Client::builder()
+ .timeout(Duration::from_secs(PROBE_TIMEOUT_SECS))
+ .user_agent("openhuman-core")
+ .build()
+ .map_err(|e| format!("failed to build http client: {e}"))?;
+
+ for url in self.candidate_urls() {
+ match client.head(&url).send().await {
+ Ok(resp) if resp.status().is_success() => {
+ tracing::info!(url = %url, "[skill_registry] skills.sh SKILL.md found");
+ return Ok(url);
+ }
+ Ok(resp) => tracing::debug!(
+ url = %url,
+ status = resp.status().as_u16(),
+ "[skill_registry] skills.sh candidate missing"
+ ),
+ Err(error) => tracing::debug!(
+ url = %url,
+ error = %error,
+ "[skill_registry] skills.sh candidate probe failed"
+ ),
+ }
+ }
+
+ // Not in a conventional directory: one recursive listing finds it anywhere.
+ let repo = format!("github.com/{}/{}", self.owner, self.repo);
+ let tree_url = format!(
+ "{GITHUB_REPOS_API}/{}/{}/git/trees/HEAD?recursive=1",
+ self.owner, self.repo
+ );
+ tracing::info!(repo = %repo, skill = %self.skill, "[skill_registry] listing repo tree for skills.sh skill");
+ let resp = client
+ .get(&tree_url)
+ .send()
+ .await
+ .map_err(|e| format!("could not list {repo} to locate '{}': {e}", self.skill))?;
+ if !resp.status().is_success() {
+ return Err(format!(
+ "could not list {repo} to locate '{}' (GitHub returned {})",
+ self.skill,
+ resp.status().as_u16()
+ ));
+ }
+ let tree: Value = resp
+ .json()
+ .await
+ .map_err(|e| format!("could not read the {repo} file listing: {e}"))?;
+ find_skill_md_in_tree(&tree, self.skill)
+ .map(|path| self.raw_url(&path))
+ .ok_or_else(|| {
+ format!(
+ "'{}' is listed on skills.sh, but {repo} has no {}/SKILL.md",
+ self.skill, self.skill
+ )
+ })
+ }
+}
+
+/// Path of `<skill>/SKILL.md` at any depth in a GitHub recursive tree listing.
+pub(super) fn find_skill_md_in_tree(tree: &Value, skill: &str) -> Option<String> {
+ let suffix = format!("/{skill}/SKILL.md");
+ tree.get("tree")?
+ .as_array()?
+ .iter()
+ .filter(|item| item.get("type").and_then(Value::as_str) == Some("blob"))
+ .filter_map(|item| item.get("path").and_then(Value::as_str))
+ .find(|path| path.ends_with(&suffix) || *path == &suffix[1..])
+ .map(str::to_string)
+}
+
+#[cfg(test)]
+#[path = "download_tests.rs"]
+mod tests;
diff --git a/crates/openhuman-core/src/skills/catalog/download_tests.rs b/crates/openhuman-core/src/skills/catalog/download_tests.rs
new file mode 100644
index 0000000000..c8a0323aa0
--- /dev/null
+++ b/crates/openhuman-core/src/skills/catalog/download_tests.rs
@@ -0,0 +1,65 @@
+use super::*;
+use serde_json::json;
+
+#[test]
+fn clawhub_download_url_uses_the_file_api_and_rejects_unsafe_slugs() {
+ assert_eq!(
+ clawhub_download_url("apple-design").as_deref(),
+ Some("https://clawhub.ai/api/v1/skills/apple-design/file?path=SKILL.md")
+ );
+ for slug in ["", ".", "..", "a/b", "a?b", "a b"] {
+ assert_eq!(clawhub_download_url(slug), None, "slug {slug:?}");
+ }
+}
+
+#[test]
+fn skills_sh_ref_parses_listing_urls_only() {
+ let skill = SkillsShRef::parse("https://skills.sh/getagentseal/founder-playbook/100m-leads")
+ .expect("skills.sh listing");
+ assert_eq!(
+ (skill.owner, skill.repo, skill.skill),
+ ("getagentseal", "founder-playbook", "100m-leads")
+ );
+ for url in [
+ "https://skills.sh/owner/repo",
+ "https://skills.sh/o/r/s/extra",
+ "https://skills.sh/o/../s",
+ "https://example.com/o/r/s",
+ "https://lobehub.com/agent/x",
+ ] {
+ assert!(SkillsShRef::parse(url).is_none(), "not a listing: {url}");
+ }
+}
+
+#[test]
+fn skills_sh_candidates_cover_the_conventional_skill_dirs() {
+ let skill = SkillsShRef::parse("https://skills.sh/o/r/my-skill").unwrap();
+ assert_eq!(
+ skill.candidate_urls(),
+ vec![
+ "https://raw.githubusercontent.com/o/r/HEAD/my-skill/SKILL.md",
+ "https://raw.githubusercontent.com/o/r/HEAD/skills/my-skill/SKILL.md",
+ "https://raw.githubusercontent.com/o/r/HEAD/.agents/skills/my-skill/SKILL.md",
+ "https://raw.githubusercontent.com/o/r/HEAD/.claude/skills/my-skill/SKILL.md",
+ ]
+ );
+}
+
+#[test]
+fn find_skill_md_in_tree_matches_the_skill_directory_at_any_depth() {
+ let tree = json!({ "tree": [
+ { "path": "plugins/x/skills/my-skill", "type": "tree" },
+ { "path": "plugins/x/skills/not-my-skill/SKILL.md", "type": "blob" },
+ { "path": "plugins/x/skills/my-skill/SKILL.md", "type": "blob" },
+ ]});
+ assert_eq!(
+ find_skill_md_in_tree(&tree, "my-skill").as_deref(),
+ Some("plugins/x/skills/my-skill/SKILL.md")
+ );
+ let root = json!({ "tree": [{ "path": "my-skill/SKILL.md", "type": "blob" }] });
+ assert_eq!(
+ find_skill_md_in_tree(&root, "my-skill").as_deref(),
+ Some("my-skill/SKILL.md")
+ );
+ assert_eq!(find_skill_md_in_tree(&tree, "other-skill"), None);
+}
diff --git a/crates/openhuman-core/src/skills/catalog/mod.rs b/crates/openhuman-core/src/skills/catalog/mod.rs
index 4fd85c8df1..9ba49a675a 100644
--- a/crates/openhuman-core/src/skills/catalog/mod.rs
+++ b/crates/openhuman-core/src/skills/catalog/mod.rs
@@ -14,6 +14,8 @@
#[cfg(feature = "skills")]
pub mod agent;
#[cfg(feature = "skills")]
+mod download;
+#[cfg(feature = "skills")]
pub mod ops;
#[cfg(feature = "skills")]
pub mod schemas;
diff --git a/crates/openhuman-core/src/skills/catalog/ops.rs b/crates/openhuman-core/src/skills/catalog/ops.rs
index c575a99fd7..71277cd141 100644
--- a/crates/openhuman-core/src/skills/catalog/ops.rs
+++ b/crates/openhuman-core/src/skills/catalog/ops.rs
@@ -9,6 +9,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
use tokio::sync::Mutex;
+use super::download::{self, SkillsShRef};
use super::store;
use super::store::CachedCatalog;
use super::types::CatalogEntry;
@@ -292,7 +293,7 @@ pub async fn search_catalog(
let catalog = browse_catalog_fresh().await?;
let q = query.to_lowercase();
- let filtered: Vec<CatalogEntry> = catalog
+ let mut filtered: Vec<CatalogEntry> = catalog
.into_iter()
.filter(|entry| {
if let Some(src) = source_filter {
@@ -319,6 +320,9 @@ pub async fn search_catalog(
.unwrap_or(false)
})
.collect();
+ // Entries install cannot fetch go last, so find-and-install reaches a
+ // working hit first. The sort is stable: match order is otherwise kept.
+ filtered.sort_by_key(|entry| !entry.has_direct_download());
tracing::debug!(
result_count = filtered.len(),
@@ -378,12 +382,110 @@ pub async fn install_from_catalog(
));
}
+ // A skills.sh entry's `download_url` is the most common location, not a
+ // verified one: find where this repo keeps the skill before fetching.
+ let url = match entry.source_url.as_deref().and_then(SkillsShRef::parse) {
+ Some(skill) if skill.candidate_urls().first() == Some(&entry.download_url) => {
+ skill.resolve().await?
+ }
+ _ => entry.download_url.clone(),
+ };
+
let params = crate::skills::ops_install::InstallWorkflowFromUrlParams {
- url: entry.download_url.clone(),
+ url,
timeout_secs: Some(60),
};
- crate::skills::ops_install::install_workflow_from_url(workspace_dir, params).await
+ crate::skills::ops_install::install_workflow_from_url(workspace_dir, params)
+ .await
+ .map_err(|error| {
+ // ClawHub answers a slug that several authors publish under with
+ // 409, and the catalog does not record which author's skill this is.
+ if entry.source.eq_ignore_ascii_case("clawhub") && error.ends_with("returned status 409")
+ {
+ format!(
+ "'{}' is published on ClawHub by more than one author and the catalog does not say which one, so it can't be installed automatically.",
+ entry.name
+ )
+ } else {
+ error
+ }
+ })
+}
+
+/// How many alternative ids an install error lists.
+const MAX_SUGGESTED_IDS: usize = 5;
+
+/// Resolve an install request to exactly one catalog entry.
+///
+/// `entry_id` is matched against [`CatalogEntry::id`]. Ids used to be display
+/// names, which many entries share, so a name is still accepted when exactly
+/// one entry carries it; otherwise the error names real ids to use instead.
+pub fn find_catalog_entry<'a>(
+ catalog: &'a [CatalogEntry],
+ entry_id: &str,
+) -> Result<&'a CatalogEntry, String> {
+ let entry_id = entry_id.trim();
+ if let Some(entry) = catalog.iter().find(|e| e.id == entry_id) {
+ return Ok(entry);
+ }
+ let named: Vec<&CatalogEntry> = catalog.iter().filter(|e| e.name == entry_id).collect();
+ match named.as_slice() {
+ [entry] => Ok(*entry),
+ [] => {
+ let closest = closest_entry_ids(catalog, entry_id);
+ tracing::debug!(
+ entry_id = %entry_id,
+ suggestions = closest.len(),
+ "[skill_registry] install id not in catalog"
+ );
+ let hint = if closest.is_empty() {
+ "Use an id returned by skill_registry_search.".to_string()
+ } else {
+ format!("Closest ids: {}.", closest.join(", "))
+ };
+ Err(format!("no catalog entry has id '{entry_id}'. {hint}"))
+ }
+ many => Err(format!(
+ "{} catalog entries are named '{entry_id}'; install one by its id, e.g. {}.",
+ many.len(),
+ many.iter()
+ .take(MAX_SUGGESTED_IDS)
+ .map(|e| e.id.as_str())
+ .collect::<Vec<_>>()
+ .join(", ")
+ )),
+ }
+}
+
+/// Ids sharing the most words with `wanted`; installable and shorter ids win ties.
+fn closest_entry_ids(catalog: &[CatalogEntry], wanted: &str) -> Vec<String> {
+ let words: Vec<String> = wanted
+ .split(|c: char| !c.is_alphanumeric())
+ .filter(|w| !w.is_empty())
+ .map(str::to_lowercase)
+ .collect();
+ let mut scored: Vec<(usize, bool, &str)> = catalog
+ .iter()
+ .filter_map(|entry| {
+ let haystack = format!("{} {}", entry.id, entry.name).to_lowercase();
+ let score = words
+ .iter()
+ .filter(|w| haystack.contains(w.as_str()))
+ .count();
+ (score > 0).then_some((score, entry.has_direct_download(), entry.id.as_str()))
+ })
+ .collect();
+ scored.sort_by(|a, b| {
+ b.0.cmp(&a.0)
+ .then(b.1.cmp(&a.1))
+ .then(a.2.len().cmp(&b.2.len()))
+ });
+ scored
+ .into_iter()
+ .take(MAX_SUGGESTED_IDS)
+ .map(|(_, _, id)| id.to_string())
+ .collect()
}
pub(crate) fn parse_hermes_entry(item: &serde_json::Value) -> Option<CatalogEntry> {
@@ -478,16 +580,22 @@ pub(crate) fn parse_hermes_entry(item: &serde_json::Value) -> Option<CatalogEntr
.filter(|s| !s.is_empty())
.map(|s| s.to_string());
+ let identifier = item
+ .get("identifier")
+ .and_then(|v| v.as_str())
+ .map(str::trim)
+ .filter(|s| !s.is_empty());
+
let download_url = derive_download_url(
&source,
- &category,
+ identifier,
&name,
docs_path.as_deref(),
source_url.as_deref(),
);
Some(CatalogEntry {
- id: name.clone(),
+ id: catalog_entry_id(&source, identifier, &name),
name,
description,
source,
@@ -505,25 +613,40 @@ pub(crate) fn parse_hermes_entry(item: &serde_json::Value) -> Option<CatalogEntr
})
}
+/// Stable, unique entry id.
+///
+/// Hermes publishes a unique `identifier` per entry. Most are already
+/// source-qualified paths (`skills-sh/o/r/s`, `lobehub/x`, `owner/repo/path`),
+/// but ClawHub's is a bare slug that can equal another source's skill name, so
+/// a bare identifier is prefixed with its source. Bundled and optional Hermes
+/// skills carry no identifier; their names are unique among themselves and
+/// contain no `/`, so they cannot collide with a qualified id.
+fn catalog_entry_id(source: &str, identifier: Option<&str>, name: &str) -> String {
+ match identifier {
+ Some(identifier) if identifier.contains('/') => identifier.to_string(),
+ Some(slug) => format!("{}/{slug}", source.to_ascii_lowercase()),
+ None => name.to_string(),
+ }
+}
+
/// Resolve a fetchable `SKILL.md` URL for a catalog entry.
///
/// Precedence:
/// 1. `OPENHUMAN_SKILL_REGISTRY_DOWNLOAD_BASE_URL` test override.
/// 2. `docsPath` — Hermes' own bundled / optional skills, which live in the
/// `NousResearch/hermes-agent` repo under `skills/` / `optional-skills/`.
-/// 3. `sourceUrl` — community skills (ClawHub / LobeHub / skills.sh / browse.sh
-/// / NVIDIA). When it points at a GitHub blob/tree it is rewritten to the
-/// `raw.githubusercontent.com` `SKILL.md`; non-GitHub portals have no raw
-/// download.
+/// 3. `sourceUrl` on GitHub (browse.sh, NVIDIA, GitHub, ...): the blob/tree
+/// view is rewritten to the `raw.githubusercontent.com` `SKILL.md`.
+/// 4. ClawHub `identifier`: ClawHub's file API by slug.
+/// 5. skills.sh `sourceUrl`: the most common location in the listed GitHub
+/// repo. [`install_from_catalog`] locates the real one before fetching.
///
-/// Returns an empty string when no direct download can be derived (portal-only
-/// community skills). [`install_from_catalog`] turns that into an actionable
-/// error rather than fetching a guaranteed-404 URL. Previously every community
-/// skill was force-templated onto a `NousResearch/hermes-agent` path it never
-/// lived at, so virtually all community installs 404'd — issue #3741.
+/// Returns an empty string when no download exists (LobeHub agents have no
+/// `SKILL.md`). [`install_from_catalog`] turns that into an actionable error
+/// rather than fetching a guaranteed-404 URL (#3741).
fn derive_download_url(
- _source: &str,
- _category: &str,
+ source: &str,
+ identifier: Option<&str>,
name: &str,
docs_path: Option<&str>,
source_url: Option<&str>,
@@ -540,7 +663,16 @@ fn derive_download_url(
if let Some(url) = source_url.and_then(download_url_from_source_url) {
return url;
}
- // No resolvable direct download (portal-only community skill).
+ if source.eq_ignore_ascii_case("clawhub") {
+ if let Some(url) = identifier.and_then(download::clawhub_download_url) {
+ return url;
+ }
+ }
+ if let Some(skill) = source_url.and_then(SkillsShRef::parse) {
+ if let Some(url) = skill.candidate_urls().into_iter().next() {
+ return url;
+ }
+ }
String::new()
}
diff --git a/crates/openhuman-core/src/skills/catalog/ops_tests.rs b/crates/openhuman-core/src/skills/catalog/ops_tests.rs
index 175e0e2f09..5f13ad47bb 100644
--- a/crates/openhuman-core/src/skills/catalog/ops_tests.rs
+++ b/crates/openhuman-core/src/skills/catalog/ops_tests.rs
@@ -79,31 +79,139 @@ fn parse_hermes_entry_derives_github_blob_source_url() {
}
#[test]
-fn parse_hermes_entry_leaves_portal_source_url_undownloadable() {
- // ClawHub / LobeHub / skills.sh portals serve HTML, not raw markdown —
- // no direct download. download_url is empty; source_url is preserved so
- // install can point the user at the page. (#3741)
- for url in [
- "https://clawhub.ai/skills/agentkilox-code-audit",
- "https://lobehub.com/agent/9-somboon",
- "https://skills.sh/sickn33/antigravity-awesome-skills/00-andruia-consultant",
+fn parse_hermes_entry_leaves_entries_without_a_skill_md_undownloadable() {
+ // LobeHub entries are system-prompt agents with no SKILL.md, and a ClawHub
+ // page without a slug gives the file API nothing to fetch. download_url is
+ // empty; source_url is preserved so install can point at the page. (#3741)
+ for (source, url) in [
+ ("LobeHub", "https://lobehub.com/agent/9-somboon"),
+ ("ClawHub", "https://clawhub.ai/skills/agentkilox-code-audit"),
] {
let item = json!({
"name": "portal-skill",
"description": "x",
"category": "other",
- "source": "ClawHub",
+ "source": source,
"sourceUrl": url
});
let entry = parse_hermes_entry(&item).expect("entry");
- assert_eq!(
- entry.download_url, "",
- "portal url must not be downloadable: {url}"
- );
+ assert_eq!(entry.download_url, "", "no SKILL.md behind: {url}");
+ assert!(!entry.has_direct_download());
assert_eq!(entry.source_url.as_deref(), Some(url));
}
}
+#[test]
+fn parse_hermes_entry_installs_clawhub_skills_by_slug() {
+ // ClawHub entries carry only a slug; the file API serves its SKILL.md. (#6285)
+ let entry = parse_hermes_entry(&json!({
+ "name": "Apple Design",
+ "description": "x",
+ "category": "apple",
+ "source": "ClawHub",
+ "identifier": "apple-design",
+ "sourceUrl": ""
+ }))
+ .expect("entry");
+ assert_eq!(
+ entry.download_url,
+ "https://clawhub.ai/api/v1/skills/apple-design/file?path=SKILL.md"
+ );
+ assert!(entry.has_direct_download());
+}
+
+#[test]
+fn parse_hermes_entry_points_skills_sh_at_the_listed_github_repo() {
+ // skills.sh lists a GitHub repo's skill; install locates the file. (#6285)
+ let entry = parse_hermes_entry(&json!({
+ "name": "100m-leads",
+ "description": "x",
+ "source": "skills.sh",
+ "identifier": "skills-sh/getagentseal/founder-playbook/100m-leads",
+ "sourceUrl": "https://skills.sh/getagentseal/founder-playbook/100m-leads"
+ }))
+ .expect("entry");
+ assert_eq!(
+ entry.download_url,
+ "https://raw.githubusercontent.com/getagentseal/founder-playbook/HEAD/100m-leads/SKILL.md"
+ );
+ assert_eq!(
+ entry.id,
+ "skills-sh/getagentseal/founder-playbook/100m-leads"
+ );
+}
+
+/// Same-named entries as the live catalog has them: several ClawHub skills
+/// share a display name, and a ClawHub slug equals a bundled skill's name.
+fn same_named_catalog() -> Vec<CatalogEntry> {
+ [
+ json!({ "name": "AI Code Review", "source": "ClawHub", "identifier": "qf-code-review" }),
+ json!({ "name": "AI Code Review", "source": "ClawHub", "identifier": "ai-code-review-ops" }),
+ json!({ "name": "apple-notes", "source": "built-in", "docsPath": "bundled/apple/apple-apple-notes" }),
+ json!({ "name": "apple-notes", "source": "ClawHub", "identifier": "apple-notes" }),
+ json!({ "name": "Apple Design", "source": "ClawHub", "identifier": "apple-design" }),
+ ]
+ .iter()
+ .map(|item| parse_hermes_entry(item).expect("entry"))
+ .collect()
+}
+
+#[test]
+fn parse_hermes_entry_gives_same_named_entries_distinct_ids() {
+ let ids: Vec<String> = same_named_catalog().into_iter().map(|e| e.id).collect();
+ assert_eq!(
+ ids,
+ [
+ "clawhub/qf-code-review",
+ "clawhub/ai-code-review-ops",
+ "apple-notes",
+ "clawhub/apple-notes",
+ "clawhub/apple-design",
+ ]
+ );
+}
+
+#[test]
+fn find_catalog_entry_matches_ids_and_unambiguous_legacy_names() {
+ let catalog = same_named_catalog();
+ let by_id = find_catalog_entry(&catalog, "clawhub/ai-code-review-ops").unwrap();
+ assert_eq!(by_id.id, "clawhub/ai-code-review-ops");
+ // An exact id wins over another entry carrying the same name.
+ assert_eq!(
+ find_catalog_entry(&catalog, "apple-notes").unwrap().source,
+ "built-in"
+ );
+ // Ids used to be display names; a name only one entry has still resolves.
+ assert_eq!(
+ find_catalog_entry(&catalog, "Apple Design").unwrap().id,
+ "clawhub/apple-design"
+ );
+}
+
+#[test]
+fn find_catalog_entry_refuses_an_ambiguous_name_and_lists_the_ids() {
+ let err = find_catalog_entry(&same_named_catalog(), "AI Code Review").unwrap_err();
+ assert!(
+ err.contains("2 catalog entries are named 'AI Code Review'"),
+ "{err}"
+ );
+ assert!(
+ err.contains("clawhub/qf-code-review") && err.contains("clawhub/ai-code-review-ops"),
+ "{err}"
+ );
+}
+
+#[test]
+fn find_catalog_entry_not_found_suggests_real_ids_instead_of_a_refresh() {
+ let err = find_catalog_entry(&same_named_catalog(), "ai-code-review").unwrap_err();
+ assert!(
+ err.starts_with("no catalog entry has id 'ai-code-review'"),
+ "{err}"
+ );
+ assert!(err.contains("clawhub/ai-code-review-ops"), "{err}");
+ assert!(!err.contains("refresh"), "{err}");
+}
+
#[test]
fn download_url_from_source_url_rejects_non_github_and_malformed() {
assert_eq!(
@@ -325,3 +433,38 @@ async fn search_rejects_stale_and_fetches_fresh() {
store::clear_cache();
std::env::remove_var(CACHE_DIR_ENV);
}
+
+#[tokio::test]
+async fn search_ranks_installable_entries_before_uninstallable_ones() {
+ let _env = env_lock();
+ let tmp = tempfile::tempdir().unwrap();
+ std::env::set_var(CACHE_DIR_ENV, tmp.path());
+ let agent = parse_hermes_entry(&json!({
+ "name": "review-agent",
+ "description": "x",
+ "source": "LobeHub",
+ "identifier": "lobehub/review-agent",
+ "sourceUrl": "https://lobehub.com/agent/review-agent"
+ }))
+ .unwrap();
+ let skill = parse_hermes_entry(&json!({
+ "name": "review-skill",
+ "description": "x",
+ "source": "ClawHub",
+ "identifier": "review-skill"
+ }))
+ .unwrap();
+ store::save_catalog_cache(&[agent, skill]);
+
+ let hits = search_catalog("review", None, None).await.unwrap();
+
+ let ids: Vec<&str> = hits.iter().map(|e| e.id.as_str()).collect();
+ assert_eq!(
+ ids,
+ ["clawhub/review-skill", "lobehub/review-agent"],
+ "an installable hit must come before one install will reject"
+ );
+
+ store::clear_cache();
+ std::env::remove_var(CACHE_DIR_ENV);
+}
diff --git a/crates/openhuman-core/src/skills/catalog/schemas/handlers.rs b/crates/openhuman-core/src/skills/catalog/schemas/handlers.rs
index efa0b912d7..e027349f18 100644
--- a/crates/openhuman-core/src/skills/catalog/schemas/handlers.rs
+++ b/crates/openhuman-core/src/skills/catalog/schemas/handlers.rs
@@ -76,15 +76,7 @@ pub(super) fn handle_install(params: Map<String, Value>) -> ControllerFuture {
);
let catalog = ops::browse_catalog(false).await?;
- let entry = catalog
- .iter()
- .find(|e| e.id == p.entry_id)
- .ok_or_else(|| {
- format!(
- "entry '{}' not found in catalog. Run skill_registry_browse with force_refresh first.",
- p.entry_id
- )
- })?;
+ let entry = ops::find_catalog_entry(&catalog, &p.entry_id)?;
let workspace = crate::skills::schemas::resolve_workspace_dir().await;
let outcome = ops::install_from_catalog(&workspace, entry).await?;
diff --git a/crates/openhuman-core/src/skills/catalog/tools.rs b/crates/openhuman-core/src/skills/catalog/tools.rs
index dc327725aa..dc2e2e0201 100644
--- a/crates/openhuman-core/src/skills/catalog/tools.rs
+++ b/crates/openhuman-core/src/skills/catalog/tools.rs
@@ -207,7 +207,7 @@ impl Tool for SkillRegistryInstallTool {
"properties": {
"entry_id": {
"type": "string",
- "description": "The skill entry id (slug) to install."
+ "description": "The `id` of the entry to install, exactly as returned by skill_registry_search (e.g. 'clawhub/apple-design')."
}
},
"required": ["entry_id"]
@@ -240,12 +240,8 @@ impl Tool for SkillRegistryInstallTool {
.await
.map_err(|e| anyhow::anyhow!("failed to load catalog: {e}"))?;
- let entry = catalog.iter().find(|e| e.id == entry_id).ok_or_else(|| {
- anyhow::anyhow!(
- "{NOT_FOUND_MARKER} skill '{entry_id}' not found in catalog. \
- Run skill_registry_browse first to refresh."
- )
- })?;
+ let entry = ops::find_catalog_entry(&catalog, entry_id)
+ .map_err(|e| anyhow::anyhow!("{NOT_FOUND_MARKER} {e}"))?;
match ops::install_from_catalog(&self.workspace_dir, entry).await {
Ok(outcome) => Ok(ToolResult::success(serde_json::to_string(&json!({
diff --git a/crates/openhuman-core/src/skills/catalog/types.rs b/crates/openhuman-core/src/skills/catalog/types.rs
index 63610500e8..0086c84806 100644
--- a/crates/openhuman-core/src/skills/catalog/types.rs
+++ b/crates/openhuman-core/src/skills/catalog/types.rs
@@ -5,7 +5,9 @@ use serde::{Deserialize, Serialize};
/// One entry in the indexed skill catalog.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CatalogEntry {
- /// Unique slug (e.g. "apple-notes", "docker-manager").
+ /// Unique id: the upstream identifier, source-qualified (e.g.
+ /// "clawhub/apple-design", "skills-sh/owner/repo/skill"), or the name for
+ /// bundled Hermes skills (e.g. "apple-notes").
pub id: String,
/// Display name.
pub name: String,
@@ -24,10 +26,10 @@ pub struct CatalogEntry {
pub tags: Vec<String>,
/// Compatible platform hints.
pub platforms: Vec<String>,
- /// Direct download URL for the SKILL.md file. Empty when the upstream
- /// source hosts the skill on a non-raw portal (ClawHub / LobeHub /
- /// skills.sh) with no fetchable `SKILL.md`; install surfaces an actionable
- /// error pointing at [`source_url`] instead of a misleading 404.
+ /// Download URL for the SKILL.md file. Empty when the source publishes no
+ /// `SKILL.md` (LobeHub agents); install surfaces an actionable error
+ /// pointing at [`source_url`] instead of a misleading 404. For skills.sh
+ /// it is the most common location, resolved at install time.
pub download_url: String,
/// Human-facing source page for the skill (GitHub blob/tree, LobeHub,
/// ClawHub, skills.sh, …). Carried from the catalog's `sourceUrl`; used to
diff --git a/crates/openhuman-core/src/skills/ops_create_and_url_tests.rs b/crates/openhuman-core/src/skills/ops_create_and_url_tests.rs
index 6c9ce01fec..2d7ef8f036 100644
--- a/crates/openhuman-core/src/skills/ops_create_and_url_tests.rs
+++ b/crates/openhuman-core/src/skills/ops_create_and_url_tests.rs
@@ -430,6 +430,15 @@ fn normalize_install_url_rejects_whole_repo() {
assert!(err.contains("whole-repo"), "{err}");
}
+#[test]
+fn normalize_install_url_accepts_a_file_api_that_names_the_md_in_its_query() {
+ let url = "https://clawhub.ai/api/v1/skills/apple-design/file?path=SKILL.md";
+ assert_eq!(normalize_install_url(url).unwrap(), url);
+ let err =
+ normalize_install_url("https://clawhub.ai/api/v1/skills/x/file?path=run.sh").unwrap_err();
+ assert!(err.contains(".md"), "{err}");
+}
+
#[test]
fn normalize_install_url_rejects_non_md_suffix() {
let err = normalize_install_url("https://example.com/skill.txt").unwrap_err();
diff --git a/crates/openhuman-core/src/skills/ops_install/url_validation.rs b/crates/openhuman-core/src/skills/ops_install/url_validation.rs
index c51e996ec2..19d2cd616c 100644
--- a/crates/openhuman-core/src/skills/ops_install/url_validation.rs
+++ b/crates/openhuman-core/src/skills/ops_install/url_validation.rs
@@ -47,8 +47,13 @@ pub(crate) fn normalize_install_url(raw: &str) -> Result<String, String> {
let check = url::Url::parse(&normalized)
.map_err(|e| format!("unsupported url form: parse normalized {normalized:?}: {e}"))?;
- let path_lower = check.path().to_ascii_lowercase();
- if !path_lower.ends_with(".md") {
+ let names_md_file = check.path().to_ascii_lowercase().ends_with(".md")
+ // A file API names the file in its query instead (ClawHub's
+ // `/skills/<slug>/file?path=SKILL.md`).
+ || check
+ .query_pairs()
+ .any(|(key, value)| key == "path" && value.to_ascii_lowercase().ends_with(".md"));
+ if !names_md_file {
return Err(format!(
"unsupported url form: path must end in .md, got {normalized:?}"
));
diff --git a/docs/TEST-COVERAGE-MATRIX.md b/docs/TEST-COVERAGE-MATRIX.md
index 345cb9ae19..977cabe6ae 100644
--- a/docs/TEST-COVERAGE-MATRIX.md
+++ b/docs/TEST-COVERAGE-MATRIX.md
@@ -576,6 +576,7 @@ End-to-end coverage of the agent harness via the web-chat RPC surface against an
| 13.3.4 | ChatGPT sign-in in AI settings | VU | `app/src/components/settings/oauth/__tests__/OpenAiOAuthConnect.test.tsx`, `app/src/components/settings/panels/__tests__/AIPanel.test.tsx` | ✅ | Mocked core RPCs cover sign-in, disconnect, provider/routing persistence, failure paths, and delayed initial status. Live desktop OAuth remains a release smoke check. |
| 13.3.5 | OpenRouter sign-in (PKCE) in AI settings | RU+VU | `crates/openhuman-app/src/loopback_oauth_tests.rs`, `app/src/utils/__tests__/openrouterOAuth.test.ts`, `app/src/utils/__tests__/loopbackOauthListener.test.ts`, `app/src/components/settings/panels/__tests__/AIPanel.test.tsx` | ✅ | A pending sign-in stays dismissable (Cancel/Esc/click-outside abort the flow and free the loopback port); Deny, `error=` and missing-code callbacks get a "Sign-in was not completed." page and a dialog error instead of "You're signed in."; cancel clears the listener timeout so a retry is not stopped; the key exchange honours the abort signal (#6263). Live Authorize remains a release smoke check. |
| 13.3.6 | Skill registry search→install→agent runs the skill | RI | `tests/agent_harness_e2e.rs` (`agent_installs_a_registry_skill_then_runs_it`), `tests/skill_registry_e2e.rs`, `tests/skills_mcp_registry_live.rs` (manual, `#[ignore]`) | ✅ | Agent finds a loopback-catalog skill via `use_skill(skills/setup_skills)`, installs it behind the approval gate, the SKILL.md lands on disk, then `run_skill` → `describe_workflow` returns its body to the model. The live smoke reports, per catalog source, how many listed skills have a download URL and installs one sample each. |
+| 13.3.7 | Skill registry install sources + unique entry ids | RU+VU | `crates/openhuman-core/src/skills/catalog/ops_tests.rs`, `crates/openhuman-core/src/skills/catalog/download_tests.rs`, `crates/openhuman-core/src/skills/ops_create_and_url_tests.rs`, `app/src/components/skills/__tests__/SkillsExplorerTab.test.tsx` | 🟡 | ClawHub entries download through ClawHub's file API by slug; skills.sh entries map to their GitHub repo, with the conventional skill directories and the tree match unit-tested; LobeHub agents (no `SKILL.md`) rank last in search and show "Not installable" instead of Install; ids are the source-qualified Hermes identifier, an ambiguous display name is refused with the real ids, and a missing id suggests the closest ones (#6285, #6287). The live skills.sh probe and ClawHub fetch are network calls and remain a manual check. |
### 13.4 Developer Options