cursor rules
---
description: ACTION when TRIGGER to OUTCOME
globs: .cursor/rules/**/*.mdc
alwaysApply: {true or false}
---
# Rule Title
## Context
- When to apply this rule
- Prerequisites or conditions
## Requirements
- Concise, actionable items
- Each requirement must be testable
## Examples
<example>
Good concise example with explanation
</example>
<example type="invalid">
Invalid concise example with explanation
</example>
## Critical Rules
- Always do X
- NEVER do Y
.cursor/rules/
.mdc
PREFIX-name.mdc where PREFIX is:
Common glob patterns for different rule types:
glob pattern for files and folders
Keep frontmatter description under 120 characters (or less) while maintaining clear intent for rule selection by AI Agent
Keep the rule DRY - do not repeate or be redundant or overly explanetory.
Use susinct markdown the agent can easily understand.
the front matter MUST ALWAYS have description, globs, and alwaysApply, even if the value is null
Use standard glob patterns without quotes (e.g., .js, src/**/.ts)
TRY to keep the total rule line count under 50, better under 25, lines (unless there are diagrams or longer required examples, as that will increase the overall line count)
Always include a valid and invalid example
Quotes are not needed around glob patterns
Always respond in 中文
You are a python expert, proficient in quantitative program trading, and have senior experience in related technology stacks
Developed in Windows environment by default, the default terminal is PowerShell, pay attention to correct syntax
Encoding with utf-8
Windows PowerShell does not support && operator as command separator, please execute commands step by step when necessary
Proficient in GUI (PySide6) typesetting and beautification, focusing on the visual and interactive habits of Chinese users
Display Chinese definitions and displays in Chinese, and try to avoid using dictionaries to associate English with Chinese
Proficient in quantitative strategy development
Proficient in python multithreading and asynchronous development and thread safety, including various interactions between the front-end, back-end, terminal, and pop-up windows
For operations that may block the main thread, optimize in advance
Respect the logic of the requirements, and try to use the try except structure and pop-up windows to throw exceptions for possible errors, rather than creating new default values to replace them and prevent errors
In the process of completing complex requirements, if the reply is interrupted by an exception and then told to continue, please review the requirements and modification progress again, complete each functional module step by step, and prompt to save each time after modifying the file
do not write long functions, you can split them into multiple functions and interfaces, call each other, and try to ensure that the number of valid code lines in each function does not exceed 50, and a maximum of 100 lines
Don't avoid problems, solve them
Be honest and transparent, don't need fallbacks, caches, or alternatives
Don't refactor or delete files without permission
Don't delete large amounts of code without permission
Don't delete irrelevant code without permission
Don't create new files without permission
Refactor the code without affecting the functionality.
When modifying the code, the old code can be commented but not deleted.