makefile-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Table of Contents

目录

Testing

测试

Run
pytest plugins/pensive/tests/skills/test_makefile_review.py
to verify review logic.
运行
pytest plugins/pensive/tests/skills/test_makefile_review.py
验证评审逻辑。

Makefile Review Workflow

Makefile评审工作流

Audit Makefiles for best practices, deduplication, and portability.
审计Makefile是否符合最佳实践、是否存在重复代码、可移植性是否达标。

Quick Start

快速开始

bash
/makefile-review
bash
/makefile-review

When To Use

适用场景

  • Makefile changes or additions
  • Build system optimization
  • Portability improvements
  • CI/CD pipeline updates
  • Developer experience improvements
  • Makefile变更或新增
  • 构建系统优化
  • 可移植性改进
  • CI/CD流水线更新
  • 开发者体验优化

When NOT To Use

不适用场景

  • Creating new Makefiles - use abstract:make-dogfood
  • Architecture review - use architecture-review
  • 创建新的Makefile:请使用abstract:make-dogfood
  • 架构评审:请使用architecture-review

Required TodoWrite Items

必填待办项

  1. makefile-review:context-mapped
  2. makefile-review:dependency-graph
  3. makefile-review:dedup-candidates
  4. makefile-review:tooling-alignment
  5. makefile-review:evidence-logged
  1. makefile-review:context-mapped
  2. makefile-review:dependency-graph
  3. makefile-review:dedup-candidates
  4. makefile-review:tooling-alignment
  5. makefile-review:evidence-logged

Workflow

工作流

Step 1: Map Context (
makefile-review:context-mapped
)

步骤1:上下文映射 (
makefile-review:context-mapped
)

Confirm baseline:
bash
pwd && git status -sb && git diff --stat
Verification: Run
git status
to confirm working tree state.
Find Make-related files:
bash
rg -n "^include" -g'Makefile*'
rg --files -g '*.mk'
Document changed targets, project goals, and tooling requirements.
确认基线:
bash
pwd && git status -sb && git diff --stat
验证: 运行
git status
确认工作树状态。
查找Make相关文件:
bash
rg -n "^include" -g'Makefile*'
rg --files -g '*.mk'
记录变更的构建目标、项目目标和工具要求。

Step 2: Dependency Graph (
makefile-review:dependency-graph
)

步骤2:依赖图 (
makefile-review:dependency-graph
)

@include modules/dependency-graph.md
@include modules/dependency-graph.md

Step 3: Deduplication Audit (
makefile-review:dedup-candidates
)

步骤3:重复项审计 (
makefile-review:dedup-candidates
)

@include modules/deduplication-patterns.md
@include modules/deduplication-patterns.md

Step 4: Portability Check (
makefile-review:tooling-alignment
)

步骤4:可移植性检查 (
makefile-review:tooling-alignment
)

@include modules/portability-checks.md
@include modules/portability-checks.md

Step 5: Evidence Log (
makefile-review:evidence-logged
)

步骤5:证据日志 (
makefile-review:evidence-logged
)

Use
imbue:evidence-logging
to record command outputs with file:line references.
Summarize findings:
  • Severity (critical, major, minor)
  • Expected impact
  • Suggested refactors
  • Owners and dates for follow-ups
使用
imbue:evidence-logging
记录命令输出,并附上文件:行号引用。
总结发现问题:
  • 严重等级(critical、major、minor)
  • 预期影响
  • 建议重构方案
  • 跟进负责人与截止日期

Progressive Loading

渐进式加载

Load additional context as needed:
Best Practices & Examples:
@include modules/best-practices.md
Plugin Dogfood Checks:
@include modules/plugin-dogfood-checks.md
- Makefile completeness analysis, target generation, and dogfooding validation.
按需加载额外上下文:
最佳实践与示例:
@include modules/best-practices.md
插件自验检查:
@include modules/plugin-dogfood-checks.md
- 用于Makefile完整性分析、目标生成和自验验证。

Output Format

输出格式

markdown
undefined
markdown
undefined

Summary

Summary

Makefile review findings
Makefile review findings

Context

Context

  • Files reviewed: [list]
  • Targets changed: [list]
  • Files reviewed: [list]
  • Targets changed: [list]

Dependency Analysis

Dependency Analysis

[graph and issues]
[graph and issues]

Duplication Candidates

Duplication Candidates

[D1] Repeated command

[D1] Repeated command

  • Locations: [list]
  • Recommendation: [pattern rule]
  • Locations: [list]
  • Recommendation: [pattern rule]

Portability Issues

Portability Issues

[cross-platform concerns]
[cross-platform concerns]

Missing Targets

Missing Targets

  • help
  • format
  • lint
  • help
  • format
  • lint

Recommendation

Recommendation

Approve / Approve with actions / Block
undefined
Approve / Approve with actions / Block
undefined

Exit Criteria

退出标准

  • Context mapped
  • Dependencies analyzed
  • Deduplication reviewed
  • Portability checked
  • Evidence logged
  • 上下文已映射
  • 依赖已分析
  • 重复项已评审
  • 可移植性已检查
  • 证据已记录

Troubleshooting

问题排查

Common Issues

常见问题

No Makefile found Ensure
Makefile
or
*.mk
files exist in the project root or specify paths explicitly.
Include directives not resolved Run
rg -n "^include" -g'Makefile*'
to trace include chains manually.
未找到Makefile 确保项目根目录存在
Makefile
*.mk
文件,或显式指定文件路径。
Include指令无法解析 运行
rg -n "^include" -g'Makefile*'
手动追踪include引用链。