promptgraph-mcp 2.3.8 → 2.3.9
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/package.json +1 -1
- package/parser.js +9 -3
package/package.json
CHANGED
package/parser.js
CHANGED
|
@@ -18,8 +18,8 @@ const SKIP_FILENAMES = new Set([
|
|
|
18
18
|
'pull_request_template', 'issue_template', 'funding',
|
|
19
19
|
]);
|
|
20
20
|
|
|
21
|
-
// Filename patterns that are never skills
|
|
22
|
-
const SKIP_FILENAME_RE = /^(_|\.)|^v?\d+[\.\-]\d+|^\d{4}[\-_]\d{2}|^readme|^license|^changelog|^contributing/i;
|
|
21
|
+
// Filename patterns that are never skills — readme* catches ALL variants (readme_de, readme_zh-CN, etc.)
|
|
22
|
+
const SKIP_FILENAME_RE = /^(_|\.)|^v?\d+[\.\-]\d+|^\d{4}[\-_]\d{2}|^readme|^license|^changelog|^contributing|^code.of.conduct|^security|^authors|^credits|^disclaimer|^notice|^copying|^warranty|^promotion|^funding/i;
|
|
23
23
|
|
|
24
24
|
// Path segments that indicate the file is NOT a skill
|
|
25
25
|
const SKIP_DIRS = new Set([
|
|
@@ -30,7 +30,7 @@ const SKIP_DIRS = new Set([
|
|
|
30
30
|
]);
|
|
31
31
|
|
|
32
32
|
// First-header values that signal documentation, not a skill
|
|
33
|
-
const DOC_FIRST_HEADERS = /^(overview|introduction|about|background|welcome|getting started|what is|why |table of contents|toc|foreword|preface)/i;
|
|
33
|
+
const DOC_FIRST_HEADERS = /^(overview|introduction|about|background|welcome|getting started|what is|why |table of contents|toc|foreword|preface|readme)/i;
|
|
34
34
|
|
|
35
35
|
// Imperative verbs commonly found in skill headers
|
|
36
36
|
const IMPERATIVE_HEADERS = /\b(run|use|apply|execute|check|debug|fix|create|add|remove|deploy|test|write|generate|analyze|review|refactor|optimize|configure|setup|install|scan|audit|validate|search|find|extract|parse)\b/i;
|
|
@@ -119,6 +119,12 @@ export function isSkillFile(filePath, raw) {
|
|
|
119
119
|
|
|
120
120
|
try {
|
|
121
121
|
if (!raw) raw = fs.readFileSync(filePath, 'utf8');
|
|
122
|
+
|
|
123
|
+
// Hard-reject: content starts with README header or badge lines
|
|
124
|
+
const firstLines = raw.trimStart().slice(0, 300);
|
|
125
|
+
if (/^#\s*readme\b/i.test(firstLines)) return false;
|
|
126
|
+
if (/!\[.*\]\(https?:\/\/(img\.shields\.io|badge\.fury|travis-ci|github\.com\/[^)]+\/badge)/i.test(firstLines)) return false;
|
|
127
|
+
|
|
122
128
|
return skillScore(raw, base) >= 3;
|
|
123
129
|
} catch {
|
|
124
130
|
return false;
|