makefile

Validates required Make variables with descriptive errors before Makefile targets execute commands.

2|Updated May 14, 2026
One-click install
npx skills add https://github.com/AnthonyPoschen/agent-skills --skill makefile-anthonyposchen
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: makefile
Source: https://github.com/AnthonyPoschen/agent-skills/tree/main/skills/makefile
Command: npx skills add https://github.com/AnthonyPoschen/agent-skills --skill makefile-anthonyposchen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Make targets that depend on user-provided variables often fail midway through execution with cryptic shell errors, or worse, run destructive commands with empty values. This Skill ensures every required Make variable is checked upfront with a clear, human-readable error message before any command runs. ## Core Features & Use Cases - Required Variable Guards: Adds a reusable check_defined helper that fails the target immediately with a descriptive error when a required variable is missing. - Shared Guard Macros: Groups common variable checks (e.g., Git credentials for FluxCD setup) into narrow reusable macros without forcing unrelated targets to declare unused inputs. - Security-Conscious Rules: Validates secret variables like tokens without ever echoing their values, and avoids variable names that shadow environment variables like PATH or HOME. - Use Case: When writing a Makefile target that bootstraps a Kubernetes cluster with FluxCD, the skill ensures GIT_USERNAME, GIT_TOKEN, GIT_BRANCH, and KUSTOMIZATION_PATH are all validated with clear descriptions before any flux command executes. ## Quick Start Ask the AI to review your Makefile and add required variable validation with descriptive error messages to every target that accepts user input.

Frequently Asked Questions about makefile

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate required variables in a Makefile?▼

Use a check_defined helper macro that calls Make's $(error) function when a variable is undefined. Invoke it at the start of each target with a description of what the variable is for, so the build fails before any command runs.

How to make a Makefile target fail with a custom error message?▼

Define a check_defined macro using $(if $(value $1),,$(error Undefined $1 ...)) and call it inside the target recipe. The error message can include the target name and a description of what value the user must provide.

Should I use $(VAR) or ${VAR} in Makefiles?▼

Prefer $(VAR) in Make recipes for consistency with Make's own syntax. Use ${VAR} only when the shell command specifically needs shell-style expansion after Make has finished its own variable expansion.

How do I handle secret variables like tokens in Makefiles?▼

Validate that secret variables such as GIT_TOKEN are defined using check_defined, but never echo or print their values in recipes. Pass them quoted into commands, like --password="$(GIT_TOKEN)", so they are used without being exposed.

Why does my Make variable conflict with environment variables?▼

Make imports environment variables, so names like PATH, HOME, SHELL, or USER get shadowed or overridden unexpectedly. Use explicit names like KUSTOMIZATION_PATH or CONFIG_PATH instead of generic ones to avoid collisions.