21 lines
891 B
Markdown
21 lines
891 B
Markdown
|
|
# AI Agent Coding Rules
|
||
|
|
|
||
|
|
## 1. Code Length Limits
|
||
|
|
- **Python files (`.py`)**: Maximum 600 lines per file.
|
||
|
|
- **JavaScript/HTML files (`.js`, `.html`)**: Maximum 500 lines per file.
|
||
|
|
|
||
|
|
## 2. Architecture
|
||
|
|
- Follow the **MVC (Model-View-Controller)** pattern for all new features and refactoring.
|
||
|
|
- **Models**: Handle data and business logic.
|
||
|
|
- **Views**: Manage presentation and user interface.
|
||
|
|
- **Controllers**: Process input, interact with models, and render views.
|
||
|
|
|
||
|
|
## 3. Coding Practices
|
||
|
|
- No guessing: All code must be based on clear requirements or existing patterns in the codebase.
|
||
|
|
- Avoid unnecessary complexity and keep code readable.
|
||
|
|
- Document any non-obvious logic with concise comments.
|
||
|
|
|
||
|
|
## 4. General
|
||
|
|
- Ensure all code changes comply with these rules before merging or deploying.
|
||
|
|
- If a rule cannot be followed, document the reason clearly in the code and notify the team.
|