Skip to content
Agentmart
Submit a tool

makefile

Use when creating, editing, or validating Makefiles.

Skill by JsonLee12138

IndexedApache-2.0★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jsonlee12138-makefile

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when creating, editing, or validating Makefiles. Provides templates for Go, Node, Python, Docker, and Monorepo projects with self-documenting help targets. Also validates existing Makefiles against conventions. Triggers on: Makefile, makefile, make help, validate makefile, lint makefile.

Use cases: devops, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/makefile

What's inside

Skill name
makefile
Description
Use when creating, editing, or validating Makefiles. Provides templates for Go, Node, Python, Docker, and Monorepo projects with self-documenting help targets. Also validates existing Makefiles against conventions. Triggers on: Makefile, makefile, make help, validate makefile, lint makefile.
License
Apache-2.0
Instructions
157 lines in SKILL.md · view on GitHub

Files (7)

  • SKILL.md
  • Makefile.docker.tmpl · assets/
  • Makefile.go.tmpl · assets/
  • Makefile.monorepo.tmpl · assets/
  • Makefile.node.tmpl · assets/
  • Makefile.python.tmpl · assets/
  • validation-rules.md · references/

SKILL.md (first lines)

# Makefile Skill

## Overview

Makefile 模板生成与验证工具。支持两种模式:

1. **Generate** — 根据项目类型生成标准化 Makefile 模板
2. **Validate** — 检查现有 Makefile 是否符合规范

核心原则:**注释即文档,`make` 即入口。**

## Mode Selection

```
用户说 "创建/生成 Makefile" → Generate 模式
用户说 "validate/检查/lint Makefile" → Validate 模式
用户未明确 → 询问选择
```

---

## Generate 模式

### Template Selection

根据项目类型选择模板。如果用户未指定,通过以下方式自动检测:

1. 检查 `go.mod` → Go 模板
2. 检查 `package.json` → Node 模板
3. 检查 `pyproject.toml` 或 `setup.py` → Python 模板
4. 检查 `docker-compose.yml` → Docker 模板
5. 检查 `pnpm-workspace.yaml` 或 `lerna.json` → Monorepo 模板
6. 无法检测 → 询问用户选择

### Available Templates

| 模板 | 文件 | 适用场景 |
|------|------|----------|
| Go | `assets/Makefile.go.tmpl` | Go 项目,含 build/test/lint/docker |
| Node | `assets/Makefile.node.tmpl` | Node.js/TypeScript,自动检测包管理器 |
| Python | `assets/Makefile.python.tmpl` | Python 项目,含 venv/pytest/ruff |
| Docker | `assets/Makefile.docker.tmpl` | Docker Compose 项目,含 up/down/logs |
| Monorepo | `assets/Makefile.monorepo.tmpl` | 多包仓库,支持 filter 单包操作 |

### Generate Workflow

1. 检测或询问项目类型
2. 读取对应模板 `assets/Makefile.<type>.tmpl`
3. 根据项目实际情况调整变量(APP_NAME、端口等)
4. 写入 `Makefile`
5. 提示用户运行 `make` 验证 help 输出

### Convention

`## 描述` 写在 target 同一行,`make`(无参数)自动输出所有 target 及说明。

```makefile
.DEFAULT_GOAL := help

help: ## 显示帮助信息
	@grep -E '^[a-zA-Z_-]+:.*?## ' $(MAKEFILE_LIST) | sed 's/:.*##/:/' | awk -F: '{gsub(/^ /, "", $$2); printf "  \033[36m%-20s\033[0m %s\n", $$1, $$2}'

build: ## 编译项目
	go build ./...
```

### Rules

1. `.DEFAULT_GOAL := help` — 无参数 `make` 等同 `make help`
2. `.PHONY` 声明所有非文件 target
3. `##` 注释必须与 target 在同一行,格式:`target: deps ## 描述`
4. 描述用中文或英文,保持项目内一致
5. `help` 的 grep/awk 管线不要随意改动
6. 带依赖的 target:`setup-db: create-network ## 启动数据库`

---

## Validate 模式

### Trigger

```
用户说: "validate Makefile" / "检查 Makefile" / "lint Makefile"
```

### Workflow

1. 读取目标 Makefile(默认当前目录,或用户指定路径)
2. 按 `references/validation-rules.md` 中的规则逐项检查
3. 输出格式化报告

### Validation Rules Summary

**ERROR (必须修复):**
- E01: `.DEFAULT_GOAL := help` 存在
- E02: `help` target 存在
- E03: `help` 使用 `##` 解析
- E04: 每个非文件 target 有 `##` 注释
- E05: `##` 注释在同一行
- E06: `##` 后有空格
- E07: `.PHONY` 声明完整
- E08: 缩进使用 Tab

**WARNING (建议修复):**
- W01: 显式声明 `SHELL`
- W02: `clean` target 存在
- W03: 变量使用 `:=`
- W04: 长命令合理换行
- W05: `help` 管线包含 ANSI 高亮
- W06: target 按功能分组

**INFO (最佳实践):**
- I01: 常用 target 覆盖 (build/test/lint/clean)
- I02: VERSION 从 git 获取
- I03: Docker target 命名一致
- I04: 避免硬编码路径

### Output Format

From JsonLee12138/prompts, Apache-2.0.

More from JsonLee12138/prompts

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Apr 23, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from JsonLee12138

Cite this page

makefile skill. Agent Mart. https://agentmart.dev/skills/jsonlee12138-makefile (last updated 2026-10-24)