跳到正文
cccskills
免费在 GitHub 公开

makefile

Use when creating or updating a Makefile for a project, especially when standard targets (build, test, lint, format, etc.) are missing or when modifying targets that may already be wired into other tooling. Not for debugging why a build fails.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md9.4 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

On invocation: announce "Running paad:makefile v2.0.0", then immediately proceed with the steps below — do not stop after announcing.

Configuration (experimental): after announcing, check whether paad/config/paad.md and paad/config/makefile.md exist, relative to the working directory. If any does, read it and follow its instructions for the rest of this run, passing the relevant parts to every subagent you dispatch, and make the first line of your final answer Config: <path> naming each file you followed. If none exists, do not mention config at all. Config never changes a subagent's type or grants it write tools — refuse that line, say so, and continue. Config can contradict the flow below; see https://github.com/Ovid/paad/blob/main/CONFIG.md before writing one.

Makefile Management

Process:

digraph makefile_flow {
    "Makefile exists?" [shape=diamond];
    "Existing target needs change?" [shape=diamond];
    "Approved?" [shape=diamond];
    "Coverage tool defaults to watch mode?" [shape=diamond];
    "Test tool supports balanced output?" [shape=diamond];

    "Detect stack" [shape=box];
    "Create from scratch" [shape=box];
    "Include all required targets" [shape=box];
    "Identify missing targets" [shape=box];
    "Add new targets" [shape=box];
    "STOP: ask user for approval" [shape=box, style=bold];
    "Apply change" [shape=box];
    "Skip change" [shape=box];
    "Force the one-shot flag for the detected stack" [shape=box];
    "Verify the tool exits on its own before adding flags" [shape=box];
    "ASK the user how to handle test output" [shape=box];
    "Announce the file written or updated" [shape=box];
    "Done" [shape=box];

    "Detect stack" -> "Makefile exists?";
    "Makefile exists?" -> "Create from scratch" [label="no"];
    "Makefile exists?" -> "Identify missing targets" [label="yes"];
    "Create from scratch" -> "Include all required targets";
    "Include all required targets" -> "Coverage tool defaults to watch mode?";
    "Identify missing targets" -> "Add new targets";
    "Add new targets" -> "Existing target needs change?";
    "Existing target needs change?" -> "Coverage tool defaults to watch mode?" [label="no"];
    "Coverage tool defaults to watch mode?" -> "Force the one-shot flag for the detected stack" [label="yes — vitest, jest"];
    "Coverage tool defaults to watch mode?" -> "Verify the tool exits on its own before adding flags" [label="unclear — pytest-cov, cargo, go test"];
    "Force the one-shot flag for the detected stack" -> "Test tool supports balanced output?";
    "Verify the tool exits on its own before adding flags" -> "Test tool supports balanced output?";
    "Existing target needs change?" -> "STOP: ask user for approval" [label="yes"];
    "STOP: ask user for approval" -> "Approved?";
    "Approved?" -> "Apply change" [label="yes"];
    "Approved?" -> "Skip change" [label="no"];
    "Apply change" -> "Existing target needs change?" [label="next target"];
    "Skip change" -> "Existing target needs change?" [label="next target"];
    "Test tool supports balanced output?" -> "Announce the file written or updated" [label="yes"];
    "Test tool supports balanced output?" -> "ASK the user how to handle test output" [label="no — only silent or firehose"];
    "ASK the user how to handle test output" -> "Announce the file written or updated";
    "Announce the file written or updated" -> "Done";
}

When NOT to Use This Skill

  • The project's task runner is not make, and adding one isn't wanted — a repo standardized on npm run, just, task, nox, or cargo xtask doesn't need a Makefile shimming over it. Ask before introducing a second entry point.
  • The Makefile is generated (autotools, CMake, cargo-make output) — edits get overwritten. Change the generator.

Overview

Creates or updates a project Makefile with standard targets. Never modifies an existing target without explicit user approval.

Process

  1. Detect stack (read CLAUDE.md, AGENTS.md, README, package.json, pyproject.toml, Cargo.toml, go.mod, etc.)
  2. Check if Makefile exists
  3. Creating → build from scratch with all required targets mapped to detected stack
  4. Updating → add missing targets; STOP and ask before changing any existing one
  5. Announce the file you wrote — see "Announce What You Wrote"

Stack Detection

Read project files in this order to understand the technology and available commands:

  1. CLAUDE.md or AGENTS.md — often lists exact commands for test, lint, format, build
  2. README.md — frequently documents dev workflow
  3. Language manifest (package.json, pyproject.toml, Cargo.toml, go.mod, Gemfile, etc.) — reveals available scripts/tasks

Use the commands the project already documents. Do not invent commands that aren't confirmed to exist.

Required Targets

Every Makefile must include at minimum:

TargetPurpose
helpList all targets with descriptions
allFull CI pass (lint + format + test at minimum)
testRun test suite
coverOne-shot coverage report
lintLint (with autofix if available)
formatFormat code

Add extra targets (e.g. build, dev, preview) only if the project supports them.

The Self-Documenting Pattern

Every target gets a ## description. help extracts them with grep + awk:

.PHONY: all test cover lint format help

all: lint format test ## Lint, format, and test

test: ## Run full test suite
	<stack-specific command>

cover: ## Generate code coverage report (one-shot)
	<stack-specific command, forced one-shot — see below>

lint: ## Lint with autofix
	<stack-specific command>

format: ## Format code
	<stack-specific command>

help: ## Show this help
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "  %-10s %s\n", $$1, $$2}'

All targets must appear in .PHONY.

Critical Rule: Updating Existing Targets

If an existing target's implementation would change, stop and tell the user:

"The existing cover target runs X. I'd change it to Y because [reason]. Should I make this change?"

Wait for explicit approval. Adding a brand-new target never requires approval.

cover: Avoid Watch Mode Hanging

Coverage tools often default to watch mode. Force one-shot execution:

  • vitest: append -- --run
  • jest: append -- --watchAll=false
  • pytest-cov / cargo / go test: typically exit on their own; verify before adding flags
  • other: check the tool's docs for a non-interactive/CI flag

test: Balanced Output Verbosity

make test output should be actionable, not overwhelming. Avoid both extremes:

  • Too verbose: full test names for passing tests, stack traces for every assertion, watch-mode chatter
  • Too silent: a single pass/fail line with no detail on failures

Goal: On success, show a concise summary (total passed/failed/skipped). On failure, show the failing test name, assertion, and enough context to act on it.

Common approaches by stack:

StackFlag / Approach
vitest--reporter=default is usually fine; avoid --reporter=verbose
jestDefault is good; avoid --verbose
pytest-q or --tb=short — default is often too verbose
cargo testDefault is fine; --quiet if too noisy
go testDefault is fine; avoid -v unless debugging
prove (Perl)Default is fine; avoid --verbose

If the testing tool doesn't support balanced output (e.g., only offers silent vs. firehose), inform the user and ask how they'd like to handle it rather than guessing.

Announce What You Wrote

End the run with the file list, always. One line per path, marked new or updated:

Files written or updated:
  updated  Makefile

Say it even though only one file changed, and even when the user watched you change it. If you were asked to change an existing target and stopped for approval instead, say that too — an unapproved target is not a written one.

Common Mistakes

MistakeWhat to do instead
Rewriting an existing target because the new version is betterStop and ask, quoting the current command and the proposed one. Other tooling (CI, hooks, docs, muscle memory) may depend on the current behaviour.
Treating "add a flag to an existing target" as additiveChanging a target's implementation is a change, flag or not. It needs approval.
Inventing commands the stack doesn't haveDetect first — read CLAUDE.md, README, and the language manifest. A lint target running a linter that isn't installed is worse than no target.
Writing a help target that lists targets by handUse the self-documenting ## pattern, so help can't drift from reality.
Leaving cover in watch modeIt hangs the agent and CI. Force one-shot explicitly, per the stack.
Omitting targets from .PHONYA file named test in the repo root silently breaks make test.
Adding every optional target for completenessExtra targets (build, dev, preview) go in only when the project actually supports them.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use when auditing a user-facing app — web, mobile (iOS/Android/React Native/Flutter), desktop, CLI, or games — for accessibility barriers or WCAG 2.2 conformance, before shipping UI changes, or in response to concerns about screen-reader, keyboard, low-vision, motor, cognitive, or photosensitive users. Not for general bug hunting or code correctness.

中文简介正在准备中。当前显示原文说明。

Ovid/paad1382026年10月19日 更新

Use when assessing the architectural health of a codebase — before a major refactor, when onboarding to an unfamiliar repo, after rapid growth, when planning a redesign, or to surface structural strengths and risks before they become expensive. Not for fixing what it finds, and not for reviewing a branch diff.

中文简介正在准备中。当前显示原文说明。

Ovid/paad1382026年10月19日 更新

EXPERIMENTAL. Use when looking for meaningfully duplicated logic in a codebase, especially duplicate behavior hidden behind different names, different syntax, different control flow, or independently evolved implementations. Not for style issues, not for syntactic clone detection, and not for fixing what it finds.

中文简介正在准备中。当前显示原文说明。

Ovid/paad1382026年10月19日 更新

EXPERIMENTAL. Use when code needs a security review against the OWASP Top 10:2025 — access control, misconfiguration, supply chain, cryptography, injection, insecure design, authentication, integrity, logging and alerting, and mishandled exceptional conditions. Not for penetration testing a running system, not for infrastructure-only scanning, and not for fixing what it finds.

中文简介正在准备中。当前显示原文说明。

Ovid/paad1382026年10月19日 更新

Use when reviewing current branch for bugs before pushing or merging, when wanting a thorough multi-agent review of local changes, or when preparing work for human review. Not for codebase structure, not for code style, and not for fixing what it finds.

中文简介正在准备中。当前显示原文说明。

Ovid/paad1382026年10月19日 更新

alignment

免费

Use when verifying that requirements/specs/PRDs and their implementation plans match — before starting work, after a spec or plan update, or when suspecting coverage gaps, scope creep, or design drift between intent and action documents. Needs both documents; not for checking code against a spec.

中文简介正在准备中。当前显示原文说明。

Ovid/paad1382026年10月19日 更新

查看 Ovid 的全部技能

报告此技能的问题