Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Set up a task an agent can finish well card 5 of 6

Done is written before the agent starts

builds on: Choose what to hand to an agent, Write a task the agent can finish, Give the context it can't find, Size tasks so each step is checkable, Ask for a plan before code, Give it an executable definition of done, Rule out shortcuts explicitly
These two tests are the definition of done. You write them before any code exists. - `test_filters_by_status`: done means only order 2, the refunded one, comes back. - `test_unknown_status_is_rejected`: a typo like `refundd` must fail loudly. Without this test, a typo could quietly return an empty export while the suite stays green. Then take three steps: 1. Run them and see red: `TypeError`, because `status` isn't a parameter yet. 2. Commit the file. 3. Tell the agent the file is read-only. **Afterwards, check:** `git diff <that commit> -- tests/export/test_status_filter.py` shows nothing.
// Python
# tests/export/test_status_filter.py
# db: test-database fixture the project already provides
import pytest
from orders.export import export_orders

def test_filters_by_status(db):
    db.add_order(id=1, status="paid")
    db.add_order(id=2, status="refunded")
    rows = export_orders(db, status="refunded")
    assert [r["id"] for r in rows] == [2]

def test_unknown_status_is_rejected(db):
    with pytest.raises(ValueError):
        export_orders(db, status="refundd")
Terms on this card
red
A test or check that is currently failing.
green
A test or check that is currently passing.
diff
The change under review in unified format: '-' lines removed, '+' lines added, unprefixed lines are unchanged context.
`TypeError`
Python exception raised when a function is called the wrong way, for example with a keyword argument it doesn't have.
the agent
The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
Learn this step by step on Bytewise
Lesson goal: Decide whether and how to delegate a real request, then turn it into a well-sized task: a clear goal and acceptance test, the right context, a plan step, explicit guardrails and small checkable increments. Explain which failure mode each element prevents. · the whole lesson