feat: Enhanced analyze - shows overview, scripts, sections, better project matching

This commit is contained in:
2026-03-24 21:59:53 +01:00
parent 48a452b994
commit fc6ddbd1b2
4 changed files with 113 additions and 19 deletions
+34 -6
View File
@@ -215,17 +215,45 @@ export default function ClawHubMarketplace() {
description: data.description,
triggers: data.triggers
});
let output = `📋 ${selectedSkill.name}\n\n`;
output += `Description: ${data.description || "N/A"}\n\n`;
output += `Triggers: ${data.triggers || "N/A"}\n\n`;
let output = `📋 ${selectedSkill.name}\n`;
output += `${"─".repeat(40)}\n\n`;
output += `💬 ${data.description || "N/A"}\n\n`;
output += `🎯 Triggers: ${data.triggers || "N/A"}\n\n`;
if (data.overview) {
output += `📝 Overview:\n${data.overview.substring(0, 500)}${data.overview.length > 500 ? "..." : ""}\n\n`;
}
if (data.scripts && data.scripts.length > 0) {
output += `🛠️ Scripts: ${data.scripts.join(", ")}\n\n`;
}
if (data.sections) {
const relevantSections = Object.entries(data.sections).filter(([k]) =>
!["overview", "triggers", "description", "guardrails"].includes(k.toLowerCase())
);
if (relevantSections.length > 0) {
output += `📚 Sections:\n`;
relevantSections.forEach(([title, body]) => {
output += `${title}\n`;
});
output += `\n`;
}
}
if (data.projectMatches && data.projectMatches.length > 0) {
output += `🎯 Project Matches:\n`;
data.projectMatches.forEach((m: string) => {
output += `${m}\n`;
output += `${"─".repeat(40)}\n`;
data.projectMatches.forEach((m: {name: string; relevance: string; why: string}) => {
output += `\n 📦 ${m.name.toUpperCase()}\n`;
output += ` ${m.why}\n`;
});
output += `\n`;
} else {
output += `❌ No direct project matches found\n`;
}
output += (data.raw ? `📄 SKILL.md Preview:\n${data.raw.substring(0, 500)}...` : "");
setOutput(output);
} catch (e) {
setOutput("Error: " + String(e));