Skip to content

feat(workflow): append_system_prompt per prompt step - #6

Merged
coston merged 1 commit into
mainfrom
feat/append-system-prompt-per-step
Sep 8, 2026
Merged

coston merged 1 commit into
mainfrom
feat/append-system-prompt-per-step

Conversation

@coston

@coston coston commented Sep 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Adds append_system_prompt as a per-step YAML field for type: prompt steps, threaded through RawStepSchema → convertInnerStep → ClaudeTask.appendSystemPrompt (with {{var}} substitution, same as prompt:).
  • The CLI-arg plumbing already existed (buildClaudeArgs → --append-system-prompt) but was only ever set by internal planning/refine/eval invocations — no YAML-authored step could reach it.

Why

A rule embedded in a prompt step's prompt: text has to compete with everything else in a long user turn for the model's compliance. In practice, even a short, sharply-worded rule (e.g. "never narrate before the deliverable") can keep failing an llm_as_judge check on leaked preamble no matter how forcefully it's worded, because wording strength doesn't fix where the instruction lives. System-level instructions get materially stronger adherence than the same words placed in the user turn; executant already has that lever (--append-system-prompt), it just wasn't exposed to ordinary workflow steps.

Testing

  • npm run lint — clean
  • npx tsc --noEmit — clean
  • npm test — full suite green (1043 pass, 3 pre-existing skips, 0 fail), including 3 new tests covering: field passthrough, omission when unset, and {{var}} substitution.

Not merging this myself — it's a published, auto-updating package every sandbox pulls before each run, so this is for your review before it ships.

A quality-critical rule (e.g. "never narrate before the deliverable")
placed in a prompt step's `prompt:` text competes with everything else
in a long user turn and is unreliable in practice — even a sharply
worded rule can keep failing an llm_as_judge check on leaked preamble,
because wording strength doesn't fix where the instruction lives.

buildClaudeArgs already supports --append-system-prompt via
ClaudeTask.appendSystemPrompt, but only internal planning/refine/eval
invocations ever set it — no YAML-authored prompt step could reach it.
Adds append_system_prompt as a per-step field, threaded through
RawStepSchema -> convertInnerStep -> ClaudeTask, with {{var}}
substitution like prompt: already has.
@coston
coston force-pushed the feat/append-system-prompt-per-step branch from 3b99ace to 8aaebe0 Compare September 8, 2026 15:36
@coston
coston merged commit 6490334 into main Sep 8, 2026
1 check passed
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant