Justfile Development
Workflows for authoring, reviewing, planning, and updating justfiles with the just command runner.
When to Use
- Creating a new justfile for a project
- Adding or modifying recipes
- Reviewing a justfile for quality issues
- Planning which recipes a project needs
- Upgrading a justfile as a project matures
- Converting a Makefile to a justfile
- Setting up monorepo module structure
Workflows
Author
When creating a new justfile or adding recipes.
New Justfile Scaffold:
set shell := ["bash", "-cu"]
default:
@just --list
# =============================================================================
# Development
# =============================================================================
# Build the project
[group('dev')]
build:
<build-command>
# =============================================================================
# Testing
# =============================================================================
# Run test suite
[group('test')]
test:
<test-command>
# =============================================================================
# Code Quality
# =============================================================================
# Format code
[group('lint')]
fmt:
<fmt-command>
# Run linter
[group('lint')]
lint:
<lint-command>
# =============================================================================
# Utilities
# =============================================================================
# Remove build artifacts
[group('util')]
[confirm('Remove all build artifacts?')]
clean:
<clean-command>
Recipe Writing Rules:
| Rule |
Example |
Always add [group('name')] |
[group('dev')] |
| Doc comment above every recipe |
# Build the project |
Private helpers start with _ |
_ensure-tool name: |
[confirm] on destructive ops |
[confirm('Delete all?')] |
| Prefer parameters over env vars |
recipe name='default': |
| Single responsibility |
Compose with dependencies |
No && chaining |
Use separate lines or deps |
No cd |
Use [working-directory] |
Adding Recipes to Existing Justfiles:
- Identify the correct group (see Standard Groups below)
- Place recipe near related recipes in the same section
- Add doc comment
- Add
[group] attribute
- If destructive, add
[confirm]
Review
Use this checklist when reviewing justfiles.
## Justfile Review
- [ ] `set shell` declared at top
- [ ] All recipes grouped with `[group('name')]`
- [ ] Every recipe has a doc comment
- [ ] No ungrouped recipes (except `default`)
- [ ] Private helpers prefixed with `_`
- [ ] Destructive recipes use `[confirm]`
- [ ] No `cd` usage (use `[working-directory]`)
- [ ] No `&&` chaining (use dependencies or separate lines)
- [ ] No secrets in justfile (env vars or `op://`)
- [ ] `default` recipe shows `just --list`
- [ ] Section separators between groups
- [ ] Recipe names are kebab-case
- [ ] No monolithic recipes (compose from focused ones)
- [ ] Parameters preferred over env vars for inputs
Common Issues:
| Issue |
Fix |
Missing set shell |
Add set shell := ["bash", "-cu"] at top |
| Ungrouped recipes |
Add [group('name')] attribute |
| Missing doc comments |
Add # Description above recipe |
cd in recipe body |
Use [working-directory('path')] |
&& chaining |
Split into separate lines or deps |
| Hardcoded secrets |
Replace with env('VAR') or op:// |
| God recipe doing everything |
Split into focused recipes, compose with deps |
Plan
Use when deciding what recipes a project needs.
3-Question Assessment:
| Question |
Yes |
No |
| Has CI? |
Add quality gates (coverage, check-all) |
Skip quality recipes |
| Deploys to prod? |
Add security + deploy recipes |
Skip deploy/security |
| Multiple languages? |
Add module structure |
Keep single justfile |
Recipe Sets by Project Type:
| Project Type |
Baseline |
Quality |
Deploy |
Modules |
| Rust CLI |
build, test, lint, fmt, clean |
coverage, bench, release |
docker |
— |
| Rust lib |
build, test, lint, fmt, docs |
coverage, bench |
release |
— |
| Web app |
build, test, lint, fmt, dev |
coverage |
docker, deploy |
if polyglot |
| Monorepo |
orchestrate, default |
per-package |
per-service |
yes |
| MCP server |
build, test, lint, fmt |
coverage |
docker, release |
— |
Decision: Single File vs Modules:
| Criteria |
Single justfile |
Modules |
| Recipe count |
< 20 |
> 20 |
| Languages |
1 |
2+ |
| Repo structure |
flat |
monorepo/workspace |
| Shared recipes |
none |
CDN imports needed |
Convert
When migrating from a Makefile to a justfile.
Steps:
- Map targets to recipes (all recipes are phony — no
.PHONY needed)
- Add
set shell := ["bash", "-cu"] at top
- Add
default recipe with @just --list
- Group recipes with
[group('name')] and add section separators
- Add doc comments above each recipe
- Fix anti-patterns (see translations below)
- Add
[confirm] to destructive recipes
- Validate:
just --list shows grouped, documented recipes
Makefile → just Translations:
| Makefile |
just |
.PHONY: target |
Not needed (all recipes are phony) |
target: dep1 dep2 |
recipe: dep1 dep2 (same syntax) |
cd dir && cmd |
[working-directory('dir')] attribute |
cmd1 && cmd2 |
Separate lines in recipe body |
$(VAR) |
{{VAR}} |
@echo "msg" |
@echo "msg" (same) |
export VAR=val |
export VAR := "val" at top |
include file.mk |
import "file.just" |
Update
When upgrading an existing justfile.
Maturity Progression:
| Level |
When |
Add |
| 0: Baseline |
Every project |
default, build, test, lint, fmt, clean |
| 1: Quality |
CI/CD added |
coverage, test-watch, check-all, bench |
| 2: Security |
Deploying |
audit, sbom, doctor |
| 3: Production |
Prod systems |
deploy, migrate, logs, status |
| 4: Polyglot |
Multi-language |
modules, orchestration |
YAGNI: Only add levels you currently need. Reassess when project scope changes.
Module Migration:
When a justfile exceeds ~20 recipes, consider splitting:
- Create
just/ directory
- Move related recipes to
just/<group>.just
- Add
import? "just/<group>.just" to root justfile
- Or use CDN:
mod name "https://just.arusty.dev/modules/<name>.just"
Quick Reference
Standard Groups
| Group |
Purpose |
Typical Recipes |
dev |
Development |
build, setup, install, watch, dev |
test |
Testing |
test, coverage, bench, test-watch |
lint |
Code quality |
fmt, lint, clippy, check |
docs |
Documentation |
docs-build, docs-serve |
docker |
Containers |
docker-build, docker-run, docker-push |
release |
Publishing |
release, version-bump, changelog |
util |
Maintenance |
clean, update, doctor |
Essential Syntax
| Feature |
Syntax |
| Settings |
set shell := ["bash", "-cu"] |
| Groups |
[group('dev')] |
| Confirm |
[confirm('message')] |
| Working dir |
[working-directory('path')] |
| Private |
_recipe-name: |
| Parameters |
recipe name: |
| Default params |
recipe name='value': |
| Variadic |
recipe *args: |
| Dependencies |
recipe: dep1 dep2 |
| Param deps |
recipe: (dep1 "arg") |
| Conditional |
if os() == "macos" { ... } |
| Shebang |
#!/usr/bin/env python3 |
| Script attr |
[script('python3')] |
| Optional import |
import? "just/mod.just" |
| CDN module |
mod name "https://url" |
Common Functions
| Function |
Returns |
os() |
"linux", "macos", "windows" |
arch() |
"x86_64", "aarch64" |
env('VAR') |
Environment variable value |
env('VAR', 'default') |
With fallback |
justfile_directory() |
Dir containing justfile |
invocation_directory() |
Dir where just was called |
aRustyDev Conventions
- Shell: always
set shell := ["bash", "-cu"]
- CDN modules from
just.arusty.dev
- Local modules in
just/ with import?
- Gist templates via
just apply-gist (see gist-templates rule)
- KuzuDB recipes follow
graph-data-pattern rule
Language Patterns
Quick lookup — see references/recipe-patterns.md for full details.
| Recipe |
Rust |
Go |
TypeScript |
Python |
fmt |
cargo fmt |
gofmt -w . |
prettier --write . |
ruff format . |
lint |
cargo clippy |
golangci-lint run |
eslint . |
ruff check . |
test |
cargo test |
go test ./... |
vitest |
pytest |
build |
cargo build |
go build ./... |
tsc |
python -m build |
coverage |
cargo tarpaulin |
go test -cover |
vitest --coverage |
pytest --cov |
See Also
references/syntax-quick-ref.md — full syntax reference
references/recipe-patterns.md — recipe patterns by category and language
references/module-system.md — module system deep dive
references/maturity-model.md — maturity assessment details
examples/rust-project.just — complete Rust CLI/lib justfile
examples/monorepo-root.just — monorepo router pattern
examples/arustydev.just — aRustyDev conventions with gist templates
tables/standard-groups.md — group definitions and ordering
tables/language-recipes.md — Rust/Go/TS/Python recipe matrix
1---2name: justfile-dev3description: >-4 Justfile authoring, reviewing, and planning for the just command runner.5 Use when creating new justfiles, adding recipes, reviewing existing justfiles6 for quality, planning recipe sets for new projects, or upgrading justfiles7 as projects mature. Covers syntax patterns, module system, recipe groups,8 language-specific templates, and maturity assessment.9metadata:10 source: https://skillmd.com/skills/arustydev/justfile-dev11---1213# Justfile Development1415Workflows for authoring, reviewing, planning, and updating justfiles with the `just` command runner.1617## When to Use1819- Creating a new justfile for a project20- Adding or modifying recipes21- Reviewing a justfile for quality issues22- Planning which recipes a project needs23- Upgrading a justfile as a project matures24- Converting a Makefile to a justfile25- Setting up monorepo module structure2627## Workflows2829### Author3031When creating a new justfile or adding recipes.3233**New Justfile Scaffold:**3435```just36set shell := ["bash", "-cu"]3738default:39 @just --list4041# =============================================================================42# Development43# =============================================================================4445# Build the project46[group('dev')]47build:48 <build-command>4950# =============================================================================51# Testing52# =============================================================================5354# Run test suite55[group('test')]56test:57 <test-command>5859# =============================================================================60# Code Quality61# =============================================================================6263# Format code64[group('lint')]65fmt:66 <fmt-command>6768# Run linter69[group('lint')]70lint:71 <lint-command>7273# =============================================================================74# Utilities75# =============================================================================7677# Remove build artifacts78[group('util')]79[confirm('Remove all build artifacts?')]80clean:81 <clean-command>82```8384**Recipe Writing Rules:**8586| Rule | Example |87|------|---------|88| Always add `[group('name')]` | `[group('dev')]` |89| Doc comment above every recipe | `# Build the project` |90| Private helpers start with `_` | `_ensure-tool name:` |91| `[confirm]` on destructive ops | `[confirm('Delete all?')]` |92| Prefer parameters over env vars | `recipe name='default':` |93| Single responsibility | Compose with dependencies |94| No `&&` chaining | Use separate lines or deps |95| No `cd` | Use `[working-directory]` |9697**Adding Recipes to Existing Justfiles:**98991. Identify the correct group (see Standard Groups below)1002. Place recipe near related recipes in the same section1013. Add doc comment1024. Add `[group]` attribute1035. If destructive, add `[confirm]`104105### Review106107Use this checklist when reviewing justfiles.108109```markdown110## Justfile Review111112- [ ] `set shell` declared at top113- [ ] All recipes grouped with `[group('name')]`114- [ ] Every recipe has a doc comment115- [ ] No ungrouped recipes (except `default`)116- [ ] Private helpers prefixed with `_`117- [ ] Destructive recipes use `[confirm]`118- [ ] No `cd` usage (use `[working-directory]`)119- [ ] No `&&` chaining (use dependencies or separate lines)120- [ ] No secrets in justfile (env vars or `op://`)121- [ ] `default` recipe shows `just --list`122- [ ] Section separators between groups123- [ ] Recipe names are kebab-case124- [ ] No monolithic recipes (compose from focused ones)125- [ ] Parameters preferred over env vars for inputs126```127128**Common Issues:**129130| Issue | Fix |131|-------|-----|132| Missing `set shell` | Add `set shell := ["bash", "-cu"]` at top |133| Ungrouped recipes | Add `[group('name')]` attribute |134| Missing doc comments | Add `# Description` above recipe |135| `cd` in recipe body | Use `[working-directory('path')]` |136| `&&` chaining | Split into separate lines or deps |137| Hardcoded secrets | Replace with `env('VAR')` or `op://` |138| God recipe doing everything | Split into focused recipes, compose with deps |139140### Plan141142Use when deciding what recipes a project needs.143144**3-Question Assessment:**145146| Question | Yes | No |147|----------|-----|----|148| Has CI? | Add quality gates (coverage, check-all) | Skip quality recipes |149| Deploys to prod? | Add security + deploy recipes | Skip deploy/security |150| Multiple languages? | Add module structure | Keep single justfile |151152**Recipe Sets by Project Type:**153154| Project Type | Baseline | Quality | Deploy | Modules |155|-------------|----------|---------|--------|---------|156| Rust CLI | build, test, lint, fmt, clean | coverage, bench, release | docker | — |157| Rust lib | build, test, lint, fmt, docs | coverage, bench | release | — |158| Web app | build, test, lint, fmt, dev | coverage | docker, deploy | if polyglot |159| Monorepo | orchestrate, default | per-package | per-service | yes |160| MCP server | build, test, lint, fmt | coverage | docker, release | — |161162**Decision: Single File vs Modules:**163164| Criteria | Single `justfile` | Modules |165|----------|-------------------|---------|166| Recipe count | < 20 | > 20 |167| Languages | 1 | 2+ |168| Repo structure | flat | monorepo/workspace |169| Shared recipes | none | CDN imports needed |170171### Convert172173When migrating from a Makefile to a justfile.174175**Steps:**1761771. Map targets to recipes (all recipes are phony — no `.PHONY` needed)1782. Add `set shell := ["bash", "-cu"]` at top1793. Add `default` recipe with `@just --list`1804. Group recipes with `[group('name')]` and add section separators1815. Add doc comments above each recipe1826. Fix anti-patterns (see translations below)1837. Add `[confirm]` to destructive recipes1848. Validate: `just --list` shows grouped, documented recipes185186**Makefile → just Translations:**187188| Makefile | just |189|----------|------|190| `.PHONY: target` | Not needed (all recipes are phony) |191| `target: dep1 dep2` | `recipe: dep1 dep2` (same syntax) |192| `cd dir && cmd` | `[working-directory('dir')]` attribute |193| `cmd1 && cmd2` | Separate lines in recipe body |194| `$(VAR)` | `{{VAR}}` |195| `@echo "msg"` | `@echo "msg"` (same) |196| `export VAR=val` | `export VAR := "val"` at top |197| `include file.mk` | `import "file.just"` |198199### Update200201When upgrading an existing justfile.202203**Maturity Progression:**204205| Level | When | Add |206|-------|------|-----|207| 0: Baseline | Every project | default, build, test, lint, fmt, clean |208| 1: Quality | CI/CD added | coverage, test-watch, check-all, bench |209| 2: Security | Deploying | audit, sbom, doctor |210| 3: Production | Prod systems | deploy, migrate, logs, status |211| 4: Polyglot | Multi-language | modules, orchestration |212213**YAGNI**: Only add levels you currently need. Reassess when project scope changes.214215**Module Migration:**216217When a justfile exceeds ~20 recipes, consider splitting:2182191. Create `just/` directory2202. Move related recipes to `just/<group>.just`2213. Add `import? "just/<group>.just"` to root justfile2224. Or use CDN: `mod name "https://just.arusty.dev/modules/<name>.just"`223224## Quick Reference225226### Standard Groups227228| Group | Purpose | Typical Recipes |229|-------|---------|-----------------|230| `dev` | Development | build, setup, install, watch, dev |231| `test` | Testing | test, coverage, bench, test-watch |232| `lint` | Code quality | fmt, lint, clippy, check |233| `docs` | Documentation | docs-build, docs-serve |234| `docker` | Containers | docker-build, docker-run, docker-push |235| `release` | Publishing | release, version-bump, changelog |236| `util` | Maintenance | clean, update, doctor |237238### Essential Syntax239240| Feature | Syntax |241|---------|--------|242| Settings | `set shell := ["bash", "-cu"]` |243| Groups | `[group('dev')]` |244| Confirm | `[confirm('message')]` |245| Working dir | `[working-directory('path')]` |246| Private | `_recipe-name:` |247| Parameters | `recipe name:` |248| Default params | `recipe name='value':` |249| Variadic | `recipe *args:` |250| Dependencies | `recipe: dep1 dep2` |251| Param deps | `recipe: (dep1 "arg")` |252| Conditional | `if os() == "macos" { ... }` |253| Shebang | `#!/usr/bin/env python3` |254| Script attr | `[script('python3')]` |255| Optional import | `import? "just/mod.just"` |256| CDN module | `mod name "https://url"` |257258### Common Functions259260| Function | Returns |261|----------|---------|262| `os()` | `"linux"`, `"macos"`, `"windows"` |263| `arch()` | `"x86_64"`, `"aarch64"` |264| `env('VAR')` | Environment variable value |265| `env('VAR', 'default')` | With fallback |266| `justfile_directory()` | Dir containing justfile |267| `invocation_directory()` | Dir where `just` was called |268269## aRustyDev Conventions270271- Shell: always `set shell := ["bash", "-cu"]`272- CDN modules from `just.arusty.dev`273- Local modules in `just/` with `import?`274- Gist templates via `just apply-gist` (see `gist-templates` rule)275- KuzuDB recipes follow `graph-data-pattern` rule276277## Language Patterns278279Quick lookup — see `references/recipe-patterns.md` for full details.280281| Recipe | Rust | Go | TypeScript | Python |282|--------|------|----|------------|--------|283| `fmt` | `cargo fmt` | `gofmt -w .` | `prettier --write .` | `ruff format .` |284| `lint` | `cargo clippy` | `golangci-lint run` | `eslint .` | `ruff check .` |285| `test` | `cargo test` | `go test ./...` | `vitest` | `pytest` |286| `build` | `cargo build` | `go build ./...` | `tsc` | `python -m build` |287| `coverage` | `cargo tarpaulin` | `go test -cover` | `vitest --coverage` | `pytest --cov` |288289## See Also290291- `references/syntax-quick-ref.md` — full syntax reference292- `references/recipe-patterns.md` — recipe patterns by category and language293- `references/module-system.md` — module system deep dive294- `references/maturity-model.md` — maturity assessment details295- `examples/rust-project.just` — complete Rust CLI/lib justfile296- `examples/monorepo-root.just` — monorepo router pattern297- `examples/arustydev.just` — aRustyDev conventions with gist templates298- `tables/standard-groups.md` — group definitions and ordering299- `tables/language-recipes.md` — Rust/Go/TS/Python recipe matrix