Agent skill
makefile
Generate standard Makefile for Go projects with test, lint, clean, fmt, tidy, ci, and coverage targets following best practices
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/testing/makefile
SKILL.md
Generate Standard Makefile
Generate a Makefile with standard targets for Go projects.
Required Targets
- test: Run
go test -v ./...to execute all tests - lint: Run
golangci-lint run ./...for linting - clean: Run
go cleanand remove coverage files (coverage.out, coverage.html) - fmt: Run
go fmt ./...and verify no changes withgit diff --exit-code - tidy: Run
go mod tidyand verify no changes withgit diff --exit-code - ci: Run all checks (tidy, fmt, lint, test) and display success message
- coverage: Generate coverage report and HTML output
Format Requirements
- Use
.PHONYdeclaration for all targets - Each command should use tab indentation
- The
citarget should display a green success message: "EVERYTHING PASSED!" - Coverage target should output the location of the HTML report
Template
.PHONY: test lint clean fmt tidy ci coverage
test:
go test -v ./...
lint:
golangci-lint run ./...
clean:
go clean
rm -f coverage.out coverage.html
fmt:
go fmt ./... && git diff --exit-code
tidy:
go mod tidy && git diff --exit-code
ci: tidy fmt lint test
@echo
@echo "\033[32mEVERYTHING PASSED!\033[0m"
coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report: coverage.html"
Create this Makefile at the root of the project. If the project needs additional targets (like proto for protocol buffers), ask the user first.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?