justfile
justfile Skill
just is a command runner for project-specific commands. Similar to Make but simpler.
Basic Syntax
# Default recipe (runs when just is called without arguments)
default:
@echo "Available: just --list"
# Basic recipe
build:
cargo build --release
# Dependencies
test: build
cargo test
# Arguments
greet name:
echo "Hello, {{name}}!"
# Default arguments
serve port="8080":
python -m http.server {{port}}
# Variadic arguments
run *args:
cargo run -- {{args}}
Variables
# String
version := "1.0.0"
# Shell command result
git_hash := `git rev-parse --short HEAD`
# Environment variable with default
home := env_var_or_default("HOME", "/tmp")
# Usage
info:
echo "Version: {{version}}, Hash: {{git_hash}}"
Settings
# Shell
set shell := ["bash", "-cu"]
# Load .env
set dotenv-load
# Continue on error
set ignore-errors
# Suppress command echo
set quiet
# Working directory
set working-directory := "subdir"
Conditionals
# OS detection
install:
{{if os() == "macos" { "brew install foo" } else { "apt install foo" }}}
# Architecture detection
build:
{{if arch() == "aarch64" { "make arm" } else { "make x86" }}}
Built-in Functions
| Function | Description |
|---|---|
os() |
OS name (linux, macos, windows) |
arch() |
Architecture (x86_64, aarch64) |
env_var("NAME") |
Get environment variable |
justfile_directory() |
Directory containing justfile |
invocation_directory() |
Directory where just was invoked |
Common Commands
just # Run default recipe
just recipe # Run specific recipe
just recipe arg # Run with arguments
just --list # List recipes
just --dry-run # Show without running
just --choose # Select with fzf
just --fmt # Format justfile
GitHub Actions
Use extractions/setup-just@v3. See assets/gh_action_example.yaml for full example.
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v3
# with:
# just-version: '1.40.0' # Optional version
- run: just build
- run: just test
Practical Example
set dotenv-load
set shell := ["bash", "-cu"]
default:
@just --list
# Dev server
dev:
npm run dev
# Build
build:
npm run build
# Test
test *args:
npm test {{args}}
# Lint + format
check:
npm run lint
npm run format:check
# CI (called from GitHub Actions)
ci: check build test
# Release
release version:
git tag -a v{{version}} -m "Release v{{version}}"
git push origin v{{version}}
# Cleanup
clean:
rm -rf dist node_modules
References
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