Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\\n'\n else\n break\n fi\n done \u003c \"$makefile\"\n\n # Get the rest of the file\n content=$(tail -n +$(($(echo -n \"$header\" | grep -c

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\\n') + 1)) \"$makefile\" 2>/dev/null || cat \"$makefile\")\n\n # Reconstruct file\n {\n echo -n \"$header\"\n echo \"# ============================================\"\n echo \"# Added by add_standard_targets.sh\"\n echo \"# ============================================\"\n echo \"$vars_to_add\"\n echo \"$content\"\n } > \"${makefile}.tmp\"\n mv \"${makefile}.tmp\" \"$makefile\"\n\n print_info \"Added missing variable definitions\"\n fi\n}\n\n# Main function\nmain() {\n local dry_run=0\n local makefile_path=\"Makefile\"\n local explicit_file=0\n local explicit_targets=0\n local -a targets=()\n local -a positional=()\n\n # Parse options and positional args.\n while [[ $# -gt 0 ]]; do\n case \"$1\" in\n -h|--help)\n usage\n exit 0\n ;;\n -l|--list)\n list_targets\n exit 0\n ;;\n -n|--dry-run)\n dry_run=1\n shift\n ;;\n --file)\n if [[ $# -lt 2 ]]; then\n print_error \"--file requires a path argument\"\n exit 1\n fi\n makefile_path=\"$2\"\n explicit_file=1\n shift 2\n ;;\n --targets)\n explicit_targets=1\n shift\n while [[ $# -gt 0 ]]; do\n case \"$1\" in\n --|--file|--targets|-h|--help|-l|--list|-n|--dry-run)\n break\n ;;\n -*)\n print_error \"Unknown option: $1\"\n usage\n exit 1\n ;;\n *)\n targets+=(\"$1\")\n shift\n ;;\n esac\n done\n ;;\n --)\n shift\n while [[ $# -gt 0 ]]; do\n positional+=(\"$1\")\n shift\n done\n ;;\n -*)\n print_error \"Unknown option: $1\"\n usage\n exit 1\n ;;\n *)\n positional+=(\"$1\")\n shift\n ;;\n esac\n done\n\n # Resolve positional args with backward compatibility for unambiguous usage.\n if [[ ${#positional[@]} -gt 0 ]]; then\n if [[ $explicit_targets -eq 1 ]]; then\n if [[ $explicit_file -eq 1 ]]; then\n print_error \"Unexpected positional args with --file and --targets\"\n print_error \"Use: ${SCRIPT_NAME} --file \u003cpath> --targets \u003ctarget...>\"\n exit 1\n fi\n if [[ ${#positional[@]} -gt 1 ]]; then\n print_error \"Too many positional args with --targets\"\n print_error \"Use: ${SCRIPT_NAME} [--file \u003cpath>] --targets \u003ctarget...>\"\n exit 1\n fi\n makefile_path=\"${positional[0]}\"\n explicit_file=1\n elif [[ $explicit_file -eq 1 ]]; then\n targets+=(\"${positional[@]}\")\n else\n if is_known_target \"${positional[0]}\"; then\n if [[ -e \"${positional[0]}\" ]]; then\n print_error \"Ambiguous input '${positional[0]}': matches a target and existing path.\"\n print_error \"Use --file \u003cpath> or --targets \u003ctarget...> explicitly.\"\n exit 2\n fi\n targets=(\"${positional[@]}\")\n else\n makefile_path=\"${positional[0]}\"\n if [[ ${#positional[@]} -gt 1 ]]; then\n targets=(\"${positional[@]:1}\")\n fi\n fi\n fi\n fi\n\n if [[ $explicit_targets -eq 1 ]] && [[ ${#targets[@]} -eq 0 ]]; then\n print_error \"--targets requires at least one target name\"\n exit 1\n fi\n\n # Default target set when none explicitly requested\n if [[ ${#targets[@]} -eq 0 ]]; then\n targets=(\"${ALL_TARGETS[@]}\")\n fi\n\n # Validate requested target names before modifying files\n local target\n for target in \"${targets[@]}\"; do\n if ! is_known_target \"$target\"; then\n print_error \"Unknown target: $target\"\n echo \"\"\n list_targets\n exit 1\n fi\n done\n\n # Check if Makefile exists\n if [[ ! -f \"$makefile_path\" ]]; then\n print_error \"Makefile not found: $makefile_path\"\n exit 1\n fi\n\n print_info \"Processing: $makefile_path\"\n echo \"\"\n\n # Track what we'll add\n local targets_added=0\n local targets_skipped=0\n local content_to_add=\"\"\n local -a added_targets=()\n\n # Check each target\n for target in \"${targets[@]}\"; do\n if target_exists \"$target\" \"$makefile_path\"; then\n print_skipped \"$target\"\n targets_skipped=$((targets_skipped + 1))\n continue\n fi\n\n if [[ $dry_run -eq 1 ]]; then\n echo -e \"${GREEN}+${NC} Would add: ${BLUE}$target${NC}\"\n else\n content_to_add+=\"$(generate_target \"$target\")\"\n added_targets+=(\"$target\")\n fi\n targets_added=$((targets_added + 1))\n done\n\n echo \"\"\n\n # Apply changes if not dry run\n if [[ $dry_run -eq 0 ]] && [[ $targets_added -gt 0 ]]; then\n # Add missing variables first\n add_missing_variables \"$makefile_path\"\n\n # Append targets to Makefile\n echo \"$content_to_add\" >> \"$makefile_path\"\n\n # Report results\n for target in \"${added_targets[@]}\"; do\n print_added \"$target\"\n done\n\n print_success \"Added $targets_added target(s) to $makefile_path\"\n elif [[ $dry_run -eq 1 ]]; then\n print_info \"Dry run - no changes made\"\n echo \"Would add $targets_added target(s), skip $targets_skipped existing target(s)\"\n else\n print_info \"No targets to add (all requested targets already exist)\"\n fi\n\n # Summary\n echo \"\"\n echo \"Summary:\"\n echo \" Targets added: $targets_added\"\n echo \" Targets skipped: $targets_skipped\"\n\n if [[ $targets_added -gt 0 ]] && [[ $dry_run -eq 0 ]]; then\n echo \"\"\n print_info \"Run 'make help' to see available targets\"\n print_info \"Run 'make -n \u003ctarget>' to preview what a target does\"\n fi\n}\n\n# Run main function\nmain \"$@\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":14273,"content_sha256":"15a03d4651bc37947c375520fb58c5658bd5d6e5386bb58e227f4f96e8ee0ba9"},{"filename":"scripts/generate_makefile_template.sh","content":"#!/usr/bin/env bash\n#\n# generate_makefile_template.sh\n# Description: Generate Makefile templates for different project types\n# Usage: bash generate_makefile_template.sh [OPTIONS] [PROJECT_TYPE] [PROJECT_NAME] [OUTPUT_FILE]\n#\n\nset -euo pipefail\n\n# Script metadata\nreadonly SCRIPT_NAME=\"$(basename \"${BASH_SOURCE[0]}\")\"\nreadonly SCRIPT_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\n\n# Default values\nFORCE=0\nPROJECT_TYPE=\"\"\nPROJECT_NAME=\"myproject\"\nOUTPUT_FILE=\"Makefile\"\n\n# Colors for output\nif [[ -t 1 ]]; then\n readonly RED='\\033[0;31m'\n readonly GREEN='\\033[0;32m'\n readonly YELLOW='\\033[1;33m'\n readonly NC='\\033[0m' # No Color\nelse\n readonly RED=''\n readonly GREEN=''\n readonly YELLOW=''\n readonly NC=''\nfi\n\n# Print functions\nprint_error() {\n echo -e \"${RED}ERROR:${NC} $*\" >&2\n}\n\nprint_success() {\n echo -e \"${GREEN}SUCCESS:${NC} $*\"\n}\n\nprint_info() {\n echo -e \"${YELLOW}INFO:${NC} $*\"\n}\n\n# Usage information\nusage() {\n cat \u003c\u003c EOF\nUsage: ${SCRIPT_NAME} [OPTIONS] [PROJECT_TYPE] [PROJECT_NAME] [OUTPUT_FILE]\n\nGenerate Makefile templates for different project types.\n\nOptions:\n -f, --force Overwrite existing files without prompting\n -h, --help Show this help message\n\nArguments:\n PROJECT_TYPE Type of project (required)\n PROJECT_NAME Name of the project (default: myproject)\n OUTPUT_FILE Output file path (default: Makefile)\n\nProject Types:\n c Simple C project\n c-lib C library project\n cpp C++ project\n go Go project\n python Python project\n java Java project\n generic Generic project\n\nExamples:\n ${SCRIPT_NAME} c myapp\n ${SCRIPT_NAME} go server Makefile\n ${SCRIPT_NAME} python mypackage build.mk\n ${SCRIPT_NAME} -f c myapp Makefile # Force overwrite\n\nEOF\n}\n\n# Parse command line options\nparse_args() {\n local -a positional=()\n\n while [[ $# -gt 0 ]]; do\n case \"$1\" in\n -f|--force)\n FORCE=1\n shift\n ;;\n -h|--help)\n usage\n exit 0\n ;;\n -*)\n print_error \"Unknown option: $1\"\n usage\n exit 1\n ;;\n *)\n positional+=(\"$1\")\n shift\n ;;\n esac\n done\n\n if [[ ${#positional[@]} -gt 3 ]]; then\n print_error \"Too many positional arguments. Expected: [PROJECT_TYPE] [PROJECT_NAME] [OUTPUT_FILE]\"\n usage\n exit 1\n fi\n\n if [[ ${#positional[@]} -ge 1 ]]; then\n PROJECT_TYPE=\"${positional[0]}\"\n fi\n if [[ ${#positional[@]} -ge 2 ]]; then\n PROJECT_NAME=\"${positional[1]}\"\n fi\n if [[ ${#positional[@]} -ge 3 ]]; then\n OUTPUT_FILE=\"${positional[2]}\"\n fi\n}\n\n# Escape replacement text for sed \"s///\" usage.\nescape_sed_replacement() {\n printf '%s' \"$1\" | sed -e 's/[\\\\/&]/\\\\&/g'\n}\n\n# Render a template from stdin and replace PROJECT_NAME safely.\nrender_template_with_project() {\n local project=\"$1\"\n local escaped_project\n escaped_project=\"$(escape_sed_replacement \"$project\")\"\n sed \"s/PROJECT_NAME/${escaped_project}/g\"\n}\n\n# Generate C project Makefile\ngenerate_c_makefile() {\n local project=\"$1\"\n render_template_with_project \"$project\" \u003c\u003c 'EOF'\n# Makefile for C project\nSHELL := bash\n.ONESHELL:\n.SHELLFLAGS := -eu -o pipefail -c\n.DELETE_ON_ERROR:\n.SUFFIXES:\nMAKEFLAGS += --warn-undefined-variables\nMAKEFLAGS += --no-builtin-rules\n\nPROJECT := PROJECT_NAME\nVERSION := 1.0.0\n\nCC ?= gcc\nCFLAGS ?= -Wall -Wextra -O2\nPREFIX ?= /usr/local\n\nSRCDIR := src\nBUILDDIR := build\nOBJDIR := $(BUILDDIR)/obj\n\nSOURCES := $(wildcard $(SRCDIR)/*.c)\nOBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)\nDEPENDS := $(OBJECTS:.o=.d)\nTARGET := $(BUILDDIR)/$(PROJECT)\n\n.PHONY: all clean install test help\n\n## Build the application (default)\nall: $(TARGET)\n\n$(TARGET): $(OBJECTS)\n\t@mkdir -p $(@D)\n\t$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@\n\n$(OBJDIR)/%.o: $(SRCDIR)/%.c\n\t@mkdir -p $(@D)\n\t$(CC) $(CPPFLAGS) $(CFLAGS) -MMD -MP -c $\u003c -o $@\n\n-include $(DEPENDS)\n\n## Install to PREFIX\ninstall: $(TARGET)\n\tinstall -d $(DESTDIR)$(PREFIX)/bin\n\tinstall -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(PROJECT)\n\n## Run tests\ntest: $(TARGET)\n\t@echo \"Running tests...\"\n\t@$(TARGET) --test\n\n## Remove build artifacts\nclean:\n\t$(RM) -r $(BUILDDIR)\n\n## Show help\nhelp:\n\t@echo \"$(PROJECT) v$(VERSION)\"\n\t@echo \"\"\n\t@sed -n 's/^## //p' $(MAKEFILE_LIST)\nEOF\n}\n\n# Generate C++ project Makefile\ngenerate_cpp_makefile() {\n local project=\"$1\"\n render_template_with_project \"$project\" \u003c\u003c 'EOF'\n# Makefile for C++ project\nSHELL := bash\n.ONESHELL:\n.SHELLFLAGS := -eu -o pipefail -c\n.DELETE_ON_ERROR:\n.SUFFIXES:\nMAKEFLAGS += --warn-undefined-variables\nMAKEFLAGS += --no-builtin-rules\n\nPROJECT := PROJECT_NAME\nVERSION := 1.0.0\n\nCXX ?= g++\nCXXFLAGS ?= -Wall -Wextra -std=c++17 -O2\nPREFIX ?= /usr/local\n\nSRCDIR := src\nBUILDDIR := build\nOBJDIR := $(BUILDDIR)/obj\n\nSOURCES := $(wildcard $(SRCDIR)/*.cpp)\nOBJECTS := $(SOURCES:$(SRCDIR)/%.cpp=$(OBJDIR)/%.o)\nDEPENDS := $(OBJECTS:.o=.d)\nTARGET := $(BUILDDIR)/$(PROJECT)\n\n.PHONY: all clean install test help\n\n## Build the application (default)\nall: $(TARGET)\n\n$(TARGET): $(OBJECTS)\n\t@mkdir -p $(@D)\n\t$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@\n\n$(OBJDIR)/%.o: $(SRCDIR)/%.cpp\n\t@mkdir -p $(@D)\n\t$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MP -c $\u003c -o $@\n\n-include $(DEPENDS)\n\n## Install to PREFIX\ninstall: $(TARGET)\n\tinstall -d $(DESTDIR)$(PREFIX)/bin\n\tinstall -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(PROJECT)\n\n## Run tests\ntest: $(TARGET)\n\t@echo \"Running tests...\"\n\t@$(TARGET) --test\n\n## Remove build artifacts\nclean:\n\t$(RM) -r $(BUILDDIR)\n\n## Show help\nhelp:\n\t@echo \"$(PROJECT) v$(VERSION)\"\n\t@echo \"\"\n\t@sed -n 's/^## //p' $(MAKEFILE_LIST)\nEOF\n}\n\n# Generate C library Makefile\ngenerate_c_lib_makefile() {\n local project=\"$1\"\n render_template_with_project \"$project\" \u003c\u003c 'EOF'\n# Makefile for C library project\n.DELETE_ON_ERROR:\n\nPROJECT := PROJECT_NAME\nVERSION := 1.0.0\n\nCC ?= gcc\nAR ?= ar\nRANLIB ?= ranlib\nCFLAGS ?= -Wall -Wextra -O2 -fPIC\nPREFIX ?= /usr/local\n\nSRCDIR := src\nBUILDDIR := build\nOBJDIR := $(BUILDDIR)/obj\n\nSOURCES := $(wildcard $(SRCDIR)/*.c)\nOBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)\nHEADERS := $(wildcard $(SRCDIR)/*.h)\n\nSTATIC_LIB := $(BUILDDIR)/lib$(PROJECT).a\nSHARED_LIB := $(BUILDDIR)/lib$(PROJECT).so.$(VERSION)\n\n.PHONY: all static shared clean install help\n\n## Build both static and shared libraries\nall: static shared\n\n## Build static library\nstatic: $(STATIC_LIB)\n\n## Build shared library\nshared: $(SHARED_LIB)\n\n$(STATIC_LIB): $(OBJECTS)\n\t@mkdir -p $(@D)\n\t$(AR) rcs $@ $^\n\t$(RANLIB) $@\n\n$(SHARED_LIB): $(OBJECTS)\n\t@mkdir -p $(@D)\n\t$(CC) -shared -Wl,-soname,lib$(PROJECT).so.1 $^ -o $@\n\n$(OBJDIR)/%.o: $(SRCDIR)/%.c\n\t@mkdir -p $(@D)\n\t$(CC) $(CPPFLAGS) $(CFLAGS) -c $\u003c -o $@\n\n## Install libraries\ninstall: all\n\tinstall -d $(DESTDIR)$(PREFIX)/lib\n\tinstall -m 644 $(STATIC_LIB) $(DESTDIR)$(PREFIX)/lib/\n\tinstall -m 755 $(SHARED_LIB) $(DESTDIR)$(PREFIX)/lib/\n\tinstall -d $(DESTDIR)$(PREFIX)/include/$(PROJECT)\n\tinstall -m 644 $(HEADERS) $(DESTDIR)$(PREFIX)/include/$(PROJECT)/\n\n## Clean build artifacts\nclean:\n\t$(RM) -r $(BUILDDIR)\n\n## Show help\nhelp:\n\t@sed -n 's/^## //p' $(MAKEFILE_LIST)\nEOF\n}\n\n# Generate Go project Makefile\ngenerate_go_makefile() {\n local project=\"$1\"\n render_template_with_project \"$project\" \u003c\u003c 'EOF'\n# Makefile for Go project\n.PHONY: all build install test clean fmt lint help\n\nPROJECT := PROJECT_NAME\nGO ?= go\nPREFIX ?= /usr/local\nGO_MAIN ?= ./cmd/$(PROJECT)\n\nVERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo \"dev\")\nLDFLAGS := -ldflags \"-X main.version=$(VERSION)\"\n\nSOURCES := $(shell find . -name '*.go' -not -path './vendor/*')\nGO_SUM := $(wildcard go.sum)\nTARGET := $(PROJECT)\n\n## Build the application (default)\nall: build\n\n## Build binary\nbuild: $(TARGET)\n\n$(TARGET): $(SOURCES) go.mod $(GO_SUM)\n\t$(GO) build $(LDFLAGS) -o $@ $(GO_MAIN)\n\n## Install to PREFIX\ninstall: $(TARGET)\n\tinstall -d $(DESTDIR)$(PREFIX)/bin\n\tinstall -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/\n\n## Run tests\ntest:\n\t$(GO) test -v ./...\n\n## Clean build artifacts\nclean:\n\t$(RM) $(TARGET)\n\t$(GO) clean\n\n## Format code\nfmt:\n\t$(GO) fmt ./...\n\n## Run linter\nlint:\n\tgolangci-lint run\n\n## Show help\nhelp:\n\t@echo \"$(PROJECT) - Go Project\"\n\t@echo \"Version: $(VERSION)\"\n\t@echo \"\"\n\t@sed -n 's/^## //p' $(MAKEFILE_LIST)\nEOF\n}\n\n# Generate Python project Makefile\ngenerate_python_makefile() {\n local project=\"$1\"\n render_template_with_project \"$project\" \u003c\u003c 'EOF'\n# Makefile for Python project\n.PHONY: all build install develop test format lint clean help\n\nPROJECT := PROJECT_NAME\nPYTHON ?= python3\nPIP ?= $(PYTHON) -m pip\n\n## Build the package (default)\nall: build\n\n## Build Python package\nbuild:\n\t$(PYTHON) -m build\n\n## Install package\ninstall:\n\t$(PIP) install .\n\n## Install in development mode\ndevelop:\n\t$(PIP) install -e .[dev]\n\n## Run tests\ntest:\n\t$(PYTHON) -m pytest tests/ -v\n\n## Format code\nformat:\n\t$(PYTHON) -m black src/ tests/\n\t$(PYTHON) -m isort src/ tests/\n\n## Run linters\nlint:\n\t$(PYTHON) -m flake8 src/ tests/\n\t$(PYTHON) -m pylint src/\n\n## Clean build artifacts\nclean:\n\t$(RM) -r build/ dist/ *.egg-info/\n\t$(RM) -r .pytest_cache/ .coverage htmlcov/\n\tfind . -type d -name '__pycache__' -exec rm -r {} +\n\n## Show help\nhelp:\n\t@echo \"$(PROJECT) - Python Project\"\n\t@echo \"\"\n\t@sed -n 's/^## //p' $(MAKEFILE_LIST)\nEOF\n}\n\n# Generate Java project Makefile\ngenerate_java_makefile() {\n local project=\"$1\"\n render_template_with_project \"$project\" \u003c\u003c 'EOF'\n# Makefile for Java project\n.DELETE_ON_ERROR:\n\nPROJECT := PROJECT_NAME\nVERSION := 1.0.0\nMAIN_CLASS := Main\n\n# Java tools\nJAVAC ?= javac\nJAVA ?= java\nJAR ?= jar\n\n# Compiler flags\nJAVAC_FLAGS ?= -Xlint:all -encoding UTF-8\nJAR_FLAGS := cvf\n\n# Directories\nSRCDIR := src\nBUILDDIR := build\nCLASSDIR := $(BUILDDIR)/classes\nLIBDIR := lib\nDOCDIR := $(BUILDDIR)/docs\nDISTDIR := dist\n\n# Source and class files\nJAVA_SOURCES := $(shell find $(SRCDIR) -name '*.java')\nJAVA_CLASSES := $(JAVA_SOURCES:$(SRCDIR)/%.java=$(CLASSDIR)/%.class)\n\n# Classpath\nCLASSPATH := $(CLASSDIR)\nifneq ($(wildcard $(LIBDIR)/*.jar),)\n CLASSPATH := $(CLASSPATH):$(LIBDIR)/*\nendif\n\n# Output JAR\nTARGET := $(DISTDIR)/$(PROJECT)-$(VERSION).jar\n\n.PHONY: all build compile jar run run-jar test clean distclean docs help\n\n## Build the project (default)\nall: build\n\n## Compile and create JAR\nbuild: jar\n\n## Compile Java sources\ncompile: $(CLASSDIR)/.compiled\n\n$(CLASSDIR)/.compiled: $(JAVA_SOURCES)\n\t@mkdir -p $(CLASSDIR)\n\t$(JAVAC) $(JAVAC_FLAGS) -d $(CLASSDIR) -cp \"$(CLASSPATH)\" $(JAVA_SOURCES)\n\t@touch $@\n\n## Create JAR file\njar: compile\n\t@mkdir -p $(DISTDIR)\n\t@echo \"Manifest-Version: 1.0\" > $(BUILDDIR)/MANIFEST.MF\n\t@echo \"Main-Class: $(MAIN_CLASS)\" >> $(BUILDDIR)/MANIFEST.MF\n\t@echo \"Created-By: Makefile\" >> $(BUILDDIR)/MANIFEST.MF\n\t$(JAR) $(JAR_FLAGS)m $(TARGET) $(BUILDDIR)/MANIFEST.MF -C $(CLASSDIR) .\n\t@echo \"Created: $(TARGET)\"\n\n## Run the application\nrun: compile\n\t$(JAVA) -cp \"$(CLASSPATH)\" $(MAIN_CLASS)\n\n## Run with JAR\nrun-jar: jar\n\t$(JAVA) -jar $(TARGET)\n\n## Run tests (requires JUnit in lib/)\ntest: compile\n\t@echo \"Running tests...\"\n\t@if [ -d \"$(SRCDIR)/test\" ]; then \\\n\t\t$(JAVA) -cp \"$(CLASSPATH):$(LIBDIR)/*\" org.junit.runner.JUnitCore; \\\n\telse \\\n\t\techo \"No test directory found\"; \\\n\tfi\n\n## Generate Javadoc\ndocs:\n\t@mkdir -p $(DOCDIR)\n\tjavadoc -d $(DOCDIR) -sourcepath $(SRCDIR) -subpackages .\n\t@echo \"Documentation generated: $(DOCDIR)/index.html\"\n\n## Remove build artifacts\nclean:\n\t$(RM) -r $(BUILDDIR)\n\t@echo \"Clean complete\"\n\n## Remove all generated files\ndistclean: clean\n\t$(RM) -r $(DISTDIR)\n\t@echo \"Distclean complete\"\n\n## Show available targets\nhelp:\n\t@echo \"$(PROJECT) v$(VERSION) - Java Project\"\n\t@echo \"\"\n\t@echo \"Targets:\"\n\t@sed -n 's/^## //p' $(MAKEFILE_LIST) | column -t -s ':' | sed 's/^/ /'\n\t@echo \"\"\n\t@echo \"Variables:\"\n\t@echo \" JAVAC=$(JAVAC)\"\n\t@echo \" JAVAC_FLAGS=$(JAVAC_FLAGS)\"\n\t@echo \" MAIN_CLASS=$(MAIN_CLASS)\"\n\t@echo \"\"\n\t@echo \"Directory Structure:\"\n\t@echo \" $(SRCDIR)/ - Java source files\"\n\t@echo \" $(LIBDIR)/ - External JAR dependencies\"\n\t@echo \" $(BUILDDIR)/ - Build output\"\n\t@echo \" $(DISTDIR)/ - Distribution JARs\"\n\t@echo \"\"\n\t@echo \"Examples:\"\n\t@echo \" make # Build the project\"\n\t@echo \" make run # Compile and run\"\n\t@echo \" make jar # Create JAR file\"\n\t@echo \" make MAIN_CLASS=MyApp # Set main class\"\nEOF\n}\n\n# Generate generic Makefile\ngenerate_generic_makefile() {\n local project=\"$1\"\n render_template_with_project \"$project\" \u003c\u003c 'EOF'\n# Generic Makefile\n.PHONY: all build clean install test help\n\nPROJECT := PROJECT_NAME\nVERSION := 1.0.0\n\n## Build the project (default)\nall: build\n\n## Build target\nbuild:\n\t@echo \"Building $(PROJECT)...\"\n\t# Add build commands here\n\n## Install target\ninstall: build\n\t@echo \"Installing $(PROJECT)...\"\n\t# Add installation commands here\n\n## Run tests\ntest:\n\t@echo \"Running tests...\"\n\t# Add test commands here\n\n## Clean build artifacts\nclean:\n\t@echo \"Cleaning...\"\n\t# Add cleanup commands here\n\n## Show help\nhelp:\n\t@echo \"$(PROJECT) v$(VERSION)\"\n\t@echo \"\"\n\t@echo \"Available targets:\"\n\t@sed -n 's/^## //p' $(MAKEFILE_LIST)\nEOF\n}\n\n# Main generation logic\ngenerate_makefile() {\n local type=\"$1\"\n local project=\"$2\"\n local output=\"$3\"\n\n # Check if output file exists\n if [[ -f \"${output}\" ]]; then\n if [[ \"${FORCE}\" -eq 1 ]]; then\n print_info \"Overwriting existing file: ${output}\"\n elif [[ -t 0 ]]; then\n # Interactive mode - prompt user\n print_error \"File '${output}' already exists\"\n read -p \"Overwrite? [y/N] \" -n 1 -r\n echo\n if [[ ! $REPLY =~ ^[Yy]$ ]]; then\n print_info \"Aborted\"\n exit 0\n fi\n else\n # Non-interactive mode - fail without --force\n print_error \"File '${output}' already exists. Use -f/--force to overwrite.\"\n exit 1\n fi\n fi\n\n print_info \"Generating ${type} Makefile for project '${project}'...\"\n\n case \"${type}\" in\n c)\n generate_c_makefile \"${project}\" > \"${output}\"\n ;;\n c-lib)\n generate_c_lib_makefile \"${project}\" > \"${output}\"\n ;;\n cpp)\n generate_cpp_makefile \"${project}\" > \"${output}\"\n ;;\n go)\n generate_go_makefile \"${project}\" > \"${output}\"\n ;;\n python)\n generate_python_makefile \"${project}\" > \"${output}\"\n ;;\n java)\n generate_java_makefile \"${project}\" > \"${output}\"\n ;;\n generic)\n generate_generic_makefile \"${project}\" > \"${output}\"\n ;;\n *)\n print_error \"Unknown project type: ${type}\"\n echo \"\"\n usage\n exit 1\n ;;\n esac\n\n print_success \"Makefile generated: ${output}\"\n print_info \"Edit the Makefile to customize for your project\"\n print_info \"Run 'make help' to see available targets\"\n}\n\n# Parse arguments\nparse_args \"$@\"\n\n# Check required argument\nif [[ -z \"${PROJECT_TYPE}\" ]]; then\n usage\n exit 0\nfi\n\n# Main execution\ngenerate_makefile \"${PROJECT_TYPE}\" \"${PROJECT_NAME}\" \"${OUTPUT_FILE}\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":15334,"content_sha256":"f85287a85ab0b152b2d7f8681642d616031896e4e75d45b78970de514a324747"},{"filename":"test/test_helper_scripts.sh","content":"#!/usr/bin/env bash\nset -euo pipefail\n\nSKILL_DIR=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")/..\" && pwd)\"\nADD_TARGETS_SCRIPT=\"$SKILL_DIR/scripts/add_standard_targets.sh\"\nGENERATE_SCRIPT=\"$SKILL_DIR/scripts/generate_makefile_template.sh\"\n\nfail() {\n echo \"FAIL: $1\" >&2\n exit 1\n}\n\nrequire_line() {\n local file=\"$1\"\n local pattern=\"$2\"\n grep -qE \"$pattern\" \"$file\" || fail \"Expected pattern '$pattern' in $file\"\n}\n\nrequire_literal_line() {\n local file=\"$1\"\n local line=\"$2\"\n grep -Fxq \"$line\" \"$file\" || fail \"Expected exact line '$line' in $file\"\n}\n\nTMP_DIR=\"$(mktemp -d)\"\ntrap 'rm -rf \"$TMP_DIR\"' EXIT\n\n# ─── add_standard_targets.sh ──────────────────────────────────────────────────\n\n# Case 1: dry-run mode should not modify the Makefile.\nmkdir -p \"$TMP_DIR/dry_run\"\ncat > \"$TMP_DIR/dry_run/Makefile\" \u003c\u003c'EOF'\nTARGET := demo\n\nall:\n\t@echo \"demo\"\nEOF\n\ncp \"$TMP_DIR/dry_run/Makefile\" \"$TMP_DIR/dry_run/Makefile.before\"\ndry_output=\"$(cd \"$TMP_DIR/dry_run\" && bash \"$ADD_TARGETS_SCRIPT\" -n Makefile clean test)\"\n[[ \"$dry_output\" == *\"Would add\"* ]] || fail \"Dry run output did not report planned additions\"\ncmp -s \"$TMP_DIR/dry_run/Makefile.before\" \"$TMP_DIR/dry_run/Makefile\" \\\n || fail \"Dry run modified Makefile contents\"\n\n# Case 2: explicit-target mode should use ./Makefile when no file path is passed.\nmkdir -p \"$TMP_DIR/explicit_targets\"\ncat > \"$TMP_DIR/explicit_targets/Makefile\" \u003c\u003c'EOF'\nTARGET := demo\n\nall:\n\t@echo \"demo\"\nEOF\n\n(cd \"$TMP_DIR/explicit_targets\" && bash \"$ADD_TARGETS_SCRIPT\" clean test >/dev/null)\nrequire_line \"$TMP_DIR/explicit_targets/Makefile\" '^clean:'\nrequire_line \"$TMP_DIR/explicit_targets/Makefile\" '^test:'\n\n# Case 3: positional parsing with explicit Makefile path should keep the first target.\nmkdir -p \"$TMP_DIR/explicit_path\"\ncat > \"$TMP_DIR/explicit_path/custom.mk\" \u003c\u003c'EOF'\nTARGET := demo\n\nall:\n\t@echo \"demo\"\nEOF\n\nbash \"$ADD_TARGETS_SCRIPT\" \"$TMP_DIR/explicit_path/custom.mk\" clean test >/dev/null\nrequire_line \"$TMP_DIR/explicit_path/custom.mk\" '^clean:'\nrequire_line \"$TMP_DIR/explicit_path/custom.mk\" '^test:'\n\n# Case 4: ambiguous positional input should fail closed when a colliding path exists.\nmkdir -p \"$TMP_DIR/ambiguous_positional\"\ncat > \"$TMP_DIR/ambiguous_positional/Makefile\" \u003c\u003c'EOF'\nTARGET := demo\n\nall:\n\t@echo \"demo\"\nEOF\ntouch \"$TMP_DIR/ambiguous_positional/clean\"\ncp \"$TMP_DIR/ambiguous_positional/Makefile\" \"$TMP_DIR/ambiguous_positional/Makefile.before\"\nif ambiguous_output=\"$(cd \"$TMP_DIR/ambiguous_positional\" && bash \"$ADD_TARGETS_SCRIPT\" clean test 2>&1)\"; then\n fail \"Ambiguous positional input unexpectedly succeeded\"\nfi\n[[ \"$ambiguous_output\" == *\"Ambiguous input\"* ]] || fail \"Expected ambiguity error output\"\ncmp -s \"$TMP_DIR/ambiguous_positional/Makefile.before\" \"$TMP_DIR/ambiguous_positional/Makefile\" \\\n || fail \"Ambiguous parsing path modified Makefile\"\n\n# Case 5: explicit --targets mode should bypass positional ambiguity.\n(cd \"$TMP_DIR/ambiguous_positional\" && bash \"$ADD_TARGETS_SCRIPT\" --targets clean test >/dev/null)\nrequire_line \"$TMP_DIR/ambiguous_positional/Makefile\" '^clean:'\nrequire_line \"$TMP_DIR/ambiguous_positional/Makefile\" '^test:'\n\n# Case 6: explicit --file + --targets mode should update the selected file.\nmkdir -p \"$TMP_DIR/explicit_flags\"\ncat > \"$TMP_DIR/explicit_flags/custom.mk\" \u003c\u003c'EOF'\nTARGET := demo\n\nall:\n\t@echo \"demo\"\nEOF\nbash \"$ADD_TARGETS_SCRIPT\" --file \"$TMP_DIR/explicit_flags/custom.mk\" --targets clean test >/dev/null\nrequire_line \"$TMP_DIR/explicit_flags/custom.mk\" '^clean:'\nrequire_line \"$TMP_DIR/explicit_flags/custom.mk\" '^test:'\n\n# Case 13: idempotency — targets that already exist must not be duplicated.\nmkdir -p \"$TMP_DIR/idempotent\"\nbash \"$GENERATE_SCRIPT\" go myservice \"$TMP_DIR/idempotent/Makefile\" >/dev/null 2>&1\nbash \"$ADD_TARGETS_SCRIPT\" \"$TMP_DIR/idempotent/Makefile\" clean test >/dev/null\nclean_count=\"$(grep -c '^clean:' \"$TMP_DIR/idempotent/Makefile\")\"\ntest_count=\"$(grep -c '^test:' \"$TMP_DIR/idempotent/Makefile\")\"\n[[ \"$clean_count\" -eq 1 ]] || fail \"clean target duplicated ($clean_count occurrences after add on existing Makefile)\"\n[[ \"$test_count\" -eq 1 ]] || fail \"test target duplicated ($test_count occurrences after add on existing Makefile)\"\n\n# Case 14: add_missing_variables must inject required variables without duplicating the header.\nmkdir -p \"$TMP_DIR/add_vars\"\ncat > \"$TMP_DIR/add_vars/Makefile\" \u003c\u003c'EOF'\n# My project header\n# Author: test\n\nCC := gcc\nEOF\nbash \"$ADD_TARGETS_SCRIPT\" \"$TMP_DIR/add_vars/Makefile\" install >/dev/null\nrequire_line \"$TMP_DIR/add_vars/Makefile\" '^PROJECT :='\nrequire_line \"$TMP_DIR/add_vars/Makefile\" '^PREFIX \\?= /usr/local

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/add_vars/Makefile\" '^VERSION :='\nrequire_line \"$TMP_DIR/add_vars/Makefile\" '^install:'\nheader_count=\"$(grep -c '^# My project header

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\"$TMP_DIR/add_vars/Makefile\")\"\n[[ \"$header_count\" -eq 1 ]] || fail \"Header comment duplicated ($header_count occurrences) by add_missing_variables\"\n\n# ─── generate_makefile_template.sh ───────────────────────────────────────────\n\n# Case 6: output-file argument mapping (TYPE NAME OUTPUT) should be deterministic.\nmkdir -p \"$TMP_DIR/template_output\"\n(cd \"$TMP_DIR/template_output\" && bash \"$GENERATE_SCRIPT\" generic myproject out.mk >/dev/null)\n[[ -f \"$TMP_DIR/template_output/out.mk\" ]] || fail \"Output file argument was not honored\"\nrequire_line \"$TMP_DIR/template_output/out.mk\" '^PROJECT := myproject

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\n\n# Case 7: generated Go template should include hardened defaults.\n(cd \"$TMP_DIR/template_output\" && bash \"$GENERATE_SCRIPT\" go service go.mk >/dev/null)\nrequire_line \"$TMP_DIR/template_output/go.mk\" '^\\.PHONY: all build install test clean fmt lint help

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/go.mk\" '^GO_MAIN \\?= \\./cmd/\\$\\(PROJECT\\)

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/go.mk\" '^GO_SUM := \\$\\(wildcard go\\.sum\\)

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/go.mk\" '^\\$\\(TARGET\\): \\$\\(SOURCES\\) go\\.mod \\$\\(GO_SUM\\)

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\n\n# Case 8: C template should use gcc, enable dependency tracking, and include modern header.\nbash \"$GENERATE_SCRIPT\" c myapp \"$TMP_DIR/template_output/c.mk\" >/dev/null 2>&1\nrequire_line \"$TMP_DIR/template_output/c.mk\" '^CC \\?= gcc

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/c.mk\" '^\\.DELETE_ON_ERROR:

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/c.mk\" '^-include \\$\\(DEPENDS\\)

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/c.mk\" '^\\$\\(OBJDIR\\)/%.o: \\$\\(SRCDIR\\)/%.c

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\n\n# Case 9: C library template should declare both static and shared library targets.\nbash \"$GENERATE_SCRIPT\" c-lib mylib \"$TMP_DIR/template_output/c-lib.mk\" >/dev/null 2>&1\nrequire_line \"$TMP_DIR/template_output/c-lib.mk\" '^AR \\?= ar

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/c-lib.mk\" '^STATIC_LIB :='\nrequire_line \"$TMP_DIR/template_output/c-lib.mk\" '^SHARED_LIB :='\nrequire_line \"$TMP_DIR/template_output/c-lib.mk\" '^\\.PHONY: all static shared clean install help

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\n\n# Case 10: C++ template must not corrupt project names that contain \"gcc\".\nbash \"$GENERATE_SCRIPT\" cpp gcc-wrapper \"$TMP_DIR/template_output/cpp.mk\" >/dev/null 2>&1\nrequire_line \"$TMP_DIR/template_output/cpp.mk\" '^PROJECT := gcc-wrapper

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/cpp.mk\" '^CXX \\?= g\\+\\+

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/cpp.mk\" '\\$\\(SRCDIR\\)/%.cpp'\n\n# Case 11: Python template should use python3 and include a develop (editable-install) target.\nbash \"$GENERATE_SCRIPT\" python mypkg \"$TMP_DIR/template_output/python.mk\" >/dev/null 2>&1\nrequire_line \"$TMP_DIR/template_output/python.mk\" '^PYTHON \\?= python3

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/python.mk\" '^develop:'\nrequire_line \"$TMP_DIR/template_output/python.mk\" '\\$\\(PYTHON\\) -m build'\n\n# Case 12: Java template should include JAR creation, correct toolchain variables, and distclean.\nbash \"$GENERATE_SCRIPT\" java myapp \"$TMP_DIR/template_output/java.mk\" >/dev/null 2>&1\nrequire_line \"$TMP_DIR/template_output/java.mk\" '^JAVAC \\?= javac

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/java.mk\" '^MAIN_CLASS := Main

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\nrequire_line \"$TMP_DIR/template_output/java.mk\" '^jar:'\nrequire_line \"$TMP_DIR/template_output/java.mk\" '^distclean: clean

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…

\n\n# Case 15: slash in project names should render literally in template output.\nbash \"$GENERATE_SCRIPT\" generic 'svc/api' \"$TMP_DIR/template_output/special-slash.mk\" >/dev/null 2>&1\nrequire_literal_line \"$TMP_DIR/template_output/special-slash.mk\" 'PROJECT := svc/api'\n\n# Case 16: ampersand in project names should render literally in template output.\nbash \"$GENERATE_SCRIPT\" generic 'x&y' \"$TMP_DIR/template_output/special-amp.mk\" >/dev/null 2>&1\nrequire_literal_line \"$TMP_DIR/template_output/special-amp.mk\" 'PROJECT := x&y'\n\n# Case 17: backslash in project names should render literally in template output.\nbash \"$GENERATE_SCRIPT\" generic 'a\\b' \"$TMP_DIR/template_output/special-backslash.mk\" >/dev/null 2>&1\nrequire_literal_line \"$TMP_DIR/template_output/special-backslash.mk\" 'PROJECT := a\\b'\n\necho \"PASS: makefile-generator helper script regression tests\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":9102,"content_sha256":"238e329e79e7fd484a9d3e8340f71f5ae20343376d85ac69bfdc0e6e64674355"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Makefile Generator","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Overview","type":"text"}]},{"type":"paragraph","content":[{"text":"Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to Use","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Creating new Makefiles from scratch","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Setting up build systems for projects (C/C++, Python, Go, Java)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Implementing build automation and CI/CD integration","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Converting manual build processes to Makefiles","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The user asks to \"create\", \"generate\", or \"write\" a Makefile","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Do NOT use for:","type":"text","marks":[{"type":"strong"}]},{"text":" Validating existing Makefiles (use devops-skills:makefile-validator), debugging (use ","type":"text"},{"text":"make -d","type":"text","marks":[{"type":"code_inline"}]},{"text":"), or running builds.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Trigger Phrases","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this skill when prompts look like:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"Generate a Makefile for a Go service\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"Create a production Makefile with install/test/help targets\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"Write a Makefile for a C project with dependency tracking\"","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"\"Add standard GNU targets to this existing Makefile\"","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Generation Workflow","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Stage 1: Gather Requirements","type":"text"}]},{"type":"paragraph","content":[{"text":"Collect information for the following categories. ","type":"text"},{"text":"Use AskUserQuestion when information is missing or ambiguous:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Category","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Information Needed","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Project","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Language (C/C++/Python/Go/Java), structure (single/multi-directory)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Build","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Source files, output artifacts, dependencies, build order","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Install","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PREFIX location, directories (bin/lib/share), files to install","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Targets","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"all, install, clean, test, dist, help (which are needed?)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Config","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Compiler, flags, pkg-config dependencies, cross-compilation","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"When to Use AskUserQuestion (MUST ask if any apply):","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Condition","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Example Question","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Language not specified","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"What programming language is this project? (C/C++/Go/Python/Java)\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Project structure unclear","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Is this a single-directory or multi-directory project?\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Docker requested but registry unknown","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Which container registry should be used? (docker.io/ghcr.io/custom)\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Multiple binaries possible","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Should this build a single binary or multiple executables?\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Install targets needed but paths unclear","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Where should binaries be installed? (default: /usr/local/bin)\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cross-compilation mentioned","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"What is the target platform/architecture?\"","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"When to Skip AskUserQuestion (proceed with defaults):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"User explicitly provides all required information","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Standard project type with obvious defaults (e.g., \"Go project with Docker\" → use standard Go+Docker patterns)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"User says \"use defaults\" or \"standard setup\"","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Default Assumptions (when not asking):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Single-directory project structure","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"PREFIX=/usr/local","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Standard targets: all, build, test, clean, install, help","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"No cross-compilation","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Stage 2: Documentation Lookup","type":"text"}]},{"type":"paragraph","content":[{"text":"When REQUIRED (MUST perform lookup):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"User requests integration with unfamiliar tools, frameworks, or build systems","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Complex build patterns not covered in Stage 3 examples (e.g., Bazel, Meson, custom toolchains)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Docker/container integration","type":"text","marks":[{"type":"strong"}]},{"text":" (Dockerfile builds, multi-stage, registry push)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"CI/CD platform-specific integration (GitHub Actions, GitLab CI, Jenkins)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cross-compilation for unusual targets or embedded systems","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Package manager integration (Conan, vcpkg, Homebrew formulas)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Multi-binary or multi-library projects","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Version embedding via ldflags or build-time variables","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"paragraph","content":[{"text":"When OPTIONAL (may skip external lookup):","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Standard language patterns already covered in Stage 3 (C/C++, Go, Python, Java)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Simple single-binary projects with no external dependencies","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"User provides complete requirements with no ambiguity","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Internal docs already cover the required pattern comprehensively","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Lookup Process (follow in order):","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ALWAYS consult internal docs first using explicit file-open commands","type":"text","marks":[{"type":"strong"}]},{"text":" (primary source of truth):","type":"text"}]},{"type":"paragraph","content":[{"text":"Full doc path map (prefer full paths for deterministic access):","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Doc","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Full Path","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Structure guide","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"devops-skills-plugin/skills/makefile-generator/docs/makefile-structure.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Variables guide","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"devops-skills-plugin/skills/makefile-generator/docs/variables-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Targets guide","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"devops-skills-plugin/skills/makefile-generator/docs/targets-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Patterns guide","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Optimization guide","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"devops-skills-plugin/skills/makefile-generator/docs/optimization-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security guide","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"devops-skills-plugin/skills/makefile-generator/docs/security-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Requirement","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Read This Doc","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Docker/container targets","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".../docs/patterns-guide.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (Pattern 8: Docker Integration)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Multi-binary projects","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".../docs/patterns-guide.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (Pattern 7: Multi-Binary Project)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Go projects with version embedding","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".../docs/patterns-guide.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" (Pattern 5: Go Project)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Parallel builds, caching, ccache","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".../docs/optimization-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Credentials, secrets, API keys","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".../docs/security-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Complex dependencies, pattern rules","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".../docs/patterns-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Order-only prerequisites","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".../docs/optimization-guide.md","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":".../docs/targets-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Variables, assignment operators","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":".../docs/variables-guide.md","type":"text","marks":[{"type":"code_inline"}]}]}]}]}]},{"type":"paragraph","content":[{"text":"Deterministic open/read commands:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# From repository root:\nsed -n '1,220p' devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md\nrg -n \"Pattern 5|Pattern 8\" devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md\n\n# From skill directory:\nsed -n '1,220p' docs/security-guide.md","type":"text"}]},{"type":"paragraph","content":[{"text":"If shell commands are unavailable, use the environment's file-open/read capability on the same paths.","type":"text"}]},{"type":"paragraph","content":[{"text":"Required Workflow Example (Docker + Go with version embedding):","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Step 1: Read Go pattern\nrg -n \"Pattern 5\" devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md\n\n# Step 2: Read Docker pattern\nrg -n \"Pattern 8\" devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md\n\n# Step 3: Read security guidance\nsed -n '1,220p' devops-skills-plugin/skills/makefile-generator/docs/security-guide.md","type":"text"}]},{"type":"paragraph","content":[{"text":"Then generate Makefile and list consulted docs in a header comment.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Try context7 for external tool documentation","type":"text","marks":[{"type":"strong"}]},{"text":" (when internal docs don't cover a specific tool):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"# Only needed for tools/frameworks NOT covered in internal docs\nmcp__context7__resolve-library-id: \"\u003ctool-name>\"\nmcp__context7__query-docs: query=\"\u003cintegration-topic>\"\n\n# Example queries:\n# - For Docker: query=\"dockerfile best practices\"\n# - For Go: query=\"go build ldflags\"\n# - For specific tools: query=\"\u003ctool> makefile integration\"","type":"text"}]},{"type":"paragraph","content":[{"text":"Fallback:","type":"text","marks":[{"type":"strong"}]},{"text":" If context7 is unavailable or returns nothing useful, record that and continue to Step 3.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Fallback to WebSearch","type":"text","marks":[{"type":"strong"}]},{"text":" (only if pattern not found in internal docs OR context7):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"\"\u003cspecific-feature>\" makefile best practices 2025\nExample: \"docker makefile best practices 2025\"\nExample: \"go ldflags version makefile 2025\"","type":"text"}]},{"type":"paragraph","content":[{"text":"Trigger WebSearch when:","type":"text","marks":[{"type":"strong"}]},{"text":" Internal docs don't cover the specific integration AND context7 returns no relevant results.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Note:","type":"text","marks":[{"type":"strong"}]},{"text":" Document which internal docs you consulted in your response (add comment in generated Makefile header).","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Stage 3: Generate Makefile","type":"text"}]},{"type":"paragraph","content":[{"text":"Optional helper-script fast path (for standard layouts):","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Generate template: TYPE NAME OUTPUT\nbash scripts/generate_makefile_template.sh go myservice Makefile\n\n# Add only selected standard targets\nbash scripts/add_standard_targets.sh Makefile install clean help","type":"text"}]},{"type":"paragraph","content":[{"text":"Use manual authoring when requirements are complex (Docker release flow, multi-binary matrices, custom toolchains).","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Header (choose one style)","type":"text"}]},{"type":"paragraph","content":[{"text":"Traditional (POSIX-compatible):","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":".DELETE_ON_ERROR:\n.SUFFIXES:","type":"text"}]},{"type":"paragraph","content":[{"text":"Modern (GNU Make 4.0+, recommended):","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"SHELL := bash\n.ONESHELL:\n.SHELLFLAGS := -eu -o pipefail -c\n.DELETE_ON_ERROR:\n.SUFFIXES:\nMAKEFLAGS += --warn-undefined-variables\nMAKEFLAGS += --no-builtin-rules","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Standard Variables","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"# User-overridable (use ?=)\nCC ?= gcc\nCFLAGS ?= -Wall -Wextra -O2\nPREFIX ?= /usr/local\nDESTDIR ?=\n\n# GNU installation directories\nBINDIR ?= $(PREFIX)/bin\nLIBDIR ?= $(PREFIX)/lib\nINCLUDEDIR ?= $(PREFIX)/include\n\n# Project-specific (use :=)\nPROJECT := myproject\nVERSION := 1.0.0\nSRCDIR := src\nBUILDDIR := build\nSOURCES := $(wildcard $(SRCDIR)/*.c)\nOBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(BUILDDIR)/%.o)","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Language-Specific Build Rules","type":"text"}]},{"type":"paragraph","content":[{"text":"C/C++:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"$(TARGET): $(OBJECTS)\n\t$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@\n\n$(BUILDDIR)/%.o: $(SRCDIR)/%.c\n\t@mkdir -p $(@D)\n\t$(CC) $(CPPFLAGS) $(CFLAGS) -MMD -MP -c $\u003c -o $@\n\n-include $(OBJECTS:.o=.d)","type":"text"}]},{"type":"paragraph","content":[{"text":"Go:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"$(TARGET): $(shell find . -name '*.go') go.mod\n\tgo build -o $@ ./cmd/$(PROJECT)","type":"text"}]},{"type":"paragraph","content":[{"text":"Python:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":".PHONY: build\nbuild:\n\tpython -m build\n\n.PHONY: develop\ndevelop:\n\tpip install -e .[dev]","type":"text"}]},{"type":"paragraph","content":[{"text":"Java:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"$(BUILDDIR)/%.class: $(SRCDIR)/%.java\n\t@mkdir -p $(@D)\n\tjavac -d $(BUILDDIR) -sourcepath $(SRCDIR) $\u003c","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Standard Targets","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":".PHONY: all clean install uninstall test help\n\n## Build all targets\nall: $(TARGET)\n\n## Install to PREFIX\ninstall: all\n\tinstall -d $(DESTDIR)$(BINDIR)\n\tinstall -m 755 $(TARGET) $(DESTDIR)$(BINDIR)/\n\n## Remove built files\nclean:\n\t$(RM) -r $(BUILDDIR) $(TARGET)\n\n## Run tests\ntest:\n\t# Add test commands\n\n## Show help\nhelp:\n\t@echo \"$(PROJECT) v$(VERSION)\"\n\t@echo \"Targets: all, install, clean, test, help\"\n\t@echo \"Override: make CC=clang PREFIX=/opt\"","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Stage 4: Validate and Format","type":"text"}]},{"type":"paragraph","content":[{"text":"Validation is required for every generated Makefile.","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Validation Tool Preflight (default + fallback)","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Preferred path:","type":"text","marks":[{"type":"strong"}]},{"text":" run ","type":"text"},{"text":"devops-skills:makefile-validator","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If validator skill is unavailable:","type":"text","marks":[{"type":"strong"}]},{"text":" run local fallback checks:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Required fallback check (if make exists)\nmake -f \u003cMakefile> -n --dry-run\n\n# Structural fallback checks\nrg -n '^ {1,}\\S' \u003cMakefile> # suspicious space-indented recipe lines\nrg -n '^\\.PHONY:' \u003cMakefile>","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If ","type":"text","marks":[{"type":"strong"}]},{"text":"make","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":" is unavailable:","type":"text","marks":[{"type":"strong"}]},{"text":" run structural checks only, report \"partial validation due to missing make binary\", and request user confirmation before claiming production readiness.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Required Validation Loop","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"1. Generate Makefile following stages above\n2. Run validator skill (or fallback checks if unavailable)\n3. Fix all errors (MUST have 0 errors before completion)\n4. Apply formatting fixes (see \"Formatting Step\" below)\n5. Fix warnings when feasible (SHOULD fix; explain if skipped)\n6. Address info items for large/production projects\n7. Re-run validation until checks pass\n8. Output structured validation report (REQUIRED - see format below)","type":"text"}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Formatting Step (REQUIRED)","type":"text"}]},{"type":"paragraph","content":[{"text":"When mbake reports formatting issues, you MUST either:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Auto-apply formatting","type":"text","marks":[{"type":"strong"}]},{"text":" (preferred for minor issues):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"mbake format \u003cMakefile>","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Explain why not applied","type":"text","marks":[{"type":"strong"}]},{"text":" (if formatting would break functionality):","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"Formatting not applied because:\n- [specific reason, e.g., \"heredoc syntax would be corrupted\"]\n- Manual review recommended for: [specific lines]","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If ","type":"text"},{"text":"mbake","type":"text","marks":[{"type":"code_inline"}]},{"text":" is not installed or not executable, skip formatter execution and record: ","type":"text"},{"text":"Formatting skipped: mbake unavailable in current environment.","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Formatting Decision Guide:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"mbake Report","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Action","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Would reformat\" with no specific issues","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Auto-apply with ","type":"text"},{"text":"mbake format","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Specific whitespace/indentation issues","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Auto-apply with ","type":"text"},{"text":"mbake format","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Issues in complex heredocs or multi-line strings","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Skip formatting, explain in output","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Issues in ","type":"text"},{"text":"# bake-format off","type":"text","marks":[{"type":"code_inline"}]},{"text":" sections","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Skip (intentionally disabled)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"mbake","type":"text","marks":[{"type":"code_inline"}]},{"text":" command unavailable","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Skip formatting, record tool-unavailable reason","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"Validation Pass Criteria:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Level","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Requirement","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Action","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Errors (0 required)","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Syntax errors, missing tabs, invalid targets","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"MUST fix before completion","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Warnings (fix if feasible)","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Formatting issues, missing optimizations","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SHOULD fix; explain if skipped","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Info (address for production)","type":"text","marks":[{"type":"strong"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Enhancement suggestions, style preferences","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SHOULD address for production Makefiles","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"Known mbake False Positives (can be safely ignored):","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"The mbake validator may report warnings for valid GNU Make special targets. These are false positives and can be ignored:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"mbake Warning","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Actual Status","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Explanation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Unknown special target '.DELETE_ON_ERROR'\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ Valid","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Critical GNU Make target that deletes failed build artifacts","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Unknown special target '.SUFFIXES'\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ Valid","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Standard GNU Make target for disabling/setting suffix rules","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Unknown special target '.ONESHELL'\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ Valid","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"GNU Make 3.82+ feature for single-shell recipe execution","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Unknown special target '.POSIX'\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ Valid","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"POSIX compliance declaration","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":4},"content":[{"text":"Validation Report Output (REQUIRED)","type":"text"}]},{"type":"paragraph","content":[{"text":"After validation completes, you MUST output a structured report in the following format. This is not optional.","type":"text"}]},{"type":"paragraph","content":[{"text":"Required Report Format:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"## Validation Report\n\n**Result:** [PASSED / PASSED with warnings / FAILED]\n**Errors:** [count]\n**Warnings:** [count]\n**Info:** [count]\n\n### Errors Fixed\n- [List each error and how it was fixed, or \"None\" if 0 errors]\n\n### Warnings Addressed\n- [List each warning that was fixed]\n\n### Warnings Skipped (with reasons)\n- [List each warning that was NOT fixed and explain why]\n- Example: \"mbake reports '.DELETE_ON_ERROR' as unknown - this is a valid GNU Make\n special target (false positive)\"\n\n### Formatting Applied\n- [Yes/No] - [If No, explain why formatting was skipped]\n\n### Info Items Addressed\n- [List info items that were addressed for production Makefiles]\n- [Or \"N/A - simple project\" if not applicable]\n\n### Remaining Issues (if any)\n- [List any issues requiring user attention]\n- [Or \"None - Makefile is production-ready\"]","type":"text"}]},{"type":"paragraph","content":[{"text":"Example Complete Report:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"## Validation Report\n\n**Result:** PASSED with warnings\n**Errors:** 0\n**Warnings:** 2\n**Info:** 1\n\n### Errors Fixed\n- None\n\n### Warnings Addressed\n- Fixed: Added error handling to install target (|| exit 1)\n\n### Warnings Skipped (with reasons)\n- mbake reports \".DELETE_ON_ERROR\" as unknown - this is a valid and critical\n GNU Make special target that ensures failed builds don't leave corrupt files.\n See: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html\n\n### Formatting Applied\n- Yes - Applied `mbake format` to fix whitespace issues\n\n### Info Items Addressed\n- Added .NOTPARALLEL for Docker targets (parallel safety)\n- Added error handling for docker-push target\n\n### Remaining Issues\n- None - Makefile is production-ready","type":"text"}]},{"type":"paragraph","content":[{"text":"Common Info Items to Address:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Info Item","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"When to Fix","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"How to Fix","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"mkdir without order-only prerequisites\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Large projects (>10 targets)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"target: prereqs | $(BUILDDIR)","type":"text","marks":[{"type":"code_inline"}]},{"text":" pattern","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"recipe commands lack error handling\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Critical operations (install, deploy)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add ","type":"text"},{"text":"set -e","type":"text","marks":[{"type":"code_inline"}]},{"text":" in .SHELLFLAGS or use ","type":"text"},{"text":"&&","type":"text","marks":[{"type":"code_inline"}]},{"text":" chaining","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"consider using ccache\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Long compile times","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add ","type":"text"},{"text":"CC := ccache $(CC)","type":"text","marks":[{"type":"code_inline"}]},{"text":" pattern","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"parallel-sensitive commands detected\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Docker/npm/pip targets","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Add ","type":"text"},{"text":".NOTPARALLEL:","type":"text","marks":[{"type":"code_inline"}]},{"text":" for affected targets or proper dependencies","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"Production-Quality Requirements (MUST address for Docker/deploy targets):","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"When generating Makefiles with Docker or deployment targets, you MUST apply these production patterns:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Error Handling for docker-push:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"## Push Docker image to registry (with error handling)\ndocker-push: docker-build\n\t@echo \"Pushing $(IMAGE)...\"\n\tdocker push $(IMAGE) || { echo \"Failed to push $(IMAGE)\"; exit 1; }\n\tdocker push $(IMAGE_LATEST) || { echo \"Failed to push $(IMAGE_LATEST)\"; exit 1; }","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Parallel Safety for Docker targets:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"# Prevent parallel execution of Docker targets (race conditions)\n.NOTPARALLEL: docker-build docker-push docker-run","type":"text"}]},{"type":"paragraph","content":[{"text":"Or use proper dependencies to serialize:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"docker-push: docker-build # Ensures build completes before push\ndocker-run: docker-build # Ensures build completes before run","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Install target error handling:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"install: $(TARGET)\n\tinstall -d $(DESTDIR)$(PREFIX)/bin || exit 1\n\tinstall -m 755 $(TARGET) $(DESTDIR)$(PREFIX)/bin/ || exit 1","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Note:","type":"text","marks":[{"type":"strong"}]},{"text":" When validation shows info items about error handling or parallel safety, you MUST address them for any Makefile containing Docker, deploy, or install targets. Explain in your response which patterns were applied.","type":"text"}]},{"type":"paragraph","content":[{"text":"Validation Checklist:","type":"text","marks":[{"type":"strong"}]}]},{"type":"checkbox_list","attrs":{"id":null},"content":[{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Syntax correct (","type":"text"},{"text":"make -n","type":"text","marks":[{"type":"code_inline"}]},{"text":" passes)","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"All non-file targets have .PHONY","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Tab indentation (not spaces)","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"No hardcoded credentials","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"User-overridable variables use ","type":"text"},{"text":"?=","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":".DELETE_ON_ERROR present","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"MAKEFLAGS optimizations included (Modern header)","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Order-only prerequisites for build directories (large projects)","type":"text"}]}]},{"type":"checkbox_item","attrs":{"checked":false},"content":[{"type":"paragraph","content":[{"text":"Error handling in critical recipes (install, deploy, docker-push)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Best Practices","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Variables","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"?=","type":"text","marks":[{"type":"code_inline"}]},{"text":" for user-overridable (CC, CFLAGS, PREFIX)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":":=","type":"text","marks":[{"type":"code_inline"}]},{"text":" for project-specific (SOURCES, OBJECTS)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use pkg-config: ","type":"text"},{"text":"CFLAGS += $(shell pkg-config --cflags lib)","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Targets","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Always declare ","type":"text"},{"text":".PHONY","type":"text","marks":[{"type":"code_inline"}]},{"text":" for non-file targets","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Default target should be ","type":"text"},{"text":"all","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":".DELETE_ON_ERROR","type":"text","marks":[{"type":"code_inline"}]},{"text":" for safety","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Document with ","type":"text"},{"text":"##","type":"text","marks":[{"type":"code_inline"}]},{"text":" comments for help target","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Directory Creation","type":"text"}]},{"type":"paragraph","content":[{"text":"Two approaches for creating build directories:","type":"text"}]},{"type":"paragraph","content":[{"text":"Simple (inline mkdir):","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"$(BUILDDIR)/%.o: $(SRCDIR)/%.c\n\t@mkdir -p $(@D)\n\t$(CC) $(CFLAGS) -c $\u003c -o $@","type":"text"}]},{"type":"paragraph","content":[{"text":"Optimized (order-only prerequisites):","type":"text","marks":[{"type":"strong"}]},{"text":" Prevents unnecessary rebuilds when directory timestamps change.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"makefile"},"content":[{"text":"$(BUILDDIR):\n\t@mkdir -p $@\n\n$(BUILDDIR)/%.o: $(SRCDIR)/%.c | $(BUILDDIR)\n\t$(CC) $(CFLAGS) -c $\u003c -o $@","type":"text"}]},{"type":"paragraph","content":[{"text":"Use order-only prerequisites (","type":"text"},{"text":"|","type":"text","marks":[{"type":"code_inline"}]},{"text":") for large projects with many targets.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Recipes","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use tabs, never spaces","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Quote variables in shell: ","type":"text"},{"text":"$(RM) \"$(TARGET)\"","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"@","type":"text","marks":[{"type":"code_inline"}]},{"text":" prefix for quiet commands","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Test with ","type":"text"},{"text":"make -n","type":"text","marks":[{"type":"code_inline"}]},{"text":" first","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Helper Scripts (Optional)","type":"text"}]},{"type":"paragraph","content":[{"text":"These scripts are ","type":"text"},{"text":"optional convenience tools","type":"text","marks":[{"type":"strong"}]},{"text":" for quick template generation.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"When to Use Scripts vs Manual Generation","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Scenario","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Recommendation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Simple, standard project (single binary, no special features)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ Use ","type":"text"},{"text":"generate_makefile_template.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":" for speed","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Complex project (Docker, multi-binary, custom patterns)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ Use manual generation for full control","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Adding targets to existing Makefile","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ Use ","type":"text"},{"text":"add_standard_targets.sh","type":"text","marks":[{"type":"code_inline"}]}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"User has specific formatting/style requirements","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"❌ Use manual generation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Rapid prototyping / proof-of-concept","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅ Use scripts, customize later","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Production-ready Makefile","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"⚠️ Start with script, then customize manually","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"generate_makefile_template.sh","type":"text"}]},{"type":"paragraph","content":[{"text":"Generates a complete Makefile template for a specific project type. Script path: ","type":"text"},{"text":"scripts/generate_makefile_template.sh","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash scripts/generate_makefile_template.sh [TYPE] [NAME] [OUTPUT_FILE]\n\nTypes: c, c-lib, cpp, go, python, java, generic","type":"text"}]},{"type":"paragraph","content":[{"text":"Example:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash scripts/generate_makefile_template.sh go myservice\n# Creates Makefile with Go patterns, version embedding, standard targets\n\nbash scripts/generate_makefile_template.sh go myservice build/Makefile\n# Writes template to build/Makefile (TYPE NAME OUTPUT)","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"add_standard_targets.sh","type":"text"}]},{"type":"paragraph","content":[{"text":"Adds missing standard GNU targets to an existing Makefile. Script path: ","type":"text"},{"text":"scripts/add_standard_targets.sh","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash scripts/add_standard_targets.sh [MAKEFILE] [TARGETS...]\nbash scripts/add_standard_targets.sh [TARGETS...] # uses ./Makefile\n\nTargets: all, install, uninstall, clean, distclean, test, check, help, dist","type":"text"}]},{"type":"paragraph","content":[{"text":"Example:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash scripts/add_standard_targets.sh Makefile install uninstall help\n# Adds install, uninstall, help targets if they don't exist\n\nbash scripts/add_standard_targets.sh clean test\n# Explicit-target mode: modifies ./Makefile\n\nbash scripts/add_standard_targets.sh -n Makefile dist\n# Dry-run mode: shows planned changes without editing files","type":"text"}]},{"type":"paragraph","content":[{"text":"Note:","type":"text","marks":[{"type":"strong"}]},{"text":" Manual generation following the Stage 3 patterns produces equivalent results but allows for more customization.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Helper Script Regression Smoke Tests","type":"text"}]},{"type":"paragraph","content":[{"text":"Run after modifying helper scripts or templates:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"bash test/test_helper_scripts.sh","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Done Criteria","type":"text"}]},{"type":"paragraph","content":[{"text":"Consider the task complete only when all checks below are satisfied:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Trigger matched and missing requirements were clarified (or documented defaults were applied).","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Relevant internal docs were opened via explicit file paths before generation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Generated Makefile has complete ","type":"text"},{"text":".PHONY","type":"text","marks":[{"type":"code_inline"}]},{"text":" coverage for non-file targets.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Go templates include optional ","type":"text"},{"text":"go.sum","type":"text","marks":[{"type":"code_inline"}]},{"text":" handling and configurable ","type":"text"},{"text":"GO_MAIN","type":"text","marks":[{"type":"code_inline"}]},{"text":" entrypoint.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Validation ran with ","type":"text"},{"text":"makefile-validator","type":"text","marks":[{"type":"code_inline"}]},{"text":" (preferred) or documented fallback checks.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Formatting was applied with ","type":"text"},{"text":"mbake","type":"text","marks":[{"type":"code_inline"}]},{"text":", or skipped with an explicit tool-unavailable/compatibility reason.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Final response includes the required structured validation report.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Documentation","type":"text"}]},{"type":"paragraph","content":[{"text":"Detailed guides in ","type":"text"},{"text":"docs/","type":"text","marks":[{"type":"code_inline"}]},{"text":":","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"makefile-structure.md","type":"text","marks":[{"type":"strong"}]},{"text":" - Organization, layout, includes","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"variables-guide.md","type":"text","marks":[{"type":"strong"}]},{"text":" - Assignment operators, automatic variables","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"targets-guide.md","type":"text","marks":[{"type":"strong"}]},{"text":" - Standard targets, .PHONY, prerequisites","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"patterns-guide.md","type":"text","marks":[{"type":"strong"}]},{"text":" - Pattern rules, dependencies","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"optimization-guide.md","type":"text","marks":[{"type":"strong"}]},{"text":" - Parallel builds, caching","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"security-guide.md","type":"text","marks":[{"type":"strong"}]},{"text":" - Safe expansion, credential handling","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Resources","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"GNU Make Manual","type":"text","marks":[{"type":"link","attrs":{"href":"https://www.gnu.org/software/make/manual/","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"GNU Coding Standards","type":"text","marks":[{"type":"link","attrs":{"href":"https://www.gnu.org/prep/standards/standards.html","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Makefile Conventions","type":"text","marks":[{"type":"link","attrs":{"href":"https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html","title":null}}]}]}]}]}]},"metadata":{"date":"2026-11-02","name":"makefile-generator","author":"@skillopedia","source":{"stars":331,"repo_name":"cc-devops-skills","origin_url":"https://github.com/akin-ozer/cc-devops-skills/blob/HEAD/devops-skills-plugin/skills/makefile-generator/SKILL.md","repo_owner":"akin-ozer","body_sha256":"1dd5902d5d3d696dc3bfacc361ba2a0a85404e3fa06a756b8d364468c6a48f2c","cluster_key":"07b202f16855de736335c1f6f9b3ce18a6b21a2235a45a33b84dc1177d56c4aa","clean_bundle":{"format":"clean-skill-bundle-v1","source":"akin-ozer/cc-devops-skills/devops-skills-plugin/skills/makefile-generator/SKILL.md","text_bytes":112973,"source_commit":"276af751e659315aaf56d3ad13d7c26f4e72e28a","skills_sh_rank":17071,"attachment_count":9,"text_attachments":9,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"devops-skills-plugin/skills/makefile-generator/SKILL.md","import_metadata":{"date":"2026-11-02","author":"@skillopedia","version":"v1","category":"devops-infrastructure","category_label":"DevOps"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"devops-infrastructure","import_tag":"skills-sh-top20k-2026-11","description":"Create, generate, or scaffold Makefiles with .PHONY targets and build automation."}},"renderedAt":1793661345403}

Makefile Generator Overview Generate production-ready Makefiles with best practices for C/C++, Python, Go, Java, and generic projects. Features GNU Coding Standards compliance, standard targets, security hardening, and automatic validation via devops-skills:makefile-validator skill. When to Use - Creating new Makefiles from scratch - Setting up build systems for projects (C/C++, Python, Go, Java) - Implementing build automation and CI/CD integration - Converting manual build processes to Makefiles - The user asks to "create", "generate", or "write" a Makefile Do NOT use for: Validating existi…