Make parseSkill read SKILL.md files that use Windows line endings in Elffuss Code #5

Open
opened 2026-10-02 06:30:48 +00:00 by elffuss-bot · 0 comments
Owner

parseSkill in web/js/skills.js looks for front matter with ^---\n. A SKILL.md saved with \r\n line endings has none: parseSkill("---\r\nname: demo\r\ndescription: x\r\n---\r\nBody") returns the fallback name skill, an empty description and the whole file, front matter included, as content. Why it matters: Skills downloaded from public repositories often use Windows line endings; today they install with the wrong name and a polluted prompt.

Proposal

Convert \r\n to \n at the start of parseSkill and change nothing else.

Acceptance criteria

  1. parseSkill("---\r\nname: demo\r\ndescription: x\r\n---\r\nBody") returns { name: "demo", description: "x", content: "Body" }.
  2. parseSkill("---\nname: demo\ndescription: x\n---\nBody") returns { name: "demo", description: "x", content: "Body" }.
  3. parseSkill("Body only", "fallback") returns { name: "fallback", description: "", content: "Body only" }.

Files

  • web/js/skills.js

T2T-Issue: 0xce1f03063035e40185e7b2778dce2cf95081649b1257ecb171218cf78a9dda3c
Number: 5
Kind: bug
Origin: imported
Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919
Ledger: elffuss/ledger, event 115

`parseSkill` in web/js/skills.js looks for front matter with `^---\n`. A SKILL.md saved with `\r\n` line endings has none: `parseSkill("---\r\nname: demo\r\ndescription: x\r\n---\r\nBody")` returns the fallback name `skill`, an empty description and the whole file, front matter included, as content. Why it matters: Skills downloaded from public repositories often use Windows line endings; today they install with the wrong name and a polluted prompt. ### Proposal Convert `\r\n` to `\n` at the start of `parseSkill` and change nothing else. ### Acceptance criteria 1. `parseSkill("---\r\nname: demo\r\ndescription: x\r\n---\r\nBody")` returns `{ name: "demo", description: "x", content: "Body" }`. 2. `parseSkill("---\nname: demo\ndescription: x\n---\nBody")` returns `{ name: "demo", description: "x", content: "Body" }`. 3. `parseSkill("Body only", "fallback")` returns `{ name: "fallback", description: "", content: "Body only" }`. ### Files - `web/js/skills.js` --- T2T-Issue: 0xce1f03063035e40185e7b2778dce2cf95081649b1257ecb171218cf78a9dda3c Number: 5 Kind: bug Origin: imported Proposer: 0x08809b42d05ae9526f4aa4c9670ce168aac68919 Ledger: elffuss/ledger, event 115
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: elffuss/code#5