#+TITLE: SKILL: Task Integrity Agent (Universal Literate Note) #+ID: skill-task-integrity #+STARTUP: content #+FILETAGS: :gtd:integrity:safety:psf: * Overview The *Task Integrity Agent* is the "Guardian" of the GTD system. It ensures that all task transitions adhere to semantic rules, preventing logical inconsistencies and maintaining the structural health of the task hierarchy. * Phase A: Demand (PRD) :PROPERTIES: :STATUS: FROZEN :END: ** 1. Purpose Define automated behaviors for GTD state consistency and dependency verification. ** 2. User Needs - *Semantic Enforcement:* Valid state transitions (Active vs. Resolved). - *Dependency Awareness:* Block closing parents with active children. - *Proactive Assistance:* Suggesting next logical actions based on momentum. - *Fidelity:* Preservation of metadata during state transitions. ** 3. Success Criteria *** TODO Semantic Category Mapping *** TODO Active Children Detection *** TODO State Transition Block Verification * Phase B: Blueprint (PROTOCOL) :PROPERTIES: :STATUS: SIGNED :END: ** 1. Architectural Intent Interfaces for state verification and hierarchical auditing. Source of truth is the Org-mode AST and GTD metadata. ** 2. Semantic Interfaces #+begin_src lisp (defun semantic-state-category (state) "Maps raw keywords to :active or :resolved categories.") (defun has-active-children-p (parent-id) "Recursively checks for active subtasks.") (defun verify-skill-task-integrity (proposed-action context) "System 2 gatekeeper for logical task consistency.") #+end_src * Phase D: Build (Implementation) ** State Mapping #+begin_src lisp :tangle projects/org-skill-task-integrity/src/integrity-logic.lisp (defun semantic-state-category (state) (let ((s (string-upcase (or state "")))) (cond ((member s '("TODO" "NEXT" "WAIT") :test #'string=) :active) ((member s '("DONE" "CNCL" "CANCELED") :test #'string=) :resolved) (t :unknown)))) #+end_src ** Dependency Checking #+begin_src lisp :tangle projects/org-skill-task-integrity/src/integrity-logic.lisp (defun has-active-children-p (parent-id) ;; Simplified implementation for refactor nil) #+end_src * Registration #+begin_src lisp (defskill :skill-task-integrity :priority 50 :trigger #'trigger-skill-task-integrity :neuro #'neuro-skill-task-integrity :symbolic #'verify-skill-task-integrity) #+end_src