关于 makefile-review
makefile-review 是用于审查 Makefile 实践、重复内容、依赖关系和可移植性的 Skill。它引导开发者为构建系统和 CI/CD 流水线变更整理有依据的审查结论。
主要功能
- 01梳理项目与 Makefile 上下文
- 02分析目标依赖关系
- 03检查重复内容
- 04审查可移植性与工具一致性
- 05通过引用验证结论
适用场景
- 01审查 Makefile 变更
- 02优化构建系统
- 03检查可移植性
- 04评估 CI/CD 流水线更新
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ athola/ claude-night-market --skill makefile-review安装后在 Claude Code 中输入/makefile-review确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
modules/best-practices.mddeduplication-patterns.mddependency-graph.mdplugin-dogfood-checks.mdportability-checks.md详细介绍
原文在翻译后有更新,译文可能不是最新。
测试
运行 pytest plugins/pensive/tests/skills/test_makefile_review.py,验证审查逻辑。
Makefile 审查工作流
审核 Makefile 是否符合最佳实践、是否消除了重复,以及是否具备可移植性。
快速开始
/makefile-review
适用场景
- 修改或新增 Makefile
- 优化构建系统
- 改进可移植性
- 更新 CI/CD 流水线
- 改进开发者体验
不适用场景
- 创建新的 Makefile——使用 abstract:make-dogfood
- 架构审查——使用 architecture-review
必需的 TodoWrite 项
makefile-review:context-mappedmakefile-review:dependency-graphmakefile-review:dedup-candidatesmakefile-review:tooling-alignmentmakefile-review:evidence-loggedmakefile-review:findings-verified
工作流
步骤 1:梳理上下文(makefile-review:context-mapped)
确认基线:
pwd && git status -sb && git diff --stat
验证: 运行 git status,确认工作树状态。
查找与 Make 相关的文件:
rg -n "^include" -g'Makefile*'
rg --files -g '*.mk'
记录已更改的目标、项目目标和工具要求。
步骤 2:依赖关系图(makefile-review:dependency-graph)
@include modules/dependency-graph.md
步骤 3:重复项审查(makefile-review:dedup-candidates)
@include modules/deduplication-patterns.md
步骤 4:可移植性检查(makefile-review:tooling-alignment)
@include modules/portability-checks.md
步骤 5:证据记录(makefile-review:evidence-logged)
使用 imbue:proof-of-work 记录命令输出,并注明文件:行号引用。
总结审查结果:
- 严重性(严重、主要、次要)
- 预期影响
- 建议的重构
- 后续跟进的负责人和日期
渐进式加载
按需加载其他上下文:
最佳实践与示例:@include modules/best-practices.md
插件 Dogfood 检查:@include modules/plugin-dogfood-checks.md - Makefile 完整性分析、目标生成和 dogfooding 验证。
输出格式
## Summary
Makefile review findings
## Context
- Files reviewed: [list]
- Targets changed: [list]
## Dependency Analysis
[graph and issues]
## Duplication Candidates
### [D1] Repeated command
- Locations: [list]
- Anchor: `verbatim source text at file:line`
- Recommendation: [pattern rule]
## Portability Issues
[cross-platform concerns]
## Missing Targets
- [ ] help
- [ ] format
- [ ] lint
## Recommendation
Approve / Approve with actions / Block
验证审查结果有据可依(makefile-review:findings-verified)
将审查结果写入 .review/findings.json,运行引用验证器
(Skill(imbue:review-core) 第 5 步),并删除验证器拒绝的结果,或将其标记为
UNVERIFIED。
退出标准
- 已梳理上下文
- 已分析依赖关系
- 已审查重复项
- 已检查可移植性
- 已记录证据
- 每项报告结果都带有
Location和经citation_verifier.py(退出码为0)确认的原文Anchor;或者,未验证的结果已被删除或标记为UNVERIFIED
故障排除
常见问题
未找到 Makefile
确保项目根目录中存在 Makefile 或 *.mk 文件,或明确指定路径。
未解析 include 指令
运行 rg -n "^include" -g'Makefile*',手动追踪 include 链。