Skip to content
just-pro logo

Justfile Skill

just-pro

This skill provides patterns for setting up just (command runner) in projects. Use PROACTIVELY when creating build systems, setting up new repos, or when the user asks about just/justfile configuration. Covers both simple single-project repos and monorepos with hierarchical justfile modules.

SKILL.md

Full skill instructions

Justfile Skill

Build system configuration using just, a modern command runner.

Related skills:

  • mise - Tool version management (includes just+mise integration patterns)
  • go-pro, rust-pro, typescript-pro - Language-specific templates

Installation

# Via mise (recommended - version pinned per-project)
mise use just

# macOS
brew install just

# Linux/​Windows (via cargo)
cargo install just

# Or prebuilt binaries: https://github.com/​casey/​just/​releases

When to Use Just

ScenarioRecommendation
Cross-language monorepojust - Unified interface across packages
Single Go/​Rust projectjust or language-native (go/​cargo)
Node.js projectnpm scripts primary, just optional wrapper
CI/​CD porcelainjust - Single entry point for all operations
Simple scriptsjust - Better than shell scripts

Project Patterns

Simple Repo (Single Package)

For single-language projects, create one justfile at repo root.

# Project Build System
# Usage: just --list

default:
    @just --list

# === Quality Gates ===
check: fmt lint test
    @echo "All checks passed"

fmt:
    go fmt ./​...

lint:
    go tool golangci-lint run

test:
    go test -race ./​...

build:
    go build -o bin/​app ./​cmd/​app

See references/​simple-repo.just for complete templates.

Monorepo (Multiple Packages)

For monorepos, use hierarchical justfiles with the mod system:

repo/
├── justfile              # Router - imports package modules
└── packages/
    ├── api-go/
    │   └── justfile      # Go package recipes
    ├── web/
    │   └── justfile      # TypeScript package recipes (optional)
    └── ops/
        └── justfile      # DevOps recipes

Root justfile (router):

# Monorepo Build System
# Usage: just --list
# Usage: just go <recipe>

mod go "packages/​api-go"
mod web "packages/​web"
mod ops "ops"

default:
    @just --list

# Umbrella recipes call into modules
check: (go::check) (web::check)
    @echo "All checks passed"

setup: (go::setup) (web::setup)
    @echo "All toolchains ready"

Commands become: just go check, just go lint, just web build, just ops deploy

See references/​monorepo-root.just and references/​package-go.just for templates.

Recipe Patterns

Quality Gates

Always provide a single check recipe that runs all quality gates:

# Full quality gates - run before commits
check: fmt lint test coverage-check
    @echo "All checks passed"

Quick Check (Dev Iteration)

Fast feedback loop for development - essential checks only:

# Quick feedback loop - essential checks only
check-quick: lint test
    @echo "Quick checks passed"

Clean Recipe

Standard cleanup for build artifacts and caches:

# Remove build artifacts and caches
clean:
    rm -rf build/ coverage.out node_modules/​.cache

Parallel Check Execution (CI)

Run package checks in parallel for faster CI:

# Run all package checks in parallel (CI optimization)
check-parallel:
    @just api check & just web check & wait

Coverage Enforcement

Use shebang for multi-line shell logic:

# Check coverage meets 70% minimum
coverage-check:
    #!/​usr/​bin/​env bash
    set -euo pipefail
    go test -race -coverprofile=coverage.out ./​...
    COVERAGE=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//')
    COVERAGE_INT=${COVERAGE%.*}
    [ "$COVERAGE_INT" -ge 70 ] || (echo "FAIL: Coverage ${COVERAGE}% < 70%" && exit 1)
    echo "PASS: Coverage ${COVERAGE}%"

The #!/​usr/​bin/​env bash shebang runs the entire recipe as a single shell script (variables persist across lines).

Umbrella Recipes with Module Dependencies

# Root justfile calling into modules
check: (go::check) (web::check)
    @echo "All checks passed"

Optional Modules

For packages that may not exist in all environments:

mod? optional-package "packages/​optional"

Documentation Comments

Every recipe should have a doc comment (shown in just --list):

# Run unit tests with race detection
test:
    go test -race ./​...

Module doc comments - Comments above mod statements also appear in just --list:

# Go API (GraphQL + Watermill)
mod api "packages/​api"

# Next.js frontend
mod web "packages/​web"

# PostgreSQL database
mod db "packages/​db"

Output of just --list:

api ...      # Go API (GraphQL + Watermill)
db ...       # PostgreSQL database
web ...      # Next.js frontend

Always add doc comments to module imports for discoverability.

Module System Details

Syntax

mod <name> "<path>"              # Required module
mod? <name> "<path>"             # Optional module (no error if missing)
mod <name>                       # Module at ./<name>/​justfile

Working Directory

Recipes in modules run with their working directory set to the module's directory, not the root. This is the desired behavior for package-local commands.

Listing Module Recipes

just --list           # Root recipes + module names
just --list go        # Recipes in 'go' module
just --list-submodules # All recipes including submodules

Important: Use just --list <module> not just <module> --list. The flag must come before the module name.

Calling Module Recipes

just go check         # From command line
(go::check)          # As dependency in justfile

Integration with Language Toolchains

Go Projects

# Uses go.mod tool directive for pinned versions
lint:
    go tool golangci-lint run

# Auto-fix linting issues (chains goimports to fix imports after modernize changes)
fix:
    go tool golangci-lint run --fix
    go tool goimports -w .

Why chain goimports? The modernize linter may change code (e.g., fmt.Errorf() → errors.New()) without updating imports, breaking builds. Running goimports after --fix resolves this.

TypeScript/​Node Projects

Two approaches:

Option A: Thin wrapper (recommended for consistency)

# packages/​web/​justfile
check:
    npm run check

lint:
    npm run lint

test:
    npm test

Option B: Direct delegation from root (simpler)

# Root justfile - no web module
ts-web-check:
    cd packages/​web && npm run check

Rust Projects

check: fmt lint test
    @echo "All checks passed"

fmt:
    cargo fmt --all

lint:
    cargo clippy -- -D warnings

test:
    cargo test

Mise Integration

When a project uses mise for tool version management, just recipes should use mise exec to ensure pinned versions are used regardless of developer shell setup.

See the mise skill for full mise setup including shell config, direnv integration, and project .mise.toml patterns.

Shell Override (Recommended)

# All recipes automatically use mise-pinned tools
set shell := ["mise", "exec", "--", "bash", "-c"]

build:
    npm run build

test:
    go test ./​...

Graceful Degradation

For repos where mise is optional:

set shell := ["bash", "-c"]

# Use mise if available, otherwise fall back to PATH
_exec cmd:
    #!/​usr/​bin/​env bash
    if command -v mise &>/​dev/​null; then
        mise exec -- {{cmd}}
    else
        {{cmd}}
    fi

build: (_exec "npm run build")
test: (_exec "go test ./​...")
lint: (_exec "golangci-lint run")

Note: No .mise.toml check needed - mise traverses parent directories automatically.

Why This Matters

Developer SetupWithout mise execWith mise exec
Has direnv + miseCorrect versionsCorrect versions
Has mise activateCorrect versionsCorrect versions
Fresh clone, no setupSystem tools (wrong version)Pinned versions
CI/​CDNeeds activation stepJust works

Recommendation: Use the shell override for team repos. Use graceful degradation for open source where mise adoption varies.

Caveats

Failure mode: Shell override + mise not installed = cryptic "could not find shell" error. Use graceful degradation for open source.

First clone: Contributors must run mise trust to allow the repo's config:

setup:
    mise trust
    mise install
    @echo "Toolchain ready"

Security Auditing

All language templates include consistent audit recipes:

RecipePurpose
auditCheck for vulnerabilities (informational)
audit-fixAuto-fix where possible (npm only)
audit-ciCI-friendly (strict, production deps only)

Language tools:

LanguageToolInstallation
Node/​npmnpm auditBuilt-in
Gogovulncheckgo get -tool golang.org/​x/​vuln/​cmd/​govulncheck@latest
Rustcargo auditcargo install cargo-audit

Reference Templates

Load the appropriate template based on project structure:

TemplateUse Case
references/​simple-repo.justSingle-package repositories
references/​monorepo-root.justMonorepo root router
references/​package-go.justGo package in monorepo
references/​package-ts.justTypeScript package in monorepo
references/​package-rust.justRust package in monorepo

Note: Reference files use .just extension for organization. Actual project files must be named justfile (no extension) or .justfile.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View