/makefile-generator
Create, generate, or scaffold Makefiles with .PHONY targets and build automation.
$ npx -y skills add akin-ozer/cc-devops-skills --skill makefile-generator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/makefile-generator
Context preview
The summary Claude sees to decide when to auto-load this skill.
Create, generate, or scaffold Makefiles with .PHONY targets and build automation.
SKILL.md
makefile-generator.SKILL.mdname: makefile-generator
description: Create, generate, or scaffold Makefiles with .PHONY targets and build automation.
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 existing Makefiles (use devops-skills:makefile-validator), debugging (use `make -d`), or running builds.
Trigger Phrases
Use this skill when prompts look like:
- "Generate a Makefile for a Go service"
- "Create a production Makefile with install/test/help targets"
- "Write a Makefile for a C project with dependency tracking"
- "Add standard GNU targets to this existing Makefile"
Generation Workflow
Stage 1: Gather Requirements
Collect information for the following categories. **Use AskUserQuestion when information is missing or ambiguous:**
| Category | Information Needed | |----------|-------------------| | **Project** | Language (C/C++/Python/Go/Java), structure (single/multi-directory) | | **Build** | Source files, output artifacts, dependencies, build order | | **Install** | PREFIX location, directories (bin/lib/share), files to install | | **Targets** | all, install, clean, test, dist, help (which are needed?) | | **Config** | Compiler, flags, pkg-config dependencies, cross-compilation |
**When to Use AskUserQuestion (MUST ask if any apply):**
| Condition | Example Question | |-----------|------------------| | Language not specified | "What programming language is this project? (C/C++/Go/Python/Java)" | | Project structure unclear | "Is this a single-directory or multi-directory project?" | | Docker requested but registry unknown | "Which container registry should be used? (docker.io/ghcr.io/custom)" | | Multiple binaries possible | "Should this build a single binary or multiple executables?" | | Install targets needed but paths unclear | "Where should binaries be installed? (default: /usr/local/bin)" | | Cross-compilation mentioned | "What is the target platform/architecture?" |
**When to Skip AskUserQuestion (proceed with defaults):**
- User explicitly provides all required information
- Standard project type with obvious defaults (e.g., "Go project with Docker" → use standard Go+Docker patterns)
- User says "use defaults" or "standard setup"
**Default Assumptions (when not asking):**
- Single-directory project structure
- PREFIX=/usr/local
- Standard targets: all, build, test, clean, install, help
- No cross-compilation
Stage 2: Documentation Lookup
**When REQUIRED (MUST perform lookup):**
- User requests integration with unfamiliar tools, frameworks, or build systems
- Complex build patterns not covered in Stage 3 examples (e.g., Bazel, Meson, custom toolchains)
- **Docker/container integration** (Dockerfile builds, multi-stage, registry push)
- CI/CD platform-specific integration (GitHub Actions, GitLab CI, Jenkins)
- Cross-compilation for unusual targets or embedded systems
- Package manager integration (Conan, vcpkg, Homebrew formulas)
- **Multi-binary or multi-library projects**
- **Version embedding via ldflags or build-time variables**
**When OPTIONAL (may skip external lookup):**
- Standard language patterns already covered in Stage 3 (C/C++, Go, Python, Java)
- Simple single-binary projects with no external dependencies
- User provides complete requirements with no ambiguity
- Internal docs already cover the required pattern comprehensively
**Lookup Process (follow in order):**
1. **ALWAYS consult internal docs first using explicit file-open commands** (primary source of truth):
**Full doc path map (prefer full paths for deterministic access):**
| Doc | Full Path | |-----|-----------| | Structure guide | `devops-skills-plugin/skills/makefile-generator/docs/makefile-structure.md` | | Variables guide | `devops-skills-plugin/skills/makefile-generator/docs/variables-guide.md` | | Targets guide | `devops-skills-plugin/skills/makefile-generator/docs/targets-guide.md` | | Patterns guide | `devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md` | | Optimization guide | `devops-skills-plugin/skills/makefile-generator/docs/optimization-guide.md` | | Security guide | `devops-skills-plugin/skills/makefile-generator/docs/security-guide.md` |
| Requirement | Read This Doc | |-------------|---------------| | Docker/container targets | `.../docs/patterns-guide.md` (Pattern 8: Docker Integration) | | Multi-binary projects | `.../docs/patterns-guide.md` (Pattern 7: Multi-Binary Project) | | Go projects with version embedding | `.../docs/patterns-guide.md` (Pattern 5: Go Project) | | Parallel builds, caching, ccache | `.../docs/optimization-guide.md` | | Credentials, secrets, API keys | `.../docs/security-guide.md` | | Complex dependencies, pattern rules | `.../docs/patterns-guide.md` | | Order-only prerequisites | `.../docs/optimization-guide.md` or `.../docs/targets-guide.md` | | Variables, assignment operators | `.../docs/variables-guide.md` |
**Deterministic open/read commands:**
# From repository root:
sed -n '1,220p' devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md
rg -n "Pattern 5|Pattern 8" devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md
# From skill directory:
sed -n '1,220p' docs/security-guide.md
If shell commands are unavailable, use the environment's file-open/read capability on the same paths.
**Required Workflow Example (Docker + Go with version embedding):**
Read more
name: makefile-generator description: Create, generate, or scaffold Makefiles with .PHONY targets and build automation.
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 existing Makefiles (use devops-skills:makefile-validator), debugging (use `make -d`), or running builds.
Trigger Phrases
Use this skill when prompts look like:
- "Generate a Makefile for a Go service"
- "Create a production Makefile with install/test/help targets"
- "Write a Makefile for a C project with dependency tracking"
- "Add standard GNU targets to this existing Makefile"
Generation Workflow
Stage 1: Gather Requirements
Collect information for the following categories. **Use AskUserQuestion when information is missing or ambiguous:**
| Category | Information Needed | |----------|-------------------| | **Project** | Language (C/C++/Python/Go/Java), structure (single/multi-directory) | | **Build** | Source files, output artifacts, dependencies, build order | | **Install** | PREFIX location, directories (bin/lib/share), files to install | | **Targets** | all, install, clean, test, dist, help (which are needed?) | | **Config** | Compiler, flags, pkg-config dependencies, cross-compilation |
**When to Use AskUserQuestion (MUST ask if any apply):**
| Condition | Example Question | |-----------|------------------| | Language not specified | "What programming language is this project? (C/C++/Go/Python/Java)" | | Project structure unclear | "Is this a single-directory or multi-directory project?" | | Docker requested but registry unknown | "Which container registry should be used? (docker.io/ghcr.io/custom)" | | Multiple binaries possible | "Should this build a single binary or multiple executables?" | | Install targets needed but paths unclear | "Where should binaries be installed? (default: /usr/local/bin)" | | Cross-compilation mentioned | "What is the target platform/architecture?" |
**When to Skip AskUserQuestion (proceed with defaults):**
- User explicitly provides all required information
- Standard project type with obvious defaults (e.g., "Go project with Docker" → use standard Go+Docker patterns)
- User says "use defaults" or "standard setup"
**Default Assumptions (when not asking):**
- Single-directory project structure
- PREFIX=/usr/local
- Standard targets: all, build, test, clean, install, help
- No cross-compilation
Stage 2: Documentation Lookup
**When REQUIRED (MUST perform lookup):**
- User requests integration with unfamiliar tools, frameworks, or build systems
- Complex build patterns not covered in Stage 3 examples (e.g., Bazel, Meson, custom toolchains)
- **Docker/container integration** (Dockerfile builds, multi-stage, registry push)
- CI/CD platform-specific integration (GitHub Actions, GitLab CI, Jenkins)
- Cross-compilation for unusual targets or embedded systems
- Package manager integration (Conan, vcpkg, Homebrew formulas)
- **Multi-binary or multi-library projects**
- **Version embedding via ldflags or build-time variables**
**When OPTIONAL (may skip external lookup):**
- Standard language patterns already covered in Stage 3 (C/C++, Go, Python, Java)
- Simple single-binary projects with no external dependencies
- User provides complete requirements with no ambiguity
- Internal docs already cover the required pattern comprehensively
**Lookup Process (follow in order):**
1. **ALWAYS consult internal docs first using explicit file-open commands** (primary source of truth):
**Full doc path map (prefer full paths for deterministic access):**
| Doc | Full Path | |-----|-----------| | Structure guide | `devops-skills-plugin/skills/makefile-generator/docs/makefile-structure.md` | | Variables guide | `devops-skills-plugin/skills/makefile-generator/docs/variables-guide.md` | | Targets guide | `devops-skills-plugin/skills/makefile-generator/docs/targets-guide.md` | | Patterns guide | `devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md` | | Optimization guide | `devops-skills-plugin/skills/makefile-generator/docs/optimization-guide.md` | | Security guide | `devops-skills-plugin/skills/makefile-generator/docs/security-guide.md` |
| Requirement | Read This Doc | |-------------|---------------| | Docker/container targets | `.../docs/patterns-guide.md` (Pattern 8: Docker Integration) | | Multi-binary projects | `.../docs/patterns-guide.md` (Pattern 7: Multi-Binary Project) | | Go projects with version embedding | `.../docs/patterns-guide.md` (Pattern 5: Go Project) | | Parallel builds, caching, ccache | `.../docs/optimization-guide.md` | | Credentials, secrets, API keys | `.../docs/security-guide.md` | | Complex dependencies, pattern rules | `.../docs/patterns-guide.md` | | Order-only prerequisites | `.../docs/optimization-guide.md` or `.../docs/targets-guide.md` | | Variables, assignment operators | `.../docs/variables-guide.md` |
**Deterministic open/read commands:**
# From repository root: sed -n '1,220p' devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md rg -n "Pattern 5|Pattern 8" devops-skills-plugin/skills/makefile-generator/docs/patterns-guide.md # From skill directory: sed -n '1,220p' docs/security-guide.md
If shell commands are unavailable, use the environment's file-open/read capability on the same paths.
**Required Workflow Example (Docker + Go with version embedding):**
A practical skill pack for DevOps work in Claude Code and Codex desktop. This repository ships 31 skills: 16 generators for scaffolding production-ready configs 14 validators for linting, security checks, and dry-run validation 1 debugger (k8s-debug) for
Repo: akin-ozer/cc-devops-skills
Other skills on cc-devops-skills.
- /ansible-generator
Generate, create, or scaffold Ansible playbooks, roles, tasks, handlers, inventory, vars.
Open skill - /ansible-validator
Validate, lint, audit, or debug Ansible playbooks, roles, inventories, FQCN, tasks.
Open skill - /azure-pipelines-generator
Generate/create/scaffold azure-pipelines.yml, stages, jobs, steps, or reusable templates.
Open skill - /azure-pipelines-validator
Validate, lint, audit, or review azure-pipelines.yml — syntax, security, best practices.
Open skill - /bash-script-generator
Create, generate, write, or scaffold bash/shell scripts (.sh), automation, or CLI tools.
Open skill - /bash-script-validator
Validate, lint, audit, or fix bash/shell/.sh scripts via ShellCheck.
Open skill

