Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Scaffolded templates put @ref LLP comments above the frontmatter, silently killing every key (alwaysRun, model, description)

オープン
#60 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
typescript
領域
cli, tooling

調査の方向性

src/config/load.ts:386 の parseFrontmatter から始め、templates/ 配下の4つのファイルを調査し、続いて src/config/load.ts:173-175 での利用箇所と src/core/prompts.ts:726 での説明のレンダリングを追跡します。完了条件は、新しく scaffold されたリポジトリで templates の frontmatter キーが保持され、提供されているすべての template が空でないキー集合としてパースされることを確認する regression test があることです。

索引モデルが issue の本文から書いたものです。

説明

bug

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:

export function parseFrontmatter(md: string): { data: Record<string, string>; 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                 <!-
templates/agents/consistency.md          <!-
templates/agents/correctness.md          <!-
templates/agents/security.md             <!-

Impact

Consumed at src/config/load.ts:173-175, so the dropped keys fall back to defaults:

Template Key lost Consequence
agents/security.md alwaysRun: true The security agent stops being always-run. It is now only included when the router happens to pick it.
agents/security.md model: anthropic/claude-opus-5 Security reviews run on the config default instead of Opus.
coordinator.md model: anthropic/claude-opus-5 Consolidation and the final decision run on the default model.
all three agents description The router prompt renders (no description) for every agent — see src/core/prompts.ts:726. Routing has nothing to discriminate on.

alwaysRun is the serious one: src/config/load.ts:174 tests the value against "", so it becomes false, and the guarantee that security always reviews every PR is quietly gone.

Reproduction

Scaffold a fresh repo and run any review. Observed on a real run against expo/expo PR #48510:

  [coordinator] started claude-sonnet-5
Models used — … coordinator: anthropic/claude-sonnet-5

despite model: anthropic/claude-opus-5 sitting in coordinator.md.

Why it went unnoticed

This repo's own .expo-code-review/ files are correct — they start with ---. So do the hand-tuned configs in expo/eas-cli and brentvatne/euxy. Only a freshly scaffolded repo gets the broken shape, and the failure is silent, so nothing surfaces it.

Suggested fix

  1. Move the @ref LLP annotations in templates/coordinator.md and templates/agents/*.md to below the closing ---, or into the frontmatter as # comment lines (the parser already allows those).
  2. Consider making parseFrontmatter tolerate leading whitespace and HTML comments before the delimiter. It is a small change and stops this whole class of silent misconfiguration for adopters who add a license header or a comment of their own.
  3. Add a doctor check: if a prompt file contains a line matching ^(description|alwaysRun|model|temperature): that the parser did not pick up, fail with a pointer to the delimiter. This is the check that would have caught it.

A regression test asserting that every shipped template's frontmatter parses to a non-empty key set would keep it from coming back.

主要言語
TypeScript
スター
4
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

expo/code-review-cli のほかの issue

expo/code-review-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。