aws / aws/amazon-q-developer-cli
Feature - Automated and Context-Aware Rule File Management
- Dominant language
- Rust
- Stars
- 2k
- Forks
- 439
- PR merge metrics
- No merged PRs in 30d
Description
I am submitting a feature request to enhance the functionality of Amazon Q rule files. The goal is to provide a powerful, context-aware system for managing rules without manual selection.
**Problem Statement**
Currently, Amazon Q rule files are treated as discrete, manually selected units. This approach is inefficient and prone to error, leading to two primary issues:
- **Bloated Context:** Developers must manually select rules.md files for their current task. Forgetting to deselect irrelevant rules (e.g., UI rules during a backend task) can lead to bloated context and suboptimal responses.
- **Lack of Hierarchy:** There is no mechanism to define a cascading set of rules. A project-wide set of common rules and a subdirectory-specific set of specialized rules cannot be automatically combined.
**Proposed Solution**
We propose introducing a more advanced rule file format that is automatically discovered and applied based on the developer's current working directory. This file, whether named rules.md or following a proposed standard like [AGENT.md](https://ampcode.com/AGENT.md), would act as a single source of truth for agent behavior in a given context.
**Key Functionality:**
- **Automatic Discovery:** Amazon Q would automatically detect the presence of a rules file in the current directory and all parent directories up to the project root.
- **Hierarchical Application:** Rules would be applied in a cascading manner. A rule file in a subdirectory could extend, append to, or override rules defined in a parent directory's rule file.
- **Structured Content**: The rules file would contain more than just a list of instructions. It could be structured with sections (e.g., # General, # Roles, # Instructions), similar to the AGENT.md proposal, to define different types of agent behavior within a single file.
**Use Case Example**
Imagine a project with the following structure:
```
project-root/
├── rules.md (Main project rules)
├── frontend/
│ └── src/
│ └── rules.md (UI-specific rules)
└── backend/
├── database/
│ └── rules.md (Database migration rules)
└── api/
```
With this feature, if a developer is working in backend/database/, Amazon Q would automatically combine the rules from project-root/rules.md and backend/database/rules.md. The frontend/rules.md file would be completely ignored, ensuring the context is lean, accurate, and completely automated.
**Benefits**
- **Improved Developer Experience:** Eliminates the need for manual rule file management, saving time and reducing friction.
- **Higher-Quality Responses:** A more focused, automatically curated context leads to better and more relevant code suggestions and explanations.
- **Enhanced Team Consistency:** Teams can enforce best practices for rules by simply adding a rules.md file to a directory, which is version-controlled and applied consistently for everyone.
- **Alignment with AI Standards:** Adopting a structured, multi-file approach for defining agent behavior aligns with and supports emerging industry standards.
Contributor guide
Assessment
This issue has not been assessed yet.