Makefile Workflow
Create or refine Makefiles that encode a reliable developer workflow. Mirror the project's existing tooling (Go, Node, Bazel, Supabase, etc.) and use low-noise output for successful runs.
Instructions
- •Ask for essentials if missing:
- •Primary language(s) and tooling (Go, Node, Bazel, Python, etc.)
- •Lint/format/test commands already in use
- •Whether the project wants
all,check, andfixtargets
- •Start with a clear, consistent target taxonomy:
- •
all: full local workflow (format + fix + tests + build + check-* targets) - •
check: CI-friendly checks (no mutation), prefercheck-*targets - •
format+check-format - •
lint+fix - •
test,build,coverage,clean
- •
- •Use the stricter naming convention for non-mutating checks:
- •Prefer
check-*over names liketype-check,bundle-check - •Example:
check-astro,check-bundle
- •Prefer
- •Reduce output noise for successful runs:
- •If the repo has
scripts/quiet-run.sh, wrap commands like:@./scripts/quiet-run.sh "Label" <command> - •Only use it where the project already does; don't invent a helper without asking.
- •If the repo has
- •Use
.PHONYfor non-file targets and group related sections with comments. - •Keep shell-safe loops and cross-platform sed where needed:
- •Prefer
rgfor file lists. - •Avoid scanning
node_modulesor vendor directories.
- •Prefer
- •For Go projects, include
golangci-lintverification hashes if.golangci.ymlis present. - •For frontend projects, prefer
npm run <task>orpnpm run <task>to preserve project scripts. - •If generation or formatting changes files, add
check-generatedorcheck-formatthat fails on a dirty git diff. - •For large repos, consider stamp files to avoid repeated work.
Recommended target patterns
Minimal workflow
- •
all:format fix test build - •
check:check-format lint test build
Go + linters
- •
lint-golangci,fix-golangci,verify-golangci-config - •
coverage,coverage-html,coverage-report,clean-coverage
Frontend + Supabase
- •
check-astro,check-bundle,test-e2e,db-push,db-reset,db-status,db-gen-types
Output expectations
When asked to create or update a Makefile:
- •Produce a ready-to-run Makefile tailored to the project.
- •Preserve existing targets and semantics; only add or adjust as needed.
- •Call out any assumptions (package manager, tools, coverage thresholds).