# Agent — List migrations

Read `_shared.md` first.

## Goal

Return a snapshot of the EF Core migration state in the current worktree.
Never mutate anything.

## Steps

1. Resolve the worktree path (usually `$CWD` or the path passed in).
2. Invoke the CLI:

   ```bash
   npx tsx skills/efcore/cli/list/index.ts --spec '{"cwd":"<WORKTREE>"}'
   ```

3. Parse the JSON output. Display the result grouped by context, then by
   assembly. For each migration, show whether it is applied.

## What to highlight

- The detected `kind` (`generated`, `studio`, or `unknown`) helps the user
  understand which DbContext pattern they are working against.
- `warnings[]` contains actionable items (missing `dotnet-ef`, no csproj,
  …) — surface these clearly.
- If `assemblies[i].error` is set, the list for that assembly failed.
  Report the error and move on — do not fail the whole report.

## What NOT to do

- Do not create, delete, or modify files.
- Do not run `dotnet ef database update`.
- Do not call `create`, `squash`, or `rebase-snapshot` from this agent.
