feat: Enhanced analyze - shows overview, scripts, sections, better project matching
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user