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/skills
empirical-prompt-tuning
Methodology for iteratively improving agent-facing instructions (skills / slash commands / CLAUDE.md / code-gen prompts) by having a bias-free executor run them and evaluating two-sidedly (executor self-report + instruction-side metrics) until improvements plateau. Use after creating or revising a prompt or skill.
39gh-fix-ci
Debug or fix failing GitHub PR checks running in GitHub Actions. Inspects checks/logs via `gh`, drafts a fix plan, and implements only after explicit approval. Out of scope: external CI (e.g. Buildkite) — report only the details URL.
10tech-article-reproducibility
Evaluate the reproducibility of technical articles. Dispatch a subagent to simulate a first-time reader reproducing the work locally and list missing information. Use as the final check on a draft before publication.
9retrospective-codify
On task completion, pair "what failed first" with "what finally worked" and codify the should-have-known-it insight as an ast-grep rule, skill, or CLAUDE.md rule. Use after trial-and-error solutions to spare future-you (or another agent) the same trap. Trigger phrases: "codify today''s lessons," "make it a skill," "drop it into lint."
9playwright-test
Best practices and reference for Playwright Test (E2E). Covers how to write tests, avoiding fixed waits, network triggers, DnD, shard/retry setup on GitHub Actions, and more. Use when writing, reviewing, or configuring CI for Playwright tests.
7ast-grep-practice
Operate ast-grep as a project lint tool. Covers sgconfig.yml, fix/rewrite rules, constraints, transform, testing, and CI. Use when writing rules ast-grep can express but general-purpose linters cannot.
7