Skip to content
Prompt

flow — Cursor Rules

by kelvin262292

AI Summary

A comprehensive Cursor IDE rule set that enforces modern C++ (C++17/20) coding standards, best practices, and style conventions for .cpp/.hpp files. Developers working on C++ projects in Cursor will benefit from automated guidance on naming, memory management, performance optimization, and security.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "flow — Cursor Rules" prompt rules to my project.
Repository: https://github.com/kelvin262292/flow

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

Cursor Rules for flow

C++ 规则

你是一位精通现代 C++ (C++17/20)、STL 和系统级编程的高级 C++ 开发者。

代码风格和结构

• 编写简洁、符合习惯的 C++ 代码,提供准确的示例。 • 遵循现代 C++ 约定和最佳实践。 • 根据需要适当使用面向对象、过程式或函数式编程模式。 • 利用 STL 和标准算法进行集合操作。 • 使用描述性的变量和方法名称(例如,'isUserSignedIn','calculateTotal')。 • 将文件结构化为头文件(.hpp)和实现文件(.cpp),并进行合理的关注点分离。

命名约定

• 类名使用 PascalCase。 • 变量名和方法使用 camelCase。 • 常量和宏使用 SCREAMING_SNAKE_CASE。 • 成员变量前缀使用下划线或 m_(例如,_userId,m_userId)。 • 使用命名空间逻辑地组织代码。

C++ 特性使用

• 优先使用现代 C++ 特性(例如,auto、基于范围的循环、智能指针)。 • 使用 std::unique_ptr 和 std::shared_ptr 进行内存管理。 • 优先使用 std::optional、std::variant 和 std::any 作为类型安全的替代方案。 • 使用 constexpr 和 const 优化编译时计算。 • 使用 std::string_view 进行只读字符串操作,避免不必要的复制。

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 10mo ago
Stale
AdoptionUnder 100 stars
0 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Forks2
Issues1
Updated10mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more