跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

makefile-development

This skill should be used when the user asks to "create a Makefile", "write a Makefile", "add a make target", or mentions Makefile conventions.

dwmkerr · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add dwmkerr/claude-toolkit --skill makefile-development

技能说明


name: makefile-development description: This skill should be used when the user asks to "create a Makefile", "write a Makefile", "add a make target", or mentions Makefile conventions.

Makefile Development

Create Makefiles following consistent conventions.

Template

default: help

.PHONY: help
help: # Show help for each of the Makefile recipes.
	@grep -E '^[a-zA-Z0-9 -]+:.*#'  Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done

.PHONY: init
init: # Initialise the development environment.
	./scripts/init.sh

Conventions

ElementConvention
FilenameMakefile (capitalised, no extension)
Default targetdefault: help as the first line
.PHONYDeclare directly above each target
Help commentsSingle # on the target line: target: # Description.
Target namesLowercase, hyphen-separated (test-e2e, type-check)
Complex logicDelegate to scripts (./scripts/build.sh) rather than inline

Help Target

The self-documenting help target parses # comments and prints sorted, colour-coded output:

.PHONY: help
help: # Show help for each of the Makefile recipes.
	@grep -E '^[a-zA-Z0-9 -]+:.*#'  Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done

Every target must have a # Description. comment or it won't appear in help output.

Common Targets

TargetPurpose
helpShow available targets (always present)
init or setupInstall dependencies, configure environment
buildCompile or bundle artifacts
devStart local development server
testRun test suite
lintRun linters and formatters

Important

After creating or modifying Makefiles, remind the user:

Use tabs. Makefile recipes require literal tab characters for indentation, not spaces.