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 project | Project already uses Make exclusively and migration is not desired — use |
| Auditing existing Justfile for missing standard recipes | Writing complex custom recipes — use |
| Migrating from Makefile to Justfile | Project has no task runner needs (single-file scripts) |
| Ensuring Justfile follows team conventions (groups, comments, settings) | Debugging a specific recipe failure — use direct |
| Running CI/CD compliance checks on project task runners | Only need to list available recipes — run |
| 适用场景 | 其他方案适用场景 |
|---|---|
| 为项目新建Justfile | 项目已完全使用Make且不希望迁移——使用 |
| 审计现有Justfile是否缺失标准任务脚本 | 编写复杂自定义任务脚本——使用 |
| 从Makefile迁移到Justfile | 项目无任务运行器需求(单文件脚本) |
| 确保Justfile遵循团队规范(分组、注释、设置) | 调试特定任务脚本失败——直接使用 |
| 对项目任务运行器执行CI/CD合规检查 | 仅需列出可用任务脚本——直接运行 |
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:
- : Report compliance status without modifications (CI/CD mode)
--check-only - : Apply fixes automatically without prompting
--fix
从命令参数中解析:
- : 仅报告合规状态,不进行修改(CI/CD模式)
--check-only - : 自动应用修复,无需提示
--fix
Execution
执行流程
Execute this Justfile compliance check:
执行Justfile合规检查:
Step 1: Detect Justfile and project type
步骤1:检测Justfile和项目类型
- Check for or
justfilein project rootJustfile - If exists, read and analyze current recipes and settings
- Detect project type from file indicators:
| Indicator | Project Type |
|---|---|
| Python |
| Node.js |
| Rust |
| Go |
| None of the above | Generic |
- 检查项目根目录下是否存在或
justfileJustfile - 若存在,读取并分析当前任务脚本和设置
- 根据标识文件检测项目类型:
| 标识文件 | 项目类型 |
|---|---|
| Python |
| Node.js |
| Rust |
| Go |
| 以上均无 | 通用型 |
Step 2: Analyze required and optional recipes
步骤2:分析必需和可选任务脚本
Check for required recipes:
| Recipe | Purpose | Severity |
|---|---|---|
| Alias to help (first recipe) | FAIL if missing |
| Display available recipes | FAIL if missing |
| Run test suite | FAIL if missing |
| Run linters | FAIL if missing |
| Build project artifacts | WARN if missing |
| Remove temporary files | WARN if missing |
Check for context-dependent recipes:
| Recipe | When Required | Severity |
|---|---|---|
| If project uses auto-formatters | WARN |
| If project has runnable service | INFO |
| If project has background service | INFO |
| If project supports watch mode | INFO |
检查必需任务脚本:
| 任务脚本 | 用途 | 严重程度 |
|---|---|---|
| 指向help的别名(首个任务脚本) | 缺失则失败 |
| 显示可用任务脚本 | 缺失则失败 |
| 运行测试套件 | 缺失则失败 |
| 运行代码检查工具 | 缺失则失败 |
| 构建项目产物 | 缺失则警告 |
| 删除临时文件 | 缺失则警告 |
检查上下文相关任务脚本:
| 任务脚本 | 必需条件 | 严重程度 |
|---|---|---|
| 项目使用自动格式化工具 | 警告 |
| 项目包含可运行服务 | 提示 |
| 项目包含后台服务 | 提示 |
| 项目支持热重载模式 | 提示 |
Step 3: Check compliance settings
步骤3:检查合规设置
Validate Justfile settings:
| Check | Standard | Severity |
|---|---|---|
| File exists | justfile present | FAIL if missing |
| Default recipe | First recipe is | WARN if missing |
| Dotenv loading | | INFO |
| Help recipe | Lists all recipes | FAIL if missing |
| Language-specific | Commands match project type | FAIL if mismatched |
| Recipe comments | Recipes have descriptions | INFO |
验证Justfile设置:
| 检查项 | 标准要求 | 严重程度 |
|---|---|---|
| 文件存在 | 存在justfile | 缺失则失败 |
| 默认任务脚本 | 首个任务脚本为 | 缺失则警告 |
| 加载Dotenv | 包含 | 提示 |
| 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 foundIf , stop here.
--check-only打印格式化的合规报告:
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-onlyStep 5: Create or update Justfile (if --fix or user confirms)
步骤5:创建或更新Justfile(若使用--fix或用户确认)
If flag or user confirms:
--fix- Missing Justfile: Create from standard template based on project type
- Missing recipes: Add recipes with appropriate commands
- Missing settings: Add if
set dotenv-loadexists.env - Missing help: Add help recipe with
just --list
Use language-specific commands from the template section below.
若使用参数或用户确认:
--fix- 缺失Justfile:根据项目类型从标准模板创建
- 缺失任务脚本:添加包含合适命令的任务脚本
- 缺失配置:若存在文件则添加
.env配置set dotenv-load - 缺失Help:添加包含的help任务脚本
just --list
使用下方模板中的语言专属命令。
Step 6: Update standards tracking
步骤6:更新标准跟踪文件
Update :
.project-standards.yamlyaml
components:
justfile: "2025.1"更新:
.project-standards.yamlyaml
components:
justfile: "2025.1"Justfile Template
Justfile模板
Universal Structure
通用结构
just
undefinedjust
undefinedJustfile for {{PROJECT_NAME}}
Justfile for {{PROJECT_NAME}}
Run just
or just help
to see available recipes
justjust helpRun just
or just help
to see available recipes
justjust helpset 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}}
undefinedstop:
{{STOP_COMMAND}}
undefinedLanguage-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-infoNode.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 .cacheRust:
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 cleanGo:
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 -cachePython(基于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-infoNode.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 .cacheRust:
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 cleanGo:
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 -cacheDetection Logic
检测逻辑
Service detection (start/stop needed):
- Has -> Docker Compose service
docker-compose.yml - Has + HTTP server code -> Container service
Dockerfile - Has or
src/server.*-> Application servicesrc/main.*
Dev mode detection:
- Python: Has FastAPI/Flask/Django -> uvicorn/flask/manage.py with reload
- Node: Has script in package.json
dev - Rust: Has in dependencies
cargo-watch - Go: Has or
air.tomlmain.go
服务检测(需要start/stop任务):
- 存在-> Docker Compose服务
docker-compose.yml - 存在+ HTTP服务器代码 -> 容器化服务
Dockerfile - 存在或
src/server.*-> 应用服务src/main.*
开发模式检测:
- Python: 包含FastAPI/Flask/Django -> 使用带热重载的uvicorn/flask/manage.py
- Node: 中包含
package.json脚本dev - Rust: 依赖中包含
cargo-watch - Go: 存在或
air.tomlmain.go
Migration from Makefile
从Makefile迁移
If a Makefile exists but no Justfile:
- Detect project type from Makefile commands
- Suggest creating Justfile with equivalent recipes
- Optionally keep Makefile for backwards compatibility
若存在Makefile但无Justfile:
- 根据Makefile命令检测项目类型
- 建议创建包含等效任务脚本的Justfile
- 可选择保留Makefile以兼容旧版本
Agentic Optimizations
智能代理优化
| Context | Command |
|---|---|
| Quick compliance check | |
| Auto-fix all issues | |
| List existing recipes | |
| Verify specific recipe exists | |
| Check Justfile syntax | |
| 上下文场景 | 命令 |
|---|---|
| 快速合规检查 | |
| 自动修复所有问题 | |
| 列出现有任务脚本 | |
| 验证特定任务脚本存在 | |
| 检查Justfile语法 | |
Flags
参数标识
| Flag | Description |
|---|---|
| Report status without offering fixes |
| Apply fixes automatically |
| 参数 | 描述 |
|---|---|
| 仅报告状态,不提供修复选项 |
| 自动应用修复 |
Examples
示例
bash
undefinedbash
undefinedCheck 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
undefinedSee Also
另请参阅
- - Makefile configuration (legacy)
/configure:makefile - - Run all compliance checks
/configure:all - - GitHub Actions workflows
/configure:workflows - - Docker configuration
/configure:dockerfile - skill - Comprehensive Just expertise
justfile-expert
- - Makefile配置(旧版)
/configure:makefile - - 运行所有合规检查
/configure:all - - GitHub Actions工作流
/configure:workflows - - Docker配置
/configure:dockerfile - 技能 - 全面的Just专业技能
justfile-expert