Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor rules: Copy improvements and reordering sections #1813

Merged
merged 2 commits into from
Mar 26, 2025

Conversation

samejr
Copy link
Member

@samejr samejr commented Mar 22, 2025

Makes some small copy improvements and reorders some sections.

Summary by CodeRabbit

  • Documentation
    • Refined task-writing guidelines for improved clarity.
    • Introduced an updated section outlining essential requirements.
    • Standardized code examples and reorganized content to enhance usability.

Copy link

changeset-bot bot commented Mar 22, 2025

⚠️ No Changeset found

Latest commit: 499fb1f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "proxy" is specified in the `ignore` option but it is not found in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

Copy link
Contributor

coderabbitai bot commented Mar 22, 2025

Walkthrough

The pull request updates the documentation guidelines for writing Trigger.dev tasks. It clarifies instructions—for example, specifying "any environment variables"—and introduces a new section on essential requirements for task code generation. The update mandates the use of @trigger.dev/sdk/v3, prohibits using client.defineJob, and insists on exporting every task. Additionally, it standardizes code block identifiers from typescript to ts, removes a redundant section, and reorganizes the document for improved clarity.

Changes

File(s) Change Summary
.cursor/rules/writing-tasks.mdc - Clarified environment variable setup instructions
- Added "Essential requirements when generating task code" section (mandating use of @trigger.dev/sdk/v3, disallowing client.defineJob, and requiring task exports)
- Updated code snippet identifiers from typescript to ts
- Removed the redundant "ABSOLUTE REQUIREMENTS FOR AI CODE GENERATION" section
- Reorganized content for clearer task implementation guidelines

Possibly related PRs

Suggested reviewers

  • nicktrn

Poem

I'm a bunny with a coder’s heart,
Hopping through docs, leaving a smart art.
Guidelines now clear like a freshly ploughed field,
New rules and formats—a code bounty revealed.
With a twitch of my nose and a joyful leap,
I celebrate these changes in bounds, not cheap!
🥕 Hop on, and let the Trigger.dev magic keep!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c4e1364 and 499fb1f.

📒 Files selected for processing (1)
  • .cursor/rules/writing-tasks.mdc (57 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: units / 🧪 Unit Tests
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
.cursor/rules/writing-tasks.mdc (5)

3-3: Updated description looks good.

The document description has been updated to "Guidelines for writing Trigger.dev tasks," which clearly communicates the purpose of this document.


12-14: Improved setup instructions with better clarity.

Great improvements to the setup instructions:

  1. Clarifying "any environment variables" makes the instruction more comprehensive
  2. Adding the dev command provides a complete workflow for users

These changes enhance the document's usability for developers.


15-20: Excellent addition of essential requirements section.

This new section provides critical guidance for task code generation with clear, non-negotiable requirements:

  • Using the v3 SDK
  • Never using deprecated client.defineJob pattern
  • Ensuring tasks are exported
  • Encouraging example payload generation

This section helps prevent common errors and ensures code generated by AI models will work correctly.


26-26: Standardized code block identifiers from typescript to ts.

Consistently updated all code block identifiers from typescript to ts throughout the document, which:

  1. Follows modern convention for TypeScript code blocks
  2. Creates consistency across the entire document
  3. May improve syntax highlighting in some platforms/editors

This change enhances the document's professional appearance and consistency.

Also applies to: 53-53, 73-73, 95-95, 115-115, 131-131, 159-159, 177-177, 193-193, 209-209, 225-225, 241-241, 257-257, 273-273, 314-314, 328-328, 362-362, 377-377, 402-402, 420-420, 438-438, 460-460, 480-480, 500-500, 518-518, 536-536, 558-558, 587-587, 606-606, 636-636, 645-645, 677-677, 687-687, 704-704, 736-736, 759-759, 776-776, 808-808, 835-835, 848-848, 862-862, 882-882, 902-902, 911-911, 941-941, 971-971, 991-991, 1016-1016, 1022-1022, 1029-1029, 1037-1037, 1059-1059, 1081-1081, 1102-1102, 1127-1127, 1137-1137, 1153-1153, 1167-1167, 1175-1175, 1183-1183, 1191-1191, 1199-1199, 1243-1243


1247-1269: Added helpful verification steps and guidelines for AI code generation.

This new section provides:

  1. Clear verification steps for AI models to follow
  2. Explicit consequences of incorrect implementation
  3. A structured response template

These additions will improve the quality of AI-generated code by encouraging thorough verification and consistency, ultimately leading to more reliable task implementations.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@matt-aitken matt-aitken merged commit d745bb6 into main Mar 26, 2025
12 checks passed
@matt-aitken matt-aitken deleted the cursor-rules-updates branch March 26, 2025 18:38
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