#+TITLE: SKILL: Scribe Agent (Universal Literate Note) #+ID: skill-scribe #+STARTUP: content #+FILETAGS: :scribe:distillation:psf:audit: * Overview The *Scribe Agent* is the primary custodian of the Institutional Memory. It distills ephemeral daily thoughts into atomic notes, enriches the knowledge graph via Karpathy-style synthesis, and audits foundry projects. * Phase A: Demand (PRD) :PROPERTIES: :STATUS: FROZEN :END: ** 1. Purpose Define automated distillation, enrichment, and auditing behaviors. ** 2. User Needs - *Knowledge Distillation:* Weekly scan of ~daily/~ files to extract evergreen concepts. - *Privacy Mandate:* NEVER process subtrees with the ~@personal~ tag. (LLM exclusion). - *Content Enrichment (Karpathy Method):* 1. Cross-linking to existing notes. 2. Merging redundant concepts. 3. Splitting bloated notes. 4. Deciding on further self-learning (deep or adjacent). 5. Generating project ideas from insights. - *Archive Preservation:* Never delete originals from ~daily/~. ** 3. Success Criteria *** TODO Successful distillation of a week's worth of dailies. *** TODO Automated link suggestion between new and old notes. *** TODO Project idea generation verified by user. * Phase B: Blueprint (PROTOCOL) :PROPERTIES: :STATUS: SIGNED :END: ** 1. Architectural Intent Uses a weekly heartbeat trigger. Employs a "Compiler" approach: System 1 (Neuro) generates synthesis proposals, System 2 (Symbolic) verifies file-system safety and tag constraints. ** 2. Semantic Interfaces #+begin_src lisp (defun scribe-distill-weekly () "Main entry point for weekly knowledge synthesis.") (defun scribe-enrich-concept (note-id) "Triggers neural analysis for linking and project ideas.") #+end_src * Phase D: Build (Implementation) ** Git-based Change Detection #+begin_src lisp :tangle ../projects/org-skill-scribe/src/scribe-engine.lisp (defun scribe-get-changed-dailies () "Returns list of daily files modified in the last 7 days via git." (uiop:run-program (list "git" "log" "--since='1 week ago'" "--name-only" "--pretty=format:" "--" "daily/") :output :lines)) #+end_src ** Pre-Filtering (The Privacy Wall) #+begin_src lisp :tangle ../projects/org-skill-scribe/src/scribe-engine.lisp (defun scribe-filter-personal (org-ast-node) "Recursively strips out any headline or content tagged with @personal. This runs strictly in System 2 BEFORE any data is passed to System 1." (let ((tags (getf (org-agent:org-object-attributes org-ast-node) :TAGS))) (when (not (member "@personal" tags :test #'string=)) org-ast-node))) #+end_src ** Karpathy-Style Synthesis #+begin_src lisp :tangle ../projects/org-skill-scribe/src/scribe-engine.lisp (defun neuro-skill-scribe-enrich (context) "Neural stage for high-entropy knowledge synthesis. Assumes 'context' has already passed through scribe-filter-personal." (let* ((content (getf context :content)) (existing-notes "")) ; Skeletal: would call atomic-notes-scan (ask-neuro content :system-prompt (format nil "You are the PSF Scribe. Your goal is to ENRICH this concept. RULES: 1. CROSS-LINK: Suggest links to existing notes. 2. MERGE/SPLIT: Identify if this should be combined with another or broken down. 3. SELF-LEARNING: Suggest a 'Path to Mastery' (deeper or adjacent). 4. PROJECTS: Suggest a PSF-style project based on this. 5. NO FILLER: Return a Lisp plist.")))) (defun trigger-skill-scribe (context) "Triggers on delegation to :scribe or :distill." (let ((payload (getf context :payload))) (and (eq (getf context :type) :EVENT) (eq (getf payload :sensor) :delegation) (member (getf payload :target-skill) '(:scribe :distill))))) #+end_src * Registration #+begin_src lisp (defskill :skill-scribe :priority 60 :trigger #'trigger-skill-scribe :neuro #'neuro-skill-scribe-enrich :symbolic #'scribe-get-changed-dailies) #+end_src