Skip to content

Commit 42f5dc9

Browse files
authored
Merge pull request #652 from github/combine-llms-txt-generation
Combine llms.txt generation with website data generation
2 parents b0b5bf9 + 07bc765 commit 42f5dc9

3 files changed

Lines changed: 88 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: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,84 @@ function generateSamplesData() {
695695
};
696696
}
697697

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

818896
console.log(`\n✓ All data written to website/public/data/`);
897+
898+
// Generate llms.txt
899+
const llmsTxtContent = generateLlmsTxt(agents, prompts, instructions, skills);
900+
fs.writeFileSync(
901+
path.join(ROOT_FOLDER, "website", "public", "llms.txt"),
902+
llmsTxtContent,
903+
"utf8"
904+
);
905+
console.log(`✓ llms.txt generated with ${agents.length} agents, ${prompts.length} prompts, ${instructions.length} instructions, ${skills.length} skills`);
819906
}
820907

821908
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)