# Tasks

Tasks are reusable prompts that you define in your repository's configuration. They let you run common operations with a single click — like security reviews, test generation, or code audits.

## Defining Tasks

Add a `tasks` array to your `polyscope.json` file in the repository root:

```json
{
  "tasks": [
    {
      "label": "Security review",
      "prompt": "Review the codebase for security vulnerabilities. Check for SQL injection, XSS, CSRF, and other OWASP top 10 issues. Report your findings with file paths and suggested fixes."
    },
    {
      "label": "Add test coverage",
      "prompt": "Identify areas of the codebase with missing test coverage and add tests. Focus on critical business logic and edge cases."
    },
    {
      "label": "Documentation audit",
      "prompt": "Review the codebase and identify public APIs, functions, and modules that are missing documentation. Add clear, concise documentation where needed."
    }
  ]
}
```

Each task has:

- **`label`** — The name shown in the task menu
- **`prompt`** — The full prompt sent to the agent

## Running a Task

1. Click the **Tasks** icon (list icon) on the repository header in the sidebar
2. Select a task from the dropdown
3. A new workspace is created and the task prompt is automatically sent to the agent

<!-- ![Running a task from the sidebar](/images/docs/TODO.png) -->

The agent starts working immediately in its own isolated workspace, so you can run multiple tasks in parallel.

## Use Cases

- **Code reviews** — Automated security, performance, or accessibility audits
- **Maintenance** — Dependency updates, dead code removal, linting fixes
- **Documentation** — Generate or update docs across the codebase
- **Testing** — Add missing test coverage or generate test data
- **Refactoring** — Standardize patterns, rename conventions, extract modules
