Scaffolded templates put @ref LLP comments above the frontmatter, silently killing every key (alwaysRun, model, description)
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 2
Description
## Summary
Every markdown template we ship starts with an `@ref LLP …` HTML comment placed **above** the opening `---`. The frontmatter parser requires `---` at byte 0, so in a freshly scaffolded repo the frontmatter of the coordinator and all three agents parses as nothing at all. Every key is silently dropped — no error, no warning, no `doctor` complaint.
Found while scaffolding `expo/expo` with 0.10.0.
## Root cause
`src/config/load.ts:386`:
```ts
export function parseFrontmatter(md: string): { data: Record; body: string } {
if (!md.startsWith("---")) {
return { data: {}, body: md };
}
```
Any leading byte — including a comment we ourselves put there — returns `{ data: {} }` and hands the whole file back as body.
All four shipped templates trip it:
```
$ for f in templates/coordinator.md templates/agents/*.md; do printf "%-40s %s\n" "$f" "$(head -c 3 "$f")"; done
templates/coordinator.md
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with parseFrontmatter in src/config/load.ts:386 and inspect the four files under templates/, then trace consumption at src/config/load.ts:173-175 and description rendering in src/core/prompts.ts:726. Done means a freshly scaffolded repo preserves the templates' frontmatter keys, with a regression test asserting every shipped template parses to a non-empty key set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100