makefile
Skill2 starsChanged 3 months agoMITView on GitHub
Use when creating, reviewing, or editing Makefiles, make targets, make recipes, task runners, or documentation that tells users to run make commands. Always use this skill when a make target accepts user-provided variables such as tokens, usernames, branch names, paths, namespaces, environments, or other inputs. Ensures required Make variables are validated with clear error descriptions before commands run.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- dallay/agents-skillstheir own version, first seen Aug 13, 2026
- aptitude-stack/registerytheir own version, first seen Apr 1, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- dallay/agents-skills★ 2same name
- aptitude-stack/registery★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- act-within-scopeSkill
- asd-ste100Skill
- codingSkill
- context-managementSkill
- create-verification-skillSkill
- dockerfileSkill
- domain-modelingSkill
- encode-lessonsSkill
- experience-firstSkill
- eyes-onSkill
- flux-ghcr-image-automationSkill
- flux-kustomize-layoutSkill
- frontend-designSkill
- git-commit-workflowSkill
- git-worktreeSkill
- grill-with-docsSkill
- implement-ticketsSkill
- maintain-verification-skillSkill
- omarchy-developmentSkill
- releaseSkill
- skill-evaluationSkill
- technical-writingSkill
- test-auditSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Write Makefiles that fail before doing work when required user input is missing.
- Distinctive: line 22
When adding a target that reads user input from Make variables, include this helper once near the top of the Makefile if an equivalent …
- Distinctive: line 37
Use the helper at the start of each target that requires input:
- Distinctive: line 56
Keep validation inside the target that needs the variable unless several targets share the exact same required inputs.
- Very specific: line 58
Prefer explicit variable names that do not shadow common environment variables.
- Distinctive: line 61
Do not check optional variables.
- Very specific: line 63
Use $(VAR) in Make recipes.
- Very specific: line 67
Keep .PHONY declarations for command targets.
- Very specific: line 68
Do not print secrets. It is fine to validate that GIT_TOKEN or another secret variable is present, but do not echo the value.
- Distinctive: line 73
If multiple targets require the same group of variables, extract a small guard macro with the same descriptive checks:
- Distinctive: line 89
Keep shared guard macros narrow.
- Very specific: line 94
Every required input variable has a check_defined call before use.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Makefile
Goal
Write Makefiles that fail before doing work when required user input is missing. A target that needs a user-provided variable must explain what the variable is for in the Make error, close to the target that needs it.
Required Variable Guard
When adding a target that reads user input from Make variables, include this helper once near the top of the Makefile if an equivalent helper is not already present:
# https://stackoverflow.com/a/10858332
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))$(if $(value @), \
required by target `$@`)))Use the helper at the start of each target that requires input:
.PHONY: init_cluster
init_cluster:
@:$(call check_defined, GIT_USERNAME, username used for Git operations)
@:$(call check_defined, GIT_TOKEN, access token with required repository permissions)
@:$(call check_defined, GIT_BRANCH, Git branch to reconcile)
@:$(call check_defined, KUSTOMIZATION_PATH, path from repo root to the kustomization)
flux create source git k8s --url=https://github.com/AnthonyPoschen/k8s.git --username="$(GIT_USERNAME)" --password="$(GIT_TOKEN)" --branch="$(GIT_BRANCH)" -n flux-system
flux create kustomization k8s --source=k8s -n flux-system --path="$(KUSTOMIZATION_PATH)" --interval=1mRules
- Validate every required user-provided Make variable before the first command that uses it.
- Give each
check_definedcall a short, concrete description of what the variable is for, not just "required". - Keep validation inside the target that needs the variable unless several targets share the exact same required inputs.
- Prefer explicit variable names that do not shadow common environment
variables. For example, use
KUSTOMIZATION_PATH,CONFIG_PATH, orMANIFEST_PATHinstead ofPATH. - Do not check optional variables. Document their defaults near the assignment or in the target help text.
- Use
$(VAR)in Make recipes. Avoid${VAR}unless the command specifically needs shell-style expansion after Make runs. - Quote variable expansions in shell commands when values may contain special
characters or spaces:
"$(VAR)". - Keep
.PHONYdeclarations for command targets. - Do not print secrets. It is fine to validate that
GIT_TOKENor another secret variable is present, but do not echo the value.
Shared Guards
If multiple targets require the same group of variables, extract a small guard macro with the same descriptive checks:
check_flux_git_inputs = \
$(call check_defined, GIT_USERNAME, username used for Git operations) \
$(call check_defined, GIT_TOKEN, access token with required repository permissions) \
$(call check_defined, GIT_BRANCH, Git branch to reconcile)
.PHONY: init_cluster
init_cluster:
@:$(call check_flux_git_inputs)
@:$(call check_defined, KUSTOMIZATION_PATH, path from repo root to the kustomization)
flux create source git k8s --url="$(GIT_REPO_URL)" --username="$(GIT_USERNAME)" --password="$(GIT_TOKEN)" --branch="$(GIT_BRANCH)" -n flux-systemKeep shared guard macros narrow. Do not force unrelated targets to provide variables they do not use.
Review Checklist
- Every required input variable has a
check_definedcall before use. - Each error description tells the user what value to provide and why.
- Secret variables are validated but never echoed.
- Target names are declared
.PHONY. - Variable names avoid collisions with important shell environment variables
such as
PATH,HOME,SHELL, andUSER. - Commands are not run through unnecessary semicolon chains; each recipe line is readable and fails clearly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

