mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 02:15:12 +00:00
Address code review feedback: improve code quality
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
This commit is contained in:
@@ -183,6 +183,8 @@ function generateLlmsTxt() {
|
|||||||
const url = getRelativeUrl(skillDirPath, ROOT_FOLDER);
|
const url = getRelativeUrl(skillDirPath, ROOT_FOLDER);
|
||||||
|
|
||||||
content += `- [${name}](${url}): ${description}\n`;
|
content += `- [${name}](${url}): ${description}\n`;
|
||||||
|
} else {
|
||||||
|
console.warn(`Warning: Skill directory '${dir}' found without SKILL.md file`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -224,25 +226,16 @@ function main() {
|
|||||||
|
|
||||||
console.log(`✓ llms.txt generated successfully at ${outputPath}`);
|
console.log(`✓ llms.txt generated successfully at ${outputPath}`);
|
||||||
|
|
||||||
// Count resources
|
// Count resources using a helper function
|
||||||
const lines = content.split("\n");
|
const countResources = (dirName) => {
|
||||||
const agentCount = lines.filter((l) =>
|
const lines = content.split("\n");
|
||||||
l.startsWith("- [") && l.includes("agents/")
|
return lines.filter((l) => l.startsWith("- [") && l.includes(`${dirName}/`)).length;
|
||||||
).length;
|
};
|
||||||
const promptCount = lines.filter((l) =>
|
|
||||||
l.startsWith("- [") && l.includes("prompts/")
|
|
||||||
).length;
|
|
||||||
const instructionCount = lines.filter((l) =>
|
|
||||||
l.startsWith("- [") && l.includes("instructions/")
|
|
||||||
).length;
|
|
||||||
const skillCount = lines.filter((l) =>
|
|
||||||
l.startsWith("- [") && l.includes("skills/")
|
|
||||||
).length;
|
|
||||||
|
|
||||||
console.log(` - ${agentCount} agents`);
|
console.log(` - ${countResources("agents")} agents`);
|
||||||
console.log(` - ${promptCount} prompts`);
|
console.log(` - ${countResources("prompts")} prompts`);
|
||||||
console.log(` - ${instructionCount} instructions`);
|
console.log(` - ${countResources("instructions")} instructions`);
|
||||||
console.log(` - ${skillCount} skills`);
|
console.log(` - ${countResources("skills")} skills`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error generating llms.txt: ${error.message}`);
|
console.error(`Error generating llms.txt: ${error.message}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user