AgentSkillsCN

make

适用于使用语言无关的任务运行器自动执行构建、测试与开发任务。涵盖 GNU Make、Just 以及 Task(Taskfile)——这些工具为任何技术栈的项目命令提供了一致的界面。 适用场景:Make、Makefile、Just、Justfile、Task、Taskfile、任务运行器、构建自动化、项目脚本、开发者体验、跨语言构建命令、伪目标。 不适用场景:特定语言的构建系统(Gradle、MSBuild、webpack——应使用语言特定的技能)、CI/CD 管道配置、容器编排。

SKILL.md
--- frontmatter
name: make
description: |
    Use when automating build, test, and development tasks with language-agnostic task runners. Covers GNU Make, Just, and Task (Taskfile) — tools that provide a consistent interface for project commands across any tech stack.
    USE FOR: Make, Makefile, Just, Justfile, Task, Taskfile, task runners, build automation, project scripts, developer experience, cross-language build commands, phony targets
    DO NOT USE FOR: language-specific build systems (Gradle, MSBuild, webpack — use language-specific skills), CI/CD pipeline configuration, container orchestration
license: MIT
metadata:
  displayName: "Make & Task Runners"
  author: "Tyler-R-Kendrick"
compatibility: claude, copilot, cursor

Make & Task Runners

Overview

Every project needs a way to run common commands (build, test, lint, deploy) without remembering the exact incantation. Make, Just, and Task provide a consistent make build or just test interface regardless of the underlying tech stack.

Tool Comparison

FeatureGNU MakeJustTask
FileMakefileJustfileTaskfile.yml
LanguageMake DSLCustom DSLYAML
PlatformEverywhereCross-platform binaryCross-platform binary
DependenciesTarget-basedRecipe-basedTask-based
Variables$(VAR){{var}}{{.VAR}}
Shellsh by defaultsh/bash/pwshsh/bash/pwsh
ArgumentsLimitedFirst-classFirst-class
InstallPre-installed on Unixcargo/brew/chocogo install/brew/choco

GNU Make

Makefile Anatomy

A Makefile consists of targets, prerequisites, and recipes. Recipes must be indented with a tab (not spaces).

makefile
target: prerequisites
	recipe-command

Use .PHONY to declare targets that don't represent files:

makefile
.PHONY: build test lint clean dev

Example Makefile

A polyglot project with both Node.js and .NET:

makefile
.PHONY: build test lint clean dev

build:
	npm run build
	dotnet build

test:
	npm test
	dotnet test

lint:
	npm run lint
	dotnet format --verify-no-changes

clean:
	rm -rf dist/ bin/ obj/ node_modules/

dev:
	npm run dev

Variables

makefile
APP_NAME := myapp
VERSION := 1.0.0

build:
	docker build -t $(APP_NAME):$(VERSION) .

Automatic Variables

VariableMeaning
$@The target name
$<The first prerequisite
$^All prerequisites

Include Other Makefiles

makefile
include common.mk

Conditional Logic

makefile
ifeq ($(OS),Windows_NT)
	SHELL := powershell.exe
endif

Just

Justfile Syntax

Just is simpler than Make — no tab requirement, first-class arguments, and OS-conditional recipes:

just
default:
    @just --list

build:
    npm run build
    dotnet build

test *args:
    npm test {{args}}
    dotnet test {{args}}

lint:
    npm run lint
    dotnet format --verify-no-changes

dev port="3000":
    PORT={{port}} npm run dev

# Run in PowerShell on Windows
[windows]
clean:
    Remove-Item -Recurse -Force dist, bin, obj, node_modules

[unix]
clean:
    rm -rf dist/ bin/ obj/ node_modules/

Why Just over Make

  • No tab sensitivity — indentation uses spaces, not tabs
  • Recipe argumentsjust test --verbose passes --verbose to the recipe
  • OS-conditional recipes[windows] and [unix] annotations for cross-platform support
  • Dotenv loadingset dotenv-load to automatically load .env files
  • Better error messages — clearer feedback when recipes fail

Task (Taskfile)

Taskfile.yml Syntax

yaml
version: '3'

tasks:
  build:
    cmds:
      - npm run build
      - dotnet build

  test:
    cmds:
      - npm test
      - dotnet test

  lint:
    cmds:
      - npm run lint
      - dotnet format --verify-no-changes

  dev:
    cmds:
      - npm run dev
    env:
      PORT: 3000

  clean:
    cmds:
      - rm -rf dist/ bin/ obj/ node_modules/

Why Task

  • YAML — familiar syntax for anyone working with CI/CD, Kubernetes, or Docker Compose
  • Cross-platform — single binary, works on Windows, macOS, and Linux
  • Task dependenciesdeps: [build] ensures prerequisites run first
  • Conditional execution — skip tasks based on file changes or environment
  • Dotenv support — automatically loads .env files
  • Watch modetask --watch test re-runs on file changes

When to Use Which

ScenarioRecommendation
Already have a MakefileKeep Make
New project on a mixed teamJust or Task
YAML-familiar teamTask
Need recipe argumentsJust or Task
Windows-first teamJust or Task
CI/CD scriptsMake — most compatible

Best Practices

  • Put a Makefile, Justfile, or Taskfile in every project root — it serves as the entry point for all commands
  • Use it as the single interface for all project operations — build, test, lint, format, deploy, clean
  • Document available commands with make help / just --list / task --list so new developers can discover what's available
  • Keep recipes simple — delegate to real build tools (npm, dotnet, cargo) rather than encoding complex logic in the task file
  • Use task runners for developer experience, not as a replacement for language-specific build systems (Gradle, webpack, MSBuild)
  • Commit the task file to version control and document it in the README so the whole team uses the same commands