devbox
devbox Skill
devbox は Nix ベースの開発環境管理ツール。プロジェクトごとに隔離された再現可能な環境を提供。
インストール
curl -fsSL https://get.jetify.com/devbox | bash
基本コマンド
# プロジェクト初期化(devbox.json 作成)
devbox init
# パッケージ追加
devbox add nodejs@20
devbox add python@3.12 go@1.22
# パッケージ削除
devbox rm nodejs
# devbox シェルに入る
devbox shell
# コマンド実行(シェルに入らずに)
devbox run -- npm test
# スクリプト実行
devbox run test
# サービス起動(process-compose)
devbox services start
# パッケージ検索
devbox search nodejs
devbox.json
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/main/.schema/devbox.schema.json",
"packages": [
"nodejs@20",
"python@3.12"
],
"shell": {
"init_hook": [
"echo 'Welcome to devbox!'",
"export FOO=bar"
],
"scripts": {
"test": "npm test",
"dev": "npm run dev",
"build": "npm run build"
}
}
}
パッケージ指定
{
"packages": [
"nodejs@20",
"python@3.12.0",
"go@latest",
"github:NixOS/nixpkgs#hello"
]
}
パッケージ検索: https://www.nixhub.io
スクリプト
{
"shell": {
"scripts": {
"test": "npm test",
"dev": "npm run dev",
"lint": [
"eslint .",
"prettier --check ."
]
}
}
}
devbox run test
devbox run dev
サービス(process-compose)
process-compose.yaml を作成:
processes:
web:
command: npm run dev
db:
command: postgres -D /tmp/pgdata
devbox services start # 全サービス起動
devbox services stop # 全サービス停止
devbox services ls # サービス一覧
環境変数
{
"env": {
"DATABASE_URL": "postgresql://localhost:5432/dev",
"NODE_ENV": "development"
},
"shell": {
"init_hook": [
"export API_KEY=$(<.api_key)"
]
}
}
GitHub Actions
jetify-com/devbox-install-action を使用。完全な例は assets/gh_action_example.yaml を参照。
steps:
- uses: actions/checkout@v4
- uses: jetify-com/devbox-install-action@v0.12.0
# with:
# enable-cache: true # Nix store キャッシュ
- run: devbox run test
よく使うオプション
| オプション | 説明 |
|---|---|
--config |
devbox.json のパス指定 |
--quiet |
出力抑制 |
--print-env |
環境変数を出力 |
参考
More from mizchi/chezmoi-dotfiles
empirical-prompt-tuning
agent 向けテキスト指示(skill / slash command / task プロンプト / CLAUDE.md 節 / コード生成プロンプト)を、バイアスを排した実行者に動かしてもらい、両面(実行者の自己申告 + 指示側メトリクス)で評価して反復改善する手法。改善が頭打ちになるまで回す。プロンプトや skill を新規作成・大幅改訂した直後、またはエージェントの挙動が期待通りにならない原因を指示側の曖昧さに求めたいときに使う。
90retrospective-codify
タスク完了時に「最初に失敗した内容」と「最終的に通った解法」を対応付け、最初に知っておくべきだった知見を ast-grep ルール / skill / CLAUDE.md ルールのいずれかに言語化する。試行錯誤の末にたどり着いた解や、同じ落とし穴を将来の自分(または別エージェント)に繰り返させたくないときに使う。ユーザーから「今回の学びをルール化して」「skill にして」「lint に落として」と指示されたとき、またはタスク終了時に学びを棚卸しする場面で起動する。
17conventional-changelog
Conventional Commits 規約と CHANGELOG 自動生成の横断リファレンス。commit 書式、Keep a Changelog 形式、semver タグ運用、release-please / changesets / git-cliff / towncrier 等の生成ツール比較を含む。新規リポジトリで release フローを整備するとき、既存 repo の commit 規約を統一するとき、言語に合った changelog ツールを選ぶとき、release-please 以外の選択肢を検討するときに使う。
14playwright-test
Playwright Test (E2E) のベストプラクティスとリファレンス。テストの書き方、固定 wait 回避、ネットワークトリガー、DnD、GitHub Actions での shard/retry 設定など。Playwright テストを書く・レビュー・CI 設定するときに使用。
13ast-grep-practice
ast-grep をプロジェクト lint ツールとして運用するためのガイド。sgconfig.yml 設定、fix/rewrite ルール、constraints、transform、テスト、CI 統合、既存 linter との使い分けを扱う。汎用 linter で表現できないルールを ast-grep で書くときに使用。
13gh-fix-ci
Use when a user asks to debug or fix failing GitHub PR checks that run in GitHub Actions; use `gh` to inspect checks and logs, summarize failure context, draft a fix plan, and implement only after explicit approval. Treat external providers (for example Buildkite) as out of scope and report only the details URL.
10