promptgraph-mcp 2.9.58 → 2.9.59
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.
- package/commands/bundle.js +2 -1
- package/github-import.js +19 -0
- package/package.json +1 -1
package/commands/bundle.js
CHANGED
|
@@ -137,7 +137,8 @@ export default async function handler(args, bin) {
|
|
|
137
137
|
const hasScripts = hasScriptsQuick || deepResult.hasScripts;
|
|
138
138
|
console.log(chalk.green(` ✓ ${deepResult.passed}/${deepResult.total} skills valid${hasScripts ? ' 🔧 scripts detected' : ''}`));
|
|
139
139
|
|
|
140
|
-
const
|
|
140
|
+
const { bundleDisplayName } = await import('../github-import.js');
|
|
141
|
+
const name = bundleDisplayName(repo);
|
|
141
142
|
const id = repo.replace('/', '-').toLowerCase();
|
|
142
143
|
const bundle = {
|
|
143
144
|
id, name, repo_url: repo, author: repo.split('/')[0],
|
package/github-import.js
CHANGED
|
@@ -22,6 +22,25 @@ export const SCRIPT_GLOBS = ['**/*.py', '**/*.sh', '**/*.bash', '**/*.js', '**/*
|
|
|
22
22
|
// (e.g. microsoft/skills). Recognized as skill locations despite .github being a skip dir.
|
|
23
23
|
const COPILOT_SKILL_DIRS = new Set(['skills', 'prompts', 'agents', 'commands']);
|
|
24
24
|
|
|
25
|
+
// Repo names too generic to make a good bundle title on their own — prefix the owner.
|
|
26
|
+
const GENERIC_REPO_NAMES = new Set([
|
|
27
|
+
'skills', 'skill', 'prompts', 'prompt', 'agents', 'agent', 'commands', 'command',
|
|
28
|
+
'tools', 'toolkit', 'mcp', 'ai', 'claude', 'plugins', 'plugin', 'templates', 'library',
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
// Build a human-friendly bundle name from "owner/repo". For generic repo names
|
|
32
|
+
// (owner/skills → "Owner Skills") the owner is prefixed so titles aren't all "Skills".
|
|
33
|
+
export function bundleDisplayName(ownerRepo) {
|
|
34
|
+
const [owner, repo = ''] = ownerRepo.replace(/^https?:\/\/github\.com\//, '').replace(/\.git$/, '').split('/');
|
|
35
|
+
const titlecase = (s) => s.replace(/[-_.]+/g, ' ').replace(/\s+/g, ' ').trim().replace(/\b\w/g, (c) => c.toUpperCase());
|
|
36
|
+
const repoName = titlecase(repo);
|
|
37
|
+
if (GENERIC_REPO_NAMES.has(repo.toLowerCase())) {
|
|
38
|
+
const ownerName = titlecase(owner);
|
|
39
|
+
return repoName ? `${ownerName} ${repoName}` : ownerName;
|
|
40
|
+
}
|
|
41
|
+
return repoName || titlecase(owner);
|
|
42
|
+
}
|
|
43
|
+
|
|
25
44
|
// ── helpers ───────────────────────────────────────────────────────────────────
|
|
26
45
|
|
|
27
46
|
const repoStats = new Map()
|