Skip to content
cl-asdf-system logo

ASDF System Definition

cl-asdf-system

ASDFシステム定義のベストプラクティス。.asdファイル作成・編集時に使用

SKILL.md

Full skill instructions

ASDF System Definition

基本構造

標準的なシステム定義

(defsystem "my-project"
  :version "0.1.0"
  :author "Your Name <[email protected]>"
  :maintainer "Your Name <[email protected]>"
  :license "MIT"
  :homepage "https://github.com/​you/​my-project"
  :bug-tracker "https://github.com/​you/​my-project/​issues"
  :source-control (:git "https://github.com/​you/​my-project.git")
  :description "Short description of the project"
  :long-description "Longer description with more details."
  :depends-on ("alexandria"
               "cl-ppcre"
               "dexador")
  :pathname "src/"
  :serial t
  :components ((:file "package")
               (:file "conditions")
               (:file "utils")
               (:file "core")
               (:file "api"))
  :in-order-to ((test-op (test-op "my-project/​tests"))))

テストシステム

(defsystem "my-project/​tests"
  :description "Tests for my-project"
  :depends-on ("my-project"
               "rove")
  :pathname "tests/"
  :serial t
  :components ((:file "package")
               (:file "test-utils")
               (:file "core-tests")
               (:file "api-tests"))
  :perform (test-op (o c)
             (symbol-call :rove :run c)))

ディレクトリ構成

推奨構造

my-project/
├── my-project.asd          # システム定義
├── src/
│   ├── package.lisp        # パッケージ定義
│   ├── conditions.lisp     # 条件/エラー定義
│   ├── utils.lisp          # ユーティリティ
│   ├── core.lisp           # コアロジック
│   └── api.lisp            # 公開API
├── tests/
│   ├── package.lisp        # テスト用パッケージ
│   ├── test-utils.lisp     # テストユーティリティ
│   └── core-tests.lisp     # テスト
├── docs/                   # ドキュメント
├── examples/               # 使用例
├── README.md
├── LICENSE
└── .gitignore

大規模プロジェクト

my-project/
├── my-project.asd
├── src/
│   ├── package.lisp
│   ├── core/
│   │   ├── types.lisp
│   │   ├── protocols.lisp
│   │   └── implementation.lisp
│   ├── http/
│   │   ├── client.lisp
│   │   └── server.lisp
│   └── db/
│       ├── connection.lisp
│       └── queries.lisp
└── tests/
    ├── package.lisp
    ├── core/
    └── http/

コンポーネント指定

:serial オプション

;; serial t - 順番に依存
:serial t
:components ((:file "a")   ; 最初
             (:file "b")   ; aに依存
             (:file "c"))  ; a, bに依存

;; serial nil - 明示的な依存
:serial nil
:components ((:file "a")
             (:file "b" :depends-on ("a"))
             (:file "c" :depends-on ("a" "b")))

モジュール

:components
((:module "core"
  :pathname "src/​core/"
  :serial t
  :components ((:file "types")
               (:file "protocols")
               (:file "impl")))
 (:module "http"
  :pathname "src/​http/"
  :depends-on ("core")
  :components ((:file "client")
               (:file "server"))))

条件付きコンポーネント

:components
((:file "package")
 (:file "core")
 ;; SBCLのみ
 #+sbcl (:file "sbcl-specific")
 ;; Unix系のみ
 #+(or linux darwin) (:file "unix-utils"))

依存関係

基本的な依存

:depends-on ("alexandria"        ; ユーティリティ
             "cl-ppcre"          ; 正規表現
             "local-time"        ; 日時処理
             (:version "dexador" "0.9.0"))  ; バージョン指定

フィーチャー依存

:depends-on ("alexandria"
             (:feature :sbcl "sb-concurrency")
             (:feature (:not :windows) "osicat"))

弱い依存 (オプショナル)

:weakly-depends-on ("swank")  ; なくても動作

テスト統合

Rove統合

(defsystem "my-project/​tests"
  :depends-on ("my-project" "rove")
  :pathname "tests/"
  :components ((:file "package")
               (:file "main"))
  :perform (test-op (o c)
             (symbol-call :rove :run c)))

テスト実行

# コマンドライン
rove my-project.asd

# REPL
(asdf:test-system :my-project)

ベストプラクティス

1. バージョニング

;; セマンティックバージョニング
:version "1.2.3"

;; 開発版
:version "0.0.1-dev"

2. メタデータ

;; 必須
:license "MIT"
:description "..."

;; 推奨
:author "Name <email>"
:homepage "https://..."

3. パッケージ分離

;; Good - パッケージ定義は別ファイル
:components ((:file "package")  ; defpackageのみ
             (:file "main"))    ; 実装

;; Bad - 実装ファイル内でdefpackage

4. 循環依存の回避

;; Good - 一方向の依存
;; core -> utils (OK)
;; utils -> core (NG: 循環)

;; 解決策: 共通部分を抽出
;; core -> common
;; utils -> common

Quicklispへの登録

準備

  1. GitHubでリポジトリ公開
  2. タグでバージョン管理
  3. README.mdに説明を記載

申請

https://github.com/​quicklisp/​quicklisp-projects/​issues

必要情報:

  • プロジェクト名
  • リポジトリURL
  • 簡単な説明

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View