mcpField
P
prefer-make

prefer-make

github.com/lwlee2608Development1198 installsUpdated 1d ago
Repository

About prefer-make

prefer-make is a development skill for Go projects that prioritizes existing Makefile targets over direct Go commands. It guides developers to inspect available targets, use them for builds and checks, and verify results.

Key features

  1. 01Check Makefile targets before Go commands
  2. 02Discover targets with make help
  3. 03Prefer targets for build, test, lint, and formatting
  4. 04Fall back to Go commands only when needed
  5. 05Verify exit status and output

Use cases

  1. 01Running project tests through its Makefile
  2. 02Finding the correct build or lint target
  3. 03Avoiding duplicate flags in Make commands

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/lwlee2608/agent-skills --skill prefer-make

After installing, type/prefer-makein Claude Code to confirm it loaded.

Details

From the project README

Build with Make

This project uses a Makefile. Always prefer make targets over running go commands directly.

Rules

  1. Check the Makefile first before running any go build, go test, go run, go vet, go fmt, or golangci-lint command. Look for a corresponding target.
  2. Use the Makefile target instead of the raw go command. For example:
    • make build instead of go build ./...
    • make test instead of go test ./...
    • make lint instead of golangci-lint run
    • make run instead of go run main.go
    • make fmt instead of go fmt ./...
  3. Run make help to discover targets. If that fails, read the Makefile directly.
  4. Fall back to raw go commands only if no relevant Makefile target exists for the task.

Verification procedure

  1. Before executing, confirm the target exists by checking make help output or the Makefile.
  2. After execution, verify the command exited with status 0 and produced expected output.

Common mistakes to watch for

  • Assuming target names without checking. Don't guess that make unit-test exists — read the Makefile. Target names vary across projects.
  • Adding flags to make targets that already set them. For example, running make test ARGS="-v -race" when the Makefile already passes -race. Check what the target does before adding flags.
  • Running raw go test ./specific/pkg/... for a subset when the Makefile has a target that accepts a package argument (e.g., make test PKG=./specific/pkg/...).

Comments

Markdown supported