promptgraph-mcp 2.6.9 → 2.7.1

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/github-import.js CHANGED
@@ -436,43 +436,33 @@ async function classifierCleanup(dest) {
436
436
 
437
437
  const parsed = [];
438
438
  const fileMap = [];
439
- let heuristicRemoved = 0;
440
439
 
441
440
  for (const fp of mdFiles) {
442
441
  try {
443
442
  const raw = fs.readFileSync(fp, 'utf8');
444
443
  if (!isSkillFile(fp, raw)) continue;
445
- if (!seemsLikeSkill(raw)) {
446
- try { fs.unlinkSync(fp); heuristicRemoved++; } catch {}
447
- continue;
448
- }
449
444
  parsed.push(parseSkillFile(fp, '', { raw }));
450
445
  fileMap.push(fp);
451
446
  } catch {}
452
447
  }
453
448
 
454
- if (heuristicRemoved > 0) {
455
- console.log(`Removed ${heuristicRemoved} files by content heuristic`);
456
- }
457
-
458
449
  if (parsed.length === 0) {
459
- if (heuristicRemoved > 0) removeEmptyDirs(dest);
450
+ removeEmptyDirs(dest);
460
451
  return;
461
452
  }
462
453
 
463
454
  const filtered = await filterWithClassifier(parsed);
464
455
  const keptPaths = new Set(filtered.map(s => s.path));
465
456
 
466
- let classifierRemoved = 0;
457
+ let removed = 0;
467
458
  for (const fp of fileMap) {
468
459
  if (!keptPaths.has(fp)) {
469
- try { fs.unlinkSync(fp); classifierRemoved++; } catch {}
460
+ try { fs.unlinkSync(fp); removed++; } catch {}
470
461
  }
471
462
  }
472
463
 
473
- const totalRemoved = heuristicRemoved + classifierRemoved;
474
- if (totalRemoved > 0) {
475
- console.log(`Removed ${totalRemoved} non-skill files (heuristic: ${heuristicRemoved}, classifier: ${classifierRemoved})`);
464
+ if (removed > 0) {
465
+ console.log(`Removed ${removed} non-skill files (classifier)`);
476
466
  removeEmptyDirs(dest);
477
467
  }
478
468
  }
package/marketplace.js CHANGED
@@ -373,6 +373,13 @@ export async function installBundle(bundleId) {
373
373
  }
374
374
  throw e;
375
375
  }
376
+ // Update skill count cache with real on-disk count (post-filters)
377
+ const real = localSkillCount(bundle.repo_url);
378
+ if (real !== null) {
379
+ const cache = readSkillCountCache();
380
+ cache[bundle.repo_url] = { count: real, ts: Date.now() };
381
+ writeSkillCountCache(cache);
382
+ }
376
383
  return { success: true, bundle: bundle.name, type: 'repo_import', repo_url: bundle.repo_url };
377
384
  }
378
385
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptgraph-mcp",
3
- "version": "2.6.9",
3
+ "version": "2.7.1",
4
4
  "files": [
5
5
  "*.js",
6
6
  "commands/",
package/validator.js CHANGED
@@ -50,22 +50,22 @@ export function validateSkill(filePath) {
50
50
  return { ok: false, errors, warnings };
51
51
  }
52
52
 
53
- // name
53
+ // name — derive from filename if missing (handles plain .md repos)
54
54
  if (!data.name) {
55
- errors.push('Missing required field: name');
55
+ warnings.push('Missing frontmatter "name" — derived from filename');
56
56
  } else if (typeof data.name !== 'string') {
57
57
  errors.push('Field "name" must be a string');
58
58
  } else if (!NAME_RE.test(data.name)) {
59
59
  errors.push(`Invalid name "${data.name}". Use lowercase, digits, hyphens (2-64 chars).`);
60
60
  }
61
61
 
62
- // description
62
+ // description — derive from first paragraph if missing
63
63
  if (!data.description) {
64
- errors.push('Missing required field: description');
64
+ warnings.push('Missing frontmatter "description" — derived from content');
65
65
  } else if (typeof data.description !== 'string') {
66
66
  errors.push('Field "description" must be a string');
67
67
  } else if (data.description.trim().length < MIN_DESCRIPTION_LENGTH) {
68
- errors.push(`Description too short (min ${MIN_DESCRIPTION_LENGTH} chars).`);
68
+ warnings.push(`Description very short (${data.description.trim().length} chars).`);
69
69
  }
70
70
 
71
71
  // body must have real instruction content