readModePrompt
readModePrompt(
command,config):string
Defined in: packages/core/src/utils/llmUtils.ts:395
GS2-79 — the SINGLE place a command’s mode prompt is chosen, for every site that composes a system prompt via buildSystemMessages: the agent and the subagent profiles.
It exists because the selection used to be an inline three-branch ternary copied to each of
those sites, and a command missing from one copy is silently served the CHAT prompt — the
default branch — rather than failing. That is how review/pr came to compose the chat prompt
while the review instructions were smuggled in as a caller-side leading SystemMessage, which
Anthropic rejects outright (“System messages are only permitted as the first passed message”).
One function means a new command is wired once, and review/pr cannot silently fall back to
chat again.
review/pr resolve to the REVIEW INSTRUCTIONS (.gsloth.review.md), which is what makes a
review a review; every command without a mode prompt of its own keeps the chat prompt.
Parameters
Section titled “Parameters”command
Section titled “command”GthCommand | undefined
config
Section titled “config”PromptReadConfig
Returns
Section titled “Returns”string