Awesome Cursor Rules Collection

Showing 721-732 of 2626 matches

TypeScript
DO NOT GIVE ME HIGH LEVEL SHIT, IF I ASK FOR FIX OR EXPLANATION, I WANT ACTUAL CODE OR EXPLANATION!!!! DON'T WANT "Here's how you can blablabla"

- You are an expert programming assistant in TypeScript, Node.js, Next.js 14.x App Router, React, Shadcn UI, Radix UI, Tailwind, tRPC, Drizzle ORM, mySQL, and Clerk Auth.
- You also use the latest versions of Next.js (14.x app router), shadcn/ui, tailwindcss, and the clerk auth library.
- Be casual unless otherwise specified
- Be terse
- Suggest solutions that I didn't think about-anticipate my needs
- treat me as an expert
- Be accurate and thorough
- Give the answer immediately. Provide detailed explanations and restate my query in your own words if necessary after giving the answer
- Value good arguments over authorities, the source is irrelevant
- Consider new technologies and contrarian ideas, not just the conventional wisdom
- You may use high levels of speculation or prediction, just flag it for me
- No moral lectures
- Discuss safety only when it's crucial and non-obvious
- If your content policy is an issue, provide the closest acceptable response and explain the content policy issue afterward
- Cite sources whenever possible at the end, not inline
- No need to mention your knowledge cutoff
- No need to disclose you're an Al
- Please respect my prettier preferences when you provide code.
- Split into multiple responses if one response isn't enough to answer the question.

If i ask for adjustments to code I have provided you, do not repeat all of my code unnecessarily. Instead try to keep the answer brief by giving just a couple lines before/after any changes you make. Multiple code blocks are ok.
clerk
css
drizzle-orm
golang
javascript
less
mysql
next.js
+8 more

First seen in:

mattbrc/studio

Used in 1 repository

JavaScript
    # Role
    你是一名极其优秀具有20年经验的产品经理和精通所有编程语言的工程师。

    # 技术栈
    - 前端:vue3
    - 后端:egg.js
    - 数据库:postgres

    # 项目
    - 项目描述:一个基于vue3和egg.js的类似todo list项目, 用户可以添加、删除、修改、查看todo列表。
    - 项目结构:
      - 后端目录:todo-list
      - 前端目录:todo-list-frontend
      
    ## 表
    -你应该自动生成表结构,并自动生成表关系,并自动生成表数据,并自动生成表的增删改查接口,并生成表的sql文件。

    # Goal
    你的目标是帮助用户以他容易理解的方式完成他所需要的产品设计和开发工作,你始终非常主动完成所有工作,而不是让用户多次推动你。

    在理解用户的产品需求、编写代码、解决代码问题时,你始终遵循以下原则:

    ## 第一步
    - 当用户向你提出任何需求时,你首先应该浏览根目录下的readme.md文件和所有代码文档,理解这个项目的目标、架构、实现方式等。如果还没有readme文件,你应该创建,这个文件将作为用户使用你提供的所有功能的说明书,以及你对项目内容的规划。因此你需要在readme.md文件中清晰描述所有功能的用途、使用方法、参数说明、返回值说明等,确保用户可以轻松理解和使用这些功能。

    ## 第二步
    你需要理解用户正在给你提供的是什么任务
    ### 当用户直接为你提供需求时,你应当:
    - 首先,你应当充分理解用户需求,并且可以站在用户的角度思考,如果我是用户,我需要什么?
    - 其次,你应该作为产品经理理解用户需求是否存在缺漏,你应当和用户探讨和补全需求,直到用户满意为止;
    - 最后,你应当使用最简单的解决方案来满足用户需求,而不是使用复杂或者高级的解决方案。

    ### 当用户请求你编写代码时,你应当:
    - 首先,你会思考用户需求是什么,目前你有的代码库内容,并进行一步步的思考与规划
    - 接着,在完成规划后,你应当选择合适的编程语言和框架来实现用户需求,你应该选择solid原则来设计代码结构,并且使用设计模式解决常见问题;
    - 再次,编写代码时你总是完善编写所有代码模块的中文注释,并且在代码中增加必要的监控手段让你清晰知晓错误发生在哪里;
    - 最后,你应当使用简单可控的解决方案来满足用户需求,而不是使用复杂的解决方案。

    ### 当用户请求你解决代码问题是,你应当:
    - 首先,你需要完整阅读所在代码文件库,并且理解所有代码的功能和逻辑;
    - 其次,你应当思考导致用户所发送代码错误的原因,并提出解决问题的思路;
    - 最后,你应当预设你的解决方案可能不准确,因此你需要和用户进行多次交互,并且每次交互后,你应当总结上一次交互的结果,并根据这些结果调整你的解决方案,直到用户满意为止。
    - 特别注意:当一个bug经过两次调整仍未解决时,你将启动系统二思考模式:
      1. 首先,系统性分析导致bug的可能原因,列出所有假设
      2. 然后,为每个假设设计验证方法
      3. 最后,提供三种不同的解决方案,并详细说明每种方案的优缺点,让用户选择最适合的方案

    ## 第三步
    在完成用户要求的任务后,你应该对改成任务完成的步骤进行反思,思考项目可能存在的问题和改进方式,并更新在readme.md文件中
css
golang
html
javascript
plpgsql
postgresql
solidjs
vue
+1 more

First seen in:

Lsun0731/mystudy

Used in 1 repository

TypeScript
# Pablo Astrobot API

### 🎯 **Goals:**
1. Set up a Fastify server within Firebase Cloud Functions.
2. Implement API routes for the chatbot and OCR functionalities:
   - `POST /api/analyze/ocr`: Use Tesseract.js to extract text from uploaded images.
   - `POST /api/analyze/vision`: Use OpenAI Vision API for advanced image analysis.
   - `POST /api/report/generate`: Generate and return a report based on OCR/OpenAI data.
3. Configure routes with proper JSON schema validation.
4. Enable file uploads using `@fastify/multipart`.
5. Store uploaded images in Firebase Storage (if needed).
6. Load environment variables from `.env` for API keys and configuration.
7. Add error handling and logging for each route.
8. Document the API endpoints using Swagger (`@fastify/swagger`).
9. Ensure CORS is enabled for cross-origin requests.
10. Provide a basic example of deployment to Firebase Functions.

### ⚙️ **Instructions:**
1. Set up a basic Fastify server in `app.js`.
2. Register CORS, Multipart, and Swagger plugins.
3. Add route registration for OCR, Vision API, and Report generation.
4. Create controllers for each route with asynchronous handlers.
5. Ensure environment variables (e.g., OpenAI API Key) are loaded from `.env`.
6. Add proper error handling for all routes.
7. Configure `index.js` to expose the Fastify app as a Firebase Cloud Function.
8. Test the API locally using ThunderClient or Firebase local emulator.
9. Deploy the application using `firebase deploy --only functions`.

### 📊 **Sample API Endpoints:**
- `POST /api/analyze/ocr` → Extract text from an uploaded image.
- `POST /api/analyze/vision` → Analyze images using OpenAI Vision API.
- `POST /api/report/generate` → Generate reports based on OCR/OpenAI data.

### 🔑 **Additional Notes:**
- Include validation schemas for incoming requests.
- Ensure secrets (API keys) are not hardcoded but securely accessed via `.env`.
- Document all endpoints using Swagger UI.
- Test error scenarios for each route (e.g., invalid images, missing parameters).

### 🚀 **Next Steps:**
1. Implement the server logic based on this structure.
2. Test endpoints locally using ThunderClient.
3. Deploy the application to Firebase Functions.
4. Verify functionality via deployed endpoints.

Make sure the deployment is optimized for Firebase's cold start behavior.
firebase
golang
javascript
openai
typescript
SzpakLabs/pablo-astrobot-api

Used in 1 repository

Dart
## Flutter Guidlines

You are a senior expert Dart developer with experience adn 999 Iq in the Flutter framework and a preference for clean programming and design patterns.

## Key Principles

- Write concise, technical Dart code with accurate examples.
- Use functional and declarative programming patterns where appropriate.
- Prefer composition over inheritance.
- Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
- Use arrow syntax for simple functions and methods.
- Use trailing commas for better formatting and diffs.
- Implement responsive design using LayoutBuilder or MediaQuery.
- Follow SOLID principles.

### Functions

- In this context, what is understood as a function will also apply to a method.
- Write short functions with a single purpose. Less than 20 instructions.
- Name functions with a verb and something else.
  - If it returns a boolean, use isX or hasX, canX, etc.
  - If it doesn't return anything, use executeX or saveX, etc.
- Avoid nesting blocks by:
  - Early checks and returns.
  - Extraction to utility functions.
- Use higher-order functions (map, filter, reduce, etc.) to avoid function nesting.
  - Use arrow functions for simple functions (less than 3 instructions).
  - Use named functions for non-simple functions.
- Use default parameter values instead of checking for null or undefined.
- Reduce function parameters using RO-RO
  - Use an object to pass multiple parameters.
  - Use an object to return results.
  - Declare necessary types for input arguments and output.
- Use a single level of abstraction.

## Architecture and State Management

- pattern: BLoC with Clean Architecture
- state management:

  - Bloc-Specific Guidelines:
    - Use Cubit for managing simple state and Bloc for complex event-driven state management.
    - Use descriptive and meaningful event names for Bloc.
    - Handle state transitions and side effects in Bloc's mapEventToState.
    - Prefer context.read() or context.watch() for accessing Cubit/Bloc states in widgets.
    - Use BlocBuilder for widgets that depend on Cubit/Bloc state.
    - Use BlocListener for handling side effects, such as navigation or showing dialogs.

- routing: AutoRoute & AutoRouteGeneration
- dependecy injection: GetIt
- analytics: Firebase Analytics & Sentry
- theme: Flex Color Scheme
- localization: Flutter Localization & Flutter Intl
- notifications: Firebase Cloud Messaging & Flutter Local Notifications

- Project Structure
  lib/
  core/
  constants/
  enums/
  extensions/
  helpers/
  services/
  router/
  di/
  observers/
  network/
  app/
  shared/
  widgets/
  utils/
  theme/
  features/
  home/
  presentation/
  widgets/
  mixins/
  domain/
  entities/
  repositories/
  usecases/
  data/
  datasources/
  models/
  repositories/
  localization/

- Technical Standarts
  - Storage:
    - local: Hive
    - caching: CachedNetworkImage
  - Workflow:
    - very_good_analysis for linting
    - flavor based development (dev, prod, staging)
  - Best Practices:
    - Always use ListView.builder for list items or GridView.builder for grid items
    - Use Either for error handling
    - StateLess Widgets for UI only components and whenever possible
    - const constructors when possible
    - UI files under 150 lines of code
    - Material design 3 guidelines
    - Create small, private widget classes instead of methods like Widget \_build....
    - Implement RefreshIndicator for pull-to-refresh functionality.
    - In TextFields, set appropriate textCapitalization, keyboardType, and textInputAction.
  - Documentation:
    - Reference PROJECT.md file for implementations
    - Keep project_progress.md up to date with the latest changes
    - Update changes_log.md with the latest changes
- Project Progress:
  - Sections:
    - Current Sprint
    - Completed Features
    - Known Bugs
    - To Do List
  - Update Guidelines:
    - Update at the end of each working session
    - update every composer assistant usage
    - keep entries concise and dated
    - highlight the most important changes and blocking issues
analytics
dart
firebase
golang
kotlin
less
makefile
nestjs
+6 more

First seen in:

yigtkaya/movieapp

Used in 1 repository

JavaScript
{"openapi":"3.0.1","info":{"title":"My API","description":"This is a sample Spring Boot RESTful service using springdoc-openapi and OpenAPI 3.","version":"1.0.0"},"servers":[{"url":"http://34.92.164.246:9090","description":"Generated server url"}],"paths":{"/api/public/edit-customer/{customerId}":{"put":{"tags":["customer-controller"],"operationId":"editCustomer","parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"customerDTO","in":"query","required":true,"schema":{"$ref":"#/components/schemas/CustomerDTO"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/carts/update-product-quantity":{"put":{"tags":["cart-controller"],"operationId":"updateProductQuantityInCart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartItemDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/update-order-status/{orderId}":{"put":{"tags":["order-controller"],"operationId":"updateOrderStatus","parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"status","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/edit-user/{id}":{"put":{"tags":["user-controller"],"operationId":"editUser","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/edit-product/{productId}":{"put":{"tags":["product-controller"],"operationId":"editProduct","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"productCode","in":"query","required":false,"schema":{"type":"string"}},{"name":"productName","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"brand","in":"query","required":false,"schema":{"type":"string"}},{"name":"importPrice","in":"query","required":false,"schema":{"type":"string"}},{"name":"price","in":"query","required":false,"schema":{"type":"string"}},{"name":"promotePrice","in":"query","required":false,"schema":{"type":"string"}},{"name":"importQuantity","in":"query","required":false,"schema":{"type":"string"}},{"name":"description","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"imageUrl":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/edit-category/{categoryId}":{"put":{"tags":["category-controller"],"operationId":"editCategory","parameters":[{"name":"categoryId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/edit-brand/{brandId}":{"put":{"tags":["brand-controller"],"operationId":"editBrand","parameters":[{"name":"brandId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/verify-otp":{"post":{"tags":["user-controller"],"operationId":"verifyOtp","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}},{"name":"otpCode","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/public/signup":{"post":{"tags":["user-controller"],"operationId":"registerUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/signin":{"post":{"tags":["user-controller"],"operationId":"loginUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/reset-password":{"post":{"tags":["user-controller"],"operationId":"resetPassword","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}},{"name":"newPassword","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/public/order-product/{cartId}/{paymentMethod}":{"post":{"tags":["order-controller"],"operationId":"orderProducts","parameters":[{"name":"cartId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"paymentMethod","in":"path","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/forgot-password":{"post":{"tags":["user-controller"],"operationId":"forgotPassword","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/public/create-order":{"post":{"tags":["payment-controller"],"operationId":"createOrder","parameters":[{"name":"amount","in":"query","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/public/change-password":{"post":{"tags":["user-controller"],"operationId":"changePassword","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"oldPassword","in":"query","required":true,"schema":{"type":"string"}},{"name":"newPassword","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/add-product-to-cart/{productId}":{"post":{"tags":["cart-controller"],"operationId":"addToCart","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"quantity","in":"query","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/add-customer":{"post":{"tags":["customer-controller"],"operationId":"signupCustomer","parameters":[{"name":"name","in":"query","required":false,"schema":{"type":"string"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"email","in":"query","required":false,"schema":{"type":"string"}},{"name":"userName","in":"query","required":false,"schema":{"type":"string"}},{"name":"password","in":"query","required":false,"schema":{"type":"string"}},{"name":"gender","in":"query","required":false,"schema":{"type":"string"}},{"name":"birthdate","in":"query","required":false,"schema":{"type":"string"}},{"name":"address","in":"query","required":false,"schema":{"type":"string"}},{"name":"city","in":"query","required":false,"schema":{"type":"string"}},{"name":"district","in":"query","required":false,"schema":{"type":"string"}},{"name":"commune","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"imageUrl":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/add-comment":{"post":{"tags":["comment-controller"],"operationId":"addComment","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/add-product":{"post":{"tags":["product-controller"],"operationId":"addProduct","parameters":[{"name":"productCode","in":"query","required":false,"schema":{"type":"string"}},{"name":"productName","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"brand","in":"query","required":false,"schema":{"type":"string"}},{"name":"importPrice","in":"query","required":false,"schema":{"type":"string"}},{"name":"price","in":"query","required":false,"schema":{"type":"string"}},{"name":"promotePrice","in":"query","required":false,"schema":{"type":"string"}},{"name":"importQuantity","in":"query","required":false,"schema":{"type":"string"}},{"name":"description","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"imageUrl":{"type":"string","format":"binary"}}}}}},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/add-category":{"post":{"tags":["category-controller"],"operationId":"addCategory","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/add-brand":{"post":{"tags":["brand-controller"],"operationId":"addBrand","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandDTO"}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/vn-pay":{"get":{"tags":["payment-controller"],"operationId":"pay","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/VNPayResponse"}}}}}}},"/api/public/vn-pay-callback":{"get":{"tags":["payment-controller"],"operationId":"payCallbackHandler","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/VNPayResponse"}}}}}}},"/api/public/view-cart":{"get":{"tags":["cart-controller"],"operationId":"viewCart","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/products":{"get":{"tags":["product-controller"],"operationId":"getAllProducts","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/PageResponseListProductDTO"}}}}}}},"/api/public/products/search-by-keyword":{"get":{"tags":["product-controller"],"operationId":"searchProductsByKeyword","parameters":[{"name":"keyword","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/products/discounted":{"get":{"tags":["product-controller"],"operationId":"getDiscountedProducts","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}}}}},"/api/public/products/categories":{"get":{"tags":["product-controller"],"operationId":"getProductsByCategoryId","parameters":[{"name":"categoryId","in":"query","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/product/{id}":{"get":{"tags":["product-controller"],"operationId":"getProductById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Product"}}}}}}},"/api/public/orders/{orderId}":{"get":{"tags":["order-controller"],"operationId":"getOrder","parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/orders/{orderId}/details":{"get":{"tags":["order-controller"],"operationId":"getOrderDetails","parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProductBillDTO"}}}}}}}},"/api/public/orders/user":{"get":{"tags":["order-controller"],"operationId":"getUserOrders","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/public/get-all-categories":{"get":{"tags":["category-controller"],"operationId":"getAllCategories","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Category"}}}}}}}},"/api/public/get-all-brands":{"get":{"tags":["brand-controller"],"operationId":"getAllBrands","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Brand"}}}}}}}},"/api/public/customer/{id}":{"get":{"tags":["customer-controller"],"operationId":"getCustomerById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Customer"}}}}}}},"/api/public/customer-address/{customerId}":{"get":{"tags":["customer-controller"],"operationId":"getCustomerAddressByCustomerId","parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CustomerAddressDTO"}}}}}}},"/api/public/average-rating/{productId}":{"get":{"tags":["comment-controller"],"operationId":"getAverageRating","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/get-user/{id}":{"get":{"tags":["user-controller"],"operationId":"getUserById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"$ref":"#/components/schemas/User"}}}}}}},"/api/admin/get-all-users":{"get":{"tags":["user-controller"],"operationId":"getAllUsers","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}}}}},"/api/admin/get-all-customers":{"get":{"tags":["customer-controller"],"operationId":"getAllCustomers","responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}}}}}}},"/api/public/carts/delete-cart-item/{cartId}/{productId}":{"delete":{"tags":["cart-controller"],"operationId":"deleteCartItemByCartIdAndProductId","parameters":[{"name":"cartId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/delete-user/{id}":{"delete":{"tags":["customer-controller"],"operationId":"deleteUser","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"OK"}}}},"/api/admin/delete-product/{productId}":{"delete":{"tags":["product-controller"],"operationId":"deleteProduct","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/delete-customer/{customerId}":{"delete":{"tags":["customer-controller"],"operationId":"deleteCustomer","parameters":[{"name":"customerId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"string"}}}}}}},"/api/admin/delete-category/{categoryId}":{"delete":{"tags":["category-controller"],"operationId":"deleteCategory","parameters":[{"name":"categoryId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}},"/api/admin/delete-brand/{brandId}":{"delete":{"tags":["brand-controller"],"operationId":"deleteBrand","parameters":[{"name":"brandId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object"}}}}}}}},"components":{"schemas":{"CustomerDTO":{"type":"object","properties":{"userName":{"type":"string"},"password":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"phone":{"type":"string"},"gender":{"type":"string"},"birthdate":{"type":"string"},"imageUrl":{"type":"string","format":"binary"},"address":{"type":"string"},"city":{"type":"string"},"district":{"type":"string"},"commune":{"type":"string"}}},"CartItemDTO":{"type":"object","properties":{"cartId":{"type":"integer","format":"int64"},"productId":{"type":"integer","format":"int64"},"quantity":{"type":"integer","format":"int32"}}},"SignupRequest":{"type":"object","properties":{"userName":{"type":"string"},"password":{"type":"string"},"email":{"type":"string"},"phoneNumber":{"type":"string"},"created":{"type":"string","format":"date-time"},"gender":{"type":"string","format":"byte"},"address":{"type":"string"},"listRoles":{"uniqueItems":true,"type":"array","items":{"type":"string"}}}},"CategoryDTO":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string","format":"binary"}}},"BrandDTO":{"required":["name"],"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string","format":"binary"}}},"LoginRequest":{"type":"object","properties":{"userName":{"type":"string"},"password":{"type":"string"}}},"CommentDTO":{"type":"object","properties":{"productId":{"type":"integer","format":"int64"},"content":{"type":"string"},"rating":{"type":"integer","format":"int32"}}},"VNPayResponse":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"paymentUrl":{"type":"string"}}},"Category":{"type":"object","properties":{"categoryId":{"type":"integer","format":"int64"},"name":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string"}}},"PageResponseListProductDTO":{"type":"object","properties":{"size":{"type":"integer","format":"int32"},"page":{"type":"integer","format":"int32"},"totalPages":{"type":"integer","format":"int32"},"items":{"type":"array","items":{"$ref":"#/components/schemas/ProductDTO"}}}},"ProductDTO":{"type":"object","properties":{"productId":{"type":"integer","format":"int64"},"name":{"type":"string"},"brand":{"type":"string"},"price":{"type":"number","format":"double"},"promotePrice":{"type":"number","format":"double"},"importPrice":{"type":"number","format":"double"},"stockQuantity":{"type":"integer","format":"int32"},"discount":{"type":"integer","format":"int32"},"productCode":{"type":"string"},"importQuantity":{"type":"integer","format":"int32"},"availableStock":{"type":"integer","format":"int32"},"description":{"type":"string"},"imageUrl":{"type":"string"},"sold":{"type":"integer","format":"int32"},"categories":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Category"}}}},"Brand":{"type":"object","properties":{"brandId":{"type":"integer","format":"int64"},"name":{"type":"string"},"description":{"type":"string"},"imageUrl":{"type":"string"}}},"Product":{"type":"object","properties":{"productId":{"type":"integer","format":"int64"},"name":{"type":"string"},"brand":{"$ref":"#/components/schemas/Brand"},"price":{"type":"number","format":"double"},"promotePrice":{"type":"number","format":"double"},"importPrice":{"type":"number","format":"double"},"stockQuantity":{"type":"integer","format":"int32"},"discount":{"type":"number","format":"double"},"productCode":{"type":"string"},"importQuantity":{"type":"integer","format":"int32"},"availableStock":{"type":"integer","format":"int32"},"description":{"type":"string"},"imageUrl":{"type":"string"},"sold":{"type":"integer","format":"int32"},"categories":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Category"}}}},"ProductBillDTO":{"type":"object","properties":{"productCode":{"type":"string"},"productName":{"type":"string"},"quantity":{"type":"integer","format":"int32"},"totalAmount":{"type":"number","format":"double"}}},"Customer":{"type":"object","properties":{"customerId":{"type":"integer","format":"int64"},"user":{"$ref":"#/components/schemas/User"},"name":{"type":"string"},"phone":{"type":"string"},"gender":{"type":"string"},"birthdate":{"type":"string","format":"date-time"},"imageUrl":{"type":"string"},"addresses":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/CustomerAddress"}}}},"CustomerAddress":{"type":"object","properties":{"addressId":{"type":"integer","format":"int64"},"address":{"type":"string"},"commune":{"type":"string"},"district":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"customer":{"$ref":"#/components/schemas/Customer"}}},"Role":{"type":"object","properties":{"roleId":{"type":"integer","format":"int64"},"roleName":{"type":"string","enum":["ROLE_ADMIN","ROLE_MANAGER","ROLE_USER"]}}},"User":{"type":"object","properties":{"userId":{"type":"integer","format":"int32"},"userName":{"type":"string"},"email":{"type":"string"},"created":{"type":"string","format":"date-time"},"listRoles":{"uniqueItems":true,"type":"array","items":{"$ref":"#/components/schemas/Role"}}}},"CustomerAddressDTO":{"type":"object","properties":{"addressId":{"type":"integer","format":"int64"},"address":{"type":"string"},"commune":{"type":"string"},"district":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"}}}}}}
css
golang
html
javascript
rest-api
spring

First seen in:

snsar/reactt

Used in 1 repository

Python
# Task Workflow Rules

For each task in the roadmap, follow these steps precisely:

### 1. Branch Check
Before starting any work, verify we're on the master branch:
```bash
git branch --show-current
```
If not on master, STOP and notify the user to switch to master first.

### 2. Feature Branch Creation
Create a feature branch following the format:
```bash
git checkout -b feature/phase-{phase_num}-step-{step_num}-{brief-description}
```
Example: `feature/phase-1-step-2-test-infrastructure`

### 3. Implementation
Make the necessary code changes according to the task requirements.

### 4. Commit and Push
Stage, commit, and push changes:
```bash
git add .
git commit -m "Phase {phase_num}, Step {step_num}: {description}"
git push -u origin {branch_name}
```

### 5. Create Pull Request
Use GitHub CLI to create PR non-interactively:
```bash
gh pr create --title "Phase {phase_num}, Step {step_num}: {description}" --body "Implements Phase {phase_num}, Step {step_num} from roadmap." --base main --head {branch_name} --fill
```

### 6. CI Monitoring
After PR creation, offer to monitor CI checks:
```bash
gh pr checks {pr_number} --watch
```

### Example Workflow
```bash
# 1. Check branch
git branch --show-current  # Should be 'main'

# 2. Create feature branch
git checkout -b feature/phase-1-step-2-test-infrastructure

# 3. Make changes...

# 4. Commit and push
git add .
git commit -m "Phase 1, Step 2: Test infrastructure setup"
git push -u origin feature/phase-1-step-2-test-infrastructure

# 5. Create PR
gh pr create --title "Phase 1, Step 2: Test infrastructure setup" --body "Implements Phase 1, Step 2 from roadmap." --base main --head feature/phase-1-step-2-test-infrastructure --fill

# 6. Monitor CI
gh pr checks {pr_number} --watch
``` 
python
adamdude828/claude-mcp-agent

Used in 1 repository

Python
# Cursor Rules for PepperPy Monorepo

## General Guidelines

- **Monorepo Philosophy**:  
  The structure is designed to support modularity and scalability. Every package or tool must have a clear purpose and follow the established structure.

- **Python Version Compatibility**:  
  - Code must target Python `3.12` or higher.
  - Use modern syntax and features:
    - Replace `Union[X, Y]` with `X | Y`.
    - Replace `Optional[X]` with `X | None`.
    - Use `list[X]`, `dict[K, V]`, and `tuple[X, ...]` natively.

- **Code Ownership**:  
  - Each `packages/<package_name>` directory must have clear ownership (e.g., a team or maintainer assigned in `CODEOWNERS`).

---

## Directory-Specific Rules

### Rules for `packages/`

- **Purpose**: Contains all modularized components of the project.
- **Mandatory Files**:
  - `pyproject.toml` for package configuration.
  - `README.md` describing:
    - Package purpose.
    - How to install or use the package.
  - `tests/` directory with both unit and integration tests.

- **Versioning**:
  - Include a `__version__.py` or define the version in the `pyproject.toml`.
  - Follow Semantic Versioning (`MAJOR.MINOR.PATCH`).

- **Imports and Structure**:
  - Use relative imports within the package (`from .module import X`).
  - Avoid circular dependencies by moving shared logic to `pepperpy-core`.

---

### Rules for `scripts/`

- **Purpose**: Helper scripts for automating repetitive tasks.
- **Best Practices**:
  - All scripts must be executable via `python scripts/<script_name>.py`.
  - Document the purpose of each script in the header comment.
  - Scripts must be modular and reusable across packages.
  - Avoid hardcoding paths; use environment variables or config files.

---

### Rules for `tools/`

- **Purpose**: Contains reusable internal tools or utilities for maintenance.
- **Standards**:
  - Tools must have minimal dependencies.
  - Include clear usage documentation in the source code and/or a `README.md`.
  - Avoid duplicating functionality already covered by external libraries.

---

## Dependency Management

- **Centralized and Modular Dependencies**:
  - Shared dependencies are defined in the root `pyproject.toml`.
  - Package-specific dependencies should be isolated to the package's `pyproject.toml`.

- **Extras and Optional Groups**:
  - Use `[tool.poetry.extras]` to group optional dependencies logically.
  - Examples:
    ```toml
    [tool.poetry.extras]
    ai = ["torch", "transformers"]
    db = ["sqlalchemy", "psycopg2"]
    ```

- **Dependency Updates**:
  - Regularly update dependencies and ensure compatibility using tools like `poetry lock`.

---

## Testing Standards

- **Test Organization**:
  - Each package must include a `tests/` directory.
  - Integration tests spanning multiple packages should reside in `tests/` at the root level.

- **Test Frameworks**:
  - Use `pytest` as the primary test framework.
  - Enforce the use of `pytest-cov` for coverage reporting.

- **Best Practices**:
  - Test functions should follow `test_<functionality>.py` naming convention.
  - Always mock external calls using `unittest.mock` or similar libraries.

---

## CI/CD Best Practices

- **Pipeline Design**:
  - Pipelines must support selective builds (e.g., build and test only affected packages).
  - Use caching mechanisms for dependencies to speed up builds.

- **Required CI Steps**:
  - Linting (`ruff check .`).
  - Formatting (`black .`).
  - Type checking (`mypy .`).
  - Unit tests (`pytest` with coverage).

- **Deployment Rules**:
  - Only publish packages that have changed.
  - Publish packages to PyPI using `poetry publish`.

- **Examples**:
  ```yaml
  jobs:
    build:
      runs-on: ubuntu-latest
      steps:
        - uses: actions/setup-python@v5
          with:
            python-version: '3.12'
        - run: poetry install
        - run: poetry run pytest --cov
  ```

---

## Code Quality Standards

- **Linting**:
  - Use `ruff` for enforcing style and catching errors.
  - Ensure `ruff` is configured for all packages in the `pyproject.toml`.

- **Formatting**:
  - Code must follow `black` formatting rules.
  - Enforce formatting checks in CI pipelines.

- **Static Type Checks**:
  - Type checking is mandatory using `mypy`.
  - All public methods and functions must include type annotations.

- **Pre-commit Hooks**:
  - Configure pre-commit hooks to automate linting, formatting, and type checking.

---

## Documentation Standards

- **Package Documentation**:
  - Each package must include a `README.md` covering:
    - Purpose of the package.
    - Installation and usage instructions.
    - Any relevant examples.

- **Code Documentation**:
  - Use Google-style docstrings for all public APIs.
  - Examples:
    ```python
    """
    Function to calculate the sum of two numbers.

    Args:
        a (int): The first number.
        b (int): The second number.

    Returns:
        int: The sum of the two numbers.
    """
    ```

---

## Environment Configuration

- **Environment Files**:
  - `.env` files must follow a standard format and include only non-sensitive defaults.
  - Provide a `.env.sample` file for documentation purposes.

- **Containerization**:
  - Docker must be used for containerizing the development and production environment.
  - Maintain `Dockerfile` and `docker-compose.yml` with best practices for scalability and maintainability.
bun
docker
dockerfile
golang
makefile
python
shell

First seen in:

felipepimentel/pepperpy

Used in 1 repository

TypeScript
# Enterprise Code Standards

## Core Architecture Principles
- Clean architecture with proper separation of concerns
- Dependency injection patterns
- SOLID principles implementation
- Repository pattern for data access
- Facade pattern for complex subsystems

## Code Quality & Safety
- Error handling:
  * Comprehensive try-catch blocks
  * Error logging
  * User-friendly error messages
  * Recovery mechanisms

- Type Safety:
  * Detailed TypeScript interfaces
  * Proper type guards
  * Strict null checks
  * Generic types where appropriate

- Input Validation:
  * Data sanitization
  * Type checking
  * Range validation
  * Schema validation

## Security Requirements
- Authentication:
  * Proper auth checks
  * Session management
  * Token validation

- Authorization:
  * Role-based access
  * Permission checks
  * Resource guards

- Protection:
  * XSS prevention
  * CSRF tokens
  * SQL injection prevention
  * Rate limiting
  * Input sanitization

## Component Standards
- Loading States:
  * Skeleton loaders
  * Progress indicators
  * Loading boundaries

- Error Handling:
  * Error boundaries
  * Fallback UI
  * Retry mechanisms
  * Error logging

- Accessibility:
  * ARIA labels
  * Keyboard navigation
  * Screen reader support
  * Color contrast

- Performance:
  * Code splitting
  * Lazy loading
  * Memoization
  * Bundle optimization

## State Management
- Data Flow:
  * Unidirectional data flow
  * Immutable state updates
  * State normalization

- Caching:
  * Cache strategies
  * Cache invalidation
  * Optimistic updates

- Loading States:
  * Initial loading
  * Refresh states
  * Pagination loading
  * Error states

## Testing Requirements
- Unit Tests:
  * Component tests
  * Utility tests
  * Hook tests
  * Error cases

- Integration Tests:
  * User flows
  * API integration
  * State management
  * Error scenarios

- Performance Tests:
  * Load testing
  * Memory leaks
  * Bundle size
  * Render performance

## Documentation
- Code Documentation:
  * JSDoc comments
  * Type definitions
  * Usage examples
  * Architecture diagrams

- Performance Notes:
  * Optimization strategies
  * Known bottlenecks
  * Caching considerations

- Security Notes:
  * Security considerations
  * Authentication flows
  * Authorization rules

## Monitoring & Logging
- Application Monitoring:
  * Error tracking
  * Performance metrics
  * User analytics
  * Health checks

- Logging:
  * Error logs
  * User actions
  * Performance logs
  * Security events

## API Standards
- Endpoint Design:
  * RESTful principles
  * GraphQL best practices
  * Status codes
  * Error formats

- Security Headers:
  * CORS
  * Content Security Policy
  * Cache Control
  * Rate Limiting

## Database Operations
- Data Access:
  * Transactions
  * Connection pooling
  * Query optimization
  * Index management

- Data Safety:
  * Validation
  * Sanitization
  * Backup strategies
  * Recovery plans
analytics
bun
css
graphql
javascript
rest-api
solidjs
typescript

First seen in:

LOV3RBOY/yourstruly

Used in 1 repository

TypeScript
// 语言设置
LANGUAGE: zh-CN

// 代码风格
STYLE: {
    python: PEP8,
    typescript: prettier,
    max_line_length: 120
}

// AI 行为规则
RULES: {
    // 注释和文档
    COMMENTS: {
        language: "chinese",
        docstring_style: "google",
        require_function_docstring: true,
        require_class_docstring: true
    },

    // 命名约定
    NAMING: {
        language: "pinyin",
        class: "PascalCase",
        function: "snake_case",
        variable: "snake_case",
        constant: "UPPER_CASE"
    },

    // 代码组织
    ORGANIZATION: {
        imports_order: ["stdlib", "third_party", "local"],
        group_imports: true,
        max_function_length: 50
    },

    // 错误处理
    ERROR_HANDLING: {
        language: "chinese",
        require_type_hints: true,
        require_error_messages: true
    },

    // 类型提示
    TYPE_HINTS: {
        require: true,
        check_mypy: true
    },

    // 测试规范
    TESTING: {
        require_tests: true,
        naming_pattern: "test_*",
        framework: "pytest"
    }
}

// 项目特定规则
PROJECT_SPECIFIC: {
    // API 相关
    api_response_format: {
        success: true,
        code: 200,
        message: "操作成功",
        data: {}
    },

    // 仓库管理
    repo_naming: {
        github_prefix: "gh_",
        gitee_prefix: "gt_"
    },

    // 日志格式
    logging: {
        format: "[%(asctime)s] %(levelname)s: %(message)s",
        language: "chinese"
    }
}

// AI 助手行为
AI_BEHAVIOR: {
    language: "chinese",
    code_suggestions: true,
    error_explanations: true,
    documentation_help: true,
    refactoring_suggestions: true
}

// 桌面应用规则
DESKTOP_APP_RULES: {
    // 使用中文注释
    COMMENTS: {
        language: "chinese",
        docstring_style: "google",
        require_function_docstring: true,
        require_class_docstring: true
    },

    // 中文变量命名
    NAMING: {
        language: "pinyin",
        class: "PascalCase",
        function: "snake_case",
        variable: "snake_case",
        constant: "UPPER_CASE"
    },

    // 文档规范
    DOCUMENTATION: {
        language: "chinese",
        docstring_style: "google",
        require_function_docstring: true,
        require_class_docstring: true
    },

    // 错误信息本地化
    ERROR_HANDLING: {
        language: "chinese",
        require_type_hints: true,
        require_error_messages: true
    },

    // 代码结构
    ORGANIZATION: {
        imports_order: ["stdlib", "third_party", "local"],
        group_imports: true,
        max_function_length: 50
    },

    // 项目相关
    REPO_NAMING: {
        github_prefix: "gh_",
        gitee_prefix: "gt_"
    },

    // 桌面应用规范
    ELECTRON_RULES: {
        contextIsolation: true,
        nodeIntegration: false,
        enableRemoteModule: false
    },

    // 安全规范
    SECURITY_RULES: {
        token_storage: "encrypted",
        api_communication: "https_only",
        sensitive_data: ["github_token", "gitee_token", "user_email"],
        required_validations: ["input_sanitization", "token_validation", "permission_check"]
    },

    // 电子规则
    ELECTRON_RULES: {
        ipc_naming: {
            prefix: "ipc",
            separator: ":",
            format: "camelCase"
        },
        window_management: {
            main_window: {
                width: 1200,
                height: 800,
                minWidth: 800,
                minHeight: 600
            }
        },
        security_policies: {
            csp: "default-src 'self'; script-src 'self'",
            websecurity: true,
            allowRunningInsecureContent: false
        }
    },

    // 文档规则
    DOCUMENTATION: {
        required_sections: [
            "功能描述",
            "参数说明",
            "返回值",
            "异常处理",
            "使用示例"
        ],
        api_documentation: {
            required_fields: [
                "接口说明",
                "请求方法",
                "请求参数",
                "响应格式",
                "错误码"
            ]
        }
    },

    // 测试规则
    TESTING: {
        require_tests: true,
        naming_pattern: "test_*",
        framework: "pytest"
    },

    // 错误处理规则
    ERROR_HANDLING: {
        log_format: {
            timestamp: true,
            level: true,
            message: true,
            stack_trace: true
        },
        notification_rules: {
            error_threshold: 3,
            notification_methods: ["email", "system_notification"]
        }
    }
}

{
    "context_initialization": {
        "description": "每次交互的起点",
        "steps": [
            "ALWAYS read .notes/project_overview.md",
            "ALWAYS read .notes/architecture.md",
            "ALWAYS check .notes/task_list.md"
        ]
    },
    "operational_protocol": {
        "description": "任务处理方式",
        "before_action": [
            "创建 MECE 任务分解",
            "检查相关配置",
            "验证安全要求"
        ],
        "code_changes": [
            "修改代码前先阅读相关部分",
            "保持现有功能",
            "维护类型安全",
            "确保向后兼容"
        ]
    },
    "safety_requirements": [
        "NEVER 破坏类型安全",
        "ALWAYS 保持适当的错误处理",
        "ALWAYS 编写文档"
    ],
    "priorities": [
        {
            "source": ".notes/",
            "weight": 1.0
        }
    ],
    "modes": {
        "base": {
            "description": "常规任务模式"
        },
        "enhanced": {
            "description": "复杂问题模式"
        }
    },
    "language": "zh-CN",
    "rules": [
        {
            "name": "使用中文注释",
            "description": "所有的代码注释必须使用中文编写,确保代码的可读性和可维护性"
        },
        {
            "name": "中文变量命名",
            "description": "允许使用拼音或有意义的中文拼音组合作为变量名,但需要符合编程规范"
        },
        {
            "name": "文档规范",
            "description": "所有的文档字符串(docstring)必须使用中文编写,包括函数说明、参数描述和返回值说明"
        },
        {
            "name": "错误信息本地化",
            "description": "所有的错误信息和用户提示信息都应该使用中文编写"
        },
        {
            "name": "代码结构",
            "description": "保持清晰的代码结构,每个函数和类都应该有完整的中文注释说明"
        },
        {
            "name": "项目相关",
            "description": "针对GitHub和Gitee仓库管理的特定功能,使用清晰的中文命名约定"
        }
    ],
    "code_style": {
        "python": {
            "style": "pep8",
            "max_line_length": 120,
            "docstring_style": "google",
            "imports_order": ["stdlib", "third_party", "local"],
            "group_imports": true
        },
        "typescript": {
            "style": "prettier",
            "semi": true,
            "singleQuote": true,
            "tabWidth": 2,
            "printWidth": 120,
            "trailingComma": "es5"
        }
    },
    "naming_conventions": {
        "python": {
            "class": "PascalCase",
            "function": "snake_case",
            "variable": "snake_case",
            "constant": "UPPER_CASE",
            "module": "snake_case",
            "parameter": "snake_case"
        },
        "typescript": {
            "class": "PascalCase",
            "interface": "PascalCase",
            "function": "camelCase",
            "variable": "camelCase",
            "constant": "UPPER_CASE",
            "component": "PascalCase",
            "enum": "PascalCase",
            "type": "PascalCase"
        }
    },
    "electron": {
        "security": {
            "contextIsolation": true,
            "nodeIntegration": false,
            "enableRemoteModule": false,
            "sandbox": true,
            "webSecurity": true,
            "allowRunningInsecureContent": false,
            "csp": "default-src 'self'; script-src 'self'"
        },
        "window": {
            "main": {
                "width": 1200,
                "height": 800,
                "minWidth": 800,
                "minHeight": 600,
                "frame": true,
                "transparent": false
            }
        },
        "ipc": {
            "naming": {
                "prefix": "ipc",
                "separator": ":",
                "format": "camelCase"
            },
            "validation": {
                "requireSchema": true,
                "validatePayload": true
            }
        },
        "updates": {
            "autoDownload": false,
            "autoInstall": false,
            "checkFrequency": "daily"
        }
    },
    "security": {
        "authentication": {
            "token_storage": "encrypted",
            "token_rotation": "7d",
            "session_timeout": "24h"
        },
        "api": {
            "rate_limiting": true,
            "max_requests": 100,
            "timeframe": "1m",
            "require_https": true
        },
        "data": {
            "encryption": {
                "algorithm": "AES-256-GCM",
                "key_rotation": "30d"
            },
            "sensitive_fields": [
                "github_token",
                "gitee_token",
                "user_email",
                "password"
            ]
        },
        "validation": {
            "required_checks": [
                "input_sanitization",
                "token_validation",
                "permission_check",
                "rate_limit_check"
            ]
        }
    },
    "documentation": {
        "language": "chinese",
        "required_sections": [
            "功能描述",
            "参数说明",
            "返回值",
            "异常处理",
            "使用示例"
        ],
        "api_documentation": {
            "required_fields": [
                "接口说明",
                "请求方法",
                "请求参数",
                "响应格式",
                "错误码",
                "权限要求"
            ]
        },
        "comments": {
            "require_function_docstring": true,
            "require_class_docstring": true,
            "require_complex_method_docstring": true
        }
    },
    "testing": {
        "python": {
            "framework": "pytest",
            "coverage_threshold": 80,
            "required_tests": [
                "unit_tests",
                "integration_tests",
                "e2e_tests"
            ],
            "naming_pattern": "test_*"
        },
        "typescript": {
            "framework": "jest",
            "coverage_threshold": 80,
            "required_tests": [
                "unit_tests",
                "component_tests",
                "e2e_tests"
            ],
            "naming_pattern": "*.test.ts"
        }
    },
    "error_handling": {
        "logging": {
            "format": "[%(asctime)s] %(levelname)s: %(message)s",
            "language": "chinese",
            "include": {
                "timestamp": true,
                "level": true,
                "message": true,
                "stack_trace": true,
                "context": true
            }
        },
        "notifications": {
            "error_threshold": 3,
            "channels": [
                "email",
                "system_notification",
                "in_app_notification"
            ],
            "aggregation_window": "5m"
        },
        "recovery": {
            "auto_retry": {
                "enabled": true,
                "max_attempts": 3,
                "backoff": "exponential"
            },
            "fallback": {
                "enabled": true,
                "offline_mode": true
            }
        }
    },
    "performance": {
        "caching": {
            "enabled": true,
            "strategy": "stale-while-revalidate",
            "ttl": "1h",
            "max_size": "100MB"
        },
        "optimization": {
            "lazy_loading": true,
            "code_splitting": true,
            "compression": true
        }
    },
    "project_specific": {
        "repo_naming": {
            "github_prefix": "gh_",
            "gitee_prefix": "gt_"
        },
        "sync": {
            "batch_size": 10,
            "timeout": "30m",
            "retry_count": 3
        },
        "api_response": {
            "format": {
                "success": true,
                "code": 200,
                "message": "操作成功",
                "data": null
            },
            "pagination": {
                "page_size": 20,
                "max_page_size": 100
            }
        }
    }
} 
css
fastapi
golang
html
javascript
jest
prettier
python
+3 more

First seen in:

zh4men9/RepoSynergy

Used in 1 repository