feat: Add project_rules.md and user_rules.md support with CLI management functionality #298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature: Project Rules and User Rules Support
Overview
This PR adds comprehensive support for
project_rules.md
anduser_rules.md
files, bringing trae-agent in line with the main Trae functionality and addressing issues mentioned in #293.Motivation
###Core Functionality
project_rules.md
): Project-wide coding standards and conventionsuser_rules.md
): Personal coding preferences and habits###CLI Management Tools
New
trae rules
command group with comprehensive subcommands:list [project|user]
- View current rulesadd [project|user] SECTION RULE
- Add new rulesremove [project|user] SECTION RULE
- Remove existing rulesupdate [project|user] SECTION OLD_RULE NEW_RULE
- Update rulesadd-section [project|user] SECTION
- Create new rule sectionsremove-section [project|user] SECTION
- Delete rule sectionsTechnical Implementation
Files Added/Modified
trae_agent/utils/rules_manager.py
- Core rule management functionalitytrae_agent/cli.py
- CLI command integrationtrae_agent/utils/config.py
- Configuration supporttrae_agent/utils/project_rules.py
- Enhanced rule loadingtrae_agent/agent/trae_agent.py
- Agent integrationuser_rules.md.example
- User rule template.gitignore
- Ignore personal user rulesKey Features
--working-dir
optionUsage Examples
Related Issues
Documentation
This PR provides code reference and solution for Project_rules.md related problems mentioned in #293