Chore/implement cursor commands and rules#47
Conversation
📝 WalkthroughWalkthroughSeven new documentation files were added to establish Cursor commands and rules for standardized branch naming, commit message formatting, and AI-assisted issue/PR workflow guidance. These files live under Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
.cursor/commands/branch-and-commit.md (1)
22-22: Hardcoded branch name examples are PR-specific and will mislead future users.The guidance to "prefer
chore/implement-cursor-commands-and-rulesorchore/cursor-commands-rules" is tied to the current task. Leaving it in the command file will encourage incorrect branch names for unrelated work.🔧 Proposed fix
-- For work on Cursor commands and rules, prefer a branch name based on that (e.g. `chore/implement-cursor-commands-and-rules` or `chore/cursor-commands-rules`). +- For work on Cursor commands and rules, prefer a `chore/` prefix (e.g. `chore/add-cursor-rule-x`).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.cursor/commands/branch-and-commit.md at line 22, The current guidance includes PR-specific hardcoded branch examples ("chore/implement-cursor-commands-and-rules" and "chore/cursor-commands-rules") which will mislead future users; update the sentence to remove those specific examples and replace with a generic placeholder pattern such as "chore/<short-description>" (or "feature/<short-description>") and a short note advising to use a concise, descriptive suffix for the task so the guidance remains generic and reusable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.cursor/commands/branch-and-commit.md:
- Around line 7-8: Update the two links using the undocumented `rule:` scheme to
the proper `mdc:` scheme; in .cursor/commands/branch-and-commit.md replace the
prefixes on the references to branch-naming.mdc and commit-message.mdc so they
read `mdc:branch-naming.mdc` and `mdc:commit-message.mdc` (following the usage
described in generate-cursor-rules.md and how .mdc rule files are referenced).
In @.cursor/commands/generate-cursor-rules.md:
- Around line 13-15: Update the inline comment for alwaysApply to accurately
state both options (e.g., "true = auto-apply to every request; false = do not
auto-apply"), hyphenate "comma-separated" in the globs description, and add
explicit language identifiers (e.g., yaml or markdown) to the three unlabeled
fenced code blocks referenced in this file so the blocks render and satisfy
MD040; target the `alwaysApply`, `description`, and `globs` lines and the
unlabeled fenced blocks when making these edits.
In @.cursor/rules/cloudinary-standard.mdc:
- Around line 24-30: Close the unclosed fenced TSX block and fix the example:
end the ```tsx fence after the snippet, add a Cloudinary client
definition/import so the referenced symbol cld is defined (e.g., create or
import the Cloudinary instance used to call cld.image), and include the required
placeholder transformation (use blur() or pixelate() as shown in the docs) in
the example before rendering with <AdvancedImage cldImg={myImage} />; ensure the
code references the existing symbols AdvancedImage, fill, cld, myImage and the
placeholder (blur/pixelate) so the example compiles and the document renders.
- Around line 3-4: The rule's glob targets backend files (the "globs" key
currently set to apps/api/src/**/*.{ts}) so the Cloudinary-react checks never
run; update the "globs" entry to point at the frontend source (e.g.,
apps/web/src/**/*.{ts,tsx} or a broader pattern like
apps/web/src/**/*.{js,jsx,ts,tsx}) and fix the brace expansion to include
multiple extensions, and also verify the "alwaysApply" flag is set as intended
(change if you want the rule to auto-apply). Ensure you update the "globs" key
and leave "alwaysApply" correctly set in the same rule block so Section 2 runs
against the frontend .tsx components.
---
Nitpick comments:
In @.cursor/commands/branch-and-commit.md:
- Line 22: The current guidance includes PR-specific hardcoded branch examples
("chore/implement-cursor-commands-and-rules" and "chore/cursor-commands-rules")
which will mislead future users; update the sentence to remove those specific
examples and replace with a generic placeholder pattern such as
"chore/<short-description>" (or "feature/<short-description>") and a short note
advising to use a concise, descriptive suffix for the task so the guidance
remains generic and reusable.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.cursor/commands/branch-and-commit.md.cursor/commands/generate-cursor-rules.md.cursor/commands/generate-issue-markdown.md.cursor/commands/generate-pr-markdown.md.cursor/rules/branch-naming.mdc.cursor/rules/cloudinary-standard.mdc.cursor/rules/commit-message.mdc
| - **[branch-naming.mdc](rule:branch-naming.mdc)** — use for the new branch name. | ||
| - **[commit-message.mdc](rule:commit-message.mdc)** — use for every commit message. |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find the files mentioned in the review
find . -name "branch-and-commit.md" -o -name "generate-cursor-rules.md" | head -20Repository: sam821203/SalesOps
Length of output: 145
🏁 Script executed:
#!/bin/bash
# Check if .cursor directory exists and list its structure
if [ -d ".cursor" ]; then
tree -L 3 .cursor/ 2>/dev/null || find .cursor -type f | head -30
else
echo ".cursor directory not found"
fiRepository: sam821203/SalesOps
Length of output: 331
🏁 Script executed:
#!/bin/bash
# Read the branch-and-commit.md file
if [ -f ".cursor/commands/branch-and-commit.md" ]; then
cat -n ".cursor/commands/branch-and-commit.md"
fiRepository: sam821203/SalesOps
Length of output: 2759
🏁 Script executed:
#!/bin/bash
# Read generate-cursor-rules.md
if [ -f ".cursor/generate-cursor-rules.md" ]; then
cat -n ".cursor/generate-cursor-rules.md"
fiRepository: sam821203/SalesOps
Length of output: 44
🏁 Script executed:
#!/bin/bash
# Read generate-cursor-rules.md from the correct location
cat -n ".cursor/commands/generate-cursor-rules.md"Repository: sam821203/SalesOps
Length of output: 2014
🏁 Script executed:
#!/bin/bash
# Search for any mention of "rule:" in the codebase to see if it's documented anywhere
rg "rule:" --type md --type mdcRepository: sam821203/SalesOps
Length of output: 89
🏁 Script executed:
#!/bin/bash
# Also check all Cursor-related files for link format documentation
rg "mdc:" --type md --type mdc -A 2 -B 2Repository: sam821203/SalesOps
Length of output: 89
🏁 Script executed:
#!/bin/bash
# Search for "rule:" pattern in all files
rg "rule:" -g "*.md" -g "*.mdc"Repository: sam821203/SalesOps
Length of output: 44
🏁 Script executed:
#!/antml:max_thinking
# Check the actual .mdc rule files to see what link format they use
cat -n .cursor/rules/*.mdcRepository: sam821203/SalesOps
Length of output: 6176
Change link prefix from rule: to mdc: — undocumented link scheme.
The rule: prefix in lines 7–8 is not documented. Per .cursor/commands/generate-cursor-rules.md (line 7) and usage within the actual .mdc rule files, the correct format is mdc:path/to/file, relative to the workspace root.
Proposed fix
- **[branch-naming.mdc](rule:branch-naming.mdc)** — use for the new branch name.
- **[commit-message.mdc](rule:commit-message.mdc)** — use for every commit message.
+ **[branch-naming.mdc](mdc:.cursor/rules/branch-naming.mdc)** — use for the new branch name.
+ **[commit-message.mdc](mdc:.cursor/rules/commit-message.mdc)** — use for every commit message.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - **[branch-naming.mdc](rule:branch-naming.mdc)** — use for the new branch name. | |
| - **[commit-message.mdc](rule:commit-message.mdc)** — use for every commit message. | |
| - **[branch-naming.mdc](mdc:.cursor/rules/branch-naming.mdc)** — use for the new branch name. | |
| - **[commit-message.mdc](mdc:.cursor/rules/commit-message.mdc)** — use for every commit message. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.cursor/commands/branch-and-commit.md around lines 7 - 8, Update the two
links using the undocumented `rule:` scheme to the proper `mdc:` scheme; in
.cursor/commands/branch-and-commit.md replace the prefixes on the references to
branch-naming.mdc and commit-message.mdc so they read `mdc:branch-naming.mdc`
and `mdc:commit-message.mdc` (following the usage described in
generate-cursor-rules.md and how .mdc rule files are referenced).
| - alwaysApply: true/false # Will apply to every request | ||
| - description: string # A description that allows the agent to fetch the rule | ||
| - globs: string # A comma separated list of gitignore style patterns controlling what files this rule will apply to |
There was a problem hiding this comment.
Misleading inline comment on alwaysApply, missing hyphens, and unlabelled code blocks.
Three documentation quality issues:
- Line 13:
# Will apply to every requestis only true fortrue;falsemeans the rule is never auto-applied. - Line 15: "comma separated" should be hyphenated — "comma-separated" (flagged by LanguageTool).
- Lines 20, 31, 40: Code blocks are missing language specifiers, which violates MD040 (flagged by markdownlint-cli2).
🔧 Proposed fix
-- alwaysApply: true/false # Will apply to every request
+- alwaysApply: true/false # true = apply to every request; false = manual apply only
-- description: string # A description that allows the agent to fetch the rule
-- globs: string # A comma separated list of gitignore style patterns controlling what files this rule will apply to
+- description: string # A description that allows the agent to fetch the rule
+- globs: string # A comma-separated list of gitignore-style patterns controlling what files this rule will apply toFor the code blocks, add a language identifier (e.g. yaml or markdown) on lines 20, 31, and 40:
-```
+```yaml
---
alwaysApply: true📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - alwaysApply: true/false # Will apply to every request | |
| - description: string # A description that allows the agent to fetch the rule | |
| - globs: string # A comma separated list of gitignore style patterns controlling what files this rule will apply to | |
| - alwaysApply: true/false # true = apply to every request; false = manual apply only | |
| - description: string # A description that allows the agent to fetch the rule | |
| - globs: string # A comma-separated list of gitignore-style patterns controlling what files this rule will apply to |
🧰 Tools
🪛 LanguageTool
[grammar] ~15-~15: Use a hyphen to join words.
Context: ...fetch the rule - globs: string # A comma separated list of gitignore style patter...
(QB_NEW_EN_HYPHEN)
[grammar] ~15-~15: Use a hyphen to join words.
Context: ...ng # A comma separated list of gitignore style patterns controlling what files th...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.cursor/commands/generate-cursor-rules.md around lines 13 - 15, Update the
inline comment for alwaysApply to accurately state both options (e.g., "true =
auto-apply to every request; false = do not auto-apply"), hyphenate
"comma-separated" in the globs description, and add explicit language
identifiers (e.g., yaml or markdown) to the three unlabeled fenced code blocks
referenced in this file so the blocks render and satisfy MD040; target the
`alwaysApply`, `description`, and `globs` lines and the unlabeled fenced blocks
when making these edits.
| globs: apps/api/src/**/*.{ts} | ||
| alwaysApply: false |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find src directories to understand the monorepo structure
fd --type d "src" --max-depth 4 | grep -v node_modules | grep -v dist | head -20Repository: sam821203/SalesOps
Length of output: 110
🏁 Script executed:
#!/bin/bash
# Read the cloudinary rule file to confirm it describes React/frontend usage
cat -n .cursor/rules/cloudinary-standard.mdcRepository: sam821203/SalesOps
Length of output: 1637
🏁 Script executed:
#!/bin/bash
# Search for actual `@cloudinary/react` imports to find where they're used
rg "@cloudinary/react" -l --type ts --type tsxRepository: sam821203/SalesOps
Length of output: 89
🏁 Script executed:
#!/bin/bash
# Search for actual `@cloudinary/react` imports
rg "@cloudinary/react" -lRepository: sam821203/SalesOps
Length of output: 44
🏁 Script executed:
#!/antml:
# Check what file types are present in the web app
fd --extension ts --extension tsx apps/web/src | head -20Repository: sam821203/SalesOps
Length of output: 415
🏁 Script executed:
#!/bin/bash
# List apps directory structure to confirm app names
ls -la apps/ | grep "^d"Repository: sam821203/SalesOps
Length of output: 266
🏁 Script executed:
#!/bin/bash
# Check files in apps/web/src directory
find apps/web/src -type f | head -20Repository: sam821203/SalesOps
Length of output: 833
🏁 Script executed:
#!/bin/bash
# Search for `@cloudinary` in the entire codebase to see where it's used
rg "cloudinary" -iRepository: sam821203/SalesOps
Length of output: 2201
🏁 Script executed:
#!/bin/bash
# Check the full content of the rule file to see all sections
cat .cursor/rules/cloudinary-standard.mdcRepository: sam821203/SalesOps
Length of output: 1427
Glob targets the API backend, but the rule describes frontend React usage — the rule will never auto-apply where it matters.
apps/api/src/**/*.{ts} points to backend TypeScript files, yet Section 2 is entirely about @cloudinary/react usage in frontend components. The frontend source is located in apps/web/src/ and includes .tsx files (e.g., ProductEditModal.tsx, Header/ components). Additionally, {ts} brace expansion with a single item may not be interpreted correctly by gitignore-style glob engines.
The glob should target the frontend app's source:
🔧 Proposed fix
-globs: apps/api/src/**/*.{ts}
+globs: apps/web/src/**/*.{ts,tsx}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| globs: apps/api/src/**/*.{ts} | |
| alwaysApply: false | |
| globs: apps/web/src/**/*.{ts,tsx} | |
| alwaysApply: false |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.cursor/rules/cloudinary-standard.mdc around lines 3 - 4, The rule's glob
targets backend files (the "globs" key currently set to apps/api/src/**/*.{ts})
so the Cloudinary-react checks never run; update the "globs" entry to point at
the frontend source (e.g., apps/web/src/**/*.{ts,tsx} or a broader pattern like
apps/web/src/**/*.{js,jsx,ts,tsx}) and fix the brace expansion to include
multiple extensions, and also verify the "alwaysApply" flag is set as intended
(change if you want the rule to auto-apply). Ensure you update the "globs" key
and leave "alwaysApply" correctly set in the same rule block so Section 2 runs
against the frontend .tsx components.
| ```tsx | ||
| import { AdvancedImage } from '@cloudinary/react'; | ||
| import { fill } from "@cloudinary/url-gen/actions/resize"; | ||
|
|
||
| // Standard implementation | ||
| const myImage = cld.image('sample_id').resize(fill().width(400).height(300)); | ||
| <AdvancedImage cldImg={myImage} /> No newline at end of file |
There was a problem hiding this comment.
Unclosed TSX code block will break document rendering.
The fenced code block opened at line 24 (```tsx) is never closed with a matching ```. In Cursor, any content after the unclosed fence is rendered as raw code, making the document unusable.
Additionally, cld is referenced on line 29 without a definition or import. The mandatory blur/pixelate placeholder described in line 21 is also absent from the example.
🔧 Proposed fix
import { AdvancedImage, placeholder } from '@cloudinary/react';
+import { CloudinaryImage } from '@cloudinary/url-gen';
import { fill } from "@cloudinary/url-gen/actions/resize";
+import { blur } from "@cloudinary/url-gen/actions/effect";
+const cld = new Cloudinary({ cloud: { cloudName: 'your-cloud-name' } });
+
// Standard implementation
const myImage = cld.image('sample_id').resize(fill().width(400).height(300));
-<AdvancedImage cldImg={myImage} />
+<AdvancedImage cldImg={myImage} plugins={[placeholder({ mode: 'blur' })]} />
+```🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.cursor/rules/cloudinary-standard.mdc around lines 24 - 30, Close the
unclosed fenced TSX block and fix the example: end the ```tsx fence after the
snippet, add a Cloudinary client definition/import so the referenced symbol cld
is defined (e.g., create or import the Cloudinary instance used to call
cld.image), and include the required placeholder transformation (use blur() or
pixelate() as shown in the docs) in the example before rendering with
<AdvancedImage cldImg={myImage} />; ensure the code references the existing
symbols AdvancedImage, fill, cld, myImage and the placeholder (blur/pixelate) so
the example compiles and the document renders.
Summary
.cursor/so the AI and developers can follow the same branch/commit and PR/issue workflows and conventions.Changes
Scope
Select one (aligns with
commitlint.config.cjsscopes):Related
Summary by CodeRabbit
No user-facing functionality changes; improvements focus on clearer contributor workflows and consistent project practices.