Skip to content

Runtime playbook composition #14

Description

@Allann

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:

  1. Create a workspaces/{project}/playbooks/ directory. Playbook files are markdown with optional frontmatter (title, macro).
  2. Add a PlaybookService in ai-dev.core that lists and reads playbook files for a project.
  3. Extend inbox message frontmatter to support a playbook: field containing a playbook slug.
  4. 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.
  5. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions