# Export Context

Source: https://flow-next.dev/skills/export-context/

Export a review prompt for external LLMs (ChatGPT Pro, Claude web, Gemini).

`/flow-next:export-context` writes a structured review prompt to a markdown file so you can paste it into an external model.

Use it when you want Carmack-level review but prefer ChatGPT Pro, Claude web, Gemini, or another model that does not have a CLI integration with flow-next.

## When to use it

* You have a paid subscription on an external model and want to use it.
* The local backends (`rp`, `codex`, `copilot`) are unavailable or rate-limited.
* You want to compare review verdicts across two models.
* You want to archive a review prompt for later replay.

## Invocation

```bash
/flow-next:export-context <type> [focus areas]
```

| Type             | Builds                                                                                |
| ---------------- | ------------------------------------------------------------------------------------- |
| `plan <spec-id>` | Plan-review prompt with the spec, R-IDs, and relevant repo context.                   |
| `impl`           | Implementation-review prompt for the current branch with diff and committed evidence. |

Free-text focus areas after the type narrow what the reviewer is asked to look at - e.g. `focus on security`, `the auth changes only`, `migration safety`.

## How it works

The skill uses RepoPrompt’s builder to assemble a context bundle - spec, code, diff - and renders it as a single markdown file you can paste into any web chat.

For `impl`, the diff range is detected automatically from the current branch against `main` or `master`.

## What you get

The export file contains:

* A reviewer brief (Carmack-level adversarial; concrete findings; binary verdict).
* The spec or diff under review.
* A curated selection of relevant code so the model has enough context.
* A prompt template that asks for findings in a format flow-next can re-ingest as a receipt.

## Where it stops

* Not a backend. The external model’s response is read by you, not by the skill - there is no round-trip integration.
* Not a token optimizer. The export is sized for completeness; large repos can produce large files.

## Worked example

```plaintext
/flow-next:export-context plan fn-14-rate-limits focus on migration safety
```

```text
Building context bundle (spec + R-IDs + relevant code) via the RepoPrompt builder...
Export written: plan-review-fn-14-rate-limits.md
Paste into your external model. The prompt asks for Carmack-level findings and a binary
verdict (SHIP / NEEDS_WORK / MAJOR_RETHINK) in a format flow-next can re-ingest.
```

The export is a one-way artifact: the external model’s response comes back through you, not through an integration.

* The free-text focus areas materially change the review - “migration safety” produces a different reading than a blanket pass, so name what worries you.
* Narrow before exporting on large repos: the bundle is sized for completeness and can exceed a web chat’s paste limit.
* Re-run the export after addressing findings rather than replying in the same chat - a fresh bundle reflects the fixed state.

## Dynamic usage

Recipes that compose with export-context in the [cookbook](https://flow-next.dev/guides/cookbook/):

* [Model routing](https://flow-next.dev/guides/cookbook/#model-routing) - this is the manual rung of the routing ladder: reach any model that has no CLI backend.
* [Evidence-first](https://flow-next.dev/guides/cookbook/#evidence-first) - an external verdict is still worth recording; bring it back as review notes on the spec.

## Next step

After receiving the external review, address findings in the spec or code, then re-export or run a local review:

```bash
/flow-next:plan-review <spec-id>
/flow-next:impl-review
```
