How to Brief an AI Coding Agent

Write an agent brief with a goal, constraints, and a definition of done. See weak versus strong tasks for Pi, Hermes, Cursor, and other coding agents.

Manage the Agent. Do Not Script It.

A chat prompt can be a paragraph. An agent brief is a job ticket. If you paste a 40-step script, the agent will follow the script even when the repo disagrees. If you paste a goal with no fences, it will wander. You are the manager: goal, constraints, definition of done. The agent picks the steps. That is the whole skill — and it assumes the agent is already calling the Gab AI API with your key, not OpenAI or Anthropic.

The Four Parts of a Brief

Write these four every time. Skip one, and the loop fills the gap with a guess.

Scope Beats Ambition

"Build the app" is not a first job. Neither is "refactor everything." Give the agent a slice you could review in five minutes. When that slice is done, start a new loop for the next slice — with a fresh brief, not an endless thread that has forgotten the original goal. If the agent asks a clarifying question, answer it. That is cheaper than letting it invent a product decision.

Steering mid-run

Do not paste secrets into the brief

API keys, .env files, and production credentials do not belong in the prompt. The agent can use your Gab AI key from the CLI config. If a task needs a secret, tell it which env var to read — not the value.

  1. Goal — one sentence — What will be true when this is over? "The empty-email login case returns 400." Not "look at auth."
  2. Context — where to look, not a novel — Point at paths, failing tests, or URLs. Let the agent read the files. Pasting the whole repo into the prompt wastes the context window and goes stale the moment the agent edits something.
  3. Constraints — what not to touch — Directories, dependencies, public APIs, coding style, "do not commit," "do not push," "do not delete fixtures." Agents are more dangerous than chats because they can actually do those things.
  4. Definition of done — a check the agent can run — A test command, a file that should exist, a grep that should match, a screenshot criterion. If done is a vibe, the loop never ends.

Do not paste secrets into the brief

API keys, .env files, and production credentials do not belong in the prompt. The agent can use your Gab AI key from the CLI config. If a task needs a secret, tell it which env var to read — not the value.