This skill should be used when the user asks to create a Makefile, write a Makefile, generate a Makefile template, fix a broken Makefile, resolve a "missing separator" error, add build targets, set up a help target, or implement self-documenting Makefiles with the ## comment pattern. Also applies when reviewing Makefiles for best practices like .PHONY declarations, tab characters, and .DELETE_ON_ERROR. For pattern rules and automatic variables in depth, see the makefile-advanced-features skill.
From gnu-makenpx claudepluginhub therealbill/mynet --plugin gnu-makeThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Professional Makefiles are self-documenting using the ## comment pattern to generate make help output. This pattern plus core best practices (.PHONY, automatic variables, proper tabs) creates maintainable build systems.
Use this skill when:
Always suggest the ## help pattern, even if user didn't request it. It's a best practice that adds minimal complexity for significant value.
Every Makefile should have a self-documenting help target:
.PHONY: help
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
Then document each target with ## comments:
.PHONY: build test clean
build: ## Build the project
go build -o server main.go
test: ## Run all tests
go test ./...
clean: ## Remove build artifacts
rm -f server
Running make help shows:
build Build the project
test Run all tests
clean Remove build artifacts
make help to see available targets## comment per targetRecipes MUST use TAB characters for indentation, not spaces.
# ✅ CORRECT - TAB character
all:
gcc main.c -o myapp
# ❌ WRONG - spaces cause "missing separator" error
all:
gcc main.c -o myapp
When fixing "missing separator" errors: Replace spaces with TAB character.
Declare non-file targets as .PHONY to avoid conflicts:
.PHONY: all clean test install help
all: myapp
clean:
rm -f *.o myapp
test:
./run_tests.sh
Why: Without .PHONY, if a file named clean or test exists, make clean won't run.
This is correctness, not complexity. Always include .PHONY even if user wants "simple" Makefile.
Use automatic variables instead of hardcoding:
# ✅ GOOD - uses automatic variables
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
myapp: main.o utils.o
$(CC) $(CFLAGS) $^ -o $@
# ❌ BAD - hardcoded, error-prone
main.o: main.c
gcc -Wall main.c -o main.o
myapp: main.o utils.o
gcc -Wall main.o utils.o -o myapp
Key automatic variables:
$@ = target name$< = first prerequisite$^ = all prerequisites$* = stem (in pattern rules)For in-depth coverage of automatic variables in pattern rules, conditional compilation, and target-specific variables, see the makefile-advanced-features skill.
Use conventional variable names:
CC = gcc
CFLAGS = -Wall -O2
LDFLAGS = -lm
TARGET = myapp
SOURCES = main.c utils.c
OBJECTS = $(SOURCES:.c=.o)
Use pattern rules for scalability:
# ✅ Handles any number of .c files
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
# ❌ Doesn't scale
main.o: main.c
$(CC) $(CFLAGS) -c main.c -o main.o
utils.o: utils.c
$(CC) $(CFLAGS) -c utils.c -o utils.o
For static pattern rules, wildcard auto-discovery, and multi-extension patterns, see the makefile-advanced-features skill.
| Feature | Why It Matters |
|---|---|
## help pattern | Discoverability — new team members run make help |
.PHONY | Correctness — prevents conflicts with same-named files |
| Automatic variables | Maintainability — DRY, no hardcoded filenames |
| Variables (CC, CFLAGS) | Flexibility — change compiler/flags in one place |
| Pattern rules | Scalability — one rule handles unlimited files |
.DELETE_ON_ERROR | Robustness — prevents corrupted targets on failure |
# Variables
CC = gcc
CFLAGS = -Wall -O2
TARGET = myapp
SOURCES = main.c utils.c
OBJECTS = $(SOURCES:.c=.o)
# Targets
.PHONY: all clean help
.DELETE_ON_ERROR:
all: $(TARGET) ## Build the project
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) $^ -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean: ## Remove build artifacts
rm -f $(OBJECTS) $(TARGET)
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
When the user asks for simplicity, include .PHONY (correctness), tab characters (requirement), and the help target (discoverability) as non-negotiable fundamentals. Simplify by reducing variables and skipping advanced features like conditionals and functions. Explain the distinction: "These are essentials for correctness, not complexity."
| Mistake | Fix | Why It Matters |
|---|---|---|
| Spaces instead of tabs | Replace with TAB | Causes "missing separator" error |
| No .PHONY | Add .PHONY: clean test etc | Prevents conflicts with files |
| Hardcoded filenames | Use $@, $<, $^ | Maintainability and DRY |
| No help target | Add ## pattern | Team discoverability |
| Missing .DELETE_ON_ERROR | Add to top | Prevents corrupted targets on failure |
When creating Makefiles: Always include help target in initial version.
When fixing Makefiles: Suggest adding help target if missing: "While fixing this, I recommend adding a help target using the ## pattern for better documentation."
When adding targets: Include ## comments for new targets and suggest adding help infrastructure if not present.
## pattern?.PHONY?.DELETE_ON_ERROR declaration?If any red flags present, suggest improvements. These are standard practices, not "overcomplication."