
common-lisp-ecosystem
by takeokunn
takeokunn's nixos-configuration
SKILL.md
name: Common Lisp Ecosystem description: This skill should be used when the user asks to "write common lisp", "CLOS", "ASDF", "defpackage", "defsystem", or works with Common Lisp, SBCL, or Coalton. Provides comprehensive Common Lisp ecosystem patterns and best practices.
<common_lisp_fundamentals> Code and data share the same syntax (homoiconicity). Enables powerful macro systems for code transformation.
(defmethod greet ((p person))
(format t "Hello, ~a!~%" (person-name p)))
</example>
<decision_tree name="when_to_use">
<question>Do you need polymorphic behavior based on multiple types?</question>
<if_yes>Use defgeneric and defmethod for multiple dispatch</if_yes>
<if_no>Use regular functions for single implementation</if_no>
</decision_tree>
(defmethod greet :around ((p person))
(format t "[Start]~%")
(call-next-method)
(format t "[End]~%"))
</example>
;; In my-project/main.lisp:
(defpackage #:my-project/main
(:use #:cl)
(:import-from #:my-project/utils #:helper))
</example>
<decision_tree name="when_to_use">
<question>Do you want automatic dependency inference from package definitions?</question>
<if_yes>Use package-inferred-system for modern projects</if_yes>
<if_no>Use traditional defsystem with explicit component dependencies</if_no>
</decision_tree>
(sb-ext:save-lisp-and-die "my-app"
:toplevel #'main
:executable t
:compression t)
</example>
(let ((thread (sb-thread:make-thread
(lambda ()
(setf _result_ (heavy-computation)))
:name "worker")))
(sb-thread:join-thread thread))
;; Mutex
(defvar _lock_ (sb-thread:make-mutex))
(sb-thread:with-mutex (_lock_)
(critical-section))
</example>
(strlen "hello") ; => 5
</example>
;; Execute external programs
(sb-ext:run-program "/bin/ls" '("-l"))
;; Trigger garbage collection
(sb-ext:gc)
;; POSIX interface: sb-posix
;; Network sockets: sb-bsd-sockets
</example>
(declare safe-div (Integer -> Integer -> (Maybe Integer)))
(define (safe-div x y)
(if (== y 0)
None
(Some (/ x y)))))
</example>
(define-instance (Printable Integer)
(define (print-it x)
(into x))))
</example>
<context7_libraries> Available Context7 documentation libraries for Common Lisp ecosystem.
<common_patterns> Resource management with unwind-protect for cleanup. (defmacro with-open-socket ((var host port) &body body) `(let ((,var (make-socket ,host ,port))) (unwind-protect (progn ,@body) (close-socket ,var))))
<best_practices>
Use *earmuffs* for special variables
Use +plus-signs+ for constants
Prefer functional style, minimize mutation
Provide restarts for recoverable situations
Document exported symbols
Use appropriate condition types, not just error
Use check-type for argument validation
Prefer ASDF package-inferred-system for new projects
Consider Qlot for per-project dependency management
Use Roswell for portable script execution
</best_practices>
<modern_tooling> Per-project dependency manager (like bundler/npm) <use_case>Install dependencies from qlfile</use_case> <use_case>Run commands with project dependencies</use_case> qlot install qlot exec ros run
<anti_patterns> Global mutable state makes code harder to test and reason about. Pass state explicitly or use closures to encapsulate mutable state.
<error_escalation> Style inconsistency Fix formatting, follow project conventions Compilation warning or type error Fix issue, add type declarations if needed Macro expansion error Debug with macroexpand, present options to user Reader macro conflict Block operation, require careful namespace management </error_escalation>
<related_skills> Navigate CLOS hierarchies, generic functions, and symbol definitions Access ASDF, SBCL, and Common Lisp library documentation Debug condition handling, macro expansion, and SBCL-specific issues </related_skills>
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
1ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon


