
justfile
Utilities for working with justfiles, including doc comment optimization
- version
- 1.42.0
- GitHub stars
- 20
Install
/plugin install justfile@motlin-claude-code-pluginsRun it inside Claude Code after adding the marketplace with /plugin marketplace add motlin/claude-code-plugins.
Contents
Discovered from sourceSkills 1
Justfile Style
Extract scripts and configuration
Keep recipes focused on orchestration. Do not embed script bodies in heredocs or multiline quoted strings; even short SSH status or provisioning blocks belong in standalone script files. Keep structured configuration payloads such as JSON and JQ in separate configuration or template files.
Pass runtime values as arguments or environment variables instead of interpolating them into script source. For remote execution, stream the script to the appropriate interpreter, for example:
ssh "${SSH_TARGET}" bash -s -- "${CONTAINER}" \
< "{{ justfile_directory() }}/.just/scripts/container-status.sh"
Preserve quoting, stdin usage, exit codes, and execution order when extracting. Keep secrets out of process arguments. Validate the extracted scripts locally without invoking deployment or provisioning as a test.
Within the requested scope, scan related recipes for remaining heredocs and multiline script or configuration strings rather than stopping after the first named example.
Doc comments for short recipes
When a recipe body is a single line of roughly 120 characters or less, make its doc comment the command itself instead of a descriptive phrase. The command tells the reader exactly what runs.
Before:
# Install dependencies
[group('setup')]
install:
npm install
After:
# npm install
[group('setup')]
install:
npm install
Keep a descriptive doc comment for shebang recipes, multi-line recipes, and single-line commands longer than about 120 characters.
Recipe dependencies
When a recipe needs other recipes to run first, prefer declaring them as dependencies over calling just from a recipe body or from a script the recipe runs. Dependencies run once per invocation even when several recipes share them, and avoid spawning a second just process.
Before:
# Build, then run tests
test:
just build
./scripts/run-tests.sh
After:
# ./scripts/run-tests.sh
test: build
./scripts/run-tests.sh
Pass arguments with parentheses, as in test: (build "release"). Put recipes that must run after the body behind &&, as in release: build && publish.
When several recipes begin with the same commands, extract those commands into their own recipe and declare it as a dependency of each. In a large graph of recipes, a shared dependency runs once per invocation, so just lint test does the common work once instead of repeating it in every body.
Before:
# Install, then lint
lint:
npm ci
npm run lint
# Install, then test
test:
npm ci
npm test
After:
# npm ci
install:
npm ci
# npm run lint
lint: install
npm run lint
# npm test
test: install
npm test
Commands 1
Apply the short-recipe doc comment rule from the justfile:justfile-style skill: for each recipe whose body is a single line of roughly 120 characters or less, replace the doc comment with the command itself.
# npm install
[group('setup')]
install:
npm install
Leave shebang recipes, multi-line recipes, and longer commands unchanged.
Sponsors
Details
- Marketplace
- motlin/claude-code-plugins
- Source
- plugins/justfile
- Author
- Craig Motlin
- Category
- Productivity
More from motlin/claude-code-plugins
All 30- markdown-tasksv1.42.0
- narrationv1.42.0
- offline-claude-code-guidev1.14.0
- orchestrationv1.42.0
- plans-dashboardv1.42.0
- plugin-and-skill-devv1.42.0
- pushoverv1.14.0
- recapv1.42.0
- stop-phrase-guardv1.42.0
- temporal-datav1.42.0
- tmux-titlesv1.42.0
- upstream-syncv1.42.0
- worktree-setupv1.42.0
- bash-guardsv1.42.0
- buildv1.42.0
- builtin-tasksv1.14.0
- burnv1.42.0
- codev1.42.0
- code-walkthroughv1.42.0
- demov1.42.0
- ghostty-titlesv1.42.0
- gitv1.42.0
- git-guardsv1.42.0
- githubv1.42.0