skill-check 1.0.0 → 1.1.0
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/main.js
CHANGED
|
@@ -605,15 +605,19 @@ async function runAgentScanWithFeedback(scanOptions, target, io, format) {
|
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
function resolveValidationStatus(result) {
|
|
608
|
+
if (result.summary.skillCount === 0)
|
|
609
|
+
return 'SKIPPED';
|
|
608
610
|
if (result.summary.errorCount > 0)
|
|
609
611
|
return 'FAIL';
|
|
610
612
|
if (result.summary.warningCount > 0)
|
|
611
613
|
return 'WARN';
|
|
612
614
|
return 'PASS';
|
|
613
615
|
}
|
|
614
|
-
function resolveSecurityStatus(enabled, scanExitCode) {
|
|
616
|
+
function resolveSecurityStatus(enabled, scanExitCode, skillCount) {
|
|
615
617
|
if (!enabled)
|
|
616
618
|
return 'SKIPPED';
|
|
619
|
+
if (skillCount === 0)
|
|
620
|
+
return 'SKIPPED';
|
|
617
621
|
return scanExitCode === 0 ? 'PASS' : 'FAIL';
|
|
618
622
|
}
|
|
619
623
|
function computeOverallScore(scores) {
|
|
@@ -848,7 +852,7 @@ export async function runCli(argv, io = defaultIO) {
|
|
|
848
852
|
affectedFileCount: countAffectedFiles(result.diagnostics),
|
|
849
853
|
overallScore: computeOverallScore(scores),
|
|
850
854
|
validationStatus: resolveValidationStatus(result),
|
|
851
|
-
securityStatus: resolveSecurityStatus(scanOptions.enabled, scanExitCode),
|
|
855
|
+
securityStatus: resolveSecurityStatus(scanOptions.enabled, scanExitCode, result.summary.skillCount),
|
|
852
856
|
elapsedMs: performance.now() - checkStartedAt,
|
|
853
857
|
runCommand,
|
|
854
858
|
mode: checkOptions.share ? 'share' : 'default',
|
|
@@ -857,7 +861,7 @@ export async function runCli(argv, io = defaultIO) {
|
|
|
857
861
|
if (conclusion.fullCommandPlain) {
|
|
858
862
|
io.stdout(`${conclusion.fullCommandPlain}\n`);
|
|
859
863
|
}
|
|
860
|
-
if (checkOptions.share) {
|
|
864
|
+
if (checkOptions.share && result.summary.skillCount > 0) {
|
|
861
865
|
emitShareStatus(io, 'rendering share image...');
|
|
862
866
|
const shareOutputPath = path.resolve(process.cwd(), checkOptions.shareOut ?? 'skill-check-share.png');
|
|
863
867
|
const shareText = conclusion.fullCommandPlain
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type ValidationStatus = 'PASS' | 'WARN' | 'FAIL';
|
|
1
|
+
export type ValidationStatus = 'PASS' | 'WARN' | 'FAIL' | 'SKIPPED';
|
|
2
2
|
export type SecurityStatus = 'PASS' | 'FAIL' | 'SKIPPED';
|
|
3
3
|
export type ConclusionCardMode = 'default' | 'share';
|
|
4
4
|
export interface ConclusionCardInput {
|
package/dist/core/defaults.js
CHANGED
package/dist/core/discovery.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fg from 'fast-glob';
|
|
4
|
-
import { DEFAULT_INCLUDE } from './defaults.js';
|
|
5
4
|
export async function discoverSkillFiles(config) {
|
|
6
5
|
const found = new Set();
|
|
7
|
-
const usesDefaultInclude = config.include.length === DEFAULT_INCLUDE.length &&
|
|
8
|
-
config.include.every((pattern, index) => pattern === DEFAULT_INCLUDE[index]);
|
|
9
6
|
for (const root of config.rootsAbs) {
|
|
10
7
|
if (fs.existsSync(root) && fs.statSync(root).isFile()) {
|
|
11
8
|
if (path.basename(root) === 'SKILL.md') {
|
|
@@ -23,21 +20,6 @@ export async function discoverSkillFiles(config) {
|
|
|
23
20
|
onlyFiles: true,
|
|
24
21
|
dot: true,
|
|
25
22
|
});
|
|
26
|
-
if (matches.length === 0 &&
|
|
27
|
-
usesDefaultInclude &&
|
|
28
|
-
path.basename(path.resolve(root)) === 'skills') {
|
|
29
|
-
const fallbackMatches = await fg('**/SKILL.md', {
|
|
30
|
-
cwd: root,
|
|
31
|
-
ignore: config.exclude,
|
|
32
|
-
absolute: true,
|
|
33
|
-
onlyFiles: true,
|
|
34
|
-
dot: true,
|
|
35
|
-
});
|
|
36
|
-
for (const match of fallbackMatches) {
|
|
37
|
-
found.add(path.resolve(match));
|
|
38
|
-
}
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
23
|
for (const match of matches) {
|
|
42
24
|
found.add(path.resolve(match));
|
|
43
25
|
}
|
package/dist/core/formatters.js
CHANGED
|
@@ -84,6 +84,8 @@ function renderScoreBar(score) {
|
|
|
84
84
|
return `${color('█'.repeat(filled))}${pc.dim('░'.repeat(empty))} ${color(String(score))}`;
|
|
85
85
|
}
|
|
86
86
|
function resolveValidationStatus(result) {
|
|
87
|
+
if (result.summary.skillCount === 0)
|
|
88
|
+
return 'SKIPPED';
|
|
87
89
|
if (result.summary.errorCount > 0)
|
|
88
90
|
return 'FAIL';
|
|
89
91
|
if (result.summary.warningCount > 0)
|