Skip to content

feat(core): improve AI agent rules for CLAUDE.md generation#34304

Merged
MaxKless merged 2 commits intomasterfrom
feat/improve-ai-agent-rules
Feb 5, 2026
Merged

feat(core): improve AI agent rules for CLAUDE.md generation#34304
MaxKless merged 2 commits intomasterfrom
feat/improve-ai-agent-rules

Conversation

@juristr
Copy link
Copy Markdown
Member

@juristr juristr commented Feb 3, 2026

Summary

Updates the generated CLAUDE.md content with improved guidance for AI agents working with Nx workspaces.

Changes:

  • Add "nx-workspace skill first" for workspace navigation
  • Add "prefix nx commands with package manager" rule
  • Add "NEVER guess CLI flags" rule
  • Add "Scaffolding & Generators" section (invoke nx-generate skill first)
  • Add "When to use nx_docs" guidance (USE for advanced config, DON'T USE for basic syntax)

Why These Changes

Based on testing with repeated scaffolding tasks, agents were:

Issue Fix
Calling nx_docs for basic generator syntax Added clear guidance on when to use/not use nx_docs
Guessing CLI flags incorrectly (e.g., nx sync --apply) Added "never guess flags" rule
Using global nx CLI causing version mismatches Added package manager prefix rule
Not invoking nx-generate skill on scaffolding tasks Added explicit "Scaffolding & Generators" section

Related

Companion PR with skill improvements: nrwl/nx-ai-agents-config#26

@juristr juristr requested a review from a team as a code owner February 3, 2026 14:20
@juristr juristr requested a review from AgentEnder February 3, 2026 14:20
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nx-dev Error Error Feb 3, 2026 2:20pm

Request Review

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 3, 2026

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit 234e97c
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/698481151338d60008bb861a
😎 Deploy Preview https://deploy-preview-34304--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.

@juristr juristr self-assigned this Feb 3, 2026
@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Feb 3, 2026

View your CI Pipeline Execution ↗ for commit 234e97c

Command Status Duration Result
nx affected --targets=lint,test,test-kt,build,e... ✅ Succeeded 10m 57s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3m 3s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 11s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-02-05 12:00:44 UTC

@Stanzilla
Copy link
Copy Markdown
Contributor

What about adding another for never using nx graph? Copilot keeps doing that for me

- Add nx-workspace skill first guidance
- Add package manager prefix rule
- Add "never guess CLI flags" rule
- Add Scaffolding & Generators section
- Add "When to use nx_docs" guidance
@MaxKless MaxKless force-pushed the feat/improve-ai-agent-rules branch from 91980b0 to b0507e7 Compare February 5, 2026 10:12
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 5, 2026

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit 234e97c
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/698481155f082d000852d0c5
😎 Deploy Preview https://deploy-preview-34304--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.

@juristr juristr enabled auto-merge (rebase) February 5, 2026 10:24
@juristr
Copy link
Copy Markdown
Member Author

juristr commented Feb 5, 2026

What about adding another for never using nx graph? Copilot keeps doing that for me

@Stanzilla can you elaborate? when does it use it?

@Stanzilla
Copy link
Copy Markdown
Contributor

What about adding another for never using nx graph? Copilot keeps doing that for me

@Stanzilla can you elaborate? when does it use it?

I can try to remember to copy the session when it happens the next time but it was usually when it was trying to see which targets are available afair

Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

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

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud has identified a possible root cause for your failed CI:

Our e2e-gradle tests are failing due to an external service outage, not the PR changes. The Foojay toolchain resolver (which Gradle uses to provision Java installations) is returning 503 errors, preventing Java 21 from being resolved. This is an infrastructure issue requiring the external service to recover.

No code changes were suggested for this issue.

🔂 A CI rerun has been triggered by adding an empty commit to this branch.

Nx Cloud View detailed reasoning on Nx Cloud ↗


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

- Add nx-workspace skill first guidance
- Add package manager prefix rule
- Add "never guess CLI flags" rule
- Add Scaffolding & Generators section
- Add "When to use nx_docs" guidance [Self-Healing CI Rerun]
auto-merge was automatically disabled February 5, 2026 11:41

Pull Request is not mergeable

@MaxKless MaxKless merged commit 2b07ac2 into master Feb 5, 2026
23 checks passed
@MaxKless MaxKless deleted the feat/improve-ai-agent-rules branch February 5, 2026 12:18
jaysoo pushed a commit that referenced this pull request Feb 5, 2026
## Summary

Updates the generated CLAUDE.md content with improved guidance for AI
agents working with Nx workspaces.

**Changes:**
- Add "nx-workspace skill first" for workspace navigation
- Add "prefix nx commands with package manager" rule
- Add "NEVER guess CLI flags" rule
- Add "Scaffolding & Generators" section (invoke nx-generate skill
first)
- Add "When to use nx_docs" guidance (USE for advanced config, DON'T USE
for basic syntax)

## Why These Changes

Based on testing with repeated scaffolding tasks, agents were:

| Issue | Fix |
|-------|-----|
| Calling `nx_docs` for basic generator syntax | Added clear guidance on
when to use/not use nx_docs |
| Guessing CLI flags incorrectly (e.g., `nx sync --apply`) | Added
"never guess flags" rule |
| Using global nx CLI causing version mismatches | Added package manager
prefix rule |
| Not invoking nx-generate skill on scaffolding tasks | Added explicit
"Scaffolding & Generators" section |

## Related

Companion PR with skill improvements:
nrwl/nx-ai-agents-config#26

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants