Skip to content

Conversation

codyde
Copy link
Contributor

@codyde codyde commented May 19, 2025

Adding a step to the NextJS wizard which either uses a .rules folder or gives the option to create one, and places a sentryrules file in there that can be used with LLMs

This rules file includes basic up to date examples for tracing, logging, and error tracking / exceptions.

Based off of a discussion with @HazAT.

@codyde codyde self-assigned this May 19, 2025
Copy link

github-actions bot commented May 19, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Add option to NextJS for creating sentry rules LLM file ([#997](https://github.com/getsentry/sentry-wizard/pull/997))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 1eed0ea

Copy link

codecov bot commented May 19, 2025

Codecov Report

❌ Patch coverage is 1.49254% with 66 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.86%. Comparing base (f0fdb52) to head (db6c39d).
⚠️ Report is 43 commits behind head on master.

Files with missing lines Patch % Lines
src/nextjs/nextjs-wizard.ts 0.00% 64 Missing ⚠️
src/nextjs/templates.ts 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #997      +/-   ##
==========================================
- Coverage   27.98%   27.86%   -0.13%     
==========================================
  Files         130      130              
  Lines       14233    14300      +67     
  Branches      882      882              
==========================================
+ Hits         3983     3984       +1     
- Misses      10233    10299      +66     
  Partials       17       17              
Flag Coverage Δ
unit-tests 27.86% <1.49%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

clack.log.error(
`Failed to create ${chalk.cyan(
'sentryrules.md',
)} in ${chalk.cyan('.rules')} directory. Please create it manually.`,
Copy link
Member

Choose a reason for hiding this comment

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

Shall we give them a link for the content to put this into the file? Or even a curl one-liner?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I love that idea. Sort of a "Couldn't do it, you can create it manually though!". Great suggestion.

@Lms24 Lms24 self-requested a review May 27, 2025 15:55
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

I didn't fully look at this PR yet (on my list for tomorrow) but to get CI to pass, please update the NextJS E2E tests in the repo. Looks like they time out because we added a user prompt to the wizard which we don't answer in the CLI interaction in the e2e tests.

Let me know if you need help with updating the tests.

Also it looks like the lint job is failing. Running yarn fix or yarn fix:prettier should solve that.

@Lms24 Lms24 self-requested a review May 27, 2025 16:02
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

This looks great to me! Left a comment about the e2e test, some questions and ideas for rules and a minor style correction. Thanks for working on this!

codyde and others added 3 commits May 29, 2025 21:55
@Lms24
Copy link
Member

Lms24 commented Aug 1, 2025

Hey @codyde are you still working on this? Just checking in since I'm going over older PRs to see if we can close some of them. No pressure, happy to keep it open.

@codyde codyde changed the title feat: Add option to NextJS for creating sentry rules LLM file (Do not merge) feat: Add option to NextJS for creating sentry rules LLM file Aug 12, 2025
@codyde codyde marked this pull request as draft August 12, 2025 04:18
codyde added 2 commits August 11, 2025 23:28
- Add IDE selection prompt (Cursor, VS Code, Claude Code)
- Implement IDE-specific file paths and formats:
  - Cursor: .cursorrules with special header
  - VS Code: .github/instructions/sentryrules.md
  - Claude Code: sentryrules.md in root
- Create shared ai-rules module for consistency across wizards
- Add AI rules support to all framework wizards with framework-specific content
- Fix test issues and add comprehensive unit tests
- Clean up duplicate code and use shared functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants