Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rover.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.2",
"version": "1.3",
"languages": [
"typescript",
"javascript"
Expand Down
27 changes: 26 additions & 1 deletion src/content/docs/rover/guides/assign-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,31 @@ Create a simple task from scratch in your initialized repository.
</StepItem>
</StepList>

## Provide context

You can attach external context to a task using the `--context` (or `-c`) flag. This gives the agent reference material from GitHub issues, pull requests, local files, or web URLs alongside the task description.

<StepList title="Creating a task with context">
<StepItem step={1}>
Combine a task description with context from a GitHub issue and a local file

```sh
rover task -y -c github:issue/15 -c file:./docs/design.md "Implement the new authentication flow"
```

Rover fetches the issue content and reads the local file, then provides both to the agent alongside the task description.
</StepItem>
<StepItem step={2}>
Follow the task progress

```sh
rover logs -f 1
```
</StepItem>
</StepList>

See the [Provide context to tasks](/rover/guides/provide-context) guide for full details on supported context sources and comment trust settings.

## Inspect the task

Besides listing current tasks or watching the listing, you can inspect tasks and their iterations to understand what the agent planned and executed.
Expand Down Expand Up @@ -160,8 +185,8 @@ If the agent has produced a result that needs small changes to be ready, you can
## Related Guides

<CardGrid>
<LinkCard title="Provide context to tasks" href="/rover/guides/provide-context" description="Supply external context from GitHub, local files, and URLs" />
<LinkCard title="Project Initialization" href="/rover/guides/project-initialization" description="Initialize Rover in your repository" />
<LinkCard title="Iterate on tasks" href="/rover/guides/iterate-tasks" description="Refine and improve task implementations" />
<LinkCard title="Merge changes from tasks" href="/rover/guides/merge-tasks" description="Integrate completed tasks into your codebase" />
<LinkCard title="Write technical documentation" href="/rover/guides/write-docs" description="Use Rover to create and maintain documentation" />
</CardGrid>
39 changes: 36 additions & 3 deletions src/content/docs/rover/guides/github-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ import StepList from '../../../../components/StepList.svelte';
import StepItem from '../../../../components/StepItem.svelte';
import { CardGrid, LinkCard } from '@astrojs/starlight/components';

:::caution
The `--from-github` flag is deprecated. Use the new [context system](/rover/guides/provide-context) instead: `--context github:issue/<number>`. The `--from-github` flag will continue to work but may be removed in a future release.
:::

Rover integrates with GitHub to create [tasks](/rover/concepts/task) directly from issues. This allows you to assign GitHub issues to local AI coding agents and maintain a clear link between the issue and the task result.

## Prerequisites

To create Rover [tasks](/rover/concepts/task) from GitHub issues, you need either:
To create Rover [tasks](/rover/concepts/task) from GitHub issues, you need:

- **GitHub CLI (`gh`)**: Recommended for private repositories and GitHub Enterprise. Install from [cli.github.com](https://cli.github.com/).
- **Public repository access**: For public repositories, Rover can fetch issues directly from the GitHub API without authentication.
- **GitHub CLI (`gh`)**: Install from [cli.github.com](https://cli.github.com/) and authenticate with `gh auth login`.

## Create a task from an issue

Expand Down Expand Up @@ -160,6 +163,35 @@ Add a login form with email and password fields.

Rover parses the issue and populates the workflow inputs accordingly.

## Migration to the context system

The `--from-github` and `--include-comments` flags are deprecated in favor of the more flexible [context system](/rover/guides/provide-context). The table below maps old flags to new equivalents:

| Old syntax | New syntax |
|---|---|
| `--from-github 15` | `--context github:issue/15` |
| `--from-github 15 --include-comments` | `--context github:issue/15 --context-trust-all-authors` |

The context system also supports features not available with `--from-github`:

### GitHub PR context

Use `github:pr/<number>` to provide a pull request and its diff as context. This is useful when you want the agent to align its implementation with an existing PR or address review feedback.

```sh
rover task -c github:pr/42 "Address the review comments on this PR"
```

### Cross-repo references

Reference issues and PRs from other repositories using the `github:<owner>/<repo>/issue/<number>` or `github:<owner>/<repo>/pr/<number>` format.

```sh
rover task -c github:acme/design-docs/issue/8 "Implement the feature described in the design doc"
```

See the [Provide context to tasks](/rover/guides/provide-context) guide for full details on all supported context sources.

## Best practices

To get the best results when creating tasks from GitHub issues:
Expand All @@ -180,6 +212,7 @@ To get the best results when creating tasks from GitHub issues:
## Related Guides

<CardGrid>
<LinkCard title="Provide context to tasks" href="/rover/guides/provide-context" description="Supply external context from GitHub, local files, and URLs" />
<LinkCard title="Implement a new feature" href="/rover/guides/assign-tasks" description="Create and assign tasks to AI coding agents" />
<LinkCard title="Iterate on tasks" href="/rover/guides/iterate-tasks" description="Refine and improve task implementations" />
<LinkCard title="Merge changes from tasks" href="/rover/guides/merge-tasks" description="Integrate completed tasks into your codebase" />
Expand Down
27 changes: 26 additions & 1 deletion src/content/docs/rover/guides/iterate-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,31 @@ Following the fizzbuzz example from the task creation guide, you can ask for an
</StepItem>
</StepList>

## Provide context to iterations

You can attach external context to an iteration using the `--context` flag. This lets you supply reference material such as GitHub issues, PRs, local files, or URLs that the agent can use alongside your instructions.

<StepList title="Iterating with context">
<StepItem step={1}>
Add a GitHub PR as context to guide the iteration

```sh
rover iterate 1 "Align the implementation with the reviewed approach" -c github:pr/50
```
</StepItem>
<StepItem step={2}>
Combine multiple context sources

```sh
rover iterate 1 "Update the API to match the spec" -c github:issue/20 -c file:./docs/api-spec.md
```
</StepItem>
</StepList>

Context from previous iterations carries forward automatically. You don't need to repeat URIs already provided. New context is merged with inherited context. If you pass a URI that was used in a previous iteration, Rover re-fetches it to get the latest content.

See the [Provide context to tasks](/rover/guides/provide-context) guide for full details on supported sources and comment trust settings.

## Review iteration changes

After an iteration completes, you can inspect what changed compared to the previous iteration.
Expand Down Expand Up @@ -87,8 +112,8 @@ To get the best results from iterations:
## Related Guides

<CardGrid>
<LinkCard title="Provide context to tasks" href="/rover/guides/provide-context" description="Supply external context from GitHub, local files, and URLs" />
<LinkCard title="Implement a new feature" href="/rover/guides/assign-tasks" description="Create and assign tasks to AI coding agents" />
<LinkCard title="Merge changes from tasks" href="/rover/guides/merge-tasks" description="Integrate completed tasks into your codebase" />
<LinkCard title="Project Initialization" href="/rover/guides/project-initialization" description="Initialize Rover in your repository" />
<LinkCard title="Write technical documentation" href="/rover/guides/write-docs" description="Use Rover to create and maintain documentation" />
</CardGrid>
135 changes: 135 additions & 0 deletions src/content/docs/rover/guides/provide-context.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
title: Provide context to tasks
description: Supply external context from GitHub issues, pull requests, local files, and web resources to give AI agents the information they need
sidebar:
order: 5
---

import StepList from '../../../../components/StepList.svelte';
import StepItem from '../../../../components/StepItem.svelte';
import { CardGrid, LinkCard } from '@astrojs/starlight/components';

Context lets you attach external information to a [task](/rover/concepts/task) or [iteration](/rover/guides/iterate-tasks) so the AI agent can reference it while working. Instead of pasting content into the task description, use context to provide requirements from GitHub issues, design specs from pull requests, reference documentation from local files, or API specifications from URLs.

## Supported context sources

Rover resolves context URIs through built-in providers. You can combine multiple sources in a single command.

| URI format | Description | Example |
|---|---|---|
| `github:issue/<number>` | GitHub issue from the current repo | `github:issue/15` |
| `github:pr/<number>` | GitHub PR with diff from the current repo | `github:pr/42` |
| `github:<owner>/<repo>/issue/<number>` | Cross-repo GitHub issue | `github:acme/api/issue/8` |
| `github:<owner>/<repo>/pr/<number>` | Cross-repo GitHub PR with diff | `github:acme/api/pr/31` |
| `file:./<path>` | Local file (relative path) | `file:./docs/spec.md` |
| `file:///<path>` | Local file (absolute path) | `file:///home/user/notes.md` |
| `https://<url>` | Remote web resource | `https://example.com/api-spec.yaml` |

:::tip
GitHub context requires the [GitHub CLI (`gh`)](https://cli.github.com/) to be installed and authenticated.
:::

## Add context to a task

Pass one or more `--context` flags when creating a task. Each flag accepts a context URI.

<StepList title="Creating a task with context">
<StepItem step={1}>
Create a task with context from a GitHub issue and a local spec file

```sh
rover task -c github:issue/15 -c file:./docs/api-spec.md "Implement the new endpoint"
```

Rover fetches the issue content and reads the local file, then provides both to the agent alongside the task description.
</StepItem>
<StepItem step={2}>
You can also provide context from a remote URL

```sh
rover task -c https://example.com/openapi.yaml "Generate client SDK from the API spec"
```
</StepItem>
<StepItem step={3}>
Follow the task progress

```sh
rover logs -f 1
```
</StepItem>
</StepList>

:::tip
The `-c` short flag is equivalent to `--context`. You can repeat it as many times as needed to attach multiple sources.
:::

## Add context to an iteration

Context works the same way on iterations. Pass `--context` flags to `rover iterate` to provide additional information for a follow-up iteration.

<StepList title="Iterating with context">
<StepItem step={1}>
Add a PR as context to guide a refinement iteration

```sh
rover iterate 1 "Align the implementation with the reviewed approach" -c github:pr/50
```
</StepItem>
<StepItem step={2}>
Follow the iteration progress

```sh
rover logs -f 1 2
```
</StepItem>
</StepList>

### Context inheritance

Context from previous iterations carries forward automatically. When you add new context to an iteration, it is merged with context from earlier iterations.

You don't need to repeat URIs you've already provided. If you pass a URI that was used in a previous iteration, **Rover re-fetches it to get the latest content**.

## Control comment visibility

When using GitHub issues or PRs as context, comments and reviews are **excluded by default** to prevent prompt-injection from untrusted contributors.

You can selectively include comments from trusted authors:

```sh
# Trust specific authors
rover task -c github:issue/15 --context-trust-authors alice,bob "Fix the bug"

# Trust all authors (use with caution)
rover task -c github:pr/42 --context-trust-all-authors "Review and address PR feedback"
```

The same flags work with `rover iterate`:

```sh
rover iterate 1 "Address remaining review comments" -c github:pr/42 --context-trust-all-authors
```

## Best practices

- **Prefer context over copy-paste**: Use context URIs instead of pasting content into the task description. This keeps descriptions focused and lets Rover handle formatting and attribution.
- **Combine context with clear instructions**: Context provides information; the task description should explain what to do with it.
- **Scope context narrowly**: Provide only the sources relevant to the task. Too much unrelated context can dilute the agent's focus.
- **Use GitHub PRs for alignment**: When iterating on a task, referencing a related PR helps the agent understand the desired approach and coding patterns.
- **Be deliberate with comment trust**: Only enable `--context-trust-all-authors` on repositories where you trust all contributors. For open-source projects with external contributors, prefer `--context-trust-authors` with specific usernames.

## Relevant Concepts

<CardGrid>
<LinkCard title="Task" href="/rover/concepts/task" description="Learn about Rover tasks and how they work" />
<LinkCard title="Workflow" href="/rover/concepts/workflow" description="Discover how workflows guide coding agents" />
</CardGrid>

## Related Guides

<CardGrid>
<LinkCard title="Implement a new feature" href="/rover/guides/assign-tasks" description="Create and assign tasks to AI coding agents" />
<LinkCard title="Work on GitHub issues" href="/rover/guides/github-issues" description="Create tasks from GitHub issues and track their relationship" />
<LinkCard title="Iterate on tasks" href="/rover/guides/iterate-tasks" description="Refine and improve task implementations" />
<LinkCard title="Merge changes from tasks" href="/rover/guides/merge-tasks" description="Integrate completed tasks into your codebase" />
</CardGrid>
9 changes: 8 additions & 1 deletion src/content/docs/rover/reference/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ rover task [options] [description]

**Options:**

- `--from-github <issue>`: Fetch task description from a GitHub issue number
- `-c, --context <uri>`: Add context from a URI. Can be repeated. Supported schemes: `github:issue/<n>`, `github:pr/<n>`, `github:<owner>/<repo>/issue/<n>`, `github:<owner>/<repo>/pr/<n>`, `file:<path>`, `https://<url>`
- `--context-trust-authors <users>`: Comma-separated list of trusted authors for comment inclusion
- `--context-trust-all-authors`: Trust all authors for comment inclusion (disables filtering)
- `--from-github <issue>`: *(Deprecated. Use `--context github:issue/<number>`)* Fetch task description from a GitHub issue number
- `--include-comments`: *(Deprecated. Use `--context-trust-all-authors`)* Include issue comments in the task description (requires `--from-github`)
- `--workflow, -w <name>`: Use a specific workflow to complete this task
- `-y, --yes`: Skip all confirmations and run non-interactively
- `-s, --source-branch <branch>`: Base branch for git worktree creation
Expand Down Expand Up @@ -174,6 +178,9 @@ rover iterate [options] <taskId> [instructions]

**Options:**

- `-c, --context <uri>`: Add context from a URI. Can be repeated. Supported schemes: `github:issue/<n>`, `github:pr/<n>`, `github:<owner>/<repo>/issue/<n>`, `github:<owner>/<repo>/pr/<n>`, `file:<path>`, `https://<url>`
- `--context-trust-authors <users>`: Comma-separated list of trusted authors for comment inclusion
- `--context-trust-all-authors`: Trust all authors for comment inclusion (disables filtering)
- `-i, --interactive`: Open an interactive command session to iterate on the task
- `--json`: Output JSON and skip confirmation prompts

Expand Down