refactor(framework): move all prompting into prompts/**/*.md (#551)#553
Merged
Conversation
Every agent-facing prompt now lives as markdown under packages/framework/prompts/: the system prompt (#326), the two emit protocols, and the five preset prompts. No prompt text is written in TypeScript any more. The text is unchanged. Verified byte-identical against the previous build for all eight constants and for the composed run system channel (3874 chars). scripts/gen-prompts.mjs compiles prompts/**/*.md into src/prompts.generated.ts (git-ignored), which the code imports. Generated rather than read from disk with node:fs like @gemstack/ai-autopilot does, because the system prompt and presets are reachable from src/client.ts, which the dashboard imports in the browser to show the prompt before a run (#520). A node:fs edge there breaks the browser bundle and client.test.ts fails the build over it. A module of plain strings crosses that boundary for free and keeps the package files: ["dist"].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #551.
All prompting is now markdown under
packages/framework/prompts/. No agent-facing text is written in TypeScript any more.The text is unchanged. Verified byte-identical against the previous build: all 8 constants, plus the composed run system channel, still exactly 3874 chars. This PR is a move, not an edit, so there is nothing to review prompt-wise. That is deliberate: syncing your 13 Jul rewrite is the next PR, and it will be a markdown diff you can read.
Why generated, not read from disk.
@gemstack/ai-autopilotreads itsprompts/*.mdwithnode:fsat run time. That does not work here: the system prompt and the presets are reachable fromsrc/client.ts, which the dashboard imports in the browser to show the prompt before a run (#520). Anode:fsedge there breaks the browser bundle, andclient.test.tsfails the build over it. Soscripts/gen-prompts.mjscompilesprompts/**/*.mdintosrc/prompts.generated.ts(git-ignored, rebuilt by build/test/typecheck), and the code imports plain strings. The markdown is the only source of truth, and the package staysfiles: ["dist"].Editing a prompt is: edit the
.md,pnpm build. Addingfoo/bar.mdexportsFOO_BAR.Not done here, on purpose: user-customizable prompts (post-MVP, your call on #551), and the phase-hook idea. This is the MVP shape.
No changeset: the published surface and every prompt byte are identical.
522 tests green, root typecheck green (21/21), dashboard bundle builds.