Audit and improve web accessibility following WCAG 2.1 guidelines. Use when the task involves `improve accessibility`, `a11y audit`, `WCAG compliance`, `screen reader support`, `keyboard navigation`, or `make accessible`.
日本語の概要は準備中です。原文の説明を表示しています。
Best practices for authoring clean, maintainable, and portable GNU Make Makefiles. Use when the task involves `creating or editing Makefiles`, `Makefile`, `makefile`, `*.mk`, `GNUmakefile`, `GNU Make patterns`, `build automation`, or `makefile troubleshooting`.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
Makefile for any project (C/C++, Go, Node.js, etc.).PHONY: Always mark non-file targets (e.g., clean, all, test, install) with
.PHONY to avoid conflicts with files of the same name.:= Over = When Possible: Prefer simple expansion (:=) for variables to avoid
unexpected recursive expansion and improve performance.$@ (target), $< (first prerequisite), $^ (all prerequisites),
$? (newer prerequisites), and $* (stem) in recipes to keep rules generic and reusable.$(wildcard ...) Not $(shell ls ...): Never shell out for file lists; use Make's
built-in $(wildcard *.c) function instead.-MMD -MP to generate .d files rather
than maintaining header dependencies manually.clean target and prefix destructive commands with - to
ignore errors if files don't exist.$(MAKE) -C subdir unless absolutely necessary; prefer
includes or non-recursive approaches.# -------------------------------------------------------
# Project: <name>
#
# Usage:
# make - Build the project
# make clean - Remove generated files
# make install - Install to $(PREFIX)
# make test - Run tests
#
# Variables:
# CC - C compiler (default: gcc)
# PREFIX - Installation prefix (default: /usr/local)
# -------------------------------------------------------
# --- Variables ---
CC ?= gcc
CFLAGS := -Wall -Wextra -O2
PREFIX ?= /usr/local
sources := $(wildcard src/*.c)
objects := $(sources:.c=.o)
deps := $(objects:.o=.d)
# --- Default Goal ---
all: program
# --- Build Rules ---
program: $(objects)
$(CC) -o $@ $^ $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -MMD -MP -c $< -o $@
-include $(deps)
# --- Phony Targets ---
.PHONY: all clean install test
clean:
-rm -f program $(objects) $(deps)
install: program
install -d $(PREFIX)/bin
install -m 755 program $(PREFIX)/bin
test: program
./run-tests.sh
# Simple expansion (evaluates immediately) - PREFERRED
CC := gcc
# Recursive expansion (evaluates when used)
CFLAGS = -Wall $(EXTRA_FLAGS)
# Conditional assignment (set default, allow override)
PREFIX ?= /usr/local
# Append to variable
CFLAGS += -g
# Always reference with $() - not bare $VAR
objects := $(sources:.c=.o)
# Custom pattern rule for generic transformations
%.pdf: %.md
pandoc $< -o $@
# Compile with auto-dependency generation
%.o: %.c
$(CC) $(CFLAGS) -MMD -MP -c $< -o $@
# The directory is created before compiling but does NOT
# trigger recompilation when its timestamp changes.
obj/%.o: %.c | obj
$(CC) $(CFLAGS) -c $< -o $@
obj:
mkdir -p obj
ifeq ($(OS),Windows_NT)
EXE_EXT := .exe
else
EXE_EXT :=
endif
program: main.o
$(CC) -o program$(EXE_EXT) main.o
# Use backslash-newline to split for readability
sources := main.c \
utils.c \
parser.c \
handler.c
# In recipes, backslash-newline continues the shell command
install: program
install -d $(PREFIX)/bin && \
install -m 755 program $(PREFIX)/bin
# Include shared configuration
include config.mk
# Include optional local overrides (no error if missing)
-include local.mk
# Validate required tools
ifeq ($(shell which gcc 2>/dev/null),)
$(error gcc is not installed or not in PATH)
endif
# Validate required variables
ifndef VERSION
$(error VERSION is not defined. Usage: make VERSION=1.2.3)
endif
# Delete targets if recipe fails (recommended)
.DELETE_ON_ERROR:
# Don't delete intermediate files
.SECONDARY:
# Preserve specific intermediate files
.PRECIOUS: %.o
programs := prog1 prog2 prog3
.PHONY: all clean
all: $(programs)
prog1: prog1.o common.o
$(CC) -o $@ $^
prog2: prog2.o common.o
$(CC) -o $@ $^
clean:
-rm -f $(programs) *.o
| Anti-Pattern | Why It's Bad | Do Instead |
|---|---|---|
| Spaces instead of tabs in recipes | Syntax error, hard to debug | Use tab characters |
$(shell ls *.c) for file lists | Creates subprocess, fragile | $(wildcard *.c) |
Missing .PHONY declarations | clean won't run if a file named clean exists | .PHONY: clean |
| Hardcoded file lists | Maintenance burden, easy to forget new files | $(wildcard ...) or auto-discovery |
| Complex shell scripts in recipes | Hard to read and debug | Move to a separate .sh script |
Recursive make $(MAKE) -C subdir | Breaks dependency tracking across dirs | include or non-recursive make |
Using = everywhere | Unexpected recursive expansion, slower | Use := for simple values |
| Circular dependencies | Infinite loop, build failure | Restructure dependency graph |
# Dry run - see what would execute without running
make -n
# Force rebuild all targets
make -B
# Parallel build (use number of CPU cores)
make -j$(nproc)
# Print the database of rules and variables (debugging)
make -p
# Show which makefile and line number each rule comes from
make -d
# Override a variable from the command line
make CC=clang CFLAGS="-O3"
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Audit and improve web accessibility following WCAG 2.1 guidelines. Use when the task involves `improve accessibility`, `a11y audit`, `WCAG compliance`, `screen reader support`, `keyboard navigation`, or `make accessible`.
日本語の概要は準備中です。原文の説明を表示しています。
Skill for building with the Astro web framework. Helps create Astro components and pages, configure SSR adapters, set up content collections, deploy static sites, and manage project structure and CLI commands. Use when the user needs to work with Astro, mentions .astro files, asks about static site generation (SSG), islands architecture, content collections, or deploying an Astro project.
日本語の概要は準備中です。原文の説明を表示しています。
Apply modern web development best practices for security, compatibility, and code quality. Use when the task involves `apply best practices`, `security audit`, `modernize code`, `code quality review`, or `check for vulnerabilities`.
日本語の概要は準備中です。原文の説明を表示しています。
Optimize Core Web Vitals (LCP, INP, CLS) for better page experience and search ranking. Use when the task involves `improve Core Web Vitals`, `fix LCP`, `reduce CLS`, `optimize INP`, `page experience optimization`, or `fix layout shifts`.
日本語の概要は準備中です。原文の説明を表示しています。
Advanced Docker containerization expert for multi-stage builds, image optimization, security hardening, and Compose orchestration. Use when the task involves `working with Dockerfile`, `docker-compose.yml`, `containerization`, `multi-stage builds`, or `optimizing Docker images`.
日本語の概要は準備中です。原文の説明を表示しています。
Create distinctive, production-grade frontend interfaces with high design quality that avoids generic AI aesthetics. Use when the task involves `build web components`, `create frontend interface`, `build web page`, `build web application`, `frontend design`, `create UI component`, or `design web interface`.
日本語の概要は準備中です。原文の説明を表示しています。