Skip to content

Commit dc1b933

Browse files
committed
Combine llms.txt generation with website data generation
- Move llms.txt generation into generate-website-data.mjs - Remove standalone generate-llms-txt.mjs script - Remove llms:generate npm script - llms.txt now outputs to website/public/data/ alongside other generated files
1 parent 939f148 commit dc1b933

3 files changed

Lines changed: 84 additions & 256 deletions

File tree

eng/generate-llms-txt.mjs

Lines changed: 0 additions & 254 deletions
This file was deleted.

eng/generate-website-data.mjs

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,84 @@ function generateSamplesData() {
696696
};
697697
}
698698

699+
/**
700+
* Generate llms.txt content according to the llmstxt.org specification
701+
*/
702+
function generateLlmsTxt(agents, prompts, instructions, skills) {
703+
let content = "";
704+
705+
// H1 header (required)
706+
content += "# Awesome GitHub Copilot\n\n";
707+
708+
// Summary blockquote (optional but recommended)
709+
content +=
710+
"> A community-driven collection of custom agents, prompts, instructions, and skills to enhance GitHub Copilot experiences across various domains, languages, and use cases.\n\n";
711+
712+
// Add overview section
713+
content += "## Overview\n\n";
714+
content +=
715+
"This repository provides resources to customize and enhance GitHub Copilot:\n\n";
716+
content +=
717+
"- **Agents**: Specialized GitHub Copilot agents that integrate with MCP servers\n";
718+
content +=
719+
"- **Prompts**: Task-specific prompts for code generation and problem-solving\n";
720+
content +=
721+
"- **Instructions**: Coding standards and best practices applied to specific file patterns\n";
722+
content +=
723+
"- **Skills**: Self-contained folders with instructions and bundled resources for specialized tasks\n\n";
724+
725+
// Process Agents
726+
content += "## Agents\n\n";
727+
for (const agent of agents) {
728+
const description = (agent.description || "No description available").replace(/\s+/g, " ").trim();
729+
content += `- [${agent.title}](${agent.path}): ${description}\n`;
730+
}
731+
content += "\n";
732+
733+
// Process Prompts
734+
content += "## Prompts\n\n";
735+
for (const prompt of prompts) {
736+
const description = (prompt.description || "No description available").replace(/\s+/g, " ").trim();
737+
content += `- [${prompt.title}](${prompt.path}): ${description}\n`;
738+
}
739+
content += "\n";
740+
741+
// Process Instructions
742+
content += "## Instructions\n\n";
743+
for (const instruction of instructions) {
744+
const description = (instruction.description || "No description available").replace(/\s+/g, " ").trim();
745+
content += `- [${instruction.title}](${instruction.path}): ${description}\n`;
746+
}
747+
content += "\n";
748+
749+
// Process Skills
750+
content += "## Skills\n\n";
751+
for (const skill of skills) {
752+
const description = (skill.description || "No description available").replace(/\s+/g, " ").trim();
753+
content += `- [${skill.title}](${skill.skillFile}): ${description}\n`;
754+
}
755+
content += "\n";
756+
757+
// Add documentation links
758+
content += "## Documentation\n\n";
759+
content +=
760+
"- [README.md](README.md): Main documentation and getting started guide\n";
761+
content +=
762+
"- [CONTRIBUTING.md](CONTRIBUTING.md): Guidelines for contributing to this repository\n";
763+
content +=
764+
"- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md): Community standards and expectations\n";
765+
content += "- [SECURITY.md](SECURITY.md): Security policies and reporting\n";
766+
content += "- [AGENTS.md](AGENTS.md): Project overview and setup commands\n\n";
767+
768+
// Add repository information
769+
content += "## Repository\n\n";
770+
content += "- **GitHub**: https://github.com/github/awesome-copilot\n";
771+
content += "- **License**: MIT\n";
772+
content += "- **Website**: https://github.github.io/awesome-copilot\n";
773+
774+
return content;
775+
}
776+
699777
/**
700778
* Main function
701779
*/
@@ -817,6 +895,11 @@ async function main() {
817895
);
818896

819897
console.log(`\n✓ All data written to website/public/data/`);
898+
899+
// Generate llms.txt
900+
const llmsTxtContent = generateLlmsTxt(agents, prompts, instructions, skills);
901+
fs.writeFileSync(path.join(WEBSITE_DATA_DIR, "llms.txt"), llmsTxtContent, "utf8");
902+
console.log(`✓ llms.txt generated with ${agents.length} agents, ${prompts.length} prompts, ${instructions.length} instructions, ${skills.length} skills`);
820903
}
821904

822905
main().catch((err) => {

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"scripts": {
88
"start": "npm run build",
99
"build": "node ./eng/update-readme.mjs",
10-
"llms:generate": "node ./eng/generate-llms-txt.mjs",
1110
"contributors:add": "all-contributors add",
1211
"contributors:report": "node ./eng/contributor-report.mjs",
1312
"contributors:generate": "all-contributors generate",
@@ -18,7 +17,7 @@
1817
"skill:create": "node ./eng/create-skill.mjs",
1918
"website:data": "node ./eng/generate-website-data.mjs",
2019
"website:dev": "npm run website:data && npm run --prefix website dev",
21-
"website:build": "npm run build && npm run website:data && node ./eng/generate-llms-txt.mjs website/public && npm run --prefix website build",
20+
"website:build": "npm run build && npm run website:data && npm run --prefix website build",
2221
"website:preview": "npm run --prefix website preview"
2322
},
2423
"repository": {

0 commit comments

Comments
 (0)