Agents: per-agent prompt appendix concatenated to skill at dispatch #51

Closed
opened 2026-04-18 15:00:25 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As a maintainer, I want each agent instance to optionally carry a prompt_appendix (stored in SQLite, editable later via the dashboard) that's concatenated to the base skill template at dispatch time, so that I can specialise dev-frontend with "focus on Svelte / TypeScript patterns" or reviewer-security with "weight auth / crypto / secrets regressions heavily" without editing skills/*.md and breaking every other instance of the same type.

Context

Skills in skills/*.md are the contract — reviewable, git-versioned, shared across all instances of a type. Per-instance tuning is a separate concern and should not pollute the shared skill files.

Acceptance criteria

Dispatch-time concatenation

  • At dispatch time, after loadSkill(<name>) returns the base template, append the instance's prompt_appendix if non-empty, separated by a clear heading:
    <base skill body>
    
    ## Agent-specific guidance
    
    <prompt_appendix>
    
  • Empty / null appendix → no change to the prompt.
  • The system_prompt stays as today (type-level from agents.json). Only the per-task skill gets the appendix.

Cache semantics

  • The skill cache (skillCache in src/webhook-handlers.ts or wherever loadSkill lives) keys on skill name only. The appendix is applied after cache lookup, per dispatch. No cache invalidation needed when editing an appendix through the dashboard.

Tests

  • buildPromptForDispatch(instance, skillName, vars) — base-only when appendix is empty; concat'd output when appendix set; appendix goes after the base body with the heading separator.
  • Stateless skills (review) also receive the appendix.

Dashboard integration point

  • The dashboard CRUD (A6) lets the operator edit the appendix in a textarea. This story does not ship the UI; it just wires the read path so A6 can write.

Out of scope

  • UI (see A6).
  • Per-event-type appendix (one appendix per instance, applied to every skill).
  • Prompt-level overrides (e.g. replacing acceptance-criteria sections) — append-only by design.
  • Template variables in the appendix ({{pr_number}}) — appendix is plain text; if we need templating later, add it behind an opt-in flag.

References

  • Tracking issue: #47.
  • Base skills: skills/*.md.

Dependencies

  • Blocked by: A1.
  • Blocks: A6 (UI writes the appendix).
  • Branch off: main (after A1 lands).
## User story As a **maintainer**, I want each agent instance to optionally carry a `prompt_appendix` (stored in SQLite, editable later via the dashboard) that's concatenated to the base skill template at dispatch time, so that I can specialise `dev-frontend` with "focus on Svelte / TypeScript patterns" or `reviewer-security` with "weight auth / crypto / secrets regressions heavily" without editing `skills/*.md` and breaking every other instance of the same type. ## Context Skills in `skills/*.md` are the contract — reviewable, git-versioned, shared across all instances of a type. Per-instance tuning is a separate concern and should not pollute the shared skill files. ## Acceptance criteria ### Dispatch-time concatenation - [ ] At dispatch time, after `loadSkill(<name>)` returns the base template, append the instance's `prompt_appendix` if non-empty, separated by a clear heading: ``` <base skill body> ## Agent-specific guidance <prompt_appendix> ``` - [ ] Empty / null appendix → no change to the prompt. - [ ] The `system_prompt` stays as today (type-level from `agents.json`). Only the per-task skill gets the appendix. ### Cache semantics - [ ] The skill cache (`skillCache` in `src/webhook-handlers.ts` or wherever `loadSkill` lives) keys on skill name only. The appendix is applied *after* cache lookup, per dispatch. No cache invalidation needed when editing an appendix through the dashboard. ### Tests - [ ] `buildPromptForDispatch(instance, skillName, vars)` — base-only when appendix is empty; concat'd output when appendix set; appendix goes after the base body with the heading separator. - [ ] Stateless skills (`review`) also receive the appendix. ### Dashboard integration point - [ ] The dashboard CRUD (A6) lets the operator edit the appendix in a textarea. This story does not ship the UI; it just wires the read path so A6 can write. ## Out of scope - UI (see **A6**). - Per-event-type appendix (one appendix per instance, applied to every skill). - Prompt-level overrides (e.g. replacing acceptance-criteria sections) — append-only by design. - Template variables in the appendix (`{{pr_number}}`) — appendix is plain text; if we need templating later, add it behind an opt-in flag. ## References - Tracking issue: #47. - Base skills: `skills/*.md`. ## Dependencies - **Blocked by:** A1. - **Blocks:** A6 (UI writes the appendix). - **Branch off:** `main` (after A1 lands).
Sign in to join this conversation.
No project
No assignees
1 participant
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#51
No description provided.