> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twill.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Delegation

> Common tasks you can hand off to Twill

Mention @twill wherever you work—Slack, GitHub, Linear, or the web app—and describe what you need. Here's what teams typically ask for.

## Bug Fixes

**How it works:** Describe the bug or paste an error message. Twill reproduces the issue, identifies the root cause, and opens a PR with the fix.

**Works best when:** You include reproduction steps, error messages, or stack traces. The more context, the faster the fix.

<Info>
  **Typical outcome:** Shorter time-to-fix for well-scoped bugs, with less
  context switching during the day.
</Info>

***

## Small Features

**How it works:** Describe what you want—add a new API endpoint, update a form, add a button. Twill asks clarifying questions if needed, then delivers a PR.

**Works best when:** The scope is clear and well-defined. One feature per request.

<Info>
  **Typical outcome:** Small changes land as focused PRs that match existing
  patterns.
</Info>

***

## Big Features

**How it works:** For larger features (new flows, major UI changes, multi-file backend work), start by requesting a plan (toggle **Plan** in the UI, or include `/plan` in your message/comment). In plan mode, Twill explores the repo, asks clarifying questions, and proposes an implementation plan for your approval. Once approved, Twill implements the work and opens a PR (or a sequence of smaller PRs if that’s the best fit).

**Works best when:** You share the user goal, constraints, and acceptance criteria. If there are multiple valid approaches, answering clarifying questions early keeps the plan and PR aligned.

<Info>
  **Typical outcome:** A plan you can approve or edit, followed by a reviewable
  PR that includes verification when available. See [Research &
  Planning](/agent/planning).
</Info>

***

## Refactoring

**How it works:** Ask Twill to clean up code, extract components, rename across the codebase, or migrate to a new pattern. Twill handles the tedious work while preserving behavior.

**Works best when:** You're specific about what to change and what to preserve.

<Info>
  **Typical outcome:** Mechanical changes (renames, extractions, migrations) are
  applied consistently across the codebase.
</Info>

***

## Codebase Questions

**How it works:** Ask Twill about your codebase. "How does authentication work?" or "Where is the payment processing logic?" Twill explores the code and explains it clearly.

**Works best when:** You're onboarding, exploring unfamiliar code, or need a quick answer without interrupting teammates.

<Info>
  **Typical outcome:** Faster onboarding and fewer “where is this done?”
  interruptions.
</Info>

***

## Test Coverage

**How it works:** Ask Twill to add tests for a file, function, or feature. Twill analyzes the code, identifies edge cases, and writes tests that actually catch bugs.

**Works best when:** You point to specific code that needs coverage.

<Info>
  **Typical outcome:** Better coverage for edge cases, without hand-writing
  repetitive test setup.
</Info>

***

## Documentation

**How it works:** Ask Twill to document a function, update a README, or explain how a system works. Twill reads the code and writes accurate, clear documentation.

**Works best when:** The code is reasonably well-structured. Twill can explain messy code too, but the docs will reflect that.

<Info>
  **Typical outcome:** Documentation that stays aligned with the current code
  and reduces reliance on tribal knowledge.
</Info>

***

## PR Iteration

**How it works:** When you request changes on a Twill PR, the agent picks up your feedback and pushes updates. No need to re-explain context—Twill remembers the conversation.

**Works best when:** You give specific, actionable feedback. "Make this function pure" or "Add error handling for null inputs."

<Info>
  **Typical outcome:** Faster PR iteration when feedback is concrete and
  actionable.
</Info>
