一键导入
justfile-creation
Use when creating Justfiles, needing modern command runners, or implementing just command runner patterns for task automation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating Justfiles, needing modern command runners, or implementing just command runner patterns for task automation.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | justfile-creation |
| description | Use when creating Justfiles, needing modern command runners, or implementing just command runner patterns for task automation. |
Guide for creating Justfiles using the just command runner.
Just is a modern command runner inspired by Make but simpler. It doesn't track file dependencies - it just runs commands. This makes it ideal for task automation without the complexity of Make.
# Project Configuration
project := "myproject"
version := "1.0.0"
# Default recipe (runs when no recipe specified)
default: list
# List all available recipes
list:
@just --list
# Show help
help:
@echo "Available recipes:"
@just --list
# Development recipes
build:
echo "Building {{project}}..."
# Build commands here
test:
echo "Running tests..."
# Test commands here
lint:
echo "Running linter..."
# Lint commands here
format:
echo "Formatting code..."
# Format commands here
clean:
echo "Cleaning build artifacts..."
rm -rf build/
# Installation
install:
echo "Installing {{project}}..."
# Installation commands
name := "myproject"
version := "1.0.0"
# Use variables with {{}}
build:
echo "Building {{name}} v{{version}}"
# Simple recipe
hello:
echo "Hello, World!"
# Recipe with arguments
greet name:
echo "Hello, {{name}}!"
# Recipe with default argument
greet name="World":
echo "Hello, {{name}}!"
# Recipe that depends on another
build: clean
echo "Building..."
# Multiple dependencies
deploy: build test
echo "Deploying..."
# List all recipes as default
default:
@just --list
# Or with custom formatting
help:
@echo "Available recipes:"
@just --list --unsorted
# Check for required tools
check-tools:
#!/usr/bin/env bash
command -v docker >/dev/null 2>&1 || { echo "docker required"; exit 1; }
command -v node >/dev/null 2>&1 || { echo "node required"; exit 1; }
# Setup development environment
setup: check-tools
npm install
echo "Setup complete"
# Fail on error (just does this by default)
dangerous:
set -e
rm -rf /important/path # Will stop if this fails
echo "Done"
# Continue on error
lenient:
-rm nonexistent.txt # The dash means ignore errors
echo "Done"
# Check if file exists
backup file:
#!/usr/bin/env bash
if [[ -f "{{file}}" ]]; then
cp "{{file}" "{{file}}.bak"
echo "Backup created"
else
echo "File not found: {{file}}"
exit 1
fi
# Detect OS
os := `uname -s`
# Platform-specific build
build:
#!/usr/bin/env bash
if [[ "{{os}}" == "Darwin" ]]; then
echo "Building for macOS..."
else
echo "Building for Linux..."
fi
default recipe - Always define what runs by defaultlist or help - Make recipes discoverable# to document recipesset -e for bash scripts to fail fast@ to suppress echoing of the commandcomplex-task:
#!/usr/bin/env python3
import os
print(f"Current directory: {os.getcwd()}")
print("Running Python code in just!")
alias b := build
alias t := test
build:
echo "Building..."
test:
echo "Testing..."
# Set shell for all recipes
set shell := ["bash", "-cu"]
# Allow positional arguments
set positional-arguments := true
# Export variables to environment
set export := true
# Load .env file automatically
set dotenv-load := true
# Or load specific file
set dotenv-load := "production.env"
deploy:
echo "Deploying to {{env_var('DEPLOY_HOST')}}"
# Node.js project tasks
node_version := "18"
default:
@just --list
install:
npm ci
dev:
npm run dev
build:
npm run build
test:
npm test
lint:
npm run lint
format:
npm run format
clean:
rm -rf node_modules dist/
docker-build:
docker build -t myapp:{{node_version}} .
# Rust project tasks
default:
@just --list
build:
cargo build --release
test:
cargo test
check:
cargo check
fmt:
cargo fmt
clippy:
cargo clippy -- -D warnings
clean:
cargo clean
doc:
cargo doc --open
# Run with features
run *args:
cargo run --features "dev" {{args}}
# Documentation with MkDocs
default:
@just --list
serve:
mkdocs serve
build:
mkdocs build
deploy: build
mkdocs gh-deploy
clean:
rm -rf site/
# Update dependencies
update:
pip install -U mkdocs mkdocs-material
Use when creating or modifying bash shell scripts, needing script templates, error handling patterns, or shell scripting best practices.
Use when you need detailed kitty terminal API reference, remote control commands, window management, or advanced kitty integration patterns.
Use when creating Makefiles, needing build automation, defining make targets, or implementing standard makefile patterns and recipes.
Comprehensive guide for Python type annotations, type checking, and modern typing patterns. Use when: (1) Adding type hints to Python code, (2) Configuring mypy/pyright/ty type checkers, (3) Understanding generics, protocols, and advanced type patterns, (4) Migrating to modern Python typing, (5) Setting up strict type checking in CI/CD, (6) Building type-safe APIs and libraries. Covers Python 3.10+ modern syntax, type narrowing, structural typing, and best practices.
Use when you need to explore, search, or understand codebases using structural AST patterns. Ideal for finding specific code patterns, understanding code architecture, discovering API usage, or locating code smells across multiple files.
Use when you need to perform code refactoring, semantic transformations, or structural rewrites across multiple files. Ideal for API migrations, code modernization, breaking change adoption, or systematic code transformations.