Skip to content

feat(core): feed migration docs to agents in nx migrate#35835

Merged
FrozenPandaz merged 4 commits into
masterfrom
nxc-4495
Jun 2, 2026
Merged

feat(core): feed migration docs to agents in nx migrate#35835
FrozenPandaz merged 4 commits into
masterfrom
nxc-4495

Conversation

@leosvelperez

Copy link
Copy Markdown
Member

Current Behavior

A migration's documentation (the co-located markdown explaining what it does) is not referenced in migrations.json, so when nx migrate --run-migrations --agentic drives an AI agent, the agent has no access to it.

Expected Behavior

Migration entries can declare a docs markdown path. nx migrate carries it into the generated migrations.json, and under --agentic the resolved path is surfaced to the agent (for prompt, hybrid, and validation steps) so it has context on what the migration is meant to do. Existing first-party migrations with co-located docs are wired up via the new field and published with their packages.


View session information ↗

@netlify

netlify Bot commented May 29, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit d06e919
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a1ef8b173ff600008cb22ae
😎 Deploy Preview https://deploy-preview-35835--nx-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented May 29, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit d06e919
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a1ef8b1cb814c00085571a8
😎 Deploy Preview https://deploy-preview-35835--nx-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@leosvelperez leosvelperez self-assigned this May 29, 2026
Migration entries can now declare a `docs` markdown path. Under `nx migrate --run-migrations --agentic`, the resolved path is surfaced to the agent for prompt, hybrid, and validation steps so it has context on what the migration is meant to do. The path resolves like implementation/factory and is non-fatal when absent.
…json

Add a `src/migrations/**/*.md` asset glob to the plugins that lacked it so co-located migration docs are published, and reference each existing migration's doc via the new `docs` field.
@nx-cloud

nx-cloud Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit d06e919

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 54m 11s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 4s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 16s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 19s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-02 16:35:37 UTC

@leosvelperez leosvelperez marked this pull request as ready for review June 1, 2026 13:04
@leosvelperez leosvelperez requested a review from a team as a code owner June 1, 2026 13:04
@leosvelperez leosvelperez requested a review from JamesHenry June 1, 2026 13:04

@FrozenPandaz FrozenPandaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a regression test that documentation survives into the generated migrations.json — it's the one type-unsafe seam (GeneratedMigrationDetails omits docs + an as any cast), so a future refactor could silently drop it with no test
failing. An analogous prompt test already exists at migrate.spec.ts:3628.

Comment thread packages/nx/src/command-line/migrate/migrate.ts Outdated
Comment thread packages/nx/src/command-line/migrate/migrate.ts Outdated
Comment thread packages/nx/src/command-line/migrate/migrate.ts Outdated
…ve it from the collection

- rename the migration entry `docs` field to `documentation` across the config interface, the agentic prompt plumbing (XML tag included), and every migrations.json entry
- resolve a migration's `documentation` once from its collection - the same read used for the implementation - instead of re-reading the package config separately
- validate `documentation` paths in the per-package migration specs, and add the missing rspack migrations spec
- correct the resolved-path JSDoc to note the path can be absolute when the file resolves outside the workspace
@leosvelperez leosvelperez requested a review from FrozenPandaz June 2, 2026 15:00
…ve it from the collection [Self-Healing CI Rerun]

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud has identified a flaky task in your failed CI:

🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz FrozenPandaz merged commit b801ff7 into master Jun 2, 2026
25 checks passed
@FrozenPandaz FrozenPandaz deleted the nxc-4495 branch June 2, 2026 17:42
vrxj81 pushed a commit to vrxj81/nx that referenced this pull request Jun 7, 2026
## Current Behavior

A migration's documentation (the co-located markdown explaining what it
does) is not referenced in `migrations.json`, so when `nx migrate
--run-migrations --agentic` drives an AI agent, the agent has no access
to it.

## Expected Behavior

Migration entries can declare a `docs` markdown path. `nx migrate`
carries it into the generated `migrations.json`, and under `--agentic`
the resolved path is surfaced to the agent (for prompt, hybrid, and
validation steps) so it has context on what the migration is meant to
do. Existing first-party migrations with co-located docs are wired up
via the new field and published with their packages.

<!-- polygraph-session-start -->
---
[View session information
↗](https://snapshot.app.trypolygraph.com/orgs/69cdc268b6aa527e4129c2b4/sessions/nxc-4495-6c420036)
<!-- polygraph-session-end -->

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants