feat(agents): apply per-instance prompt_appendix to skill at dispatch time #106
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!106
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/51"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
prompt_appendixapplication fromsystem_promptconcatenation to the per-task skill body at dispatch time, separated by a## Agent-specific guidanceheadingprompt_appendix: string | nullonResolvedAgent;system_promptis now type-level only (no longer includes the appendix)applyAppendix(task, instance)helper fromwebhook-config.tsandbuildPromptForDispatch(instance, skillName, vars)fromwebhook-handlers.tsfor stateless skill loading + appendix application in testsapplyAppendixafter interpolationTest plan
buildPromptForDispatchtests: base-only when appendix null/empty, concat with heading when set, stateless (review) skill also receives appendixresolveAgenttest updated:system_promptis type-level only;prompt_appendixsurfaces as its own fieldCloses #51
Review: feat(agents): apply per-instance prompt_appendix to skill at dispatch time
CI: ✅ green (run #1650, 2m50s, SHA
8c80f77)Acceptance criteria — all met
loadSkill, separated by## Agent-specific guidancesystem_promptstays type-level only (appendix NOT merged in)buildPromptForDispatchexported and tested (null, empty, non-empty, stateless skill)resolveAgenttest updated:prompt_appendixas its own field,system_promptunmodifiedCode review
webhook-config.ts— Clean.mergeAgentcorrectly mapsrow.prompt_appendix?.trim() || null(whitespace-only becomesnull).applyAppendixapplies a second.trim()on an already-trimmed value — harmless but redundant. No issue.webhook-handlers.ts— All five dispatch paths (dispatchIssueForAgent,handleReviewRequested,dispatchRebaseIfNotMergeable,handleChangesRequested,handlePostMergeRebase) correctly callapplyAppendixafterinterpolate, which is the right ordering (template vars expanded first, plain-text appendix appended after).buildPromptForDispatchis a clean, stateless helper that composesloadSkill → interpolate → applyAppendixin one call, useful for tests and fully-resolved skill name paths.webhook-ci.ts—dispatchFixCinow appliesapplyAppendixcorrectly using the PR author's resolved agent.Minor observation (not blocking):
dispatchMergeinwebhook-ci.tsdoes not applyapplyAppendix— the boss agent'sprompt_appendixis silently ignored for merge tasks. This is consistent with the explicit AC checklist (merge was intentionally omitted from the list), and the merge skill is a one-shot operation dispatched to a fixed type rather than the issue author, so the omission is arguably correct. Worth a note for A6 / future reference: if the boss instance ever gets aprompt_appendix, it won't reach merge tasks.Tests are well-structured. The four
buildPromptForDispatchcases (null, empty string, non-empty, stateless skill) fully cover the branching inapplyAppendix. The separator-position assertion (\n\n## Agent-specific guidance\n\n) catches ordering regressions.LGTM.
Review: feat(agents): apply per-instance prompt_appendix to skill at dispatch time
CI: ✅ green (run #1650, 2m50s, SHA
8c80f77)Acceptance criteria — all met
loadSkill, separated by## Agent-specific guidancesystem_promptstays type-level only (appendix NOT merged in)buildPromptForDispatchexported and tested (null, empty, non-empty, stateless skill)resolveAgenttest updated:prompt_appendixas its own field,system_promptunmodifiedCode review
webhook-config.ts— Clean.mergeAgentcorrectly mapsrow.prompt_appendix?.trim() || null(whitespace-only becomesnull).applyAppendixapplies a second.trim()on an already-trimmed value — harmless but redundant. No issue.webhook-handlers.ts— All five dispatch paths (dispatchIssueForAgent,handleReviewRequested,dispatchRebaseIfNotMergeable,handleChangesRequested,handlePostMergeRebase) correctly callapplyAppendixafterinterpolate, which is the right ordering (template vars expanded first, plain-text appendix appended after).buildPromptForDispatchis a clean, stateless helper that composesloadSkill → interpolate → applyAppendixin one call, useful for tests and fully-resolved skill name paths.webhook-ci.ts—dispatchFixCinow appliesapplyAppendixcorrectly using the PR author's resolved agent.Minor observation (not blocking):
dispatchMergeinwebhook-ci.tsdoes not applyapplyAppendix— the boss agent'sprompt_appendixis silently ignored for merge tasks. This is consistent with the explicit AC checklist (merge was intentionally omitted), and the merge skill is a one-shot operation dispatched to a fixed type. Worth noting for A6 / future reference.Tests are well-structured. The four
buildPromptForDispatchcases (null, empty string, non-empty, stateless skill) fully cover the branching inapplyAppendix. The separator-position assertion catches ordering regressions.LGTM.