원클릭으로
makefile-ops
Makefile and modular scripts conventions for DevOps projects
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Makefile and modular scripts conventions for DevOps projects
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Cloud Build CI/CD patterns with Terraform-via-Cloud-Build workflows
Podman container operations best practices and patterns
Issue-driven DevOps workflow with pre-flight checks, workspace isolation, and PR lifecycle
Google Cloud Platform operations patterns and best practices
Best practices for creating and reviewing pull requests
Create consistent releases and changelogs using semantic versioning and conventional commits
| name | makefile-ops |
| description | Makefile and modular scripts conventions for DevOps projects |
scripts/Use this skill when scaffolding a new project's operational structure, when modifying Makefile targets or scripts, or when onboarding someone to the project's development workflow.
| Domain | init | clean | build | run/deploy | test | lint |
|---|---|---|---|---|---|---|
| Local dev | local-init | local-clean | local-build | local-run | local-test | local-lint |
| Container dev | container-init | container-clean | container-build | container-run | — | — |
| Cloud runtime | cloud-init | cloud-clean | cloud-build | cloud-deploy | — | — |
| Logs | — | logs-clean | — | — | — | logs-list / logs-last |
Every Makefile target is a one-liner that calls a script:
local-build: ## Build the project locally
@bash scripts/local.sh build
Rules:
@ prefix to suppress command echo## description comments for make help support.PHONY targets declared at the topInclude a help target that extracts descriptions from ## comments:
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
scripts/
common.sh # Shared functions (always sourced first)
local.sh # Local dev operations
container.sh # Container operations (Podman)
cloud.sh # Cloud operations (gcloud, Cloud Build)
common.sh PatternEvery script sources common.sh first:
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/common.sh"
common.sh provides:
set -euo pipefail -- fail on errors, undefined vars, pipe failureslog_info, log_ok, log_warn, log_error, die.env (if it exists)PROJECT_NAME, IMAGE_NAME, IMAGE_TAG, GCP_PROJECT, GCP_REGIONrequire_cmd (assert CLI exists), confirm (yes/no prompt)Each script accepts a subcommand as its first argument:
case "${1:-}" in
init) init ;;
clean) clean ;;
build) build ;;
run) run ;;
*) die "Usage: $0 {init|clean|build|run}" ;;
esac
All scripts must be executable: chmod +x scripts/*.sh
Container build files live in cicd/, NOT at the project root:
cicd/
Dockerfile # Multi-stage build, tailored to project type
.dockerignore # Build context exclusions
The scripts/container.sh build command references cicd/Dockerfile:
podman build -f cicd/Dockerfile -t "${IMAGE_NAME}:${IMAGE_TAG}" .
The build context is the project root (.) so source code is accessible,
but the Dockerfile itself is kept separate in cicd/.
Must exclude:
.git, .gitignore, *.md, LICENSE.env, .env.* (secrets must not be baked into images)cicd/terraform/, cicd/cloudbuild*.yaml (not needed in the image)node_modules/, __pycache__/, target/, etc.)The scaffolded Makefile includes targets for managing per-run log files:
| Target | Description |
|---|---|
logs-list | List recent log files (newest first, max 20) |
logs-last | Display contents of the most recent log file |
logs-clean | Remove all log files from logs/ directory |
Log files are created automatically by the scaffolded scripts. Each make
target execution generates a timestamped log file in logs/:
logs/20260307-143022-local-build.log
logs/20260307-143155-container-run.log
logs/20260307-150000-cloud-deploy.log
These log files capture all stdout and stderr output from the command, making it easy to review past runs and diagnose failures.
npm installnpm run buildnpm run devnpm testnpm run lint or npx eslint .node:20-alpine, npm ci in buildergo mod downloadgo build -o bin/ ./...go run .go test ./...golangci-lint run or go vet ./...golang:1.22-alpine, distroless runtimepython3 -m venv .venv && pip install -r requirements.txtpython3 -m build (if applicable)python3 -m uvicorn main:app (or python3 main.py)python3 -m pytestruff check . or python3 -m flake8 .python:3.12-slim, venv copied to runtimecargo fetchcargo build --releasecargo runcargo testcargo clippy -- -D warningsrust:1.77-alpine, distroless runtimemvn dependency:resolve or gradle dependenciesmvn package -DskipTests or gradle build -x testmvn exec:java or gradle runmvn test or gradle testmvn checkstyle:check or gradle checkrequire_cmd to check
for required tools.PROJECT_ROOT..env files (git-ignored) or environment
variables. Never hardcode credentials.set -euo pipefail -- Always fail fast. Silent failures
cause cascading problems.make targets. If a project has no
Makefile, offer to scaffold one first using the scaffold tool.scripts/, container
files, Cloud Build configs, and Terraform modules -- all in cicd/.scaffold tool directly. Do not delegate scaffolding to other agents.