Loading WURK...
RomanMotion
RomanMotion
Product ad & launch videos · 3D product visuals · app & AI builder. Concept to final cut in days. Open for projects.

Give your coding agent one command for everything: a Makefile for vibe coders

Stop guessing how to run your project. One Makefile gives you and your coding agent the same setup, test, lint and check commands.

Published on November 11, 20265 min read

You ask your coding agent to add a small feature, it edits three files, runs python app.py because that's what it guessed, and tells you it's done. No tests ran, no linter ran, and you find out later when the app breaks on something that already worked. A five-minute file gives both of you one command each for setup, dev, test, lint and check.

The short answer: put a Makefile in the project root with six fixed targets: setup, dev, test, lint, fmt, check. You type make test, your agent types make test, and make check becomes what "done" means. In a JavaScript project the same thing lives in package.json scripts. That's the whole idea; the rest is copy-paste. If you want a coding agent that works this way from the first session, you can try the zcode agent harness free and point it at the Makefile below.

Every project runs differently

The annoying part isn't that projects differ. It's that your agent doesn't know which kind yours is, and guesses anyway. One project wants pip install -r requirements.txt, another poetry install, another uv sync. On the JavaScript side, npm, pnpm and yarn all look alike from the outside and take different flags. The README says one thing, the agent tries another, and when the README is three months stale, the guess wins.

Each new session starts this discovery from zero. Session one figured out your virtualenv lives in .venv and tests run with pytest -q. Session two has no memory of that, runs python -m pytest from the wrong folder, watches it fail, and quietly moves on. Meanwhile you believe tests ran. They didn't.

So write the six commands down once, in a place both of you actually read.

The Makefile: copy, paste, adjust

.PHONY: help setup dev test lint fmt check

help:
	@echo "Targets: setup dev test lint fmt check"

setup:
	python3 -m venv .venv
	.venv/bin/pip install -r requirements.txt

dev:
	.venv/bin/uvicorn app.main:app --reload

test:
	.venv/bin/pytest

lint:
	.venv/bin/ruff check .

fmt:
	.venv/bin/ruff format .

check: lint test

Swap the dev line for whatever actually starts your app: .venv/bin/flask run for Flask, .venv/bin/python app.py for a plain script. The .PHONY line tells make these names are commands, not files, so a stray file called test can't stop make test from running (GNU make manual, Phony Targets). Because help is the first target, typing plain make prints the list.

Two details do the real work. Every recipe line starts with a real TAB character. That isn't a style choice: by default make only treats tab-indented lines as recipe lines (GNU make manual, Recipe Syntax). And check depends on lint and test, so make runs lint first, and if lint fails, it stops before the tests. make check passing means both passed.

The JavaScript version: npm scripts

{
  "scripts": {
    "setup": "npm install",
    "dev": "vite",
    "test": "vitest run",
    "lint": "eslint .",
    "fmt": "prettier --write .",
    "check": "npm run lint && npm run test"
  }
}

Same shape, no new tools to learn: npm runs any command defined under scripts in package.json with npm run <name> (npm scripts docs). check chains lint and test with &&, so a lint failure blocks the tests, same as the Makefile version. Swap vite and vitest for whatever your project uses; the script names are the part that stays fixed.

Tell your agent the rule

The Makefile only helps if the agent uses it. Add this to the project instructions file your agent reads at the start of every session:

Project rules:
- Every project command is a Makefile target: setup, dev, test, lint, fmt, check.
- Run `make check` before you say anything is done. Fix what it reports, run it again.
- Never invent one-off install, test or lint commands. If a command is missing, add it as a new target and tell me you did.
- When you report done, include the last line of `make check` output.

The last line is the quiet win. "Done, make check passes" is a claim you can verify yourself in seconds by running the same command.

A make check loop means your agent runs tests and lint many times a session, so it pays to know what that usage costs you. If you're picking a monthly plan for it, this link gets you 10% off GLM coding plans.

The checklist

  • Makefile (or package.json scripts) in the project root
  • All six targets exist: setup, dev, test, lint, fmt, check
  • check runs lint and test, nothing else
  • make help prints the target list
  • Recipe lines start with a real tab
  • Your project instructions tell the agent to run make check before saying done
  • New commands become targets, not ad-hoc shell lines

Pitfalls that bite

Tabs that became spaces. Your editor may convert tabs to spaces on save, and make then fails with missing separator. Editors that support EditorConfig keep the tabs if you add this file as .editorconfig in the repo root:

[Makefile]
indent_style = tab

Targets that silently pass. A target like test: ; pytest || true exits green no matter what pytest found, and a check that runs only lint isn't a check. The test: break the code on purpose once, run make check, and confirm it actually fails. If it prints green with broken code, fix the target before you trust it again.

Commands that need env vars. make dev dies because DATABASE_URL isn't set, in every fresh session until you notice. Make the target catch it early:

dev:
	@test -f .env || (echo "copy .env.example to .env first" && exit 1)
	.venv/bin/uvicorn app.main:app --reload

Ten minutes of setup, and "is it done?" stops being a feeling and becomes a command with an exit code. We write more about working with coding agents day to day, with real setups, on our blog.

If this saved you an afternoon, a small tip on this post keeps these guides coming.

Conversation

Join the conversation

Share your thoughts with the author and other readers.

Comments0

Checking your account…

Latest comments

0
No comments yet. Be the first to share your thoughts.