Skip to content
Prompt

autowds-backend — Cursor Rules

by AutoWDS

AI Summary

Comprehensive Cursor rules for the AutoWDS full-stack project, providing coding standards, architecture guidelines, and best practices for Rust backend (Axum/Sea-ORM), React frontend, and Next.js development. Developers working on this project use it to maintain consistency and accelerate development.

Install

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

I want to add the "autowds-backend — Cursor Rules" prompt rules to my project.
Repository: https://github.com/AutoWDS/autowds-backend

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 autowds-backend

项目概述

这是一个全栈项目,包含: • 后端: Rust (Spring 框架 + Axum + Sea-ORM) • 前端: React 18 + TypeScript + Ant Design • 前端站点: Next.js • 数据库: PostgreSQL • 缓存: Redis • 任务队列: Apalis

代码风格

• 使用 Rust 2021 edition • 遵循 Rust 官方代码风格(rustfmt) • 使用 snake_case 命名函数和变量 • 使用 PascalCase 命名类型和结构体 • 使用 SCREAMING_SNAKE_CASE 命名常量

项目结构

• src/main.rs: 应用入口,配置插件和路由 • src/router/: 路由定义,使用 spring_web::handler::auto_router() 自动路由 • src/views/: 请求/响应数据结构,使用 serde 和 schemars 进行序列化和 OpenAPI 文档生成 • src/model/: 数据库模型,使用 Sea-ORM • src/utils/: 工具函数(JWT、邮件、验证码等) • src/config/: 配置文件

API 开发规范

• 使用 #[post_api], #[get_api], #[patch_api] 等宏定义路由 • 所有 API 路径以 /api 为前缀(在 router/mod.rs 中统一配置) • 使用 @tag 注释为 OpenAPI 文档分组 • 请求体使用 Json<T> 提取器,其中 T 实现 Deserialize 和 Validate • 响应使用 Result<Json<T>>,其中 T 实现 Serialize 和 JsonSchema • 错误处理使用 KnownWebError 或 anyhow::Context 提供上下文

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 2mo ago
Active
AdoptionUnder 100 stars
6 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars6
Forks1
Issues0
Updated2mo 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