Manuals / AI Coding with Cursor / Ch 2

A · Task DesignBeginner35 min read

2. Writing agent task briefs

AI Coding with Cursor · 44 pages source format

Agents fail on vague tasks. A good brief: goal, scope (files/paths), constraints, acceptance criteria, and what NOT to touch.

What you'll learn

  • Task briefs
  • Scope control
  • Acceptance criteria

Brief template

Goal / Files / Constraints / Acceptance / Do-not-touch.

## Goal
Add client-side email validation to LoginForm.jsx

## Files
- src/components/LoginForm.jsx
- src/components/LoginForm.test.jsx (create if missing)

## Constraints
- Use existing form library (react-hook-form)
- Show inline error below field
- No new dependencies

## Acceptance
- Invalid email shows "Enter a valid email"
- Valid email clears error
- Test covers both cases

## Do NOT touch
- Auth logic in src/api/auth.js
- Routing

Do this now

Write a brief for "add input validation to the login form." Run it.

Clear?

Scope creep prevention

"Do NOT touch" is as important as the goal. Agents love to refactor neighboring code.

Do this now

Run a brief with and without do-not-touch. Compare diff size.

Clear?

Checklist