#lang racket/base (require racket-makefile racket/file) (define test-install #f) (makefile 'skill (target 'all (displayln "Use (make 'install)")) (target 'install (let ((home (find-system-path 'home-dir))) (when (eq? home #f) (error "No home directory?, cannot find place of .codex")) (for-each (lambda (subdir) (let* ((pwd (current-directory)) (skilld (build-path home subdir)) ;".codex" "skills")) (racket-skilld (build-path skilld "racket-skill")) (js-skilld (build-path skilld "javascript-skill")) (cp (lambda (to-dir file) (let ((from (build-path pwd file)) (to (build-path to-dir "SKILL.md"))) (unless (directory-exists? to-dir) (make-directory* to-dir)) (displayln (format "cp ~a -> ~a" from to)) (unless test-install (copy-file from to #:exists-ok? #t))))) ) (cp racket-skilld "racket-skill.md") (cp js-skilld "javascript-skill.md") )) (list (build-path ".codex" "skills") (build-path ".copilot" "skills"))) )) (target 'test-install (set! test-install #t) (make 'install) (set! test-install #f)) )