| name | makefile-script-developer |
| version | 1.0.0 |
| description | Write production-ready GNU Makefiles with strict shell mode (`SHELL := /bin/bash` +
`.SHELLFLAGS := -euo pipefail -c`), validated multi-environment configuration via
`$(filter ...)`, pre-flight check targets (`check-tools`, `check-env`), structured
logging with timestamps, confirmation gates for destructive ops, layered `.env`
includes, platform detection, and self-documenting help. Use this skill whenever the
user asks to write a Makefile, harden an existing one, add a target, build a
deploy/release pipeline, automate Terraform/Helm/Kubernetes/Docker/build workflows, or
expose tasks as `make <target>` — including casual phrasings like "write a Makefile",
"add a make target", "automate this in make", "give me a build pipeline", or "clean up
the Makefile". Also use when reviewing an existing Makefile for safety, error handling,
or organization issues.
|
| license | MIT |
| compatibility | claude-code opencode |
| allowed-tools | ["Read","Write","Edit","Grep","Glob","Bash"] |
| metadata | {"author":"MKAbuMattar","requirements":"GNU Make 3.81+ on Linux, macOS, or Windows (WSL/MSYS2/Git Bash). Generated Makefiles target the same range and assume `bash` is available — always set `SHELL := /bin/bash` so recipes get `pipefail`, `[[ ]]`, and arrays."} |
Makefile Script Developer
Production-ready GNU Makefiles. Strict shell + validated env + logging + safety gates.
When to use
- The user asks to write, scaffold, or harden a
Makefile.
- The user wants to add or refactor a
make target / workflow / build pipeline.
- The user wants to automate Terraform / Helm / kubectl / Docker / build / release through
make.
- The user wants a self-documenting
help target or wants to clean one up.
- A task chain ends in "and put it in a Makefile so I can run
make deploy ...".
Required structure
Every Makefile you write starts from this skeleton. Do not omit SHELL := /bin/bash, the .SHELLFLAGS line, or .DEFAULT_GOAL := help. Recipes are TAB-indented, not spaces.
SHELL := /bin/bash
.SHELLFLAGS := -euo pipefail -c
.DEFAULT_GOAL := help
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables --no-print-directory
ALLOWED_ENVS := dev staging prod
ENV ?= dev
ifeq (,$(filter $(ENV),$(ALLOWED_ENVS)))
$(error ENV must be one of: $(ALLOWED_ENVS))
endif
TIMESTAMP := $(shell date +"%Y-%m-%d_%H-%M-%S")
LOG_DIR := logs/$(ENV)
.PHONY: check-tools
check-tools:
@command -v terraform >/dev/null 2>&1 || { echo "terraform not installed"; exit 1; }
@echo "Tools verified"
.PHONY: help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?
awk 'BEGIN {FS = }; {printf , $$1, $$2}'