Skip to content

Generate one prompts/ file per Session prompt, checked by the golden-file test #177

Closed

Description

@JacobStephens2

Parent

#176

What to build

Show every Session prompt at the top level of the repository as readable Markdown, generated from the same code the binary sends it from, so it can never drift.

The golden-file test that keeps the Prompts and skills page in sync also renders a prompts/ directory: one file per prompt entry the page already renders (nine in all), each named after the entry's id without the prompt- prefix (fresh.md, continuation.md, continuation-pr.md, spec-review.md, conflict-repair.md, foreign-conflict-repair.md, review-repair.md, ci-fix-repair.md, resume.md). Each file contains:

  • a note saying it is generated from the prompt module and how to regenerate it
  • the entry's title as a heading
  • its "when" sentence
  • the prompt text in a fenced code block, with the page's placeholders (the issue number shown as #<n>), using a fence longer than any run of backticks in the text.

The page's links to home-page units are omitted.

In check mode, the test fails when a file is missing, differs, or is stale (a file in prompts/ that no prompt produces). The message names the file, shows a line diff and gives the regenerate command. The regeneration variable is renamed from UPDATE_PROMPTS_PAGE to UPDATE_PROMPTS, with no alias, and it now writes the page fragment and every prompts/ file and deletes stale ones. The test skips when prompts/ is absent, as it already does for site/ in the crates.io package, and prompts/ is not added to the package.

Nothing in how a Run builds or sends Session prompts changes.

Acceptance criteria

  • prompts/ holds the nine prompt files described above, and running UPDATE_PROMPTS=1 cargo test prompts_page from a clean checkout changes nothing
  • Changing a Session prompt's wording makes cargo test fail, naming the prompts/ file, showing a line diff and the UPDATE_PROMPTS=1 cargo test prompts_page command
  • A stray file in prompts/ makes cargo test fail, and regenerating deletes it
  • A missing prompts/ file makes cargo test fail, and regenerating restores it
  • UPDATE_PROMPTS_PAGE is no longer referenced anywhere; the site page regenerates with UPDATE_PROMPTS
  • The test skips, and doesn't fail, when prompts/ is absent
  • A unit test covers choosing a code fence longer than any run of backticks in the prompt text
  • AGENTS.md says prompts/ is generated, so edit the prompt module and regenerate with UPDATE_PROMPTS=1 cargo test prompts_page
  • README.md's regeneration paragraph names UPDATE_PROMPTS and covers both the page and prompts/

Blocked by

None (can start immediately)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions