CURRENT STATE: Agent Templates (CLAUDE.md files in workspaces/agent-templates/) are used only when creating a new agent. Once created, the template content is embedded as the agent's static CLAUDE.md and never updated. There is no way to attach a different instruction set to a specific run without permanently editing the agent.
GAP: No runtime concept of a reusable procedure template that can be attached per-message without changing the agent's identity.
INSPIRED BY: Devin's Playbook feature — a reusable prompt template attached at session creation time, layered on top of the agent's base system prompt. Playbooks encode how to execute a recurring multi-step task (steps, forbidden actions, required inputs) separate from what the agent knows.
IMPLEMENT:
- Create a workspaces/{project}/playbooks/ directory. Playbook files are markdown with optional frontmatter (title, macro).
- Add a PlaybookService in ai-dev.core that lists and reads playbook files for a project.
- Extend inbox message frontmatter to support a
playbook: field containing a playbook slug.
- In DispatcherService, when building the agent launch prompt, if the message specifies a playbook, load its body and insert it between CLAUDE.md and the message body.
- Final prompt structure: [CLAUDE.md system prompt] + [playbook body] + [message body].
FILES TO CHANGE: ai-dev.core/Features/Agent/ (new PlaybookService), ai-dev.core/Services/DispatcherService.cs, ai-dev.core/Models/ (extend MessageItem frontmatter).
CURRENT STATE: Agent Templates (CLAUDE.md files in workspaces/agent-templates/) are used only when creating a new agent. Once created, the template content is embedded as the agent's static CLAUDE.md and never updated. There is no way to attach a different instruction set to a specific run without permanently editing the agent.
GAP: No runtime concept of a reusable procedure template that can be attached per-message without changing the agent's identity.
INSPIRED BY: Devin's Playbook feature — a reusable prompt template attached at session creation time, layered on top of the agent's base system prompt. Playbooks encode how to execute a recurring multi-step task (steps, forbidden actions, required inputs) separate from what the agent knows.
IMPLEMENT:
playbook:field containing a playbook slug.FILES TO CHANGE: ai-dev.core/Features/Agent/ (new PlaybookService), ai-dev.core/Services/DispatcherService.cs, ai-dev.core/Models/ (extend MessageItem frontmatter).