feat(arch): finalize Universal Literate Note transition for all projects and skills
This commit is contained in:
@@ -43,22 +43,43 @@ Interfaces for project scaffolding and triggering. Source of truth is the filesy
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Workspace Scaffolding
|
||||
#+begin_src lisp :tangle projects/org-skill-project-foundry/src/foundry-logic.lisp
|
||||
(defun scaffold-project (name type)
|
||||
"Physically creates the material PSF project and the Universal Literate Note."
|
||||
(let* ((projects-dir (or (uiop:getenv "PROJECTS_DIR") "projects/"))
|
||||
(project-dir (format nil "~a/~a/" projects-dir name))
|
||||
(notes-dir (or (uiop:getenv "MEMEX_NOTES") "notes/"))
|
||||
(skills-dir (or (uiop:getenv "SKILLS_DIR") "system/skills/"))
|
||||
(project-dir (format nil "~aorg-skill-~a/" projects-dir name))
|
||||
(note-path (format nil "~aorg-skill-~a.org" notes-dir name))
|
||||
(skill-link (format nil "~aorg-skill-~a.org" skills-dir name))
|
||||
(gtd-file (or (uiop:getenv "GTD_FILE") "gtd.org"))
|
||||
(timestamp (local-time:format-timestring nil (local-time:now) :format '("[" :year "-" :month "-" :day " " :weekday "]"))))
|
||||
(if (uiop:directory-exists-p project-dir)
|
||||
(format nil "ERROR: Project ~a exists." name)
|
||||
|
||||
(if (or (uiop:directory-exists-p project-dir) (uiop:file-exists-p note-path))
|
||||
(format nil "ERROR - Project or Note for ~a already exists." name)
|
||||
(progn
|
||||
(kernel-log "FOUNDRY - Scaffolding Universal PSF project: ~a" name)
|
||||
|
||||
;; 1. Create Material Project Structure
|
||||
(ensure-directories-exist (format nil "~asrc/" project-dir))
|
||||
(ensure-directories-exist (format nil "~atests/" project-dir))
|
||||
(ensure-directories-exist (format nil "~adocs/" project-dir))
|
||||
(uiop:run-program (list "git" "init" project-dir))
|
||||
(format nil "SUCCESS: Project ~a scaffolded." name)))))
|
||||
|
||||
;; 2. Create Universal Literate Note
|
||||
(with-open-file (out note-path :direction :output :if-exists :supersede)
|
||||
(format out "#+TITLE: SKILL: ~a (Universal Literate Note)~%#+ID: skill-~a~%#+STARTUP: content~%#+FILETAGS: :~a:psf:~%~%* Overview~%Automatically scaffolded ~a project.~%~%* Phase A: Demand (PRD)~%:PROPERTIES:~%:STATUS: DRAFT~%:END:~%~%** 1. Purpose~%Define the 'Why' and 'What' for ~a.~%"
|
||||
name name type name name))
|
||||
|
||||
;; 3. Establish System Actuator Link
|
||||
(uiop:run-program (list "ln" "-sf" note-path skill-link))
|
||||
|
||||
;; 4. Link to GTD.org
|
||||
(with-open-file (out gtd-file :direction :output :if-exists :append)
|
||||
(format out "~%** NEXT org-skill-~a~% :PROPERTIES:~% :ID: proj-~a~% :CREATED: ~a~% :PROJECT-PATH: ~a~% :PSF-STATE: A: DEMAND~% :END:~% Drafted by Project Foundry.~%"
|
||||
name name timestamp project-dir))
|
||||
|
||||
(format nil "SUCCESS - Universal PSF Project ~a scaffolded." name)))))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
|
||||
Reference in New Issue
Block a user