Skip to content

Make prompts canonical upstream: sync + codegen prompts.ts and publish llms.txt #126

@justin808

Description

@justin808

Context

PR #125 shipped the AI-agent prompts as a hand-authored site module (prototypes/docusaurus/src/constants/prompts.ts) plus a /prompts page and home Quick Start. We're moving the canonical source of the prompts to react_on_rails (mirroring how docs/CHANGELOG already sync) and publishing a public llms.txt + prompts.json so AI agents can fetch the canonical set. This issue covers the site-side wiring. The upstream canonical prompts.yml and the eval harness are tracked in the cross-linked react_on_rails issue.

Scope (reactonrails.com)

  • Extend scripts/sync-docs.mjs to copy upstream prompts.ymlcontent/upstream/prompts.yml (the CHANGELOG copy is the precedent for syncing a non-docs upstream file).
  • Add scripts/prepare-prompts.mjs (Node ESM + a node --test companion mirroring scripts/docs-layout.test.mjs). It reads the synced YAML, resolves each doc_route to an absolute reactonrails.com URL, validates the route resolves against the prepared doc slugs (fail the build on a dangling link), and emits:
    • prototypes/docusaurus/src/constants/prompts.ts — GENERATED ("do not edit" header); replaces today's hand-authored file; PromptCard / /prompts / home consumers unchanged.
    • prototypes/docusaurus/static/llms.txt and static/prompts.json — served at /llms.txt and /prompts.json.
  • Wire prepare-prompts into npm run prepare (after prepare:docs, so prepared slugs exist for validation); update build:full.
  • Add a guard so a hand-edited prompts.ts that drifts from prompts.yml fails CI.

Depends on / merge order

Requires the upstream prompts.yml (cross-linked react_on_rails issue). Merge upstream first, or land with a temporary in-repo fallback prompts.yml removed once upstream merges (per the README merge-order rule).

Acceptance

  • Generated prompts.ts reproduces the currently shipped prompt content (no visual change).
  • /llms.txt and /prompts.json return the canonical prompt set.
  • Route validation fails the build on a dangling doc link.
  • npm run build:full stays green.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions