Return the body of a SKILL.md — everything after the closing ``---``. Uses the same line-anchored logic as :func:`extract_frontmatter` so a body that contains a standalone ``---`` (e.g. a Markdown horizontal rule) is preserved intact. Files without frontmatter return their full text
(text: str)
| 68 | |
| 69 | |
| 70 | def extract_body(text: str) -> str: |
| 71 | """Return the body of a SKILL.md — everything after the closing ``---``. |
| 72 | |
| 73 | Uses the same line-anchored logic as :func:`extract_frontmatter` so a |
| 74 | body that contains a standalone ``---`` (e.g. a Markdown horizontal |
| 75 | rule) is preserved intact. Files without frontmatter return their |
| 76 | full text unchanged. |
| 77 | """ |
| 78 | lines = text.splitlines() |
| 79 | if not lines or lines[0].strip() != "---": |
| 80 | return text |
| 81 | try: |
| 82 | end = lines.index("---", 1) |
| 83 | except ValueError: |
| 84 | return text |
| 85 | return "\n".join(lines[end + 1 :]) |
| 86 | |
| 87 | |
| 88 | def extract_description(skill_md: Path) -> str: |