Skip to content

Chore/implement cursor commands and rules#47

Merged
sam821203 merged 2 commits intodevelopfrom
chore/implement-cursor-commands-and-rules
Feb 23, 2026
Merged

Chore/implement cursor commands and rules#47
sam821203 merged 2 commits intodevelopfrom
chore/implement-cursor-commands-and-rules

Conversation

@sam821203
Copy link
Owner

@sam821203 sam821203 commented Feb 23, 2026

Summary

  • What problem does this PR solve? Lack of consistent Cursor workflows for branching, committing, and generating PR/issue markdown, and no shared rules for commit messages, branch naming, and conventions (e.g. Cloudinary).
  • What approach did you take? Added Cursor commands and rules under .cursor/ so the AI and developers can follow the same branch/commit and PR/issue workflows and conventions.

Changes

  • Add Cursor command: branch-and-commit (branch naming + commit from template)
  • Add Cursor command: generate-cursor-rules (create or update rules)
  • Add Cursor rules: branch-naming, cloudinary-standard, commit-message
  • Add Cursor command: generate-issue-markdown (issue body from template)
  • Add Cursor command: generate-pr-markdown (PR description from current branch and commits)

Scope

Select one (aligns with commitlint.config.cjs scopes):

  • ui
  • layout
  • page
  • component
  • hook
  • api
  • state
  • router
  • auth
  • permission
  • i18n
  • theme
  • devops

Related

Summary by CodeRabbit

  • Documentation
    • Added guides for branching and committing, generating PR and issue descriptions, and applying repository conventions.
    • Documented branch naming and commit message standards to ensure consistent workflows.
    • Introduced media handling standards for images to promote performance and consistency, with usage examples.
  • Chores
    • Established CI-aligned conventions and templates to streamline contributions.

No user-facing functionality changes; improvements focus on clearer contributor workflows and consistent project practices.

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

📝 Walkthrough

Walkthrough

Seven 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 .cursor/commands/ for workflow procedures and .cursor/rules/ for enforcement standards.

Changes

Cohort / File(s) Summary
Cursor Commands
.cursor/commands/branch-and-commit.md, .cursor/commands/generate-cursor-rules.md, .cursor/commands/generate-issue-markdown.md, .cursor/commands/generate-pr-markdown.md
Workflow guidance files providing step-by-step procedures for creating branches, committing changes with Conventional Commits format, generating issue markdown from git history, and generating PR markdown from commits. Each file includes templates and specification of required metadata (scope categories, commit types, etc.).
Cursor Rules
.cursor/rules/branch-naming.mdc, .cursor/rules/commit-message.mdc, .cursor/rules/cloudinary-standard.mdc
Rule definition files with YAML frontmatter and specification content. Define branch naming conventions with regex validation and allowed prefixes; enforce Conventional Commits format with type, scope, and subject requirements; and prescribe Cloudinary image optimization standards with sizing and placeholder requirements.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Hop, hop, branching rules so neat,
Commits in conventional beat,
Issues and PRs now auto-write,
Cursor commands shining bright!
Cloudinary images optimized with glee,
Standardized workflows—hip-hip-hooray! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: implementing Cursor commands and rules for development workflows, with 'Chore' indicating the type and 'implement cursor commands and rules' accurately summarizing the primary focus.
Description check ✅ Passed The PR description is well-structured and comprehensive, covering the problem statement, approach, detailed list of changes, proper scope selection (devops), and related issue reference. All required sections from the template are addressed.
Linked Issues check ✅ Passed All acceptance criteria from issue #46 are fully met: branch-and-commit command, generate-cursor-rules command, generate-issue-markdown command, generate-pr-markdown command, and rules for commit messages, branch naming, and Cloudinary standard are all implemented and placed correctly under .cursor/.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the stated objectives and issue #46 requirements. No extraneous modifications or unrelated files are present in this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/implement-cursor-commands-and-rules

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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-rules or chore/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

📥 Commits

Reviewing files that changed from the base of the PR and between 3092864 and eead527.

📒 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

Comment on lines +7 to +8
- **[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.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 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 -20

Repository: 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"
fi

Repository: 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"
fi

Repository: 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"
fi

Repository: 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 mdc

Repository: 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 2

Repository: 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/*.mdc

Repository: 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.

Suggested change
- **[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).

Comment on lines +13 to +15
- 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
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Misleading inline comment on alwaysApply, missing hyphens, and unlabelled code blocks.

Three documentation quality issues:

  1. Line 13: # Will apply to every request is only true for true; false means the rule is never auto-applied.
  2. Line 15: "comma separated" should be hyphenated — "comma-separated" (flagged by LanguageTool).
  3. 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 to

For 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.

Suggested change
- 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.

Comment on lines +3 to +4
globs: apps/api/src/**/*.{ts}
alwaysApply: false
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 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 -20

Repository: 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.mdc

Repository: 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 tsx

Repository: sam821203/SalesOps

Length of output: 89


🏁 Script executed:

#!/bin/bash
# Search for actual `@cloudinary/react` imports
rg "@cloudinary/react" -l

Repository: 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 -20

Repository: 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 -20

Repository: 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" -i

Repository: 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.mdc

Repository: 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.

Suggested change
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.

Comment on lines +24 to +30
```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
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

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.

@sam821203 sam821203 merged commit 8bf2c51 into develop Feb 23, 2026
7 checks passed
@sam821203 sam821203 deleted the chore/implement-cursor-commands-and-rules branch February 23, 2026 14:40
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.

Implement Cursor commands and rules for branch, commit, and issue/PR workflows

1 participant