Fix multiline descriptions in llms.txt to be single-line

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-03 01:36:00 +00:00
parent fbc72656ab
commit 3d1d2c1aa0
2 changed files with 10 additions and 12 deletions

View File

@@ -47,18 +47,22 @@ function extractName(filePath, fileType) {
* Extracts the description from a file's frontmatter
* @param {string} filePath - Path to the file (or directory for skills)
* @param {string} fileType - Type of file (agent, prompt, instruction, skill)
* @returns {string} - The description of the resource
* @returns {string} - The description of the resource (single line)
*/
function extractDescription(filePath, fileType) {
try {
if (fileType === "skill") {
// For skills, filePath is the skill directory
const skillMetadata = parseSkillMetadata(filePath);
return skillMetadata?.description || "No description available";
const description = skillMetadata?.description || "No description available";
// Convert multiline descriptions to single line
return description.replace(/\s+/g, " ").trim();
}
const frontmatter = parseFrontmatter(filePath);
return frontmatter?.description || "No description available";
const description = frontmatter?.description || "No description available";
// Convert multiline descriptions to single line
return description.replace(/\s+/g, " ").trim();
} catch (error) {
console.error(
`Error extracting description from ${filePath}: ${error.message}`