@valentia-ai-skills/framework 2.0.2 → 2.0.3
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/bin/cli.js +60 -6
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -1369,6 +1369,39 @@ async function cmdUploadLegacyScan() {
|
|
|
1369
1369
|
process.exit(1);
|
|
1370
1370
|
}
|
|
1371
1371
|
|
|
1372
|
+
// ── Normalize manifest fields (handles alternate scanner output formats) ──
|
|
1373
|
+
if (!manifest.statistics) manifest.statistics = {};
|
|
1374
|
+
const mstats = manifest.statistics;
|
|
1375
|
+
// Some scanners output completionPercentage instead of completeness_score
|
|
1376
|
+
if (mstats.completeness_score === undefined) {
|
|
1377
|
+
mstats.completeness_score = mstats.completionPercentage ?? 0;
|
|
1378
|
+
}
|
|
1379
|
+
// Some scanners put module count in source.modules
|
|
1380
|
+
if (mstats.total_modules === undefined) {
|
|
1381
|
+
mstats.total_modules =
|
|
1382
|
+
manifest.source?.modules ??
|
|
1383
|
+
manifest.source?.fileCount ??
|
|
1384
|
+
(manifest.skills?.length ?? 0);
|
|
1385
|
+
}
|
|
1386
|
+
// Build tech_stack from source fields or scalar values in technologies if missing
|
|
1387
|
+
if (!manifest.tech_stack) {
|
|
1388
|
+
if (manifest.source) {
|
|
1389
|
+
const ts = {};
|
|
1390
|
+
if (manifest.source.language) ts.language = manifest.source.language;
|
|
1391
|
+
if (manifest.source.framework) ts.framework = manifest.source.framework;
|
|
1392
|
+
manifest.tech_stack = ts;
|
|
1393
|
+
} else if (manifest.technologies && typeof manifest.technologies === "object" && !Array.isArray(manifest.technologies)) {
|
|
1394
|
+
// Only use scalar leaf values to avoid [object Object] in display
|
|
1395
|
+
const ts = {};
|
|
1396
|
+
for (const [k, v] of Object.entries(manifest.technologies)) {
|
|
1397
|
+
if (typeof v === "string" || typeof v === "number") ts[k] = v;
|
|
1398
|
+
}
|
|
1399
|
+
manifest.tech_stack = ts;
|
|
1400
|
+
} else {
|
|
1401
|
+
manifest.tech_stack = {};
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1372
1405
|
const projectName = manifest.project;
|
|
1373
1406
|
console.log(`Project: ${c("bold", projectName)}`);
|
|
1374
1407
|
console.log(`Scanned: ${c("dim", manifest.scanned_at)}`);
|
|
@@ -1383,10 +1416,11 @@ async function cmdUploadLegacyScan() {
|
|
|
1383
1416
|
// ── Read skill files ──
|
|
1384
1417
|
const skillPayload = [];
|
|
1385
1418
|
for (const skillEntry of (manifest.skills || [])) {
|
|
1386
|
-
|
|
1387
|
-
|
|
1419
|
+
const skillFile = skillEntry.file || skillEntry.path; // accept both field names
|
|
1420
|
+
if (!skillEntry.name || !skillFile) continue;
|
|
1421
|
+
const skillFilePath = path.join(resolvedPath, skillFile);
|
|
1388
1422
|
if (!fs.existsSync(skillFilePath)) {
|
|
1389
|
-
console.log(c("yellow", ` ⚠ Skill file not found: ${
|
|
1423
|
+
console.log(c("yellow", ` ⚠ Skill file not found: ${skillFile} — skipping`));
|
|
1390
1424
|
continue;
|
|
1391
1425
|
}
|
|
1392
1426
|
skillPayload.push({
|
|
@@ -1400,10 +1434,11 @@ async function cmdUploadLegacyScan() {
|
|
|
1400
1434
|
// ── Read diagram files ──
|
|
1401
1435
|
const diagramPayload = [];
|
|
1402
1436
|
for (const diagramEntry of (manifest.diagrams || [])) {
|
|
1403
|
-
|
|
1404
|
-
|
|
1437
|
+
const diagramFile = diagramEntry.file || diagramEntry.path; // accept both field names
|
|
1438
|
+
if (!diagramEntry.name || !diagramFile) continue;
|
|
1439
|
+
const diagramFilePath = path.join(resolvedPath, diagramFile);
|
|
1405
1440
|
if (!fs.existsSync(diagramFilePath)) {
|
|
1406
|
-
console.log(c("yellow", ` ⚠ Diagram file not found: ${
|
|
1441
|
+
console.log(c("yellow", ` ⚠ Diagram file not found: ${diagramFile} — skipping`));
|
|
1407
1442
|
continue;
|
|
1408
1443
|
}
|
|
1409
1444
|
diagramPayload.push({
|
|
@@ -1412,6 +1447,25 @@ async function cmdUploadLegacyScan() {
|
|
|
1412
1447
|
content: fs.readFileSync(diagramFilePath, "utf-8"),
|
|
1413
1448
|
});
|
|
1414
1449
|
}
|
|
1450
|
+
// Auto-discover .mmd/.mermaid files from diagrams/ subdirectory if manifest listed none
|
|
1451
|
+
if (diagramPayload.length === 0) {
|
|
1452
|
+
const diagramsDir = path.join(resolvedPath, "diagrams");
|
|
1453
|
+
if (fs.existsSync(diagramsDir)) {
|
|
1454
|
+
for (const file of fs.readdirSync(diagramsDir).sort()) {
|
|
1455
|
+
if (/\.(mmd|mermaid)$/i.test(file)) {
|
|
1456
|
+
const name = file.replace(/\.(mmd|mermaid)$/i, "");
|
|
1457
|
+
diagramPayload.push({
|
|
1458
|
+
name,
|
|
1459
|
+
type: "architecture",
|
|
1460
|
+
content: fs.readFileSync(path.join(diagramsDir, file), "utf-8"),
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
if (diagramPayload.length > 0) {
|
|
1465
|
+
console.log(c("dim", ` (auto-discovered ${diagramPayload.length} diagram(s) from diagrams/)`))
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1415
1469
|
console.log(`Diagrams: ${c("green", diagramPayload.length.toString())} file(s)`);
|
|
1416
1470
|
|
|
1417
1471
|
// ── Read report files ──
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valentia-ai-skills/framework",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "AI development skills framework centralized coding standards, security patterns, and SOPs for AI-assisted development. Works with Claude Code, Cursor, Copilot, Windsurf, and any AI coding tool.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-skills",
|