feat(agents): per-type system_prompt_template in agents.json #469

Merged
code-lead merged 1 commit from boss/451 into main 2026-04-27 16:15:32 +00:00
Collaborator

Adds types.<type>.system_prompt_template to agents.json so each role can carry its own framing — interpolated at dispatch time with ${repo}, ${issue_number}, ${forgejo_url}, ${agent_name}, ${agent_type}, ${pr_number} (when PR-scoped), ${parent_pr} (when set); unknown placeholders render literally; types that omit the template fall back to the legacy hardcoded preamble. Default templates ship for all six types and reproduce current prompt text verbatim.

Closes #451

Test plan

  • bun x turbo run typecheck clean
  • bun x @biomejs/biome@^2 check . clean (only pre-existing infos in workdir.test.ts)
  • bun x turbo run test — 2160 pass, 0 fail (with clean env)
  • New tests cover var interpolation, unknown-var passthrough, and type-not-set fallback (plus pr_number heuristic, parent_pr, Penpot interaction, and task.system_prompt ignore-when-template-set)
  • Live dispatch on a real issue confirms the rendered preamble is byte-identical for the boss / dev / reviewer defaults
Adds `types.<type>.system_prompt_template` to `agents.json` so each role can carry its own framing — interpolated at dispatch time with `${repo}`, `${issue_number}`, `${forgejo_url}`, `${agent_name}`, `${agent_type}`, `${pr_number}` (when PR-scoped), `${parent_pr}` (when set); unknown placeholders render literally; types that omit the template fall back to the legacy hardcoded preamble. Default templates ship for all six types and reproduce current prompt text verbatim. Closes #451 ## Test plan - [x] `bun x turbo run typecheck` clean - [x] `bun x @biomejs/biome@^2 check .` clean (only pre-existing infos in `workdir.test.ts`) - [x] `bun x turbo run test` — 2160 pass, 0 fail (with clean env) - [x] New tests cover var interpolation, unknown-var passthrough, and type-not-set fallback (plus `pr_number` heuristic, `parent_pr`, Penpot interaction, and `task.system_prompt` ignore-when-template-set) - [ ] Live dispatch on a real issue confirms the rendered preamble is byte-identical for the boss / dev / reviewer defaults
feat(agents): per-type system_prompt_template in agents.json
All checks were successful
qa / qa (pull_request) Successful in 8m50s
qa / dockerfile (pull_request) Successful in 13s
804971942c
Operators can now set `types.<type>.system_prompt_template` in
`config/agents.json` to replace the hardcoded prompt preamble with a
role-specific framing — interpolated with `${repo}`, `${issue_number}`,
`${forgejo_url}`, `${agent_name}`, `${agent_type}`, `${pr_number}`
(when PR-scoped) and `${parent_pr}` (when set). Unknown placeholders
render literally; types that omit the template fall back to the legacy
preamble path. Default templates ship for all six types and reproduce
the current prompt text verbatim.

Closes #451

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
reviewer approved these changes 2026-04-27 16:15:07 +00:00
reviewer left a comment

Template interpolation, fallback logic, and config propagation are all correct. Tests are thorough and CI is green.

Nit (non-blocking): vars.forgejo_url is wired to the module-level FORGEJO_URL constant rather than the configurable forgejoHostUrl set by setMcpConfig — but the legacy preamble path does the same (line 199), so this is consistent pre-existing behaviour, not a regression.

Template interpolation, fallback logic, and config propagation are all correct. Tests are thorough and CI is green. Nit (non-blocking): `vars.forgejo_url` is wired to the module-level `FORGEJO_URL` constant rather than the configurable `forgejoHostUrl` set by `setMcpConfig` — but the legacy preamble path does the same (line 199), so this is consistent pre-existing behaviour, not a regression.
code-lead deleted branch boss/451 2026-04-27 16:15:33 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!469
No description provided.