Add Vibe-Coding SOP (5-stage AI coding workflow rule) - #342
Conversation
📝 WalkthroughWalkthroughAdds a new Cursor Vibe-Coding SOP covering a five-stage workflow, approval gates, development controls, testing, UI practices, and code review reporting. The README documentation list now links to the SOP. ChangesVibe-Coding SOP
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rules/vibe-coding-sop-cursorrules-prompt-file.mdc`:
- Around line 13-18: Update the “阶段 1:需求确认” section in
rules/vibe-coding-sop-cursorrules-prompt-file.mdc to explicitly prohibit
creating, modifying, deleting, or renaming any files before human approval;
retain the existing approval-gate description in README.md at line 316 with no
direct change required.
- Around line 1-4: Update the rule frontmatter for the SOP so it activates
reliably across coding tasks by setting alwaysApply to true; remove the empty
globs configuration if it is no longer needed, while preserving the existing
description.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: dca7cafd-5a50-4a83-8623-4363d86c3395
📒 Files selected for processing (2)
README.mdrules/vibe-coding-sop-cursorrules-prompt-file.mdc
| --- | ||
| description: A 5-stage vibe-coding standard operating procedure (SOP) for Cursor — requirements → tech eval → development → testing → review. Includes a safety gate that blocks file writes until the plan is approved by the human, and produces a reusable design system so generated UI stays consistent instead of "AI slop". | ||
| globs: | ||
| alwaysApply: false |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '--- locate the file ---\n'
fd -a 'vibe-coding-sop-cursorrules-prompt-file\.mdc$' . || true
printf '\n--- git status/diff stat ---\n'
git diff --stat || true
printf '\n--- target file around frontmatter and mentions ---\n'
path="$(fd 'vibe-coding-sop-cursorrules-prompt-file\.mdc$' . | head -n 1 || true)"
if [ -n "${path:-}" ]; then
wc -l "$path"
sed -n '1,40p' "$path" | cat -n
printf '\n--- rule title/self references ---\n'
rg -n 'automatic|project|wide|alwaysApply|globs|Cursor|rule|prompt|sop' "$path"
fiRepository: PatrickJS/awesome-cursorrules
Length of output: 258
🌐 Web query:
Cursor context rules yml md frontmatter alwaysApply globs documentation
💡 Result:
Cursor has transitioned to a directory-based system for managing AI instructions, using.mdc files within a.cursor/rules/ folder [1][2]. While the legacy.cursorrules file in the project root is still supported for backward compatibility, it is recommended to migrate to the new format for better scoping and organization [3][4][5]. ### Modern.mdc Rules System Project rules are now defined as.mdc (Markdown + metadata) files located in the.cursor/rules/ directory [1][4]. These files use YAML frontmatter to control their activation and scope [2][6]. ### Frontmatter Configuration Each.mdc file should contain a YAML frontmatter block at the top [2][7]. The three primary fields used to control rule application are: * description: A one-line summary that helps Cursor's agent decide whether the rule is relevant to the current task [1][4][6]. * globs: A list of file patterns (e.g., ["src//.ts", "styles/.css"]) that trigger the rule automatically when a matching file is in context [2][4]. * alwaysApply: A boolean flag [1][7]. * When true: The rule is always included in every chat session, and the globs/description fields are ignored [1][4]. * When false: The rule is applied conditionally based on matching globs or agent relevance [1][7]. ### Rule Activation Modes Based on these settings, rules generally fall into four activation categories [4][7]: 1. Always Apply: alwaysApply: true. Included in every request [4][7]. 2. Auto-attached: alwaysApply: false with globs provided. Activates when a file matching the glob is in context [1][4]. 3. Agent-requested: alwaysApply: false with a description provided (but no globs). The agent reads the description and determines if it is relevant [1][6][7]. 4. Manual: alwaysApply: false with no globs or description. The rule only activates when explicitly referenced (e.g., @-mentioning the rule in chat) [4][7]. Note: Plain.md files in the.cursor/rules/ folder are ignored by the rules system because they lack the required frontmatter [1][4]. If you prefer plain markdown without frontmatter, you can use AGENTS.md instead [1].
Citations:
- 1: https://cursor.com/docs/rules
- 2: https://design.dev/guides/cursor-rules/
- 3: https://cursor.com/help/customization/rules
- 4: https://taskprio.com/cursor-rules
- 5: https://theaienabledcoder.com/ai-tools/what-is-cursor-rules/
- 6: https://www.polarpoint.io/blog/2026/06/25/cursor-mdc-rules-the-more-powerful-ai-context-file-youre-probably-not-using/
- 7: https://aitoolsguidebook.com/en/articles/cursor-rules-tutorial/
Make the rule activate reliably across coding tasks.
With alwaysApply: false and globs: empty, the rule is agent-relevance/manual rather than project-wide. Set alwaysApply: true, or add explicit matching globs if this SOP should auto-attach only for certain task contexts.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rules/vibe-coding-sop-cursorrules-prompt-file.mdc` around lines 1 - 4, Update
the rule frontmatter for the SOP so it activates reliably across coding tasks by
setting alwaysApply to true; remove the empty globs configuration if it is no
longer needed, while preserving the existing description.
| 任何"写代码"任务(后端/前端/全栈/脚本),按这个流程走: | ||
|
|
||
| ### 阶段 1:需求确认 | ||
| - 不要一上来就写代码。先问清楚:需求边界(不做什么)、验收标准(用户用得顺的具体行为)、优先级(MVP vs 完整) | ||
| - 必产出:需求规格 + 风险点 + 后续建议 | ||
| - 拍板:边界 / 验收标准 / 优先级 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Enforce the advertised approval gate before claiming it.
The SOP and README promise that file writes are blocked until human approval, but the rule currently lacks an explicit no-mutation constraint.
rules/vibe-coding-sop-cursorrules-prompt-file.mdc#L13-L18: prohibit all file creation, modification, deletion, and renaming before approval.README.md#L316-L316: retain the safety-gate description after the rule enforces it.
📍 Affects 2 files
rules/vibe-coding-sop-cursorrules-prompt-file.mdc#L13-L18(this comment)README.md#L316-L316
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rules/vibe-coding-sop-cursorrules-prompt-file.mdc` around lines 13 - 18,
Update the “阶段 1:需求确认” section in
rules/vibe-coding-sop-cursorrules-prompt-file.mdc to explicitly prohibit
creating, modifying, deleting, or renaming any files before human approval;
retain the existing approval-gate description in README.md at line 316 with no
direct change required.
Summary
Adds Vibe-Coding SOP, a new Cursor rule providing a 5-stage standard operating procedure for AI-assisted coding: requirements → tech evaluation → development → testing → review. It enforces a "plan-before-code" safety gate that blocks file writes until the plan is human-approved, and ships a reusable design system to keep generated UI consistent.
Contribution Type
Value To Cursor Users
docs/design-system.mdso generated interfaces stay coherent instead of generic.Added Or Changed Files
rules/vibe-coding-sop-cursorrules-prompt-file.mdc— rule body with frontmatter (description,globs,alwaysApply: false) (new, +101)README.md— one new entry under Documentation (+1)Quality Checklist
.mdcfrontmatter format (description / globs / alwaysApply)Notes For Maintainers
.mdchere is a Cursor-format export of the SOP; the canonical skill (with commands / hooks / end-to-end examples) lives in the source repo.Thanks for maintaining this list!