Skip to content

Conversation

@richardgill
Copy link
Contributor

@richardgill richardgill commented Jan 14, 2026

Problem: When porting my claude code skills to pi I had some multi-line descriptions. Pi only parsed the first line which is "|".

There are several similar frontmatter functions in the codebase (each was slightly different)

I've consolidated into a single function and used the yaml library to parse the yaml (see below for library choice background).

Finally, the Select component didn't handle multi line descriptions well, so I updated the component to replace new lines with spaces.

I've made a few decisions in here that might not be your preference - if so, just let me know and I can fix them for you 👍


Appendix:

Example with multi line value:
SKILL.md:

---
name: beeper
description: |
  Search and read messages from Beeper Desktop API (WhatsApp, Signal, Telegram, etc.).
  Triggers: "check my messages", "search messages", "who messaged me", "find conversations",
  "unread messages", "beeper", "chat history".
---
continues...

Yaml library picks (a little 'deep researched', but looks good to me)

yaml is 0 deps and reasonably recently published.

Package Type Weekly Downloads (npm) GitHub Stars Total Deps Key Dependencies Bundle (gzip) Last Published TypeScript
yaml YAML 86.9M 1,605 0 (none) 31.5 KB Nov 2025 Built-in
js-yaml v4 YAML 141M 6,533 1 argparse 13.3 KB Nov 2025 @types
confbox YAML+ 20.9M 280 1 (none, bundled) ~39 KB Apr 2025 Built-in
ultramatter Frontmatter 2K 123 1 (none) ~1.3 KB Feb 2023 Built-in
front-matter Frontmatter 5.1M 690 5 js-yaml@3, esprima, ... 42.7 KB May 2020 No
gray-matter Frontmatter 2.8M 4,338 10 js-yaml@3, esprima, section-matter, ... 45.2 KB Apr 2021 .d.ts
yaml-front-matter Frontmatter 66K 195 6 js-yaml@3, commander, esprima, ... 42.5 KB Dec 2020 No

import * as fs from "node:fs";
import * as os from "node:os";
import * as path from "node:path";
import { parseFrontmatter } from "@mariozechner/pi-coding-agent";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ~ok, but I think since this is an example a handrolled function is fine if you want to revert this one.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's fine. Whatever built-in stuff we can offer to extensions, we should, so they can stay "dependency-less" for as long as possible.

…matter-utils-lib

# Conflicts:
#	packages/coding-agent/src/modes/interactive/interactive-mode.ts
@richardgill richardgill marked this pull request as ready for review January 14, 2026 18:41
Resolve conflicts keeping yaml-based frontmatter parser with
generic type support.
Resolve version conflict by taking ^0.46.0 versions while keeping
the new photon-node dependency for image processing.
@badlogic badlogic merged commit ce7e73b into badlogic:main Jan 15, 2026
1 check passed
@badlogic
Copy link
Owner

Cheers!

badlogic added a commit that referenced this pull request Jan 16, 2026
- Add OpenAI Codex official support entry
- Add pi-internal:// URL scheme
- Add ctx.shutdown() fix (#756)
- Add OpenAI Codex retry logic (#733)
- Add third-party contributions:
  - #702 by @aliou (custom tool HTML export)
  - #728 by @richardgill (frontmatter parsing, SelectList fix)
  - #747 by @kaofelix (tree filter shortcuts)
  - #752 by @richardgill (keymap expansion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants