Yeda AI Tips · #097

Español

Have the Agent Discover the Project's Own Commands

Your AI agent is running the wrong test command. It types npm test in a repo that gates merges on npm run test:ci, or bare pytest in a project whose real suite runs through tox. A guessed command can pass while the actual suite fails — or quietly skip the checks that gate the repo. Canonical always beats guessed.

Why guessed commands lie

A generic command is not "roughly right." It can be wrong in ways that look green:

The result is an agent that reports "tests pass" on work the repo would reject. The fix isn't a smarter guess — it's telling the agent to stop guessing.

The discovery pass

Before the agent runs anything generic, have it read the project surface and record the exact commands it finds. One instruction covers it:

Before running any build, test, or lint command, inspect the repo's own definitions — package manifests, task runners, and CI — and use the exact commands defined there. Never substitute a generic equivalent.

Where the truth usually lives:

SurfaceWhat to readWhat it yields
package.jsonthe scripts fieldnpm run build, npm run test:ci, npm run lint
pyproject.toml[project], [tool.*] tablestest runner config, lint/type-check settings, entry points
Makefile / justfiletargetsmake test, make check — often the wrapper CI itself calls
.github/workflows/*.ymlrun: steps in each jobthe literal commands that gate merges
CONTRIBUTING.md / AGENTS.mdsetup and check sectionshuman-documented commands and their order

CI workflows are the highest-authority source: whatever runs in the merge-gating job is the definition of "green" for that repo.

Record it, don't rediscover it

Discovery is cheap once and wasteful every time. After the first pass, have the agent write the findings down — in your agent instructions file (AGENTS.md, CLAUDE.md, or your tool's equivalent):

## Commands (discovered from CI + Makefile)
- Build: npm run build
- Type check: npm run typecheck
- Lint: npm run lint
- Tests (what CI runs): npm run test:ci

Now every future session starts with the canonical commands already in context, and a green result really means ready.

Power-user moves

Resources

Building an AI feature? Yeda AI designs, audits, and ships production LLM systems.

Talk to us · Read the blog