#+TITLE: SKILL: Scribe-RCA Agent (Universal Literate Note) #+ID: skill-scribe-rca #+STARTUP: content #+FILETAGS: :scribe:rca:learning:institutional-memory:psf: * Overview The **Scribe-RCA Agent** is a specialized extension of the Scribe role. It closes the "Learning Loop" by extracting Root Cause Analysis (RCA) entries from failures and populating the Institutional Memory. * Phase A: Demand (PRD) :PROPERTIES: :STATUS: FROZEN :END: ** 1. Purpose Define automated behaviors for failure diagnosis and memory ledger updates. ** 2. User Needs - **Perception:** Scan logs for fatal Lisp or System errors. - **Diagnosis:** Identify underlying technical reasons for failures. - **Distillation:** Generate high-signal entries (Symptom, Cause, Prevention). - **Prevention:** Ensure recurrence is avoided via persistent heuristics. ** 3. Success Criteria *** TODO Error Log Detection *** TODO RCA Entry Formatting *** TODO Institutional Memory Append Verification * Phase B: Blueprint (PROTOCOL) :PROPERTIES: :STATUS: SIGNED :END: ** 1. Architectural Intent Interfaces for analyzing system "pain" and recording learnings. Source of truth is the system log and `institutional-memory.org`. ** 2. Semantic Interfaces #+begin_src lisp (defun trigger-skill-scribe-rca (context) "Triggers on fatal error events or log rejections.") (defun scribe-rca-append (symptom cause prevention) "Appends entry to institutional-memory.org.") #+end_src * Phase D: Build (Implementation) ** Memory Append #+begin_src lisp :tangle projects/org-skill-scribe-rca/src/rca-logic.lisp (defun scribe-rca-append (symptom cause prevention) (let* ((notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/")) (memory-file (format nil "~ainstitutional-memory.org" notes-dir)) (timestamp (local-time:format-timestring nil (local-time:now) :format '("[" :year "-" :month "-" :day " " :weekday "]")))) (with-open-file (out memory-file :direction :output :if-exists :append) (format out "~%** ~a ~a~%- **Symptom:** ~a~%- **Root Cause:** ~a~%- **Prevention:** ~a~%" timestamp cause symptom cause prevention)) (format nil "SUCCESS - Updated Memory: ~a" cause))) #+end_src * Registration #+begin_src lisp (defskill :skill-scribe-rca :priority 90 :trigger #'trigger-skill-scribe-rca :neuro #'neuro-skill-scribe-rca :symbolic #'scribe-rca-append) #+end_src