Agent skill

makefile

Generate standard Makefile for Go projects with test, lint, clean, fmt, tidy, ci, and coverage targets following best practices

Stars 9
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/thrawn01/claude-dotfiles/tree/main/skills/makefile

SKILL.md

Generate Standard Makefile

Generate a Makefile with standard targets for Go projects.

Required Targets

  1. test: Run go test -v ./... to execute all tests
  2. lint: Run golangci-lint run ./... for linting
  3. clean: Run go clean and remove coverage files (coverage.out, coverage.html)
  4. fmt: Run go fmt ./... and verify no changes with git diff --exit-code
  5. tidy: Run go mod tidy and verify no changes with git diff --exit-code
  6. ci: Run all checks (tidy, fmt, lint, test) and display success message
  7. coverage: Generate coverage report and HTML output

Format Requirements

  • Use .PHONY declaration for all targets
  • Each command should use tab indentation
  • The ci target should display a green success message: "EVERYTHING PASSED!"
  • Coverage target should output the location of the HTML report

Template

makefile
.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.

Expand your agent's capabilities with these related and highly-rated skills.

thrawn01/claude-dotfiles

functional-testing

Write functional tests that test public interfaces only (HTTP APIs via requests, libraries via exported functions, CLIs via command execution). Never test internal functions directly. Expose observability APIs for internal behavior testing.

9 0
Explore
mattpocock/skills

setup-pre-commit

Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.

111,310 9,758
Explore
mattpocock/skills

git-guardrails-claude-code

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

111,310 9,758
Explore
mattpocock/skills

handoff

Compact the current conversation into a handoff document for another agent to pick up.

111,310 9,758
Explore
mattpocock/skills

edit-article

Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

111,310 9,758
Explore
mattpocock/skills

scaffold-exercises

Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.

111,310 9,758
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results