Files
memex/notes/skill-workspace-manager.org

1.7 KiB

#+TITLE - Workspace Manager Skill #+AUTHOR - org-agent #+SKILL_NAME - skill-workspace-manager

This skill automates the Para/Memex workflow, such as archiving DONE tasks and organizing the inbox.

Trigger

Triggers on buffer saves or background heartbeats.

(defun trigger-skill-workspace-manager (context)
  (let* ((payload (getf context :payload))
         (sensor (getf payload :sensor)))
    (or (eq sensor :buffer-update)
        (eq sensor :heartbeat))))

Symbolic Logic

(defun archive-completed-tasks ()
  "Identify DONE tasks and suggest archiving."
  (let ((done-tasks (org-agent:context-query-store :todo-state "DONE" :type :HEADLINE)))
    (when done-tasks
      (kernel-log "WORKSPACE - Found ~a tasks ready for archiving." (length done-tasks))
      ;; Return a list of IDs to move
      (mapcar #'org-agent:org-object-id done-tasks))))

Neuro Prompt

(defun neuro-skill-workspace-manager (context)
  (let ((ready-to-archive (archive-completed-tasks))
        (archive-dir (org-agent::get-env "ARCHIVES_DIR" "/app/8_archives/")))
    (if ready-to-archive
        (format nil "
          WORKSPACE UPDATE -
          I found these tasks marked DONE in the Atomic Notes (Zettelkasten) - ~a
          
          Suggest an Org-mode action to move them to the '~a' folder.
          Return a Lisp plist - (:target :emacs :action :message :text \"I found completed tasks. Should I archive them?\")
        " ready-to-archive archive-dir)
        nil)))

Registration

(defskill :skill-workspace-manager
  :priority 40
  :trigger #'trigger-skill-workspace-manager
  :neuro #'neuro-skill-workspace-manager
  :symbolic (lambda (action context) action))