configure-justfile

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/configure:justfile

/configure:justfile

Check and configure project Justfile against project standards.
检查并配置符合项目标准的项目Justfile。

When to Use This Skill

何时使用该技能

Use this skill when...Use another approach when...
Setting up a new Justfile for a projectProject already uses Make exclusively and migration is not desired — use
/configure:makefile
Auditing existing Justfile for missing standard recipesWriting complex custom recipes — use
justfile-expert
skill
Migrating from Makefile to JustfileProject has no task runner needs (single-file scripts)
Ensuring Justfile follows team conventions (groups, comments, settings)Debugging a specific recipe failure — use direct
just
commands
Running CI/CD compliance checks on project task runnersOnly need to list available recipes — run
just --list
directly
适用场景其他方案适用场景
为项目新建Justfile项目已完全使用Make且不希望迁移——使用
/configure:makefile
审计现有Justfile是否缺失标准任务脚本编写复杂自定义任务脚本——使用
justfile-expert
技能
从Makefile迁移到Justfile项目无任务运行器需求(单文件脚本)
确保Justfile遵循团队规范(分组、注释、设置)调试特定任务脚本失败——直接使用
just
命令
对项目任务运行器执行CI/CD合规检查仅需列出可用任务脚本——直接运行
just --list

Context

上下文信息

  • Project root: !
    pwd
  • Justfile: !
    find . -maxdepth 1 \( -name 'justfile' -o -name 'Justfile' \) 2>/dev/null
  • Makefile: !
    find . -maxdepth 1 -name 'Makefile' 2>/dev/null
  • Package files: !
    find . -maxdepth 1 \( -name 'package.json' -o -name 'pyproject.toml' -o -name 'Cargo.toml' -o -name 'go.mod' \) 2>/dev/null
  • Docker files: !
    find . -maxdepth 1 \( -name 'Dockerfile' -o -name 'docker-compose.yml' \) 2>/dev/null
  • Env file: !
    find . -maxdepth 1 -name '.env' 2>/dev/null
  • Project standards: !
    find . -maxdepth 1 -name '.project-standards.yaml' 2>/dev/null
  • 项目根目录: !
    pwd
  • Justfile: !
    find . -maxdepth 1 \( -name 'justfile' -o -name 'Justfile' \) 2>/dev/null
  • Makefile: !
    find . -maxdepth 1 -name 'Makefile' 2>/dev/null
  • 包管理文件: !
    find . -maxdepth 1 \( -name 'package.json' -o -name 'pyproject.toml' -o -name 'Cargo.toml' -o -name 'go.mod' \) 2>/dev/null
  • Docker相关文件: !
    find . -maxdepth 1 \( -name 'Dockerfile' -o -name 'docker-compose.yml' \) 2>/dev/null
  • 环境变量文件: !
    find . -maxdepth 1 -name '.env' 2>/dev/null
  • 项目标准文件: !
    find . -maxdepth 1 -name '.project-standards.yaml' 2>/dev/null

Parameters

参数解析

Parse from command arguments:
  • --check-only
    : Report compliance status without modifications (CI/CD mode)
  • --fix
    : Apply fixes automatically without prompting
从命令参数中解析:
  • --check-only
    : 仅报告合规状态,不进行修改(CI/CD模式)
  • --fix
    : 自动应用修复,无需提示

Execution

执行流程

Execute this Justfile compliance check:
执行Justfile合规检查:

Step 1: Detect Justfile and project type

步骤1:检测Justfile和项目类型

  1. Check for
    justfile
    or
    Justfile
    in project root
  2. If exists, read and analyze current recipes and settings
  3. Detect project type from file indicators:
IndicatorProject Type
pyproject.toml
or
requirements.txt
Python
package.json
Node.js
Cargo.toml
Rust
go.mod
Go
None of the aboveGeneric
  1. 检查项目根目录下是否存在
    justfile
    Justfile
  2. 若存在,读取并分析当前任务脚本和设置
  3. 根据标识文件检测项目类型:
标识文件项目类型
pyproject.toml
requirements.txt
Python
package.json
Node.js
Cargo.toml
Rust
go.mod
Go
以上均无通用型

Step 2: Analyze required and optional recipes

步骤2:分析必需和可选任务脚本

Check for required recipes:
RecipePurposeSeverity
default
Alias to help (first recipe)FAIL if missing
help
Display available recipesFAIL if missing
test
Run test suiteFAIL if missing
lint
Run lintersFAIL if missing
build
Build project artifactsWARN if missing
clean
Remove temporary filesWARN if missing
Check for context-dependent recipes:
RecipeWhen RequiredSeverity
format
If project uses auto-formattersWARN
start
If project has runnable serviceINFO
stop
If project has background serviceINFO
dev
If project supports watch modeINFO
检查必需任务脚本:
任务脚本用途严重程度
default
指向help的别名(首个任务脚本)缺失则失败
help
显示可用任务脚本缺失则失败
test
运行测试套件缺失则失败
lint
运行代码检查工具缺失则失败
build
构建项目产物缺失则警告
clean
删除临时文件缺失则警告
检查上下文相关任务脚本:
任务脚本必需条件严重程度
format
项目使用自动格式化工具警告
start
项目包含可运行服务提示
stop
项目包含后台服务提示
dev
项目支持热重载模式提示

Step 3: Check compliance settings

步骤3:检查合规设置

Validate Justfile settings:
CheckStandardSeverity
File existsjustfile presentFAIL if missing
Default recipeFirst recipe is
default
WARN if missing
Dotenv loading
set dotenv-load
present
INFO
Help recipeLists all recipesFAIL if missing
Language-specificCommands match project typeFAIL if mismatched
Recipe commentsRecipes have descriptionsINFO
验证Justfile设置:
检查项标准要求严重程度
文件存在存在justfile缺失则失败
默认任务脚本首个任务脚本为
default
缺失则警告
加载Dotenv包含
set dotenv-load
配置
提示
Help任务脚本列出所有任务脚本缺失则失败
语言适配性命令与项目类型匹配不匹配则失败
任务脚本注释任务脚本包含描述信息提示

Step 4: Generate compliance report

步骤4:生成合规报告

Print a formatted compliance report:
Justfile Compliance Report
==============================
Project Type: python (detected)
Justfile: Found

Recipe Status:
  default ✅ PASS
  help    ✅ PASS (just --list)
  test    ✅ PASS (uv run pytest)
  lint    ✅ PASS (uv run ruff check)
  build   ✅ PASS (docker build)
  clean   ✅ PASS
  format  ✅ PASS (uv run ruff format)
  start   ⚠️  INFO (not applicable)
  stop    ⚠️  INFO (not applicable)
  dev     ✅ PASS (uv run uvicorn --reload)

Settings Status:
  dotenv-load         ✅ PASS
  positional-arguments ℹ️  INFO (not set)

Missing Recipes: none
Issues: 0 found
If
--check-only
, stop here.
打印格式化的合规报告:
Justfile Compliance Report
==============================
Project Type: python (detected)
Justfile: Found

Recipe Status:
  default ✅ PASS
  help    ✅ PASS (just --list)
  test    ✅ PASS (uv run pytest)
  lint    ✅ PASS (uv run ruff check)
  build   ✅ PASS (docker build)
  clean   ✅ PASS
  format  ✅ PASS (uv run ruff format)
  start   ⚠️  INFO (not applicable)
  stop    ⚠️  INFO (not applicable)
  dev     ✅ PASS (uv run uvicorn --reload)

Settings Status:
  dotenv-load         ✅ PASS
  positional-arguments ℹ️  INFO (not set)

Missing Recipes: none
Issues: 0 found
若使用
--check-only
参数,流程在此终止。

Step 5: Create or update Justfile (if --fix or user confirms)

步骤5:创建或更新Justfile(若使用--fix或用户确认)

If
--fix
flag or user confirms:
  1. Missing Justfile: Create from standard template based on project type
  2. Missing recipes: Add recipes with appropriate commands
  3. Missing settings: Add
    set dotenv-load
    if
    .env
    exists
  4. Missing help: Add help recipe with
    just --list
Use language-specific commands from the template section below.
若使用
--fix
参数或用户确认:
  1. 缺失Justfile:根据项目类型从标准模板创建
  2. 缺失任务脚本:添加包含合适命令的任务脚本
  3. 缺失配置:若存在
    .env
    文件则添加
    set dotenv-load
    配置
  4. 缺失Help:添加包含
    just --list
    的help任务脚本
使用下方模板中的语言专属命令。

Step 6: Update standards tracking

步骤6:更新标准跟踪文件

Update
.project-standards.yaml
:
yaml
components:
  justfile: "2025.1"
更新
.project-standards.yaml
yaml
components:
  justfile: "2025.1"

Justfile Template

Justfile模板

Universal Structure

通用结构

just
undefined
just
undefined

Justfile for {{PROJECT_NAME}}

Justfile for {{PROJECT_NAME}}

Run
just
or
just help
to see available recipes

Run
just
or
just help
to see available recipes

set dotenv-load set positional-arguments
set dotenv-load set positional-arguments

Default recipe - show help

Default recipe - show help

default: @just --list
default: @just --list

Show available recipes with descriptions

Show available recipes with descriptions

help: @just --list --unsorted
####################
help: @just --list --unsorted
####################

Development

Development

####################
####################

Run linters

Run linters

lint: {{LINT_COMMAND}}
lint: {{LINT_COMMAND}}

Format code

Format code

format: {{FORMAT_COMMAND}}
format: {{FORMAT_COMMAND}}

Run tests

Run tests

test *args: {{TEST_COMMAND}} {{args}}
test *args: {{TEST_COMMAND}} {{args}}

Development mode with watch

Development mode with watch

dev: {{DEV_COMMAND}}
####################
dev: {{DEV_COMMAND}}
####################

Build & Deploy

Build & Deploy

####################
####################

Build project

Build project

build: {{BUILD_COMMAND}}
build: {{BUILD_COMMAND}}

Clean build artifacts

Clean build artifacts

clean: {{CLEAN_COMMAND}}
clean: {{CLEAN_COMMAND}}

Start service

Start service

start: {{START_COMMAND}}
start: {{START_COMMAND}}

Stop service

Stop service

stop: {{STOP_COMMAND}}
undefined
stop: {{STOP_COMMAND}}
undefined

Language-Specific Commands

各语言专属命令

Python (uv-based):
just
lint:
    uv run ruff check .

format:
    uv run ruff format .
    uv run ruff check --fix .

test *args:
    uv run pytest {{args}}

dev:
    uv run uvicorn app:app --reload

build:
    docker build -t {{PROJECT_NAME}} .

clean:
    find . -type f -name "*.pyc" -delete
    find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
    rm -rf .pytest_cache .ruff_cache .coverage htmlcov dist build *.egg-info
Node.js (Bun-based):
just
lint:
    bun run lint

format:
    bun run format

test *args:
    bun test {{args}}

dev:
    bun run dev

build:
    bun run build

clean:
    rm -rf node_modules dist .next .turbo .cache
Rust:
just
lint:
    cargo clippy -- -D warnings

format:
    cargo fmt

test *args:
    cargo nextest run {{args}}

dev:
    cargo watch -x run

build:
    cargo build --release

clean:
    cargo clean
Go:
just
lint:
    golangci-lint run

format:
    gofmt -s -w .
    goimports -w .

test *args:
    go test ./... {{args}}

dev:
    air

build:
    go build -o bin/{{PROJECT_NAME}} ./cmd/{{PROJECT_NAME}}

clean:
    rm -rf bin dist
    go clean -cache
Python(基于uv):
just
lint:
    uv run ruff check .

format:
    uv run ruff format .
    uv run ruff check --fix .

test *args:
    uv run pytest {{args}}

dev:
    uv run uvicorn app:app --reload

build:
    docker build -t {{PROJECT_NAME}} .

clean:
    find . -type f -name "*.pyc" -delete
    find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
    rm -rf .pytest_cache .ruff_cache .coverage htmlcov dist build *.egg-info
Node.js(基于Bun):
just
lint:
    bun run lint

format:
    bun run format

test *args:
    bun test {{args}}

dev:
    bun run dev

build:
    bun run build

clean:
    rm -rf node_modules dist .next .turbo .cache
Rust:
just
lint:
    cargo clippy -- -D warnings

format:
    cargo fmt

test *args:
    cargo nextest run {{args}}

dev:
    cargo watch -x run

build:
    cargo build --release

clean:
    cargo clean
Go:
just
lint:
    golangci-lint run

format:
    gofmt -s -w .
    goimports -w .

test *args:
    go test ./... {{args}}

dev:
    air

build:
    go build -o bin/{{PROJECT_NAME}} ./cmd/{{PROJECT_NAME}}

clean:
    rm -rf bin dist
    go clean -cache

Detection Logic

检测逻辑

Service detection (start/stop needed):
  • Has
    docker-compose.yml
    -> Docker Compose service
  • Has
    Dockerfile
    + HTTP server code -> Container service
  • Has
    src/server.*
    or
    src/main.*
    -> Application service
Dev mode detection:
  • Python: Has FastAPI/Flask/Django -> uvicorn/flask/manage.py with reload
  • Node: Has
    dev
    script in package.json
  • Rust: Has
    cargo-watch
    in dependencies
  • Go: Has
    air.toml
    or
    main.go
服务检测(需要start/stop任务):
  • 存在
    docker-compose.yml
    -> Docker Compose服务
  • 存在
    Dockerfile
    + HTTP服务器代码 -> 容器化服务
  • 存在
    src/server.*
    src/main.*
    -> 应用服务
开发模式检测:
  • Python: 包含FastAPI/Flask/Django -> 使用带热重载的uvicorn/flask/manage.py
  • Node:
    package.json
    中包含
    dev
    脚本
  • Rust: 依赖中包含
    cargo-watch
  • Go: 存在
    air.toml
    main.go

Migration from Makefile

从Makefile迁移

If a Makefile exists but no Justfile:
  1. Detect project type from Makefile commands
  2. Suggest creating Justfile with equivalent recipes
  3. Optionally keep Makefile for backwards compatibility
若存在Makefile但无Justfile:
  1. 根据Makefile命令检测项目类型
  2. 建议创建包含等效任务脚本的Justfile
  3. 可选择保留Makefile以兼容旧版本

Agentic Optimizations

智能代理优化

ContextCommand
Quick compliance check
/configure:justfile --check-only
Auto-fix all issues
/configure:justfile --fix
List existing recipes
just --list
Verify specific recipe exists
just --summary
Check Justfile syntax
just --evaluate 2>&1
上下文场景命令
快速合规检查
/configure:justfile --check-only
自动修复所有问题
/configure:justfile --fix
列出现有任务脚本
just --list
验证特定任务脚本存在
just --summary
检查Justfile语法
just --evaluate 2>&1

Flags

参数标识

FlagDescription
--check-only
Report status without offering fixes
--fix
Apply fixes automatically
参数描述
--check-only
仅报告状态,不提供修复选项
--fix
自动应用修复

Examples

示例

bash
undefined
bash
undefined

Check current Justfile compliance

检查当前Justfile合规性

/configure:justfile --check-only
/configure:justfile --check-only

Create/update Justfile for Python project

为Python项目创建/更新Justfile

/configure:justfile --fix
/configure:justfile --fix

Check compliance and prompt for fixes

检查合规性并提示修复

/configure:justfile
undefined
/configure:justfile
undefined

See Also

另请参阅

  • /configure:makefile
    - Makefile configuration (legacy)
  • /configure:all
    - Run all compliance checks
  • /configure:workflows
    - GitHub Actions workflows
  • /configure:dockerfile
    - Docker configuration
  • justfile-expert
    skill - Comprehensive Just expertise
  • /configure:makefile
    - Makefile配置(旧版)
  • /configure:all
    - 运行所有合规检查
  • /configure:workflows
    - GitHub Actions工作流
  • /configure:dockerfile
    - Docker配置
  • justfile-expert
    技能 - 全面的Just专业技能