Files
memex/notes/org-skill-chat.org

2.2 KiB

SKILL: Chat Agent (Universal Literate Note)

Overview

The Chat Agent provides a dedicated conversational interface within Emacs (`*org-agent-chat*`). It enables fluid dialogue while maintaining strict persona alignment and contextual awareness.

Phase A: Demand (PRD)

1. Purpose

Define the interfaces for direct human-to-agent conversational interaction.

2. User Needs

  • Direct Interaction: Specialized handler for `:chat-message` events.
  • Persona Alignment: Consistency with the Identity Agent's definitions.
  • Contextual Awareness: Reference to chat history for dialogue continuity.
  • Structural Output: Responses formatted as valid Org-mode subtrees.

3. Success Criteria

TODO Chat Event Triggering

TODO Persona-Driven Response Generation

TODO Emacs Buffer Insertion Verification

Phase B: Blueprint (PROTOCOL)

1. Architectural Intent

Interfaces for conversational event handling and UI integration. Source of truth is the dynamic chat buffer and the Identity skill.

2. Semantic Interfaces

(defun trigger-skill-chat (context)
  "Triggers on :sensor :chat-message.")

(defun verify-skill-chat (proposed-action context)
  "Ensures response is targeted to the correct Emacs buffer.")

Phase D: Build (Implementation)

Event Perception

(defun trigger-skill-chat (context)
  (let* ((payload (getf context :payload))
         (sensor (getf payload :sensor)))
    (eq sensor :chat-message)))

Symbolic Verification

(defun verify-skill-chat (proposed-action context)
  (if (and (eq (getf proposed-action :target) :emacs)
           (eq (getf (getf proposed-action :payload) :action) :insert-at-end))
      proposed-action
      '(:target :emacs :action :message :text "Chat failed to format response.")))

Registration

(defskill :skill-chat
  :priority 100
  :trigger #'trigger-skill-chat
  :neuro #'neuro-skill-chat
  :symbolic #'verify-skill-chat)