Skip to content
PortBay

AI coding agents

How to assign tasks to AI coding agents (and get verified work back)

A written card, a checkable done-line, a claim, a report back — the four-part contract that makes agent delegation work, and how each current tool implements it.

Nour Beiruti8 min read

Assigning a task to an AI coding agent works best when it looks like assigning a task to a teammate: a written card with a clear definition of done, an explicit assignee, a claim so nobody else grabs it, and a report back when it's finished. Most failed agent workflows skip one of those four — the task lives in a prompt buffer, the “assignment” is a copy-paste, two runs collide, or the work finishes silently and nobody can say what changed.

Write tasks an agent can actually execute

Agents fail on vague cards for the same reason contractors do. A card that dispatches well has four parts:

  • Outcome, not activity.“Users can reset their password by email” beats “work on auth.”
  • Where: the route, module or package the change belongs in. This is also your parallelism boundary — two agents, two surfaces.
  • Done means:something checkable. “The reset email arrives in the inbox and the link works over HTTPS” is checkable; “implemented correctly” is not.
  • Constraints: what not to touch, which dependency to use, any convention the codebase cares about.

If you can't write the “done means” line, the task isn't ready for an agent — it's still a design question.

The assignment mechanics, tool by tool

The current tools express “assign” differently:

  • Terminal session (Claude Squad): assignment is starting a session — fast, but the task description lives in the prompt, not in an artifact you can review later.
  • Dispatch button (Vibe Kanban, Kanbots): the card is the task; a button launches the chosen agent against a worktree.
  • Workspace creation (Superset, Conductor): assignment means opening a branch/workspace and pointing an agent at it — natural if your unit of work is a PR.
  • Board assignment (PortBay): a card has an assignee field like any tracker. Move it to Todo and the assigned agent — Claude Code, Codex, Cursor or Antigravity — is dispatched automatically. Or skip the field entirely: type @claude (or any installed agent) in a card comment with a directive, and the agent takes it from there.

Claims: the unglamorous part that saves you

The moment two agents can see the same task list, you need a claim mechanism — the multi-agent equivalent of “assignee” plus “in progress.” Worktree tools get isolation structurally (each run owns its checkout). Board tools need a lease: in PortBay, dispatch moves the card to In Progress under a lease so a second agent can't claim it, the way two teammates don't both pick up the same ticket. However it's implemented, the invariant is the same: one task, one owner, visibly marked.

The report-back: where agent workflows earn trust

A teammate who silently merges is a problem; an agent that does is a bigger one, because there are more of them. The workflow is only as good as its completion contract:

  1. The agent finishes the work.
  2. It verifies against the definition of done — which requires an environment where the app actually runs: a database for the migration, a real https://yourapp.test URL for the page, an inbox for the email. (This is why the environment layer matters more than orchestration.)
  3. It describes what changed — on the card, in plain language, where the next human or agent will look.
  4. It advances the state — the card moves itself to Done. Status that humans must update by hand decays in a day.

A worked example

The full loop in PortBay, end to end:

Card: "Password reset by email"
Where: auth module, /forgot-password route
Done means: submitting the form sends a reset email
  (visible in the local inbox); the link sets a new
  password over https://myapp.test
Constraints: use the existing mailer config; don't
  touch the session middleware

Assignee: Claude Code → move to Todo

PortBay dispatches Claude Code inside the running project. The card goes In Progress under a lease; the agent implements the flow, sends a real email into the built-in inbox, loads the reset page over HTTPS, then comments — “Added ForgotPasswordController, mail template, and tests; verified the email renders and the token flow completes” — and moves the card to Done. Review starts from a described, tested change.

Start smaller than feels useful

The teams getting value from agent delegation started with bounded, boring cards — a validation rule, an export, a flaky selector — and ratcheted scope up as the completion contract held. Write one card with a checkable done-line, assign it, and watch whether the report back matches reality. That single loop, repeated, is the whole workflow. PortBay is free and open source if you want the board and the environment in one app.

PortBay mascot — a friendly blue tugboat

Run your first local site in one click.

Download for macOS

Free & open source · macOS 11+ on Apple Silicon · Pro from $10/mo