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

# Notion

> Connect Notion to add page context to AI reviews and PR descriptions.

Add page context from Notion to make AI reviews understand your requirements and generate accurate PR descriptions.

## Setup

### Connect Notion

1. Navigate to [integration settings](https://cubic.dev/settings?tab=integrations).
2. Click **Connect** on the Notion integration card.
3. Authorize cubic to access your Notion workspace through the OAuth flow.

### Configure AI behavior

Toggle these options based on your workflow:

* **Use context when reviewing code** — The AI reviewer reads linked Notion pages to check whether code matches page requirements
* **Use context when writing PR descriptions** — Generate descriptions from linked Notion pages
* **Automatically associate pages** — cubic detects Notion page URLs and unique ID codes in your PR and links them without manual intervention

## How it works

cubic searches across all accessible pages in your connected Notion workspace. It finds pages through two methods:

### Page URLs

Add a Notion page URL to your PR title, branch name, or description. cubic extracts the page ID and imports the content automatically. Supported URL formats:

```
https://www.notion.so/Page-Title-b55c9c91384d452b81dbd1ef79372b75
https://www.notion.so/workspace/Page-Title-b55c9c91384d452b81dbd1ef79372b75
https://www.notion.so/aabbccdd00112233aabbccdd00112233?p=11223344556677881122334455667788
```

### Unique IDs

If your Notion database uses the [unique ID property](https://www.notion.so/help/database-properties#unique-id), cubic detects codes like `TASK-123` in your PR title or branch name. It searches across all accessible databases in your workspace for a matching prefix and resolves the page automatically.

Include the identifier in your branch name (`feature/TASK-123-add-auth`) or PR title (`[TASK-123] Add authentication`) for cubic to link the page.

Once connected, you can also manually link Notion pages directly in the cubic PR interface.

## Best practices

* Write clear requirements in Notion pages for better AI feedback
* Use Notion's unique ID property in databases so cubic can detect task codes in branch names and PR titles
* Link architecture and design documents to PRs that implement those designs
* Create custom agents that reference Notion context for domain-specific checks
