Skip to content

Task Authoring

Tasks are YAML files that describe what the AI agent should do, what constraints to enforce, and what files should change. This guide covers every aspect of wri

Tasks are YAML files that describe what the AI agent should do, what constraints to enforce, and what files should change. This guide covers every aspect of writing effective task definitions.

Task Structure

A complete task definition:

id: get-user-by-id
name: Add GET /users/:id endpoint
category: feature
difficulty: easy
fixture: my-express-app

prompt: |
  Add a GET /users/:id endpoint that returns a user by ID.
  Return 404 if the user doesn't exist.

expected:
  files_to_modify:
    - "src/routes/users.ts"
  files_to_ignore:
    - "**/*.test.ts"
  expected_line_count: 40

timeout_seconds: 120

Required Fields

FieldTypeDescription
idstringUnique identifier (used in CLI and artifact paths)
namestringHuman-readable task name
categorystringOne of: feature, bug-fix, refactor, edge-case, refusal
difficultystringOne of: easy, medium, hard
promptstringThe task description given to the AI agent

Expected Changes

The expected section helps Nella detect scope creep — when the agent modifies files outside the intended scope:

expected:
  files_to_modify:
    - "src/routes/users.ts"
    - "src/models/user.ts"
  files_to_ignore:
    - "**/*.test.ts"
    - "**/*.spec.ts"
  expected_line_count: 40
FieldDescription
files_to_modifyFiles the agent is expected to change. Any other modified file increases the scope creep ratio
files_to_ignoreFiles to exclude from scope creep analysis (e.g., test files)
expected_line_countApproximate expected diff size. Used for diff accuracy metrics

Scope Creep Ratio

Calculated as:

scope_creep = (unexpected_files / total_modified_files)

A ratio of 0.0 means all changes were within scope. A ratio of 0.5 means half the modified files were unexpected.

Fixture Reference

The fixture field points to a template project in fixtures/:

fixture: my-express-app

For CLI usage, you specify the repo path directly with -r.

Task Categories

CategoryPurposeExample
featureAdd new functionalityAdd a REST endpoint
bug-fixFix existing behaviorFix pagination offset error
refactorRestructure without changing behaviorExtract service class
edge-caseTest unusual inputs or boundariesHandle whitespace-only strings

Best Practices

  1. Be specific in constraints — Vague constraints like “don’t break anything” are unenforceable. Use specific file patterns and forbidden strings
  2. Use files_to_ignore for test files — Test files often change alongside source, but shouldn’t count as scope creep
  3. Set realistic timeout_seconds — Default is 120s. Increase for tasks requiring large test suites
  4. Group related constraints — Each constraint should check one thing. Multiple narrow constraints are better than one broad one
  5. Test your task definitions — Verify the task YAML parses correctly before giving it to an agent