fix(cli): drop comments from the import prompt's frontmatter example #274

Merged
abiwab merged 1 commit from fix/cli-import-prompt-frontmatter into main 2026-11-26 15:50:06 +01:00
Owner

The frontmatter has no comments: a trailing # … becomes part of the value ('Tarte au Citron Meringuée' # original language…, quotes included), and a # … line or an indented line makes the whole block fall back to a text step. The frontmatter example of gram import's prompt carried six trailing comments, which the model could copy into an imported recipe.

  • packages/cli/src/prompts/gram-spec.ts: the frontmatter example has no comments any more; what they said moves to the Rules below it (originalTitle, author as a string or an array, source always an array, portions an integer, makes not size, densities), with a new rule saying the frontmatter has no comments. The reference recipe uses yolks in the lemon curd (whites were used twice) and reuses the butter with @&butter{50g}, as its own rule asks; the egg count is unchanged (kitchen merges the two <@egg{3}).
  • packages/cli/tests/ai-spec-examples.test.ts: every line of the frontmatter example is key: value, every written key is read into meta, and no value holds a #. It also checks the gram-authoring SKILL.md and its mirror when they are present: .agents/ and .claude/ are git-ignored, so CI checks gram-spec.ts alone. Failed before the fix, and on both traps reintroduced by hand.
  • Changeset: patch on @gram-lang/cli.

First step of PR 3 of the DX plan (AI spec examples test), which will extend this test to every example of the prompt on dev/1.6.

The frontmatter has no comments: a trailing `# …` becomes part of the value (`'Tarte au Citron Meringuée' # original language…`, quotes included), and a `# …` line or an indented line makes the whole block fall back to a text step. The frontmatter example of `gram import`'s prompt carried six trailing comments, which the model could copy into an imported recipe. - `packages/cli/src/prompts/gram-spec.ts`: the frontmatter example has no comments any more; what they said moves to the Rules below it (`originalTitle`, `author` as a string or an array, `source` always an array, `portions` an integer, `makes` not `size`, `densities`), with a new rule saying the frontmatter has no comments. The reference recipe uses yolks in the lemon curd (whites were used twice) and reuses the butter with `@&butter{50g}`, as its own rule asks; the egg count is unchanged (kitchen merges the two `<@egg{3}`). - `packages/cli/tests/ai-spec-examples.test.ts`: every line of the frontmatter example is `key: value`, every written key is read into `meta`, and no value holds a `#`. It also checks the gram-authoring `SKILL.md` and its mirror when they are present: `.agents/` and `.claude/` are git-ignored, so CI checks `gram-spec.ts` alone. Failed before the fix, and on both traps reintroduced by hand. - Changeset: patch on `@gram-lang/cli`. First step of PR 3 of the DX plan (AI spec examples test), which will extend this test to every example of the prompt on `dev/1.6`.
fix(cli): drop comments from the import prompt's frontmatter example
All checks were successful
CI / Build & Test (pull_request) Successful in 5m22s
8415e497d0
abiwab merged commit d8581dc34f into main 2026-11-26 15:50:06 +01:00
abiwab deleted branch fix/cli-import-prompt-frontmatter 2026-11-26 15:50:07 +01:00
Sign in to join this conversation.
No description provided.