@yogiadhik/skillcheck 0.1.0 → 0.1.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/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ const program = new Command();
9
9
  program
10
10
  .name('skillcheck')
11
11
  .description('lint and behavioral tests for agent skills')
12
- .version('0.1.0');
12
+ .version('0.1.1');
13
13
  program
14
14
  .command('lint')
15
15
  .argument('[path]', 'skill file or directory', '.')
@@ -30,9 +30,23 @@ export const tokenBudget = (s) => {
30
30
  return [finding(s, 'token-budget', 'warning', `skill is roughly ${tokens} tokens; every invocation pays this cost`)];
31
31
  return [];
32
32
  };
33
+ // links inside fenced blocks or inline code are examples, not references
34
+ function proseOnly(body) {
35
+ const kept = [];
36
+ let inFence = false;
37
+ for (const line of body.split('\n')) {
38
+ if (/^\s*(```|~~~)/.test(line)) {
39
+ inFence = !inFence;
40
+ continue;
41
+ }
42
+ if (!inFence)
43
+ kept.push(line);
44
+ }
45
+ return kept.join('\n').replace(/`[^`\n]*`/g, '');
46
+ }
33
47
  export const relativeLinks = (s) => {
34
48
  const out = [];
35
- for (const m of s.body.matchAll(/\[[^\]]*\]\(([^)]+)\)/g)) {
49
+ for (const m of proseOnly(s.body).matchAll(/\[[^\]]*\]\(([^)]+)\)/g)) {
36
50
  const target = m[1];
37
51
  if (/^(https?:|mailto:|#)/.test(target))
38
52
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yogiadhik/skillcheck",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "lint and behavioral tests for agent skills",
5
5
  "license": "MIT",
6
6
  "author": "Yogesh Adhikari",