justfile-expert by laurigates/claude-plugins
npx skills add https://github.com/laurigates/claude-plugins --skill justfile-expert精通 Just 命令运行器、配方开发和任务自动化,专注于跨平台兼容性和项目标准化。
| 使用此技能当... | 使用替代方案当... |
|---|---|
| 为任务自动化创建/编辑 justfile | 需要支持增量编译的构建系统 → Make |
| 编写跨平台项目命令 | 需要捆绑工具版本管理 → mise tasks |
| 添加 shebang 配方(Python、Node、Ruby 等) | 已使用 mise 进行所有项目工具管理 |
| 配置 dotenv 加载和设置 | 简单的单次 shell 脚本 → 直接使用 Bash |
| 使用 just 配方设置 CI/CD | 项目已有大量 Makefile |
| 跨项目标准化配方 | 需要 Docker 特定工作流 → docker-compose |
命令运行器精通
配方开发卓越
项目标准化
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 规则 | 模式 | 示例 |
|---|---|---|
| 连字符分隔 | word-word | test-unit, format-check |
| 动词优先(动作) | verb-object | lint, build, clean |
| 名词优先(类别) | noun-verb | db-migrate, docs-serve |
| 私有前缀 | _name | _generate-secrets, _setup |
-check 后缀 | 只读验证 | format-check |
-fix 后缀 | 自动修正 | lint-fix, check-fix |
-watch 后缀 | 监视模式 | test-watch, docs-watch |
| 修饰符在基础之后 | base-modifier | build-release(而非 release-build) |
具有明确定义含义的标准复合配方:
| 配方 | 组合 | 目的 |
|---|---|---|
check | format-check + lint + typecheck | 仅代码质量,不含测试 |
pre-commit | format-check + lint + typecheck + test-unit | 快速、非变异的验证 |
ci | check + test-coverage + build | 完整的 CI 模拟 |
clean | 移除构建产物 | 部分清理 |
clean-all | clean + 移除依赖/缓存 | 完全清理 |
# 复合:仅代码质量(不含测试)
check: format-check lint typecheck
# 预提交检查(快速、非变异)
pre-commit: format-check lint typecheck test-unit
@echo "Pre-commit checks passed"
# 完整的 CI 模拟
ci: check test-coverage build
@echo "CI simulation passed"
# 清理构建产物
clean:
rm -rf dist build .next
# 清理所有内容,包括依赖项
clean-all: clean
rm -rf node_modules .venv __pycache__
配方参数
recipe param: - 必须提供recipe param="default": - 可选,有回退值+ : recipe +FILES: - 一个或多个参数* : recipe *FLAGS: - 零个或多个参数recipe $VAR: - 参数作为环境变量设置配置
set dotenv-load : 自动加载 .env 文件set positional-arguments : 启用 $1, $2 语法set export : 将所有变量导出为环境变量set shell : 自定义 shell 解释器set quiet : 抑制命令回显配方属性
[private] : 从 --list 输出中隐藏[no-cd] : 不更改目录[no-exit-message] : 抑制退出消息[unix] / [windows] / [linux] / [macos] : 平台特定配方[positional-arguments] : 每个配方的位置参数[confirm] / [confirm("message")] : 运行前需要确认[group: "name"] : 在 --list 输出中分组配方[working-directory: "path"] : 在特定目录中运行模块系统
mod name : 声明子模块mod name 'path' : 自定义模块路径just module::recipe 或 just module recipe基本配方结构
# 注释描述配方
recipe-name:
command1
command2
带参数的配方
build target:
@echo "Building {{target}}..."
cd {{target}} && make
test *args:
uv run pytest {{args}}
配方依赖
default: build test
build: _setup
cargo build --release
_setup:
@echo "Setting up..."
变量和插值
version := "1.0.0"
project := env('PROJECT_NAME', 'default')
info:
@echo "Project: {{project}} v{{version}}"
条件配方
[unix]
open:
xdg-open http://localhost:8080
[windows]
open:
start http://localhost:8080
每个项目都应提供这些标准配方,按章节组织:
# Justfile - 项目任务运行器
# 运行 `just` 或 `just help` 查看可用配方
set dotenv-load
set positional-arguments
# 默认配方 - 显示帮助
default:
@just --list
# 显示带有描述的可用配方
help:
@just --list --unsorted
####################
# 开发
####################
# 启动开发环境
dev:
# bun run dev / uv run uvicorn app:app --reload / skaffold dev
# 为生产环境构建
build:
# bun run build / cargo build --release / docker build
# 清理构建产物
clean:
# rm -rf dist build .next
####################
# 代码质量
####################
# 运行代码检查器(只读)
lint *args:
# bun run lint / uv run ruff check {{args}}
# 自动修复代码检查问题
lint-fix:
# bun run lint:fix / uv run ruff check --fix .
# 格式化代码(变异操作)
format *args:
# bun run format / uv run ruff format {{args}}
# 检查格式化而不修改(非变异操作)
format-check *args:
# bun run format:check / uv run ruff format --check {{args}}
# 类型检查
typecheck:
# bunx tsc --noEmit / uv run basedpyright
####################
# 测试
####################
# 运行所有测试
test *args:
# bun test {{args}} / uv run pytest {{args}}
# 仅运行单元测试
test-unit *args:
# bun test --grep unit {{args}} / uv run pytest -m unit {{args}}
####################
# 工作流
####################
# 复合:代码质量(不含测试)
check: format-check lint typecheck
# 预提交检查(快速、非变异)
pre-commit: format-check lint typecheck test-unit
@echo "Pre-commit checks passed"
# 完整的 CI 模拟
ci: check test-coverage build
@echo "CI simulation passed"
将配方组织到这些标准章节中:
| 章节 | 配方 | 目的 |
|---|---|---|
| 元数据 | default, help | 发现和导航 |
| 开发 | dev, build, clean, start, stop | 核心开发周期 |
| 代码质量 | lint, lint-fix, format, format-check, typecheck | 代码标准 |
| 测试 | test, test-unit, test-integration, test-e2e, test-watch | 测试层级 |
| 工作流 | check, pre-commit, ci | 复合操作 |
| 依赖项 | install, update | 包管理 |
| 数据库 | db-migrate, db-seed, db-reset | 数据操作 |
| Kubernetes | skaffold, dev-k8s | 容器编排 |
| 文档 | docs, docs-serve | 项目文档 |
使用 #################### 注释块作为章节分隔符以提高可读性。
设置/引导配方
# 初始项目设置
setup:
#!/usr/bin/env bash
set -euo pipefail
echo "Installing dependencies..."
uv sync
echo "Setting up pre-commit..."
pre-commit install
echo "Done!"
Docker 集成
# 构建容器镜像
docker-build tag="latest":
docker build -t {{project}}:{{tag}} .
# 运行容器
docker-run tag="latest" *args:
docker run --rm -it {{project}}:{{tag}} {{args}}
# 推送到注册表
docker-push tag="latest":
docker push {{registry}}/{{project}}:{{tag}}
数据库操作
# 运行数据库迁移
db-migrate:
uv run alembic upgrade head
# 创建新迁移
db-revision message:
uv run alembic revision --autogenerate -m "{{message}}"
# 重置数据库
db-reset:
uv run alembic downgrade base
uv run alembic upgrade head
CI/CD 配方
# 完整的 CI 检查(代码检查 + 测试 + 构建)
ci: lint test build
@echo "CI passed!"
# 发布工作流
release version:
git tag -a "v{{version}}" -m "Release {{version}}"
git push origin "v{{version}}"
just-mcp MCP 服务器使 AI 助手能够通过模型上下文协议发现和执行 justfile 配方,减少上下文浪费,因为 AI 无需读取完整的 justfile。
安装:
# 通过 npm
npx just-mcp --stdio
# 通过 pip/uvx
uvx just-mcp --stdio
# 通过 cargo
cargo install just-mcp
Claude Desktop 配置 (.claude/mcp.json):
{
"mcpServers": {
"just-mcp": {
"command": "npx",
"args": ["-y", "just-mcp", "--stdio"]
}
}
}
可用的 MCP 工具:
list_recipes - 发现所有配方和参数run_recipe - 使用参数执行配方get_recipe_info - 获取详细的配方文档validate_justfile - 检查语法错误| 上下文 | 命令 |
|---|---|
| 列出所有配方 | just --list 或 just -l |
| 试运行(预览) | just --dry-run recipe |
| 显示变量 | just --evaluate |
| JSON 配方列表 | just --dump --dump-format json |
| 详细执行 | just --verbose recipe |
| 特定的 justfile | just --justfile path recipe |
| 工作目录 | just --working-directory path recipe |
| 交互式选择 | just --choose |
配方开发工作流
build, test, deploy)[private]关键指南
default 配方@ 前缀抑制命令回显set dotenv-load*args 以实现传递灵活性| 特性 | Just | Make | mise tasks |
|---|---|---|---|
| 语法 | 简单、清晰 | 复杂、需要制表符 | YAML |
| 依赖项 | 内置 | 内置 | 手动 |
| 参数 | 完全支持 | 有限 | 完全支持 |
| 跨平台 | 优秀 | 良好 | 优秀 |
| 工具版本 | 否 | 否 | 是 |
| 错误消息 | 清晰 | 晦涩 | 清晰 |
| 安装 | 单个二进制文件 | 预安装 | 需要 mise |
何时使用 Just:
何时使用 mise tasks:
何时使用 Make:
有关黄金 justfile 模板、详细语法参考、高级模式和故障排除,请参阅 REFERENCE.md。
每周安装次数
71
代码仓库
GitHub 星标数
19
首次出现
2026年1月29日
安全审计
安装于
github-copilot69
opencode69
gemini-cli68
amp68
codex68
kimi-cli68
Expert knowledge for Just command runner, recipe development, and task automation with focus on cross-platform compatibility and project standardization.
| Use this skill when... | Use alternative when... |
|---|---|
| Creating/editing justfiles for task automation | Need build system with incremental compilation → Make |
| Writing cross-platform project commands | Need tool version management bundled → mise tasks |
| Adding shebang recipes (Python, Node, Ruby, etc.) | Already using mise for all project tooling |
| Configuring dotenv loading and settings | Simple one-off shell scripts → Bash directly |
| Setting up CI/CD with just recipes | Project already has extensive Makefile |
| Standardizing recipes across projects | Need Docker-specific workflows → docker-compose |
Command Runner Mastery
Recipe Development Excellence
Project Standardization
| Rule | Pattern | Examples |
|---|---|---|
| Hyphen-separated | word-word | test-unit, format-check |
| Verb-first (actions) | verb-object | lint, build, clean |
| Noun-first (categories) | noun-verb |
Standard composite recipes with defined meanings:
| Recipe | Composition | Purpose |
|---|---|---|
check | format-check + lint + typecheck | Code quality only, no tests |
pre-commit | format-check + lint + typecheck + test-unit |
# Composite: code quality only (no tests)
check: format-check lint typecheck
# Pre-commit checks (fast, non-mutating)
pre-commit: format-check lint typecheck test-unit
@echo "Pre-commit checks passed"
# Full CI simulation
ci: check test-coverage build
@echo "CI simulation passed"
# Clean build artifacts
clean:
rm -rf dist build .next
# Clean everything including deps
clean-all: clean
rm -rf node_modules .venv __pycache__
Recipe Parameters
recipe param: - must be providedrecipe param="default": - optional with fallback+: recipe +FILES: - one or more arguments*: recipe *FLAGS: - zero or more argumentsrecipe $VAR: - parameter as env varSettings Configuration
set dotenv-load : Load .env file automaticallyset positional-arguments : Enable $1, $2 syntaxset export : Export all variables as env varsset shell : Custom shell interpreterset quiet : Suppress command echoingRecipe Attributes
[private] : Hide from --list output[no-cd] : Don't change directory[no-exit-message] : Suppress exit messages[unix] / [windows] / [linux] / [macos] : Platform-specific recipes[positional-arguments] : Per-recipe positional argsModule System
mod name : Declare submodulemod name 'path' : Custom module pathjust module::recipe or just module recipeBasic Recipe Structure
# Comment describes the recipe
recipe-name:
command1
command2
Recipe with Parameters
build target:
@echo "Building {{target}}..."
cd {{target}} && make
test *args:
uv run pytest {{args}}
Recipe Dependencies
default: build test
build: _setup
cargo build --release
_setup:
@echo "Setting up..."
Variables and Interpolation
version := "1.0.0"
project := env('PROJECT_NAME', 'default')
info:
@echo "Project: {{project}} v{{version}}"
Conditional Recipes
[unix]
open:
xdg-open http://localhost:8080
[windows]
open:
start http://localhost:8080
Every project should provide these standard recipes, organized by section:
# Justfile - Project task runner
# Run `just` or `just help` to see available recipes
set dotenv-load
set positional-arguments
# Default recipe - show help
default:
@just --list
# Show available recipes with descriptions
help:
@just --list --unsorted
####################
# Development
####################
# Start development environment
dev:
# bun run dev / uv run uvicorn app:app --reload / skaffold dev
# Build for production
build:
# bun run build / cargo build --release / docker build
# Clean build artifacts
clean:
# rm -rf dist build .next
####################
# Code Quality
####################
# Run linter (read-only)
lint *args:
# bun run lint / uv run ruff check {{args}}
# Auto-fix lint issues
lint-fix:
# bun run lint:fix / uv run ruff check --fix .
# Format code (mutating)
format *args:
# bun run format / uv run ruff format {{args}}
# Check formatting without modifying (non-mutating)
format-check *args:
# bun run format:check / uv run ruff format --check {{args}}
# Type checking
typecheck:
# bunx tsc --noEmit / uv run basedpyright
####################
# Testing
####################
# Run all tests
test *args:
# bun test {{args}} / uv run pytest {{args}}
# Run unit tests only
test-unit *args:
# bun test --grep unit {{args}} / uv run pytest -m unit {{args}}
####################
# Workflows
####################
# Composite: code quality (no tests)
check: format-check lint typecheck
# Pre-commit checks (fast, non-mutating)
pre-commit: format-check lint typecheck test-unit
@echo "Pre-commit checks passed"
# Full CI simulation
ci: check test-coverage build
@echo "CI simulation passed"
Organize recipes into these standard sections:
| Section | Recipes | Purpose |
|---|---|---|
| Metadata | default, help | Discovery and navigation |
| Development | dev, build, clean, start, stop | Core dev cycle |
| Code Quality |
Use #################### comment blocks as section dividers for readability.
Setup/Bootstrap Recipe
# Initial project setup
setup:
#!/usr/bin/env bash
set -euo pipefail
echo "Installing dependencies..."
uv sync
echo "Setting up pre-commit..."
pre-commit install
echo "Done!"
Docker Integration
# Build container image
docker-build tag="latest":
docker build -t {{project}}:{{tag}} .
# Run container
docker-run tag="latest" *args:
docker run --rm -it {{project}}:{{tag}} {{args}}
# Push to registry
docker-push tag="latest":
docker push {{registry}}/{{project}}:{{tag}}
Database Operations
# Run database migrations
db-migrate:
uv run alembic upgrade head
# Create new migration
db-revision message:
uv run alembic revision --autogenerate -m "{{message}}"
# Reset database
db-reset:
uv run alembic downgrade base
uv run alembic upgrade head
CI/CD Recipes
# Full CI check (lint + test + build)
ci: lint test build
@echo "CI passed!"
# Release workflow
release version:
git tag -a "v{{version}}" -m "Release {{version}}"
git push origin "v{{version}}"
The just-mcp MCP server enables AI assistants to discover and execute justfile recipes through the Model Context Protocol, reducing context waste since the AI doesn't need to read the full justfile.
Installation:
# Via npm
npx just-mcp --stdio
# Via pip/uvx
uvx just-mcp --stdio
# Via cargo
cargo install just-mcp
Claude Desktop configuration (.claude/mcp.json):
{
"mcpServers": {
"just-mcp": {
"command": "npx",
"args": ["-y", "just-mcp", "--stdio"]
}
}
}
Available MCP Tools:
list_recipes - Discover all recipes and parametersrun_recipe - Execute a recipe with argumentsget_recipe_info - Get detailed recipe documentationvalidate_justfile - Check for syntax errors| Context | Command |
|---|---|
| List all recipes | just --list or just -l |
| Dry run (preview) | just --dry-run recipe |
| Show variables | just --evaluate |
| JSON recipe list | just --dump --dump-format json |
| Verbose execution | just --verbose recipe |
| Specific justfile |
Recipe Development Workflow
build, test, deploy)[private]Critical Guidelines
default recipe pointing to help@ prefix to suppress command echo when appropriateset dotenv-load for configuration*args for passthrough flexibility| Feature | Just | Make | mise tasks |
|---|---|---|---|
| Syntax | Simple, clear | Complex, tabs required | YAML |
| Dependencies | Built-in | Built-in | Manual |
| Parameters | Full support | Limited | Full support |
| Cross-platform | Excellent | Good | Excellent |
| Tool versions | No | No | Yes |
| Error messages | Clear | Cryptic | Clear |
| Installation | Single binary | Pre-installed | Requires mise |
When to use Just:
When to use mise tasks:
When to use Make:
For the golden justfile template, detailed syntax reference, advanced patterns, and troubleshooting, see REFERENCE.md.
Weekly Installs
71
Repository
GitHub Stars
19
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot69
opencode69
gemini-cli68
amp68
codex68
kimi-cli68
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
46,600 周安装
Microsoft Graph API 编排技能:REST API 端点、身份验证与资源管理指南
138 周安装
JSON数据处理教程:Python与JavaScript解析、验证与进阶操作指南
140 周安装
现代JavaScript模式指南:ES6+、函数式编程与代码优化最佳实践
138 周安装
OpenAI Agents Python PR草案摘要生成工具 - 自动化代码提交助手
139 周安装
Apache ECharts 教程 - 20+交互式图表制作与数据可视化技能
136 周安装
GenAI Agent Skills 目录 - 开发者AI技能库与代码助手插件集成
144 周安装
db-migrate, docs-serve |
| Private prefix | _name | _generate-secrets, _setup |
-check suffix | Read-only verification | format-check |
-fix suffix | Auto-correction | lint-fix, check-fix |
-watch suffix | Watch mode | test-watch, docs-watch |
| Modifiers after base | base-modifier | build-release (not release-build) |
| Fast, non-mutating validation |
ci | check + test-coverage + build | Full CI simulation |
clean | Remove build artifacts | Partial cleanup |
clean-all | clean + remove deps/caches | Full cleanup |
[confirm] / [confirm("message")] : Require confirmation before running[group: "name"] : Group recipes in --list output[working-directory: "path"] : Run in specific directorylint, lint-fix, format, format-check, typecheck |
| Code standards |
| Testing | test, test-unit, test-integration, test-e2e, test-watch | Test tiers |
| Workflows | check, pre-commit, ci | Composite operations |
| Dependencies | install, update | Package management |
| Database | db-migrate, db-seed, db-reset | Data operations |
| Kubernetes | skaffold, dev-k8s | Container orchestration |
| Documentation | docs, docs-serve | Project docs |
just --justfile path recipe| Working directory | just --working-directory path recipe |
| Choose interactively | just --choose |