Skip to main content

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/claude-toolkit
最近来源活动
2026年2月25日 09:20
检测到的 SKILL.md 语言
英语
星标
23
分支
2

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
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 ```makefile 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 | Element | Convention | |---------|------------| | Filename | `Makefile` (capitalised, no extension) | | Default target | `default: help` as the first line | | `.PHONY` | Declare directly above each target | | Help comments | Single `#` on the target line: `target: # Description.` | | Target names | Lowercase, hyphen-separated (`test-e2e`, `type-check`) | | Complex logic | Delegate to scripts (`./scripts/build.sh`) rather than inline | ## Help Target The self-documenting help target parses `#` comments and prints sorted, colour-coded output: ```makefile .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 | Target | Purpose | |--------|---------| | `help` | Show available targets (always present) | | `init` or `setup` | Install dependencies, configure environment | | `build` | Compile or bundle artifacts | | `dev` | Start local development server | | `test` | Run test suite | | `lint` | Run linters and formatters | ## Important After creating or modifying Makefiles, remind the user: > **Use tabs.** Makefile recipes require literal tab characters for indentation, not spaces.
在 GitHub 查看