skillhub 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +51 -11
  2. package/package.json +61 -61
  3. package/LICENSE +0 -21
package/dist/index.js CHANGED
@@ -4020,12 +4020,20 @@ async function fetchSkillContent(owner, repo, skillPath, branch = "main", source
4020
4020
  pathsToTry.push(filename);
4021
4021
  }
4022
4022
  } else {
4023
- pathsToTry = [
4024
- basePath,
4025
- ...skillPath && !skillPath.startsWith("skills/") ? [`skills/${skillPath}/SKILL.md`] : [],
4026
- ...skillPath && !skillPath.startsWith(".claude/") ? [`.claude/skills/${skillPath}/SKILL.md`] : [],
4027
- ...skillPath && !skillPath.startsWith(".github/") ? [`.github/skills/${skillPath}/SKILL.md`] : []
4028
- ];
4023
+ const skillName = skillPath ? skillPath.replace(/^(skills|\.claude\/skills|\.github\/skills)\//, "") : "";
4024
+ pathsToTry = [basePath];
4025
+ if (skillName) {
4026
+ const candidates = [
4027
+ `skills/${skillName}/${filename}`,
4028
+ `.claude/skills/${skillName}/${filename}`,
4029
+ `.github/skills/${skillName}/${filename}`
4030
+ ];
4031
+ for (const candidate of candidates) {
4032
+ if (candidate !== basePath) {
4033
+ pathsToTry.push(candidate);
4034
+ }
4035
+ }
4036
+ }
4029
4037
  }
4030
4038
  for (const pathToTry of pathsToTry) {
4031
4039
  try {
@@ -4047,18 +4055,45 @@ async function fetchSkillContent(owner, repo, skillPath, branch = "main", source
4047
4055
  }
4048
4056
  };
4049
4057
  break;
4050
- } catch (rawError) {
4051
- throw new Error(`GitHub API timeout. Try using --no-api flag or check your network connection.`);
4058
+ } catch {
4059
+ continue;
4052
4060
  }
4053
4061
  }
4054
4062
  if (error.status === 404) {
4055
4063
  continue;
4056
4064
  }
4065
+ if (error.status === 403) {
4066
+ throw new Error(
4067
+ `GitHub API rate limit exceeded. Set GITHUB_TOKEN environment variable for higher rate limits.`
4068
+ );
4069
+ }
4057
4070
  throw new Error(`Failed to fetch from GitHub: ${error.message}`);
4058
4071
  }
4059
4072
  }
4060
4073
  if (!skillMdResponse) {
4061
- throw new Error(`${filename} not found at ${owner}/${repo} (tried ${pathsToTry.length} paths)`);
4074
+ for (const pathToTry of pathsToTry) {
4075
+ try {
4076
+ const rawContent = await fetchRawFile(owner, repo, pathToTry, branch);
4077
+ skillMdResponse = {
4078
+ data: {
4079
+ content: Buffer.from(rawContent).toString("base64"),
4080
+ encoding: "base64"
4081
+ }
4082
+ };
4083
+ break;
4084
+ } catch {
4085
+ continue;
4086
+ }
4087
+ }
4088
+ }
4089
+ if (!skillMdResponse) {
4090
+ const triedPaths = pathsToTry.map((p) => ` - ${owner}/${repo}/${p}`).join("\n");
4091
+ throw new Error(
4092
+ `${filename} not found at ${owner}/${repo} (tried ${pathsToTry.length} paths):
4093
+ ${triedPaths}
4094
+
4095
+ The skill may have been moved or deleted from the repository.`
4096
+ );
4062
4097
  }
4063
4098
  if (!("content" in skillMdResponse.data)) {
4064
4099
  throw new Error(`${filename} not found`);
@@ -4312,8 +4347,13 @@ async function install(skillId, options2) {
4312
4347
  if (cachedFiles.sourceFormat) {
4313
4348
  sourceFormat = cachedFiles.sourceFormat;
4314
4349
  }
4315
- content = convertCachedFilesToSkillContent(cachedFiles, sourceFormat);
4316
- spinner.text = cachedFiles.fromCache ? `Using cached files (${cachedFiles.files.length} files)` : `Downloaded ${cachedFiles.files.length} files via API`;
4350
+ const converted = convertCachedFilesToSkillContent(cachedFiles, sourceFormat);
4351
+ if (converted.skillMd) {
4352
+ content = converted;
4353
+ spinner.text = cachedFiles.fromCache ? `Using cached files (${cachedFiles.files.length} files)` : `Downloaded ${cachedFiles.files.length} files via API`;
4354
+ } else {
4355
+ spinner.text = "API returned files but main instruction file missing, falling back...";
4356
+ }
4317
4357
  }
4318
4358
  } catch {
4319
4359
  spinner.text = "API file fetch failed, falling back to GitHub...";
package/package.json CHANGED
@@ -1,61 +1,61 @@
1
- {
2
- "name": "skillhub",
3
- "version": "0.2.4",
4
- "description": "CLI tool for managing AI Agent skills - search, install, and update skills for Claude, Codex, Copilot, and more",
5
- "author": "SkillHub Contributors",
6
- "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/airano-ir/skillhub.git",
10
- "directory": "apps/cli"
11
- },
12
- "homepage": "https://skills.palebluedot.live",
13
- "type": "module",
14
- "bin": {
15
- "skillhub": "./dist/index.js"
16
- },
17
- "files": [
18
- "dist"
19
- ],
20
- "dependencies": {
21
- "@octokit/rest": "^20.0.2",
22
- "chalk": "^5.3.0",
23
- "commander": "^11.1.0",
24
- "fs-extra": "^11.2.0",
25
- "ora": "^8.0.1",
26
- "prompts": "^2.4.2"
27
- },
28
- "devDependencies": {
29
- "@types/fs-extra": "^11.0.4",
30
- "@types/node": "^20.10.0",
31
- "@types/prompts": "^2.4.9",
32
- "tsup": "^8.0.1",
33
- "tsx": "^4.7.0",
34
- "typescript": "^5.3.0",
35
- "vitest": "^1.2.0",
36
- "skillhub-core": "0.1.0"
37
- },
38
- "engines": {
39
- "node": ">=18.0.0"
40
- },
41
- "keywords": [
42
- "ai",
43
- "agent",
44
- "skills",
45
- "cli",
46
- "claude",
47
- "codex",
48
- "copilot",
49
- "cursor",
50
- "windsurf"
51
- ],
52
- "scripts": {
53
- "build": "tsup",
54
- "dev": "tsx src/index.ts",
55
- "start": "node dist/index.js",
56
- "lint": "eslint src/",
57
- "typecheck": "tsc --noEmit",
58
- "test": "vitest",
59
- "test:run": "vitest run"
60
- }
61
- }
1
+ {
2
+ "name": "skillhub",
3
+ "version": "0.2.5",
4
+ "description": "CLI tool for managing AI Agent skills - search, install, and update skills for Claude, Codex, Copilot, and more",
5
+ "author": "SkillHub Contributors",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/airano-ir/skillhub.git",
10
+ "directory": "apps/cli"
11
+ },
12
+ "homepage": "https://skills.palebluedot.live",
13
+ "type": "module",
14
+ "bin": {
15
+ "skillhub": "./dist/index.js"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsup",
22
+ "dev": "tsx src/index.ts",
23
+ "start": "node dist/index.js",
24
+ "lint": "eslint src/",
25
+ "typecheck": "tsc --noEmit",
26
+ "test": "vitest",
27
+ "test:run": "vitest run"
28
+ },
29
+ "dependencies": {
30
+ "@octokit/rest": "^20.0.2",
31
+ "chalk": "^5.3.0",
32
+ "commander": "^11.1.0",
33
+ "fs-extra": "^11.2.0",
34
+ "ora": "^8.0.1",
35
+ "prompts": "^2.4.2"
36
+ },
37
+ "devDependencies": {
38
+ "skillhub-core": "workspace:*",
39
+ "@types/fs-extra": "^11.0.4",
40
+ "@types/node": "^20.10.0",
41
+ "@types/prompts": "^2.4.9",
42
+ "tsup": "^8.0.1",
43
+ "tsx": "^4.7.0",
44
+ "typescript": "^5.3.0",
45
+ "vitest": "^1.2.0"
46
+ },
47
+ "engines": {
48
+ "node": ">=18.0.0"
49
+ },
50
+ "keywords": [
51
+ "ai",
52
+ "agent",
53
+ "skills",
54
+ "cli",
55
+ "claude",
56
+ "codex",
57
+ "copilot",
58
+ "cursor",
59
+ "windsurf"
60
+ ]
61
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 SkillHub Contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.