Skill routing sends prompts that only mention "green", or contain "run" and "check" anywhere, to /build-check

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bun, typescript

調査の方向性

Start by reading lib/skill-route.ts, especially the trigger scoring, EVERYDAY_SPAN, and prompt-window logic described in the issue. Run the Bun repro from the issue to confirm which ordinary prompts route to /build-check. Adjust scoring so single-word collapses require the full phrase and proximity checks cover other matches; verify the repro routes only the real check request.

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

説明

Version: v1.105.4.0. lib/skill-route.ts is byte-identical to main (last change 76dd597ff, #4831).

The UserPromptSubmit router sends ordinary prompts to /build-check in two situations:

  • the prompt only mentions the word "green";
  • the prompt has the words "run" and "check" anywhere in it, however far apart.

The hint says "Run /build-check with the Skill tool before you start", so a session that follows it starts the project's test suite when nobody asked for one.

Repro

Run with bun from any directory:

import { routePrompt, scanInstalledSkills, installedSkillsDir } from '<gstack>/lib/skill-route';
const { skills } = scanInstalledSkills(installedSkillsDir());
const filler = 'Background notes for the next session about the onboarding flow and its copy. '.repeat(30);
for (const p of [
  "Please don't treat a green CI run as acceptance; the user's own retest is what counts.",
  "Run the onboarding redesign end to end, then check the copy with the designer before you merge.",
  "Run the onboarding redesign end to end. " + filler + " Then check the copy with the designer before you merge.",
  "run the checks",
  "Draft the onboarding email for new users.",
]) { const d = routePrompt(p, skills); console.log(p.length, d.route ? `${d.route.skill} via "${d.route.trigger}" ${d.route.score}` : 'no route'); }

Output:

86   build-check via "make it green" 1      <- a sentence that says NOT to rely on green CI
95   build-check via "run the checks" 1     <- "run ... check" in two clauses
2436 build-check via "run the checks" 1     <- "run" and "check" ~2,400 chars apart
14   build-check via "run the checks" 1     <- the real request (correct)
41   no route                               <- correct
Cause (lib/skill-route.ts)
  1. Single-word collapse.
    • make and it are in STOPWORDS, so "make it green" and "is it green" each have one content word: green.
    • green has 5 letters, so SPECIFIC_WORD accepts it and it is not treated as weakSingle.
    • The result is that matched / content = 1/1 = 1.0 for any prompt that contains "green".
  2. Proximity check skipped.
    • "run the checks" has the content words run and check.
    • check has 5 letters, so it counts as specific. That makes everyday false, so the EVERYDAY_SPAN rule (scattered) never runs.
    • The trigger contains "the", so it is not a noun phrase, and asksForWork does not apply either.
    • Any prompt with both words anywhere in the 4000-char head plus 1000-char tail window scores 1.0.
  3. No length guard. A 40,000-char brief or handoff is scored like a one-line request, and long prompts are where both words show up by chance.
Field data

Single machine, Claude Code, ~/.gstack/hooks/skill-route.log, 2026-11-25 to 2026-12-01:

  • 272 of 643 typed prompts were routed: 240 to /build-check and 32 to /review.
  • 262 of those 272 were 4,000+ chars (pasted directives and session briefs).
  • 0 of 158 prompts under 300 chars were routed.
  • The prompts that were routed were not requests to run checks.
  • Sessions followed the hint 4 times without being asked. Two of those started a pytest run.
Suggested fix
  • Score a trigger whose content words collapse to one word ("make it green", "is it green") only when the whole phrase, stopwords included, appears in the prompt.
  • Apply the EVERYDAY_SPAN proximity rule (or asksForWork) to every match that is not the whole phrase, not only to triggers made of everyday words.
  • Optionally, for typed prompts longer than the head window, route only when the sentence that holds the match asks for the work (ASK_CUE or imperative-first, as in #4802).

Workaround: gstack-config set skill_routing off.

主要言語
TypeScript
スター
143k
フォーク
21k
平均マージ
5時間 25分
マージ済み PR(30日)
791

環境構築

はじめの一歩

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

garrytan/gstack のほかの issue

garrytan/gstack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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